/* ============================================================
   Drive view — the postcard (Prompt 3). Rendered by drive-view.js.
   Warm paper, deep forest, campfire amber: a drive, not a GPS screen.
   ============================================================ */
.dv {
    --dv-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    gap: 22px;
    color: var(--color-text);
    font-family: var(--font-body);
}

/* --- Hero --- */
.dv-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--dv-radius);
    background: linear-gradient(160deg, var(--green-900), var(--green-950));
    aspect-ratio: 16 / 9;
    min-height: 220px;
    box-shadow: var(--shadow-md);
    isolation: isolate;
}
.dv--compact .dv-hero { aspect-ratio: 16 / 7; min-height: 180px; border-radius: var(--radius-lg); }
.dv-hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.6s var(--ease-out);
    background: var(--cream-200);
}
.dv-hero--photo .dv-hero-img,
.dv-hero--map .dv-hero-img { opacity: 1; }
.dv-hero--map .dv-hero-img { filter: saturate(0.92); }
.dv-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(14, 32, 21, 0.08) 0%, rgba(14, 32, 21, 0.12) 40%, rgba(14, 32, 21, 0.82) 100%);
    pointer-events: none;
}
.dv-hero-text {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    padding: 22px 24px 20px;
    color: var(--cream-50);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.dv--compact .dv-hero-text { padding: 16px 18px 14px; }
/* The byline under the title ("Shared by Sam R. · @sam"); kept as .dv-eyebrow for the hooks that read it. */
.dv-eyebrow {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--sun-100);
    opacity: 0.92;
}
/* Pro + Creator badges after "Shared by …" (Prompt 14). The Pro pill repeats convoy.css for pages without it. */
.dv-eyebrow-badges { display: inline-flex; gap: 6px; margin-left: 8px; vertical-align: 1px; letter-spacing: 0.5px; }
.dv-eyebrow-badges .convoy-pro-badge {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
    font-size: 0.68rem; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: #fff;
    background: var(--pro-brand);
    border: 1px solid var(--pro-brand-dark); white-space: nowrap;
}
.dv-eyebrow-badges .creator-badge { border-color: rgba(216, 239, 225, 0.35); }
.dv-title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 640;
    font-size: clamp(1.5rem, 1.1rem + 2.2vw, 2.4rem);
    line-height: 1.12;
    letter-spacing: -0.01em;
    text-wrap: balance;
    color: #fff;
    text-shadow: 0 1px 2px rgba(14, 32, 21, 0.35);
}
.dv--compact .dv-title { font-size: clamp(1.25rem, 1rem + 1.4vw, 1.7rem); }
.dv-title-arrow { color: var(--green-200); font-weight: 500; }
.dv-totals {
    margin: 2px 0 0;
    font-family: var(--font-display);
    font-size: clamp(1rem, 0.9rem + 0.8vw, 1.25rem);
    font-weight: 600;
    color: var(--sun-100);
}

/* C5: totals on a ticket stub under the hero, the remix credit stamped beside it */
.dv-stub-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: -6px; }
.dv-stub-row .dv-stub { flex: 0 1 auto; min-width: 0; }
.dv-stub-row .tp-remix-stamp { flex: 0 1 auto; }
.dv--compact .dv-stub-row { margin-top: -8px; }
.dv-stub-row .dv-totals { color: var(--color-text); }

/* --- Grid --- */
.dv-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
    align-items: start;
}
@media (min-width: 900px) {
    .dv:not(.dv--compact):not(.dv--narrow) .dv-grid {
        grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
        gap: 28px;
    }
    .dv:not(.dv--compact):not(.dv--narrow) .dv-main { position: sticky; top: 16px; }
}
.dv-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* --- Map --- */
.dv-map {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1.5px solid var(--color-border-soft);
    box-shadow: var(--shadow-sm);
}
.dv-map-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dv-map--live { aspect-ratio: 4 / 3; max-height: 520px; }
.dv-map--missing::after {
    content: 'Map on its way';
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--color-text-muted);
    font-weight: 600;
}

