/* Your drive, saved-state treatments, and shortlist controls. */

#tripPanel { min-width: 0; scroll-margin-top: 88px; }
.content-grid > #tripPanel { grid-column: 1 / -1; }

.trip-card {
    background: var(--surface, #fffcf6);
    border: 1px solid var(--rule, #d7d9cd);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-soft, 0 12px 30px rgba(32, 61, 53, 0.08));
}

.trip-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--rule, #d7d9cd);
}

.trip-eyebrow {
    margin: 0 0 4px;
    color: var(--rust, #ad482c);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.trip-title {
    margin: 0;
    color: var(--ink, #203d35);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.7rem, 3vw, 2rem);
    font-weight: 400;
    line-height: 1.1;
}

.trip-subtitle {
    max-width: 58%;
    color: var(--muted, #5d6860);
    font-size: 0.875rem;
    line-height: 1.4;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.trip-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 32px;
}

.trip-section { min-width: 0; }
.trip-pickups { padding: 20px; border-radius: 12px; background: var(--sage, #dee6d8); }

.trip-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 16px;
    color: var(--ink, #203d35);
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.trip-count {
    display: inline-grid;
    min-width: 24px;
    height: 24px;
    place-items: center;
    padding: 0 7px;
    border: 1px solid var(--control-border, #7a8276);
    border-radius: 999px;
    color: var(--ink, #203d35);
    font-size: 0.75rem;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
}

.trip-list { list-style: none; margin: 0; padding: 0; }
.trip-empty { margin: 0; padding: 12px 0; color: var(--muted, #5d6860); font-size: 0.875rem; line-height: 1.5; }

.trip-stop-item,
.trip-saved { position: relative; padding: 0 0 12px 22px; }
.trip-stop-item:last-child,
.trip-saved:last-child { padding-bottom: 0; }

.trip-stop-item::before,
.trip-saved::before {
    content: "";
    position: absolute;
    z-index: 1;
    top: 20px;
    bottom: -8px;
    left: 7px;
    width: 1px;
    background: var(--rule, #d7d9cd);
}

.trip-stop-item::after,
.trip-saved::after {
    content: "";
    position: absolute;
    z-index: 2;
    top: 17px;
    left: 3px;
    width: 9px;
    height: 9px;
    border: 2px solid var(--surface, #fffcf6);
    border-radius: 50%;
    background: var(--rust, #ad482c);
    box-shadow: 0 0 0 1px var(--rust, #ad482c);
}

.trip-pickups .trip-saved::after {
    border-color: var(--sage, #dee6d8);
    background: var(--ochre, #d6b465);
    box-shadow: 0 0 0 1px var(--ink, #203d35);
}

.trip-stop-item:last-child::before,
.trip-saved:last-child::before { display: none; }

.trip-stop {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    grid-template-areas: "photo mile badge" "photo body body";
    gap: 5px 12px;
    width: 100%;
    min-height: 76px;
    padding: 10px;
    border: 1px solid var(--rule, #d7d9cd);
    border-radius: 10px;
    background: transparent;
    color: var(--ink, #203d35);
    cursor: pointer;
    font: inherit;
    text-align: left;
    transition: background-color 160ms ease, border-color 160ms ease;
}

.trip-stop:hover { border-color: var(--control-border, #7a8276); background: var(--paper, #f5f1e8); }

.trip-stop:focus-visible,
.trip-saved-main:focus-visible,
.trip-saved-link:focus-visible,
.trip-remove:focus-visible,
.trip-plan-btn:focus-visible,
.shortlist-toggle:focus-visible { outline: 3px solid var(--rust, #ad482c); outline-offset: 3px; }

.trip-thumb {
    grid-area: photo;
    align-self: center;
    flex: none;
    display: block;
    width: 56px;
    height: 56px;
    border: 1px solid var(--rule, #d7d9cd);
    border-radius: 8px;
    background: var(--paper, #f5f1e8);
    object-fit: cover;
}

.trip-thumb-empty { display: grid; place-items: center; color: var(--muted, #5d6860); font-size: 1.25rem; }

.trip-stop-mile {
    grid-area: mile;
    align-self: center;
    color: var(--rust, #ad482c);
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.trip-stop-body { grid-area: body; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

.trip-stop-place,
.trip-saved-title { overflow-wrap: anywhere; color: var(--ink, #203d35); font-size: 0.9rem; font-weight: 700; line-height: 1.35; }

.trip-stop-meta,
.trip-saved-meta { color: var(--muted, #5d6860); font-size: 0.78rem; line-height: 1.4; font-variant-numeric: tabular-nums; }
.trip-badge { grid-area: badge; align-self: center; padding: 2px 7px; font-size: 0.68rem; }

.trip-saved {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 44px 44px;
    align-items: center;
    gap: 8px;
}

.trip-saved .trip-thumb { width: 48px; height: 48px; }

.trip-saved-main {
    min-width: 0;
    padding: 4px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.trip-saved-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.trip-saved-meta-text { min-width: 0; overflow-wrap: anywhere; }

.trip-saved-link,
.trip-remove {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--ink, #203d35);
    cursor: pointer;
    font: inherit;
    font-size: 1.1rem;
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.trip-saved-link:hover,
.trip-remove:hover { border-color: var(--control-border, #7a8276); background: var(--surface, #fffcf6); }
.trip-remove:hover { color: var(--danger, #a12f29); }

.trip-plan { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--control-border, #7a8276); }

.trip-plan-btn {
    width: 100%;
    min-height: 48px;
    padding: 10px 18px;
    border: 1px solid var(--ink, #203d35);
    border-radius: 8px;
    background: var(--ink, #203d35);
    color: var(--surface, #fffcf6);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    transition: background-color 160ms ease, color 160ms ease;
}

.trip-plan-btn:hover:not(:disabled) { background: var(--rust, #ad482c); border-color: var(--rust, #ad482c); }
.trip-plan-btn:disabled { cursor: not-allowed; opacity: 0.55; }
.trip-note { margin: 8px 0 0; color: var(--muted, #5d6860); font-size: 0.78rem; line-height: 1.45; }

.shortlist-toggle {
    display: inline-grid;
    flex: none;
    width: 44px;
    min-width: 44px;
    height: 44px;
    place-items: center;
    padding: 0;
    border: 1px solid var(--control-border, #7a8276);
    border-radius: 8px;
    background: transparent;
    color: var(--ink, #203d35);
    cursor: pointer;
    font: inherit;
    font-size: 1.35rem;
    line-height: 1;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.shortlist-toggle:hover,
.shortlist-toggle[aria-pressed="true"],
.shortlist-toggle.shortlist-on { border-color: var(--rust, #ad482c); background: var(--sage, #dee6d8); color: var(--rust, #ad482c); }

.listing-card.is-saved,
.listing-card.is-selected { border-color: var(--rust, #ad482c); background: var(--paper, #f5f1e8); }
.listing-card.is-selected { box-shadow: 0 0 0 2px var(--rust, #ad482c); }

@media (max-width: 1099px) {
    .trip-columns { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 767px) {
    .trip-card { padding: 20px; }
    .trip-header { align-items: flex-start; flex-direction: column; }
    .trip-subtitle { max-width: none; text-align: left; }
    .trip-pickups { padding: 16px; }
}

@media (max-width: 420px) {
    .trip-stop { grid-template-columns: 48px minmax(0, 1fr); grid-template-areas: "photo mile" "photo body" ". badge"; }
    .trip-stop .trip-thumb { width: 48px; height: 48px; }
    .trip-saved { grid-template-columns: 44px minmax(0, 1fr) 44px; }
    .trip-saved .trip-thumb { width: 44px; height: 44px; }
    .trip-saved-link { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .trip-stop,
    .trip-plan-btn,
    .trip-saved-link,
    .trip-remove,
    .shortlist-toggle { transition: none; }
}