.dv-tagline {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--green-ink-800);
}
.dv--compact .dv-tagline { font-size: 1.02rem; }
/* Scrappy S2: mixed scale. The drive time is the page's one big number; the ink underline sits under it. */
.dv-tagline-num {
    position: relative;
    display: inline-block;
    margin: 0 0.12em 0.28em;
    font-size: 2.1em;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}
.dv--compact .dv-tagline-num { font-size: 1.35em; margin-bottom: 0; }
.dv-tagline-num .tp-ink-mark { position: absolute; left: -2px; right: -2px; bottom: -0.32em; width: calc(100% + 4px); height: 10px; }
.dv-tagline-num .tp-ink-mark path { vector-effect: non-scaling-stroke; }

.dv-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dv-actions .btn { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.dv-actions .btn svg { width: 18px; height: 18px; flex: none; }
.dv-actions .tp-icon-btn { margin-left: -2px; }
.dv-page-header-actions .dv-post-meta { max-width: 40vw; }
.dv-save.is-saved { color: var(--sun-600); border-color: var(--sun-400); background: var(--sun-50); }

/* --- Completed drives (Prompt 10) --- */
.dv-hero .dv-driven-stamp { align-self: flex-start; margin-bottom: 2px; }
.dv-complete--undo { font-size: 0.86rem; padding-inline: 12px; }
.dv-complete-form {
    flex-basis: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--cream-50);
    border: 1px dashed var(--cream-300);
}
.dv-complete-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--green-ink-800);
}
.dv-complete-label input[type="date"] {
    font: inherit;
    font-weight: 600;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: #fff;
    color: var(--color-text);
}
.dv-complete-label input[type="date"]:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 1px; }

/* --- Drive photos (Prompt 10) --- */
.dv-photos {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border-radius: var(--radius-lg);
    background: var(--cream-50);
    border: 1px solid var(--cream-200);
    box-shadow: var(--shadow-xs);
}
.dv-photos-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.dv-photos-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 640;
    color: var(--green-ink-900);
}
.dv-photos-count { font-family: var(--font-body); font-size: 0.82rem; font-weight: 700; color: var(--color-text-muted); margin-left: 4px; }
.dv-photos-add { font-size: 0.9rem; }
.dv-photos-hint { margin: 0; font-size: 0.86rem; color: var(--color-text-muted); }
.dv-photos-status { margin: 0; font-size: 0.86rem; font-weight: 600; color: var(--color-text-muted); }
.dv-photos-status--success { color: var(--color-success); }
.dv-photos-status--error { color: var(--color-error); }
.dv-photos-status--nudge { color: var(--sun-600); }
.dv-photos-placing {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: var(--sun-50);
    border: 1px solid rgba(242, 168, 84, 0.5);
    color: var(--sun-600);
    font-weight: 700;
    font-size: 0.9rem;
}
.dv-photo-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
@media (max-width: 600px) { .dv-photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.dv-photo { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dv-photo-thumb {
    display: block;
    padding: 0;
    border: none;
    background: var(--cream-200);
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 1;
    cursor: zoom-in;
    box-shadow: var(--shadow-xs);
    transition: transform var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}
.dv-photo-thumb:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.dv-photo-thumb:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.dv-photo-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dv-photo-meta { font-size: 0.72rem; color: var(--color-text-muted); line-height: 1.3; }
.dv-photo-actions { display: flex; gap: 8px; }
.dv-photo-action {
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--green-700);
    cursor: pointer;
}
.dv-photo-action:hover { text-decoration: underline; }
.dv-photo-delete { color: var(--color-text-muted); }
.dv-photo-delete:hover { color: var(--color-error); }
.dv-photos--placing .dv-map--live { outline: 3px solid var(--sun-400); outline-offset: 2px; }
.dv-photo-lightbox {
    border: none;
    padding: 12px;
    border-radius: var(--radius-lg);
    background: var(--cream-50);
    max-width: min(92vw, 1000px);
    max-height: 92vh;
    box-shadow: var(--shadow-lg);
}
.dv-photo-lightbox::backdrop { background: rgba(14, 32, 21, 0.72); }
.dv-photo-lightbox-img { display: block; max-width: 100%; max-height: 74vh; margin: 0 auto; border-radius: var(--radius-md); object-fit: contain; }
.dv-photo-lightbox-meta { margin: 10px 0 0; font-size: 0.86rem; color: var(--color-text-muted); text-align: center; }
.dv-photo-lightbox-close { display: block; margin: 10px auto 0; }

/* --- TravelPad Pick (Prompt 7) --- */
.dv-title-pick { display: inline; }
.dv-route-line {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--cream-100);
    opacity: 0.92;
}
.dv-stops-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.dv-pick-notes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 18px;
    background: var(--sun-50);
    border: 1.5px solid rgba(242, 168, 84, 0.35);
    border-radius: var(--radius-lg);
}
.dv-pick-desc {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--brown-900);
}
.dv-pick-seasons {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--sun-600);
}
.dv-pick-windows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dv-pick-window {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
    font-size: 0.86rem;
    color: var(--color-text);
}
.dv-pick-window-kind {
    padding: 1px 7px;
    border-radius: var(--radius-sm, 9px);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: var(--green-100);
    color: var(--green-ink-800);
}
.dv-pick-window--peak .dv-pick-window-kind { background: var(--sun-100); color: var(--sun-600); }
.dv-pick-window--closed .dv-pick-window-kind { background: var(--color-error-bg); color: var(--color-error); }
.dv-pick-window-label { font-weight: 600; }
.dv-pick-window-note { flex-basis: 100%; color: var(--color-text-muted); font-size: 0.8rem; }
.dv--compact .dv-pick-notes { padding: 12px 14px; }
.dv--compact .dv-pick-desc { font-size: 0.95rem; }

/* --- Stops --- */
.dv-stops {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}
.dv-stop {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border-soft);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.dv-stop:hover { box-shadow: var(--shadow-sm); }
.dv-stop-media {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    background: var(--cream-200);
}
.dv-stop--endpoint .dv-stop-media {
    aspect-ratio: auto;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    background: transparent;
}
.dv-stop--endpoint { grid-template-columns: 44px 1fr; align-items: center; gap: 12px; padding: 10px 14px; background: var(--cream-100); }
.dv-endpoint-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--green-300);
    border: 3px solid var(--cream-50);
    box-shadow: 0 0 0 2px var(--green-900);
}
.dv-endpoint-dot--end { background: var(--sun-400); }
.dv-stop-photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: fade-in 0.4s ease both;
}
.dv-stop-photo--empty {
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--green-700);
}
.dv-stop-num {
    position: absolute;
    left: 12px;
    top: 12px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--cream-50);
    background: var(--green-700);
    border: 2px solid var(--cream-50);
    box-shadow: var(--shadow-xs);
}
.dv-stop-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dv-stop--endpoint .dv-stop-body { padding: 0; gap: 2px; }
.dv-stop-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.dv-stop-name {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 640;
    line-height: 1.25;
    color: var(--brown-900);
    overflow-wrap: anywhere;
}
.dv-stop--endpoint .dv-stop-name { font-size: 1.02rem; }
.dv-stop-eyebrow {
    margin: 0;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}
.dv-stop-cat {
    font-size: 0.74rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: var(--radius-sm, 9px);
    background: var(--green-50);
    color: var(--green-ink-800);
}
.dv-stop-copy { margin: 0; line-height: 1.5; color: var(--brown-700); overflow-wrap: anywhere; }
.dv-stop-loc { margin: 0; font-size: 0.86rem; color: var(--color-text-muted); overflow-wrap: anywhere; }

.dv-leg {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 6px 0 20px;
    color: var(--color-text-muted);
    font-size: 0.86rem;
    font-weight: 600;
    position: relative;
    min-height: 22px;
}
.dv-leg::before {
    content: '';
    position: absolute;
    left: 8px;
    top: -4px;
    bottom: -4px;
    border-left: 2px dashed var(--green-300);
}
.dv-leg--direct { padding: 8px 6px 8px 20px; }

/* --- Stops that cannot have a photo (no place id / lookup empty): a small initial tile beside the text --- */
.dv-stop--nophoto:not(.dv-stop--endpoint),
.dv--compact .dv-stop--nophoto:not(.dv-stop--endpoint) { grid-template-columns: 64px 1fr; align-items: center; gap: 4px; }
.dv-stop--nophoto .dv-stop-media,
.dv--compact .dv-stop--nophoto .dv-stop-media { aspect-ratio: 1; width: 64px; height: 64px; margin: 10px 0 10px 10px; border-radius: var(--radius-md); overflow: hidden; }
.dv-stop--nophoto .dv-stop-photo--empty { font-size: 1.5rem; }
.dv-stop--nophoto .dv-stop-num,
.dv--compact .dv-stop--nophoto .dv-stop-num { left: 4px; top: 4px; width: 22px; height: 22px; font-size: 0.7rem; }
.dv-stop--nophoto .dv-stop-body { padding: 10px 14px 10px 10px; }

/* --- Compact (modal): stop cards go side-by-side --- */
.dv--compact .dv-stop:not(.dv-stop--endpoint) { grid-template-columns: 120px 1fr; }
.dv--compact .dv-stop-media { aspect-ratio: 1; }
.dv--compact .dv-stop-body { padding: 10px 12px; }
.dv--compact .dv-stop-name { font-size: 1rem; }
.dv--compact .dv-stop-num { width: 24px; height: 24px; left: 8px; top: 8px; font-size: 0.74rem; }
.dv--compact .dv-stop-photo--empty { font-size: 1.8rem; }
.dv--compact .dv-stops { max-height: none; }

/* --- Attributions, states --- */
.dv-attributions { margin: 0; font-size: 0.74rem; color: var(--color-text-muted); line-height: 1.5; }
.dv-attributions a { color: var(--color-text-muted); }
.dv--error { padding: 28px 18px; text-align: center; gap: 10px; align-items: center; }
.dv-error-title { margin: 0; font-family: var(--font-display); font-size: 1.3rem; color: var(--green-800); }
.dv-error-copy { margin: 0; color: var(--color-text-muted); }

/* --- Skeleton --- */
.dv--skeleton .dv-hero { background: var(--cream-200); box-shadow: none; }
.dv--skeleton .dv-hero::after { display: none; }
.dv--skeleton .dv-map { border: none; box-shadow: none; }
.dv-skel-line { display: block; margin-top: 8px; }
.dv-stop--skeleton { border-style: dashed; box-shadow: none; }
.dv-stop--skeleton .dv-stop-photo { border-radius: 0; }

/* --- SEO / noscript stop list (hidden once the view renders) --- */
.dv-seo { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.dv-root[aria-busy="true"] ~ .dv-seo { position: static; width: auto; height: auto; clip: auto; }

/* --- Page chrome shared by the drive pages --- */
.dv-page {
    min-height: 100vh;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
}
.dv-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 1120px;
    margin: 0 auto;
    padding: 16px 16px 8px;
}
.dv-page-header-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dv-brand {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 680;
    color: var(--green-ink-800);
    text-decoration: none;
}
.dv-page-main {
    max-width: 1120px;
    margin: 0 auto;
    padding: 8px 16px 64px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.dv-page--narrow .dv-page-header,
.dv-page--narrow .dv-page-main { max-width: 760px; }
.dv-cta {
    padding: 22px;
    border-radius: var(--radius-lg);
    background: linear-gradient(152deg, var(--green-950) 0%, #1c3526 52%, var(--green-900) 100%);
    color: var(--cream-100);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.dv-cta-copy { display: flex; flex-direction: column; gap: 4px; }
.dv-cta-title { margin: 0; font-family: var(--font-display); font-size: 1.25rem; font-weight: 660; color: #fff; }
.dv-cta-sub { margin: 0; color: var(--green-200); }
.dv-cta-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.dv-cta-actions .btn-ghost { color: var(--cream-100); border-color: rgba(254, 252, 247, 0.4); }
.dv-cta-actions a.dv-link { color: var(--green-200); font-weight: 700; }
.dv-post-meta { display: flex; gap: 16px; color: var(--color-text-muted); font-size: 0.9rem; font-weight: 600; }
.dv-caption { margin: 0; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }

/* --- Modal host --- */
.modal--drive-preview { max-width: 820px; padding: 22px 22px 18px; max-height: calc(100vh - 32px); overflow-y: auto; }
.modal--drive-preview h2 { margin-bottom: 12px; }
.modal--drive-preview .dv-root { margin-bottom: 8px; }

@media (prefers-reduced-motion: reduce) {
    .dv-hero-img, .dv-stop, .dv-stop-photo { transition: none; animation: none; }
}

/* Inside the Convoy modal, base.css's `.modal h2` would recolour the hero title; keep it on the photo scrim. */
.modal .dv-hero-text .dv-title,
.modal .dv-hero-text .dv-eyebrow,
.modal .dv-hero-text .dv-totals { color: inherit; margin: 0; padding: 0; }

/* The postcard can be taller than the viewport on desktop: let the modal itself scroll to the actions. */
.modal--drive-preview { max-height: 92vh; overflow-y: auto; }

/* Prompt 5: "Explore the map" (lazy live map) and Share. */
.dv-map-explore {
    position: absolute; right: 12px; bottom: 12px;
    background: var(--color-surface); box-shadow: var(--shadow-sm);
}
.dv-map--live .dv-map-explore { display: none; }

/* ---------- Drive Reel (Prompt 12, js/drive-reel.js + templates/reel.html) ---------- */
.dv-reel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border-radius: var(--radius-lg);
    background: var(--cream-50);
    border: 1px solid var(--cream-200);
    box-shadow: var(--shadow-xs);
}
.dv-reel[hidden] { display: none; }
.dv-reel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.dv-reel-title { margin: 0; font-family: var(--font-display); font-size: 1.15rem; font-weight: 640; color: var(--green-900); }
.dv-reel-make { font-size: 0.9rem; }
.dv-reel-card { padding: 14px; border-radius: var(--radius-md); background: var(--cream-100); border: 1px solid var(--cream-200); }
.dv-reel-card[hidden] { display: none; }
.dv-reel-status-title { margin: 0; font-family: var(--font-display); font-size: 1.05rem; font-weight: 640; color: var(--green-900); }
.dv-reel-status-sub { margin: 2px 0 0; font-size: 0.88rem; color: var(--color-text-muted); overflow-wrap: anywhere; }
.dv-reel-progress { display: flex; align-items: center; gap: 14px; }
.dv-reel-progress-text { min-width: 0; }
/* A film reel turning: cream disc, forest spokes. */
.dv-reel-spinner {
    flex: none;
    width: 40px; height: 40px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%, var(--cream-50) 0 5px, transparent 6px),
        radial-gradient(circle at 50% 22%, var(--cream-50) 0 4px, transparent 5px),
        radial-gradient(circle at 50% 78%, var(--cream-50) 0 4px, transparent 5px),
        radial-gradient(circle at 22% 50%, var(--cream-50) 0 4px, transparent 5px),
        radial-gradient(circle at 78% 50%, var(--cream-50) 0 4px, transparent 5px),
        var(--green-700);
    box-shadow: 0 0 0 3px var(--green-100);
    animation: dv-reel-spin 2.4s linear infinite;
}
@keyframes dv-reel-spin { to { transform: rotate(360deg); } }
.dv-reel-ready { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.dv-reel-player { flex: 0 1 260px; min-width: 0; max-width: 100%; }
.dv-reel-video {
    display: block;
    width: 100%;
    aspect-ratio: 9 / 16;
    max-height: 70vh;
    border-radius: var(--radius-md);
    background: var(--green-950);
    box-shadow: var(--shadow-sm);
    object-fit: contain;
}
.dv-reel-side { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.dv-reel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.dv-reel-failed { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.dv-reel-card--failed { background: var(--color-error-bg); border-color: rgba(147, 49, 45, 0.2); }
.dv-reel-card--failed .dv-reel-status-title { color: var(--color-error); }

/* Builder modal */
.dv-reel-modal { max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; text-align: left; }
.dv-reel-form { display: flex; flex-direction: column; gap: 6px; }
.dv-reel-field { border: 0; margin: 10px 0 0; padding: 0; min-width: 0; }
.dv-reel-label { display: block; font-size: 0.82rem; font-weight: 700; color: var(--color-text-muted); margin: 10px 0 6px; padding: 0; }
.dv-reel-field > .dv-reel-label { margin-top: 0; }
.dv-reel-hint { font-weight: 600; }
.dv-reel-input {
    width: 100%;
    padding: 11px 13px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
}
.dv-reel-input:focus { outline: none; border-color: var(--color-border-focus); box-shadow: var(--ring-primary); }
.dv-reel-muted { margin: 0; font-size: 0.88rem; color: var(--color-text-muted); }
.dv-reel-photos { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.dv-reel-photo { position: relative; display: block; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; background: var(--cream-200); }
.dv-reel-photo input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.dv-reel-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out); }
.dv-reel-photo input:not(:checked) ~ img { opacity: 0.55; }
.dv-reel-photo input:checked ~ img { transform: scale(0.92); border-radius: 6px; }
.dv-reel-photo:has(input:checked) { box-shadow: inset 0 0 0 2.5px var(--green-700); }
.dv-reel-photo input:focus-visible ~ img { outline: 3px solid var(--sun-400); outline-offset: -3px; }
.dv-reel-photo-tick {
    position: absolute; top: 5px; right: 5px; width: 20px; height: 20px; border-radius: 50%;
    background: rgba(254, 252, 247, 0.9); border: 1.5px solid var(--cream-300);
}
.dv-reel-photo input:checked ~ .dv-reel-photo-tick {
    background: var(--green-700) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3 3 7-7' fill='none' stroke='%23fefcf7' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
    border-color: var(--green-700);
}
.dv-reel-photo.is-disabled { cursor: not-allowed; }
.dv-reel-photo.is-disabled img { opacity: 0.3; }
.dv-reel-looks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dv-reel-look, .dv-reel-track-label {
    position: relative; display: flex; align-items: center; gap: 10px; min-width: 0;
    padding: 10px 12px; border-radius: var(--radius-md); border: 1.5px solid var(--color-border);
    background: var(--color-surface); cursor: pointer; font-weight: 700; font-size: 0.92rem;
}
.dv-reel-look input, .dv-reel-track-label input { position: absolute; opacity: 0; pointer-events: none; }
.dv-reel-look:has(input:checked), .dv-reel-track-label:has(input:checked) { border-color: var(--green-700); box-shadow: var(--ring-primary); }
.dv-reel-look:has(input:focus-visible), .dv-reel-track-label:has(input:focus-visible) { outline: 3px solid var(--sun-400); outline-offset: 2px; }
.dv-reel-swatch { flex: none; width: 26px; height: 26px; border-radius: 8px; border: 1px solid rgba(38, 32, 15, 0.15); }
.dv-reel-look--light .dv-reel-swatch { background: linear-gradient(160deg, #fefcf7, #f3ecdd); }
.dv-reel-look--dark .dv-reel-swatch { background: linear-gradient(160deg, #21422e, #122419); }
.dv-reel-music { display: flex; flex-direction: column; gap: 6px; }
.dv-reel-track { display: flex; gap: 8px; align-items: stretch; }
.dv-reel-track-label { flex: 1; }
.dv-reel-track-text { display: flex; flex-direction: column; min-width: 0; }
.dv-reel-track-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-reel-track-meta { font-weight: 500; font-size: 0.8rem; color: var(--color-text-muted); }
.dv-reel-play {
    flex: none; width: 44px; border-radius: var(--radius-md); border: 1.5px solid var(--color-border);
    background: var(--color-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M7 5l8 5-8 5z' fill='%233e7a54'/%3E%3C/svg%3E") center / 18px no-repeat;
    cursor: pointer;
}
.dv-reel-play.is-playing {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 5h3v10H6zM11 5h3v10h-3z' fill='%23c26a25'/%3E%3C/svg%3E");
    border-color: var(--sun-400);
}
.dv-reel-note { margin: 12px 0 0; font-size: 0.84rem; color: var(--color-text-muted); }
.dv-reel-form-status { margin: 8px 0 0; font-size: 0.88rem; font-weight: 600; color: var(--color-error); }
.dv-reel-form-actions { margin-top: 14px; }
@media (max-width: 600px) {
    .dv-reel-photos { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .dv-reel-player { flex-basis: 100%; max-width: min(100%, calc(62vh * 9 / 16)); margin: 0 auto; }
    .dv-reel-modal { padding: 28px 18px 22px; }
}

/* Public reel page */
.reel-page-main { max-width: 560px; align-items: center; }
.reel-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.reel-title { margin: 0; font-family: var(--font-display); font-size: clamp(1.5rem, 5vw, 2rem); font-weight: 680; color: var(--green-900); overflow-wrap: anywhere; }
.reel-sub { margin: 0; color: var(--color-text-muted); font-weight: 600; overflow-wrap: anywhere; }
.reel-player { width: 100%; max-width: min(360px, calc(78vh * 9 / 16)); }
.reel-page-main .dv-cta { width: 100%; }

@media (prefers-reduced-motion: reduce) {
    .dv-reel-spinner { animation: none; }
    .dv-reel-photo img { transition: none; }
}

/* ---------- Flyover (Prompt 14, js/drive-flyover.js) ---------- */
.dv-fly {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border-radius: var(--radius-lg);
    background: var(--cream-50);
    border: 1px solid var(--cream-200);
    box-shadow: var(--shadow-xs);
}
.dv-fly[hidden] { display: none; }
.dv-fly-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.dv-fly-title { margin: 0; font-family: var(--font-display); font-size: 1.15rem; font-weight: 640; color: var(--green-900); }
.dv-fly-intro { margin: 0; font-size: 0.9rem; color: var(--color-text-muted); }
.dv-fly-body:empty { display: none; }
.dv-fly-note { margin: 0; font-size: 0.88rem; color: var(--color-text-muted); }
.dv-fly-error { margin: 0 0 8px; font-size: 0.88rem; font-weight: 600; color: var(--color-error); }
.dv-fly-pro { font-size: 0.86rem; padding: 7px 14px; }

/* The switch: a real checkbox under a forest track. */
.dv-fly-switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; font-size: 0.9rem; color: var(--green-900); }
.dv-fly-switch.is-busy { cursor: progress; opacity: 0.7; }
.dv-fly-switch-input { position: absolute; opacity: 0; width: 44px; height: 26px; margin: 0; cursor: inherit; }
.dv-fly-switch-track {
    position: relative;
    flex: none;
    width: 44px;
    height: 26px;
    border-radius: 999px;
    background: var(--cream-300);
    transition: background var(--duration-base) var(--ease-out);
}
.dv-fly-switch-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--cream-50);
    box-shadow: var(--shadow-sm);
    transition: transform var(--duration-base) var(--ease-spring-soft);
}
.dv-fly-switch-input:checked + .dv-fly-switch-track { background: var(--green-700); }
.dv-fly-switch-input:checked + .dv-fly-switch-track::after { transform: translateX(18px); }
.dv-fly-switch-input:focus-visible + .dv-fly-switch-track { outline: 3px solid var(--color-focus, var(--green-700)); outline-offset: 2px; }

.dv-fly-progress { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--radius-md); background: var(--cream-100); border: 1px solid var(--cream-200); }
.dv-fly-progress-text { min-width: 0; }
.dv-fly-status-title { margin: 0; font-family: var(--font-display); font-size: 1.05rem; font-weight: 640; color: var(--green-900); }
.dv-fly-status-sub { margin: 2px 0 0; font-size: 0.88rem; color: var(--color-text-muted); }
/* A compass needle sweeping: the camera lining up. */
.dv-fly-spinner {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid var(--green-100);
    border-top-color: var(--green-700);
    animation: dv-reel-spin 1.4s linear infinite;
}
.dv-fly-ready { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.dv-fly-player { position: relative; flex: 0 1 240px; min-width: 0; max-width: 100%; }
.dv-fly-video {
    display: block;
    width: 100%;
    aspect-ratio: 9 / 16;
    max-height: 70vh;
    border-radius: var(--radius-md);
    background: var(--green-950);
    box-shadow: var(--shadow-sm);
    object-fit: cover;
}
.dv-fly-credit { margin: 6px 0 0; font-size: 0.72rem; color: var(--color-text-muted); }
.dv-fly-side { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.dv-fly-feed { margin-top: 10px; font-size: 0.88rem; padding: 8px 14px; }
.dv-fly-failed { padding: 14px; border-radius: var(--radius-md); background: var(--color-error-bg); border: 1px solid rgba(147, 49, 45, 0.2); }
.dv-fly-failed .dv-fly-status-title { color: var(--color-error); }
@media (prefers-reduced-motion: reduce) {
    .dv-fly-spinner { animation: none; }
    .dv-fly-switch-track, .dv-fly-switch-track::after { transition: none; }
}

/* Prompt 15: EV chargers along the way (own / trip views) */
.dv-ev {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border-radius: var(--radius-lg);
    background: var(--cream-50);
    border: 1px solid var(--cream-200);
    box-shadow: var(--shadow-xs);
}
.dv-ev-title { margin: 0; font-family: var(--font-display); font-size: 1.15rem; font-weight: 640; color: var(--green-900); }
.dv-ev-body { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.dv-ev-note { margin: 0; font-size: 0.88rem; color: var(--color-text-muted); }
.dv-ev-credit { margin: 0; font-size: 0.74rem; color: var(--color-text-muted); }
.dv-ev-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; width: 100%; }
.dv-ev-item { display: flex; flex-direction: column; gap: 1px; padding: 6px 0; border-top: 1px solid var(--cream-200); font-size: 0.9rem; }
.dv-ev-item span { font-size: 0.8rem; color: var(--color-text-muted); }
.dv-ev-item--suggested strong { color: var(--green-800); }


/* C5 night forest: hardcoded day surfaces and inks follow the theme (generated from a scan, then reviewed). */
[data-theme="dark"] .dv-complete-label input[type="date"] { background: var(--color-surface); }

/* C5 night forest: light inks that sit on always-dark surfaces keep their day value (the cream and pale-green tokens flip at night). */
[data-theme="dark"] .dv-hero-text { color: #fefcf7; }
[data-theme="dark"] .dv-eyebrow { color: #fcefdc; }
[data-theme="dark"] .dv-title-arrow { color: #b5ddc4; }
[data-theme="dark"] .dv-totals { color: #fcefdc; }
[data-theme="dark"] .dv-route-line { color: #f8f3e8; }
[data-theme="dark"] .dv-stop-num { color: #fefcf7; }
[data-theme="dark"] .dv-cta { color: #f8f3e8; }
[data-theme="dark"] .dv-cta-sub { color: #b5ddc4; }
[data-theme="dark"] .dv-cta-actions .btn-ghost { color: #f8f3e8; }
[data-theme="dark"] .dv-cta-actions a.dv-link { color: #b5ddc4; }

/* C5: the reel in a slide mount, with a lip label */
.reel-player { background: var(--tp-mount); padding: 10px 10px 0; border-radius: 3px; box-shadow: var(--shadow-lift); }
.reel-player .dv-reel-video { border-radius: 2px; }
.reel-lip {
    display: flex; justify-content: space-between; gap: 8px;
    margin: 0; padding: 8px 2px 10px;
    font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
    color: #4c3e29; white-space: nowrap; overflow: hidden;
}
.reel-lip span { overflow: hidden; text-overflow: ellipsis; }

/* C5: your drive photos sit in Kodachrome slide mounts (no tilt: the mount is a button). */
.dv-photo-thumb {
    background: var(--tp-mount);
    border: 6px solid var(--tp-mount);
    border-bottom-width: 14px;
    border-radius: 3px;
    box-shadow: var(--shadow-lift);
}
.dv-photo-thumb img { border-radius: 1px; background: #2c2110; }
.dv-photo-thumb:hover { box-shadow: var(--shadow-lift); }
