/* viewer-v3.css — Phase 1 skeleton (Task 5) + minimal chrome (Task 8).
   Design language per spec §5: near-black, coral #E87D6C, Roboto Mono for
   data values, glass surfaces. Skeleton quality — Phase 4 does the real
   design pass live on this URL. */

:root {
    --v3-bg: #0a0a0a;
    --v3-coral: #E87D6C;
    --v3-coral-hover: #f09080;
    --v3-text: #ffffff;
    --v3-text-dim: #b0b0b0;
    --v3-mono: 'Roboto Mono', 'SF Mono', Monaco, Consolas, monospace;
    --v3-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Glass tokens — spec §5, verbatim */
    --v3-glass-bg: rgba(20, 20, 20, .7);
    --v3-glass-blur: 12px;
    --v3-glass-border: 1px solid rgba(255, 255, 255, .14);
    --v3-glass-radius: 12px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* The UA stylesheet's `[hidden] { display: none }` does not reliably
   suppress rendering of inline <svg> icons in every context this app runs
   in — confirmed live (Phase 2 Task 6 verification): both this file's
   pre-existing enter/exit icon pairs (fullscreen, map-expand) and the new
   play/pause pair rendered simultaneously despite one of each pair carrying
   `hidden` (getComputedStyle even reported display:block for the hidden
   one). Stated explicitly so every current and future hidden/shown icon
   toggle in this file actually holds — every icon-swap pair uses `<svg
   hidden>`/`el.hidden = bool`, never a class-based show/hide, so one rule
   covers all of them. */
svg[hidden] {
    display: none;
}

html,
body {
    height: 100%;
}

body {
    background: var(--v3-bg);
    font-family: var(--v3-sans);
}

.tour-container {
    position: fixed;
    inset: 0;
}

/* ---------------------------------------------------------------------
   Chrome shell — one non-interactive full-viewport wrapper; each rail
   re-enables pointer-events so the pano keeps drag/pan everywhere else.
   --------------------------------------------------------------------- */
.v3-chrome {
    position: fixed;
    inset: 0;
    z-index: 20;
    pointer-events: none;
}

.v3-rail {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
}

/* Glass surface — applied to every chip / pill / button / card. */
.v3-glass {
    background: var(--v3-glass-bg);
    -webkit-backdrop-filter: blur(var(--v3-glass-blur));
    backdrop-filter: blur(var(--v3-glass-blur));
    border: var(--v3-glass-border);
    border-radius: var(--v3-glass-radius);
}

/* Top-left: title chip */
.v3-rail-top-left {
    top: 16px;
    left: 16px;
    max-width: min(60vw, 420px);
}

.v3-title {
    padding: 8px 16px;
    color: var(--v3-text);
    font: 600 15px/1.3 var(--v3-sans);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Top-right: weather badge (Phase 2 Task 5) — mirrors the top-left title
   chip; the one corner Phase 1's chrome left empty. */
.v3-rail-top-right {
    top: 16px;
    right: 16px;
}

/* Icon swaps between the 4 shapes in weather.js's ICON_SVGS (sun/cloud/rain/
   snow) via replaceChildren — sized/colored the same as every other badge icon. */
#v3-weather-icon {
    width: 14px;
    height: 14px;
    flex: none;
    color: var(--v3-coral);
}

#v3-weather-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.v3-weather-cond {
    font-family: var(--v3-mono);
    font-weight: 500;
    color: var(--v3-text-dim);
    font-size: 11px;
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Captured (historical) mode reuses the coral accent already used for every
   other "you're viewing an alternate state" affordance (active chart tab,
   active control button) — same token, same meaning. */
#v3-weather-badge.captured-mode #v3-weather-icon,
#v3-weather-badge.captured-mode .v3-badge-value,
#v3-weather-badge.captured-mode .v3-weather-cond {
    color: var(--v3-coral);
}

/* Bottom-left: badge strip (elevation + coords) */
.v3-badge-strip {
    left: 16px;
    bottom: 16px;
    flex-wrap: wrap;
    max-width: calc(100vw - 32px);
}

.v3-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    color: var(--v3-text);
    font: 13px/1 var(--v3-sans);
    cursor: pointer;
}

.v3-badge:hover {
    background: rgba(30, 30, 30, .8);
}

.v3-badge:focus-visible {
    outline: 2px solid var(--v3-coral);
    outline-offset: 2px;
}

.v3-badge-icon {
    width: 14px;
    height: 14px;
    flex: none;
    color: var(--v3-coral);
}

.v3-badge-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.v3-badge-value,
.v3-badge-unit {
    font-family: var(--v3-mono);
    font-weight: 500;
}

.v3-badge-unit {
    color: var(--v3-text-dim);
    font-size: 11px;
    text-transform: uppercase;
}

/* Trail-progress badge (Phase 2 Task 10) — a read-only third member of the
   badge strip, not a toggle like elevation/coords: strips the `.v3-badge`
   base rule's pointer/hover affordance so it doesn't visually promise a
   click that does nothing. */
.v3-badge-static {
    cursor: default;
}

.v3-badge-static:hover {
    background: transparent;
}

#v3-progress-value {
    white-space: nowrap;
}

/* Bottom-right: zoom / fullscreen / share / motion control rail */
.v3-control-rail {
    right: 16px;
    bottom: 16px;
}

.v3-btn {
    width: 40px;
    height: 40px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--v3-text);
    cursor: pointer;
}

.v3-btn:hover {
    background: rgba(30, 30, 30, .8);
}

.v3-btn:focus-visible {
    outline: 2px solid var(--v3-coral);
    outline-offset: 2px;
}

.v3-btn svg {
    width: 18px;
    height: 18px;
}

.v3-btn.active {
    color: var(--v3-coral);
}

.v3-motion-btn {
    width: auto;
    padding: 0 14px;
    font: 500 12px/1 var(--v3-mono);
    white-space: nowrap;
}

.v3-motion-btn[disabled] {
    opacity: .5;
    cursor: default;
}

/* Keyboard-hints chip label ("?") — same 40x40 .v3-btn box every other rail
   control uses; a plain character instead of an SVG (no stroke glyph reads
   as cleanly at this size as the two characters "?" does bare). */
.v3-hints-btn-label {
    font: 600 16px/1 var(--v3-sans);
}

/* ---------------------------------------------------------------------
   AD (audio description) button (Phase 2 Task 9, spec §6) — "AD" text
   label follows the hints chip's own precedent immediately above (a plain
   character reads more cleanly than an SVG at this 40x40 box size).
   --------------------------------------------------------------------- */
.v3-ad-label {
    font: 700 13px/1 var(--v3-mono);
    letter-spacing: .02em;
}

.v3-audio-btn.loading {
    opacity: .55;
}

/* Subtle pulse while audio is actually playing (spec: "playing state with a
   subtle pulse") — a soft coral ring breathing outward, not a scale/shake
   effect; stays legible next to the other rail icons instead of drawing
   attention away from the panorama itself (spec §5's "one hierarchy"). */
.v3-audio-btn.playing {
    color: var(--v3-coral);
    animation: v3-ad-pulse 1.8s ease-in-out infinite;
}

@keyframes v3-ad-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(232, 125, 108, .45); }
    50% { box-shadow: 0 0 0 6px rgba(232, 125, 108, 0); }
}

/* ---------------------------------------------------------------------
   Screenshot button (Phase 2 Task 9) + capture flash. The flash is a
   fixed full-viewport overlay, briefly opaque then fading — a small,
   well-understood "camera shutter" affordance confirming the capture
   happened, independent of whether the browser's own download UI is
   visible. pointer-events:none so it never blocks a rapid second click.
   --------------------------------------------------------------------- */
.v3-screenshot-btn.capturing {
    opacity: .55;
}

.v3-capture-flash {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: #fff;
    pointer-events: none;
    animation: v3-capture-flash .35s ease-out forwards;
}

@keyframes v3-capture-flash {
    0% { opacity: .65; }
    100% { opacity: 0; }
}

/* ---------------------------------------------------------------------
   Side turn-around arrows (Phase 2 Task 8) — two screen-edge glass
   controls, vertically centered, shown only while the camera is looking
   roughly sideways (arrows.js toggles the `hidden` attribute; see that
   file for the full visibility contract). Sit outside every `.v3-rail`
   flex row (own fixed positioning, like `.v3-share-card`/`.v3-tm-dock`)
   since they anchor to the viewport edges, not a corner cluster.
   --------------------------------------------------------------------- */
.v3-side-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 21;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--v3-text);
    background: var(--v3-glass-bg);
    -webkit-backdrop-filter: blur(var(--v3-glass-blur));
    backdrop-filter: blur(var(--v3-glass-blur));
    border: var(--v3-glass-border);
    border-radius: 50%;
    cursor: pointer;
    opacity: .75;
    pointer-events: auto;
    transition: opacity .2s ease, background .15s ease;
}

.v3-side-arrow:hover {
    opacity: 1;
    background: rgba(30, 30, 30, .8);
}

.v3-side-arrow:focus-visible {
    opacity: 1;
    outline: 2px solid var(--v3-coral);
    outline-offset: 2px;
}

.v3-side-arrow svg {
    width: 22px;
    height: 22px;
}

.v3-side-arrow-left {
    left: 16px;
}

.v3-side-arrow-right {
    right: 16px;
}

/* Author `display: flex` above beats the UA stylesheet's own
   `[hidden] { display: none }` at equal specificity (author always wins a
   same-specificity tie against the UA sheet) — same trap already documented
   for the charts dock's tabpanels/blocks and the time-machine dock; restated
   here rather than relying on a reader to remember it applies to buttons too. */
.v3-side-arrow[hidden] {
    display: none;
}

/* Autoplay (Phase 2 Task 6) — button + countdown ring + speed popover.
   Ring radius 19 (viewBox 44x44, trail-v3.blade.php) is autoplay.js's
   RING_RADIUS constant — that file owns the circumference math; the
   dasharray/dashoffset values below only prevent a one-frame FOUC (a full
   solid ring) before JS's resetRing() runs, and are self-correcting to the
   JS-computed precise value the instant it does. */
.v3-autoplay {
    position: relative;
}

/* Descendant selector (NOT a bare `.v3-autoplay-ring`) is load-bearing (P4-6):
   the generic `.v3-btn svg { width:18px; height:18px }` rule that sizes the
   play/pause ICONS also matches this ring SVG, and at (0,1,1) it outranked a
   lone `.v3-autoplay-ring` class (0,1,0) — shrinking the ring to 18x18 and,
   with inset:-4px still in force, pinning that shrunken box to the button's
   top-left corner (the "loading/countdown indicator offset to the upper-left"
   symptom). `.v3-autoplay .v3-autoplay-ring` (0,2,0) outranks `.v3-btn svg`,
   so the ring reclaims its full 48x48 and frames the 40x40 button dead-centre. */
.v3-autoplay .v3-autoplay-ring {
    position: absolute;
    inset: -4px;
    width: calc(100% + 8px);
    height: calc(100% + 8px);
    pointer-events: none; /* clicks must reach the <button> beneath, not this overlay */
    transform: rotate(-90deg); /* 12-o'clock start */
}

.v3-autoplay-ring-track,
.v3-autoplay-ring-progress {
    fill: none;
    stroke-width: 2;
}

.v3-autoplay-ring-track {
    stroke: rgba(255, 255, 255, .14);
}

.v3-autoplay-ring-progress {
    stroke: var(--v3-coral);
    stroke-linecap: round;
    stroke-dasharray: 119.38;
    stroke-dashoffset: 119.38;
}

/* Speed popover — reveals on hover/focus/while playing. pointer-events:none
   while hidden only blocks pointer hit-testing, not keyboard focus
   traversal, so a Tab-key visitor still reaches the range input and
   :focus-within still reveals it. */
.v3-autoplay-speed-popover {
    position: absolute;
    right: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%) translateX(4px);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
}

.v3-autoplay:hover .v3-autoplay-speed-popover,
.v3-autoplay.playing .v3-autoplay-speed-popover,
.v3-autoplay-speed-popover:focus-within {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%) translateX(0);
}

.v3-autoplay-speed-label {
    color: var(--v3-text-dim);
    font: 500 11px/1 var(--v3-mono);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.v3-autoplay-speed-value {
    color: var(--v3-text);
    font: 600 12px/1 var(--v3-mono);
    min-width: 30px;
}

#v3-autoplay-speed {
    width: 90px;
    accent-color: var(--v3-coral);
}

/* Share card */
.v3-share-card {
    position: fixed;
    left: 50%;
    bottom: 96px;
    z-index: 30;
    width: min(420px, calc(100vw - 32px));
    padding: 20px;
    pointer-events: auto;
    display: none;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
    transition: opacity .15s ease, transform .15s ease;
}

.v3-share-card.open {
    display: flex;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.v3-share-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--v3-text-dim);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.v3-share-close:hover {
    color: var(--v3-text);
}

.v3-share-title {
    color: var(--v3-text);
    font: 600 16px/1.3 var(--v3-sans);
    padding-right: 24px;
}

.v3-share-label {
    display: block;
    color: var(--v3-text-dim);
    font: 500 11px/1 var(--v3-mono);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: -6px;
}

.v3-share-row {
    display: flex;
    gap: 8px;
}

.v3-share-input,
.v3-share-textarea {
    flex: 1;
    min-width: 0;
    background: rgba(0, 0, 0, .35);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 8px;
    color: var(--v3-text);
    font: 12px/1.4 var(--v3-mono);
    padding: 8px 10px;
    resize: none;
}

.v3-share-input:focus,
.v3-share-textarea:focus {
    outline: 2px solid var(--v3-coral);
    outline-offset: 1px;
}

.v3-copy-btn {
    flex: none;
    padding: 0 14px;
    background: var(--v3-coral);
    color: #1a0f0c;
    border: none;
    border-radius: 8px;
    font: 600 12px/1 var(--v3-sans);
    cursor: pointer;
}

.v3-copy-btn:hover {
    background: var(--v3-coral-hover);
}

.v3-copy-btn.copied {
    background: #6fbf73;
    color: #08210a;
}

/* ---------------------------------------------------------------------
   iNaturalist observation detail card (Phase 2 Task 10) — same floating
   glass-card idiom as .v3-share-card directly above (fixed position,
   .open class toggles visibility), opened from either an observation
   marker click (map.js, live Mapbox layer) or a row in the map dock's
   Observations list. overflow:hidden lets the top image's corners pick up
   .v3-glass's own border-radius for free, matching how the map dock
   already clips its canvas/placeholder children the same way.
   --------------------------------------------------------------------- */
.v3-obs-card {
    position: fixed;
    left: 50%;
    bottom: 96px;
    z-index: 30;
    width: min(340px, calc(100vw - 32px));
    pointer-events: auto;
    display: none;
    flex-direction: column;
    opacity: 0;
    overflow: hidden;
    transform: translateX(-50%) translateY(8px);
    transition: opacity .15s ease, transform .15s ease;
}

.v3-obs-card.open {
    display: flex;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.v3-obs-card-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--v3-text);
    background: rgba(0, 0, 0, .55);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.v3-obs-card-close:hover {
    background: rgba(0, 0, 0, .75);
}

.v3-obs-card-image {
    width: 100%;
    height: 160px;
    display: block;
    object-fit: cover;
    background: rgba(255, 255, 255, .06);
}

.v3-obs-card-body {
    padding: 14px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.v3-obs-card-eyebrow {
    color: var(--v3-text-dim);
    font: 500 10px/1 var(--v3-mono);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.v3-obs-card-name {
    color: var(--v3-text);
    font: 600 16px/1.3 var(--v3-sans);
    margin-top: 2px;
}

.v3-obs-card-taxon {
    color: var(--v3-text-dim);
    font: 500 12px/1.3 var(--v3-sans);
    font-style: italic;
}

.v3-obs-card-taxon:empty {
    display: none;
}

.v3-obs-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
}

.v3-obs-card-date,
.v3-obs-card-distance {
    color: var(--v3-text-dim);
    font: 500 11px/1 var(--v3-mono);
}

.v3-obs-card-date:empty,
.v3-obs-card-distance:empty {
    display: none;
}

.v3-obs-card-link {
    align-self: flex-start;
    margin-top: 12px;
    padding: 8px 14px;
    background: var(--v3-coral);
    color: #1a0f0c;
    border-radius: 8px;
    font: 600 12px/1 var(--v3-sans);
    text-decoration: none;
}

.v3-obs-card-link:hover {
    background: var(--v3-coral-hover);
}

.v3-obs-card-link:focus-visible {
    outline: 2px solid var(--v3-coral);
    outline-offset: 2px;
}

.v3-obs-card-link[hidden] {
    display: none;
}

/* ---------------------------------------------------------------------
   Time machine (Phase 2 Task 7) — small glass chip row, top-center, below
   the title/weather row. This is the one open corner left in the layout at
   this position: bottom-center already belongs to the charts-dock, and
   bottom-left/right are the badge-strip / control-rail+map-dock stacks.
   Rendered only for trails with trail_time_machine pivot rows (blade @if);
   the row's actual content is built/hidden per-scene by timemachine.js
   (Pano.JSON.time_machine can in principle be empty for a given scene even
   when the trail has pivot rows).
   --------------------------------------------------------------------- */
.v3-tm-dock {
    position: absolute;
    top: 64px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 21;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: min(70vw, 480px);
    /* Re-enabled per chip-wrap below — an empty/hidden row must never eat
       clicks meant for the pano underneath it. */
    pointer-events: none;
}

/* Author `display: flex` above beats the UA stylesheet's own
   `[hidden] { display: none }` (attribute styling loses to any author
   declaration — same trap already documented/fixed for the charts dock's
   tabpanels/blocks) — restate it explicitly or a "hidden" (empty) row still
   lays out as a zero-content flex box sitting in front of the pano. */
.v3-tm-dock[hidden] {
    display: none;
}

.v3-tm-chip-wrap {
    position: relative;
    pointer-events: auto;
}

.v3-tm-chip {
    display: flex;
    align-items: center;
    height: 32px;
    padding: 0 14px;
    color: var(--v3-text);
    font: 600 12px/1 var(--v3-mono);
    letter-spacing: .02em;
    cursor: pointer;
    white-space: nowrap;
}

.v3-tm-chip:hover {
    background: rgba(30, 30, 30, .8);
}

.v3-tm-chip:focus-visible {
    outline: 2px solid var(--v3-coral);
    outline-offset: 2px;
}

/* Direction-aware preview — purely decorative (pointer-events: none always;
   the chip itself is the one and only click target, both with and without
   the preview showing). Positioned above its chip, sized for a small square
   mobile_%s.jpg face crop. */
.v3-tm-preview {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%) translateY(4px);
    width: 120px;
    padding: 6px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s ease, transform .15s ease;
}

.v3-tm-preview img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 6px;
    background: rgba(0, 0, 0, .3);
}

/* Keyboard focus reveals the preview on ANY device (not gated behind the
   hover media query below) — matches the accessibility posture of the
   existing autoplay speed-popover's :focus-within rule. */
.v3-tm-chip-wrap:focus-within .v3-tm-preview {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Mouse hover reveals the preview on hover-CAPABLE pointers only. Touch
   devices never match this and get no dead hover state they can't reach —
   tapping a chip navigates immediately, same as every other control in this
   file. */
@media (hover: hover) {
    .v3-tm-chip-wrap:hover .v3-tm-preview {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ---------------------------------------------------------------------
   Minimap dock (Phase 2 Task 3) — bottom-right glass dock, stacked above
   the control rail (16 + 40 button + 12 gap = 68, rounded to 70). Placeholder
   and canvas are both position:absolute children of the same sized box and
   NEVER display:none, so Mapbox always constructs against real, non-zero
   dimensions no matter when map.js's lazy load actually resolves.
   --------------------------------------------------------------------- */
.v3-map-dock {
    position: absolute;
    right: 16px;
    bottom: 70px;
    width: 150px;
    height: 150px;
    overflow: hidden;
    pointer-events: auto;
    transition: width .25s ease, height .25s ease;
    z-index: 21;
}

.v3-map-dock.expanded {
    width: min(60vw, 460px);
    height: min(55vh, 400px);
    z-index: 25;
}

.v3-map-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--v3-text-dim);
    font: 500 11px/1 var(--v3-mono);
    text-transform: uppercase;
    letter-spacing: .05em;
    cursor: pointer;
    transition: opacity .2s ease;
}

/* ID selector, not .v3-map-canvas: Mapbox GL's own stylesheet (loaded
   dynamically, AFTER this file) applies `.mapboxgl-map { position: relative }`
   to this same element (Mapbox adds that class to whatever container it's
   given). A class-vs-class rule is a specificity tie, broken by source order
   in Mapbox's favor since its CSS loads later — which silently dropped this
   absolute/inset:0 sizing and let the container's height default to Mapbox's
   own intrinsic layout (observed live: 148x300 instead of 150x150, an
   effectively-blank map). #v3-map-canvas's ID specificity beats a class
   unconditionally, independent of load order, so this wins for good. */
#v3-map-canvas {
    position: absolute;
    inset: 0;
}

.v3-map-placeholder svg {
    width: 22px;
    height: 22px;
    color: var(--v3-coral);
}

.v3-map-placeholder.error {
    color: #e0776a;
}

.v3-map-canvas {
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}

/* Root-level state class (set by map.js once Mapbox's 'load' fires) drives
   both halves of the swap — keeps the two elements' visibility in one place
   instead of juggling a class per element. */
.v3-map-dock.map-ready .v3-map-canvas {
    opacity: 1;
    pointer-events: auto;
}

.v3-map-dock.map-ready .v3-map-placeholder {
    opacity: 0;
    pointer-events: none;
}

.v3-map-expand-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .55);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 6px;
    color: var(--v3-text);
    cursor: pointer;
}

.v3-map-expand-btn:hover {
    background: rgba(0, 0, 0, .75);
}

.v3-map-expand-btn:focus-visible {
    outline: 2px solid var(--v3-coral);
    outline-offset: 2px;
}

.v3-map-expand-btn svg {
    width: 13px;
    height: 13px;
}

/* Current-scene marker: FOV cone + hub dot, one canvas doing double duty
   (map.js draws both). Only .v3-map-cone-rotator gets the rotate() transform
   — Mapbox itself owns .v3-map-cone's transform for marker positioning, so
   rotating that element directly would fight Mapbox's own positioning. */
.v3-map-cone {
    width: 46px;
    height: 46px;
    pointer-events: none;
}

.v3-map-cone-rotator {
    width: 100%;
    height: 100%;
    transition: transform .08s linear;
}

.v3-map-cone-rotator canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* ---------------------------------------------------------------------
   iNaturalist observations (Phase 2 Task 10) — tab row + list, both inside
   the map dock (see the blade comment for the "why here, not a new dock"
   rationale). Tabs only appear once the dock is expanded (top:6px/left:6px,
   mirroring the expand button's own top:6px/right:6px on the opposite
   corner) — the 150x150 collapsed box has no room for a tab bar and the
   live marker layer (map.js) is the collapsed view's own affordance. The
   list is a `.v3-glass`-equivalent sheet that visually sits OVER the map
   canvas (later in DOM order, same inset box) rather than replacing it —
   the underlying Mapbox instance and its markers stay alive and in sync
   the whole time, so switching back to the Map tab is instant.
   --------------------------------------------------------------------- */
.v3-map-tabs {
    display: none;
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 2;
    gap: 4px;
}

.v3-map-dock.expanded .v3-map-tabs {
    display: flex;
}

.v3-map-tab {
    padding: 4px 8px;
    background: rgba(0, 0, 0, .55);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 6px;
    color: var(--v3-text-dim);
    font: 500 10px/1.4 var(--v3-mono);
    cursor: pointer;
    white-space: nowrap;
}

.v3-map-tab:hover {
    color: var(--v3-text);
}

.v3-map-tab.active {
    color: var(--v3-text);
    border-color: var(--v3-coral);
    background: rgba(232, 125, 108, .18);
}

.v3-map-tab:focus-visible {
    outline: 2px solid var(--v3-coral);
    outline-offset: 2px;
}

.v3-map-tab-count {
    color: var(--v3-coral);
    margin-left: 4px;
}

.v3-map-tab.active .v3-map-tab-count {
    color: inherit;
}

.v3-obs-list {
    position: absolute;
    inset: 38px 0 0 0;
    z-index: 1;
    overflow-y: auto;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--v3-glass-bg);
    -webkit-backdrop-filter: blur(var(--v3-glass-blur));
    backdrop-filter: blur(var(--v3-glass-blur));
}

/* Same [hidden]-vs-author-rule trap as every other dock panel in this file
   (charts tabpanels, time-machine dock, hints overlay) — restated here
   rather than relying on the UA default, which an author `display: flex`
   class always beats regardless of the `hidden` attribute's presence. */
.v3-obs-list[hidden] {
    display: none;
}

.v3-obs-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 5px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--v3-text);
    text-align: left;
    cursor: pointer;
    flex: none;
}

.v3-obs-item:hover {
    background: rgba(255, 255, 255, .08);
}

.v3-obs-item:focus-visible {
    outline: 2px solid var(--v3-coral);
    outline-offset: -2px;
}

.v3-obs-thumb {
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 6px;
    object-fit: cover;
    background: rgba(255, 255, 255, .08);
}

.v3-obs-item-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.v3-obs-item-name {
    font: 600 11px/1.3 var(--v3-sans);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v3-obs-item-dist {
    font: 500 10px/1 var(--v3-mono);
    color: var(--v3-text-dim);
}

.v3-obs-empty {
    color: var(--v3-text-dim);
    font: 500 11px/1.4 var(--v3-mono);
    padding: 14px 6px;
    text-align: center;
}

/* ---------------------------------------------------------------------
   Charts dock (Phase 2 Task 4) — bottom-center glass chip; expanded panel
   is a fixed, centered glass sheet above the control-rail row (share-card
   precedent). Chart internals (uPlot construction, readouts, captured
   fetches) live in resources/js/viewer-v3/charts.js.
   --------------------------------------------------------------------- */
.v3-charts-dock {
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    pointer-events: none;
}

.v3-charts-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    color: var(--v3-text);
    font: 500 12px/1 var(--v3-mono);
    text-transform: uppercase;
    letter-spacing: .04em;
    cursor: pointer;
    pointer-events: auto;
    white-space: nowrap;
    transition: opacity .15s ease;
}

.v3-charts-chip svg {
    width: 15px;
    height: 15px;
    color: var(--v3-coral);
}

.v3-charts-chip:hover {
    background: rgba(30, 30, 30, .8);
}

.v3-charts-chip:focus-visible {
    outline: 2px solid var(--v3-coral);
    outline-offset: 2px;
}

.v3-charts-dock.expanded .v3-charts-chip {
    opacity: 0;
    pointer-events: none;
}

.v3-charts-panel {
    position: fixed;
    left: 50%;
    bottom: 70px;
    z-index: 26; /* above the expanded map dock (25) — later-opened surface wins */
    width: min(760px, calc(100vw - 32px));
    max-height: 70vh;
    overflow-y: auto;
    padding: 14px 16px 16px;
    pointer-events: auto;
    display: none;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
    transition: opacity .15s ease, transform .15s ease;
}

.v3-charts-dock.expanded .v3-charts-panel {
    display: flex;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.v3-charts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.v3-charts-tabs {
    display: flex;
    gap: 6px;
}

/* A single tab is just a heading — hide the chrome of a one-option chooser. */
.v3-charts-tabs .v3-charts-tab:only-child {
    pointer-events: none;
    border-color: transparent;
    background: transparent;
    padding-left: 0;
}

.v3-charts-tab {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 8px;
    color: var(--v3-text-dim);
    font: 500 11px/1 var(--v3-mono);
    text-transform: uppercase;
    letter-spacing: .04em;
    cursor: pointer;
}

.v3-charts-tab:hover {
    color: var(--v3-text);
}

.v3-charts-tab.active {
    color: var(--v3-text);
    border-color: var(--v3-coral);
    background: rgba(232, 125, 108, .12);
}

.v3-charts-tab:focus-visible {
    outline: 2px solid var(--v3-coral);
    outline-offset: 2px;
}

.v3-charts-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--v3-text-dim);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.v3-charts-close:hover {
    color: var(--v3-text);
}

.v3-charts-close:focus-visible {
    outline: 2px solid var(--v3-coral);
    outline-offset: 2px;
}

.v3-charts-tabpanel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Author display:flex beats the UA stylesheet's [hidden] { display: none }
   (attribute styling loses to any author declaration) — restate it or the
   inactive tabpanels/blocks render stacked below the active one (caught
   live in this task's own Playwright pass). */
.v3-charts-tabpanel[hidden],
.v3-charts-block[hidden] {
    display: none;
}

.v3-charts-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.v3-charts-station {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.v3-charts-station-name {
    color: var(--v3-text);
    font: 600 12px/1.3 var(--v3-sans);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v3-charts-station-src {
    color: var(--v3-text-dim);
    font: 500 10px/1 var(--v3-mono);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.v3-charts-mode {
    display: flex;
    gap: 6px;
    flex: none;
}

.v3-charts-mode-btn {
    padding: 6px 10px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 8px;
    color: var(--v3-text-dim);
    font: 500 11px/1 var(--v3-mono);
    cursor: pointer;
}

.v3-charts-mode-btn:hover {
    color: var(--v3-text);
}

.v3-charts-mode-btn.active {
    color: var(--v3-text);
    border-color: var(--v3-coral);
    background: rgba(232, 125, 108, .12);
}

.v3-charts-mode-btn:focus-visible {
    outline: 2px solid var(--v3-coral);
    outline-offset: 2px;
}

.v3-charts-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.v3-charts-stat-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.v3-charts-stat {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.v3-charts-stat-label {
    color: var(--v3-text-dim);
    font: 500 10px/1 var(--v3-mono);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.v3-charts-stat-value {
    color: var(--v3-text);
    font: 600 15px/1 var(--v3-mono);
}

.v3-charts-stat-unit {
    color: var(--v3-text-dim);
    font: 500 10px/1 var(--v3-mono);
    text-transform: uppercase;
}

.v3-charts-readout {
    color: var(--v3-text);
    font: 500 12px/1 var(--v3-mono);
    min-height: 12px;
}

.v3-chart-host {
    position: relative;
    width: 100%;
}

.v3-chart-host.v3-chart-empty {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--v3-text-dim);
    font: 500 12px/1 var(--v3-mono);
    border: 1px dashed rgba(255, 255, 255, .14);
    border-radius: 8px;
}

.v3-charts-msg {
    color: var(--v3-text-dim);
    font: 500 12px/1.5 var(--v3-mono);
    padding: 12px 0;
}

.v3-charts-date {
    color: var(--v3-text-dim);
    font: 500 11px/1.4 var(--v3-mono);
}

/* uPlot hover point — square by default; match the coral dot language. */
.v3-chart-host .u-cursor-pt {
    border-radius: 50%;
}

/* Elevation hotspot name-on-hover (P4-13). Coral-keyed glass chip anchored
   over the hovered coral dot; flips below for dots near the chart's top edge.
   Non-interactive so it never intercepts the profile's click-to-jump. */
.v3-chart-hs-tip {
    position: absolute;
    z-index: 2;
    transform: translate(-50%, calc(-100% - 8px));
    max-width: 180px;
    padding: 3px 8px;
    background: rgba(10, 10, 10, .92);
    border: 1px solid var(--v3-coral);
    border-radius: 6px;
    color: var(--v3-text);
    font: 500 11px/1.3 var(--v3-mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

.v3-chart-hs-tip.v3-chart-hs-tip-below {
    transform: translate(-50%, 8px);
}

.v3-chart-hs-tip[hidden] {
    display: none;
}

/* ---------------------------------------------------------------------
   Keyboard-hints overlay (Phase 2 Task 8) — a centered modal-ish glass card
   over a dim backdrop, listing every pan/zoom/nav/dock binding in one place.
   z-index 40: comfortably above the charts panel (26, itself "above the
   expanded map dock" per that section's own comment) — the highest surface
   in this file by design, since it's the one true modal here.
   --------------------------------------------------------------------- */
.v3-hints-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, .55);
    pointer-events: auto;
}

/* Same same-specificity-tie trap as every other [hidden] element in this
   file (see the side-arrow / time-machine / charts-dock comments) —
   restated because `display: flex` is an author rule the UA stylesheet
   alone cannot override. */
.v3-hints-overlay[hidden] {
    display: none;
}

.v3-hints-card {
    position: relative;
    width: min(360px, calc(100vw - 48px));
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px;
}

.v3-hints-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--v3-text-dim);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.v3-hints-close:hover {
    color: var(--v3-text);
}

.v3-hints-close:focus-visible {
    outline: 2px solid var(--v3-coral);
    outline-offset: 2px;
}

.v3-hints-title {
    color: var(--v3-text);
    font: 600 16px/1.3 var(--v3-sans);
    padding-right: 24px;
    margin-bottom: 16px;
}

.v3-hints-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.v3-hints-list > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.v3-hints-list dt {
    flex: none;
    color: var(--v3-coral);
    font: 600 12px/1.3 var(--v3-mono);
    white-space: nowrap;
}

.v3-hints-list dd {
    color: var(--v3-text-dim);
    font: 500 13px/1.3 var(--v3-sans);
    text-align: right;
}

/* ---------------------------------------------------------------------
   Admin editing surfaces (Phase 2 Task 12) — collapsed glass chip, bottom-
   left, stacked ABOVE the visitor badge-strip (same "bottom:70px over a
   ~40px row at bottom:16px" stacking math the map-dock already uses on the
   opposite corner over the control-rail). Chip mirrors .v3-charts-chip;
   panel mirrors .v3-charts-panel's fixed/floating idiom but anchored
   bottom-left instead of centered — deliberately does not cover the
   horizontal center of the screen, where the ground trail-text ribbon this
   panel's sliders are tuning actually renders, so the admin can watch the
   live preview update while dragging.
   --------------------------------------------------------------------- */
.v3-admin-dock {
    position: absolute;
    left: 16px;
    bottom: 70px;
    z-index: 21;
}

.v3-admin-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    color: var(--v3-text);
    font: 500 12px/1 var(--v3-mono);
    text-transform: uppercase;
    letter-spacing: .04em;
    cursor: pointer;
    pointer-events: auto;
    white-space: nowrap;
}

.v3-admin-chip svg {
    width: 15px;
    height: 15px;
    color: var(--v3-coral);
}

.v3-admin-chip:hover {
    background: rgba(30, 30, 30, .8);
}

.v3-admin-chip:focus-visible {
    outline: 2px solid var(--v3-coral);
    outline-offset: 2px;
}

.v3-admin-chip[aria-expanded="true"] {
    opacity: 0;
    pointer-events: none;
}

.v3-admin-panel {
    position: fixed;
    left: 16px;
    bottom: 70px;
    z-index: 27; /* above the expanded charts panel (26) — an admin tool wins any incidental overlap */
    width: min(280px, calc(100vw - 32px));
    max-height: 70vh;
    overflow-y: auto;
    padding: 14px 16px 16px;
    pointer-events: auto;
    display: none;
    flex-direction: column;
    gap: 12px;
}

.v3-admin-panel.open {
    display: flex;
}

.v3-admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.v3-admin-title {
    color: var(--v3-text);
    font: 600 14px/1.3 var(--v3-sans);
}

.v3-admin-close {
    width: 28px;
    height: 28px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--v3-text-dim);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.v3-admin-close:hover {
    color: var(--v3-text);
}

.v3-admin-close:focus-visible {
    outline: 2px solid var(--v3-coral);
    outline-offset: 2px;
}

.v3-admin-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, .1);
}

.v3-admin-group:first-of-type {
    padding-top: 0;
    border-top: none;
}

.v3-admin-group-label {
    color: var(--v3-text-dim);
    font: 500 10px/1 var(--v3-mono);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.v3-admin-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.v3-admin-row label {
    flex: none;
    width: 52px;
    color: var(--v3-text-dim);
    font: 500 12px/1 var(--v3-sans);
}

.v3-admin-row input[type="range"] {
    flex: 1;
    min-width: 0;
    accent-color: var(--v3-coral);
}

.v3-admin-value {
    flex: none;
    width: 40px;
    text-align: right;
    color: var(--v3-text);
    font: 500 12px/1 var(--v3-mono);
}

.v3-admin-btn {
    padding: 8px 14px;
    background: var(--v3-coral);
    color: #1a0f0c;
    border: none;
    border-radius: 8px;
    font: 600 12px/1 var(--v3-sans);
    cursor: pointer;
}

.v3-admin-btn:hover {
    background: var(--v3-coral-hover);
}

.v3-admin-btn:focus-visible {
    outline: 2px solid var(--v3-coral);
    outline-offset: 2px;
}

/* Neutral by default (a mundane "Saved" confirmation needs no special
   color); .error switches to a purpose-built red — the ONE deliberate
   deviation from the spec §5 palette in this file, precedented by
   .v3-copy-btn.copied's own green a few hundred lines up: a genuine
   two-state (succeeded/failed) status distinction, not decoration. */
.v3-admin-status {
    min-height: 14px;
    color: var(--v3-text-dim);
    font: 500 11px/1.3 var(--v3-mono);
}

.v3-admin-status.error {
    color: #ff6b6b;
}

.v3-admin-edit-link {
    align-self: flex-start;
    color: var(--v3-coral);
    font: 500 12px/1 var(--v3-sans);
    text-decoration: none;
}

.v3-admin-edit-link:hover {
    text-decoration: underline;
}

.v3-admin-edit-link:focus-visible {
    outline: 2px solid var(--v3-coral);
    outline-offset: 2px;
}

/* ---------------------------------------------------------------------
   Mobile (spec §7): condense the strip, stack the rail vertically so
   neither footprint crosses the middle of a narrow viewport.
   --------------------------------------------------------------------- */
@media (max-width: 480px) {
    /* Reserve room on the right for the weather badge (icon + temp only on
       mobile, .v3-weather-cond hidden below) so a long trail name's ellipsis
       never lets the title chip grow into it — guaranteed by construction,
       not by luck of a particular trail name's length. */
    .v3-rail-top-left {
        max-width: calc(100vw - 116px);
    }

    .v3-title {
        font-size: 13px;
        padding: 6px 12px;
    }

    /* Conditions text drops on mobile; icon + temp is enough at this width,
       matching how the badge strip below also condenses. */
    .v3-weather-cond {
        display: none;
    }

    #v3-weather-badge {
        padding: 6px 10px;
        font-size: 12px;
    }

    .v3-badge-strip {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .v3-badge {
        padding: 6px 10px;
        font-size: 12px;
    }

    .v3-control-rail {
        flex-direction: column;
    }

    .v3-btn {
        width: 36px;
        height: 36px;
    }

    /* Autoplay's speed popover shrinks to match the smaller mobile button;
       it still opens leftward off the rail's right edge either way (row or
       column), so no position change is needed here, only sizing. */
    .v3-autoplay-speed-popover {
        padding: 6px 10px;
    }

    #v3-autoplay-speed {
        width: 64px;
    }

    .v3-share-card {
        bottom: 80px;
        padding: 16px;
    }

    /* Same bottom-center floating-card slot/offset as .v3-share-card just
       above — the two are mutually exclusive in practice (opened by
       different, unrelated controls) so sharing the vertical position is
       harmless and keeps every dismissible card at one predictable height. */
    .v3-obs-card {
        bottom: 80px;
    }

    .v3-obs-card-image {
        height: 130px;
    }

    /* .v3-control-rail is an 8-button column here (Task 9 added screenshot +
       AD: 8x36 + 7x8px gaps = 344px, +16px margin = 360px from the viewport
       bottom to its top edge — was 6 buttons/272px before this task, per
       Task 8's own comment, which was itself 5 buttons/228px before that,
       per Task 6's comment). The dock must clear that, not the 40px-tall
       desktop row's much smaller footprint. Same +12px buffer every prior
       task in this chain used over the raw arithmetic (228->240->284) —
       bounding-box verified zero overlap live, not just computed (see the
       task report). */
    .v3-map-dock {
        width: 108px;
        height: 108px;
        bottom: 372px;
    }

    .v3-map-dock.expanded {
        width: min(78vw, 300px);
        height: 40vh;
    }

    .v3-map-tab {
        padding: 5px 7px;
        font-size: 9px;
    }

    .v3-obs-list {
        inset: 32px 0 0 0;
    }

    .v3-obs-thumb {
        width: 30px;
        height: 30px;
    }

    /* Charts chip joins the left badge column (a data affordance, semantically
       adjacent to the elevation badge): bottom-center would collide with the
       coords badge's row on a 390px viewport. Sits above the 2-badge column
       (2 × ~30px + 6px gap + 16px margin ≈ 82 -> 88 with clearance). */
    .v3-charts-dock {
        left: 16px;
        bottom: 88px;
        transform: none;
    }

    .v3-charts-chip {
        height: 34px;
        padding: 0 12px;
        font-size: 11px;
    }

    .v3-charts-panel {
        bottom: 8px;
        width: calc(100vw - 16px);
        padding: 12px;
    }

    /* top:64px (desktop rule) already clears the mobile header row (title
       chip max ~29px tall + weather badge max ~27px tall, both anchored at
       top:16px — bottom edge <=45px either way, since both are single-line/
       ellipsis/nowrap by construction) — no position override needed here,
       only the same size-down treatment every other chip/badge gets at this
       breakpoint. */
    .v3-tm-dock {
        max-width: calc(100vw - 32px);
        gap: 6px;
    }

    .v3-tm-chip {
        height: 28px;
        padding: 0 10px;
        font-size: 11px;
    }

    .v3-tm-preview {
        width: 96px;
    }

    /* Side arrows shrink to match every other control's mobile size-down
       (.v3-btn does the identical 40px->36px step above) — still a
       comfortably tappable 40px circle including its own padding-free box. */
    .v3-side-arrow {
        width: 40px;
        height: 40px;
    }

    .v3-side-arrow svg {
        width: 19px;
        height: 19px;
    }

    .v3-hints-card {
        padding: 20px;
    }

    /* Admin dock (Phase 2 Task 12) joins the same left column charts-dock
       already established above at this breakpoint (left:16px). Cleared
       against the TALLER of the two possible stacks so there is never an
       overlap, accepting a visual gap in the shorter case (an admin-only
       tool tolerates a gap; it must never tolerate an overlap):
       charts-chip-present case: bottom:88px + height:34px = 122px top edge,
       +12px buffer (same buffer every prior task in this stacking chain
       used) = 134px. When charts-dock is absent (@if gate in the blade),
       the 2-3 badge mobile column (.v3-badge-strip flex-direction:column)
       tops out well below 134px, so this still clears with room to spare —
       bounding-box-verified live for both cases, see the task report. */
    .v3-admin-dock {
        left: 16px;
        bottom: 134px;
    }

    .v3-admin-chip {
        height: 34px;
        padding: 0 12px;
        font-size: 11px;
    }

    .v3-admin-panel {
        left: 8px;
        bottom: 8px;
        width: calc(100vw - 16px);
        padding: 12px;
    }
}

/* =======================================================================
   INTELLIGENCE LENS — Phase 3 Task 5 (the owner-approved A+B HYBRID).
   ONE engine, ONE in-scene treatment that auto-switches between two modes
   (the T4 gate's A/B/C switcher + the edge-HUD direction C are retired):
     [data-mode="cards"] glass chips pinned ON each feature (the base look).
     [data-mode="dots"]  minimal coral marks; text only for money items /
                         hover — the auto-declutter under density / zoom-out.
   overlay.js flips data-mode via the density valve (count + FOV, hysteretic).
   Shared chrome (control, scene panel, detail card) is constant. Everything
   below only takes effect when lens.js builds these nodes under ?lens=1 — so
   ?lens absent = zero visual footprint (verification #5). Design vocabulary is
   spec §5 verbatim (near-black, coral #E87D6C, Roboto Mono, glass).
   ======================================================================= */
:root {
    --lens-coral: var(--v3-coral);
    --lens-ink: rgba(12, 12, 12, .82);
    --lens-ink-blur: 10px;
    --lens-line: rgba(232, 125, 108, .55);
    --lens-verify: #f4a08f;
    --lens-shadow: 0 6px 20px -8px rgba(0, 0, 0, .75);
}

/* ---- overlay + leader/target SVG layer -------------------------------- */
.v3-lens-overlay {
    position: fixed;
    inset: 0;
    z-index: 15;
    pointer-events: none;
    font-family: var(--v3-mono);
}
.v3-lens-leaders {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}
.v3-lm-leader {
    stroke: var(--lens-line);
    stroke-width: 1;
    stroke-dasharray: 1 4;
    stroke-linecap: round;
}
.v3-lm-point {
    fill: var(--lens-coral);
    stroke: rgba(0, 0, 0, .55);
    stroke-width: 1;
}

/* ---- marker root: a small anchor centered on the projected point ------ */
.v3-lm {
    position: absolute;
    left: 0;
    top: 0;
    width: 12px;
    height: 12px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--v3-text);
    cursor: pointer;
    pointer-events: auto;
    opacity: var(--lm-o, 1);
    transform: translate(-50%, -50%) scale(var(--lm-s, 1));
    transform-origin: center;
    -webkit-font-smoothing: antialiased;
}
.v3-lm:focus-visible { outline: none; }
.v3-lm:focus-visible .v3-lm-body,
.v3-lm:focus-visible .v3-lm-anchor { outline: 2px solid var(--v3-coral); outline-offset: 2px; }

/* the point dot (the anchor that sits exactly on the feature) */
.v3-lm-anchor {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--lens-coral);
    box-shadow: 0 0 0 2px rgba(10, 10, 10, .55), 0 0 8px rgba(232, 125, 108, .5);
    transform: translate(-50%, -50%);
}

/* the label body — a glass chip: icon + text + meta (+ cluster badge) */
.v3-lm-body {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    padding: 4px 9px 4px 7px;
    border-radius: 8px;
    background: var(--lens-ink);
    -webkit-backdrop-filter: blur(var(--lens-ink-blur));
    backdrop-filter: blur(var(--lens-ink-blur));
    border: 1px solid rgba(255, 255, 255, .13);
    box-shadow: var(--lens-shadow);
    font: 500 12px/1.15 var(--v3-mono);
    letter-spacing: .1px;
    /* Smooth the (rare, hysteresis-gated) cards↔dots restyle. Only appearance
       transitions here — the per-frame POSITION is on .v3-lm's transform, which
       is deliberately left untransitioned so labels track a pan with no lag. */
    transition: opacity .18s ease, background .18s ease, border-color .18s ease;
}
.v3-lm-ico {
    width: 13px;
    height: 13px;
    flex: none;
    color: var(--lens-coral);
    opacity: .95;
}
.v3-lm-ico svg { width: 100%; height: 100%; display: block; }
.v3-lm-text {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--v3-text);
}
.v3-lm-meta {
    flex: none;
    color: var(--v3-text-dim);
    font-size: 10px;
    letter-spacing: .3px;
}
.v3-lm-meta:empty { display: none; }
.v3-lm-badge {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--lens-coral);
    color: #1a0f0d;
    font: 700 10px/1 var(--v3-mono);
}
.v3-lm-badge:empty { display: none; }

/* ---- kind semantics (shared across directions) ----------------------- */
/* Verified sign text — the money shot: verbatim, coral-accented, a check. */
.v3-lm.is-verified .v3-lm-body {
    border-color: rgba(232, 125, 108, .55);
    box-shadow: var(--lens-shadow), 0 0 0 1px rgba(232, 125, 108, .25), 0 0 14px -2px rgba(232, 125, 108, .4);
    padding-left: 9px;
}
.v3-lm.is-verified .v3-lm-text {
    color: #fff;
    font-weight: 600;
    letter-spacing: .4px;
    text-transform: uppercase;
    font-size: 11.5px;
}
.v3-lm.is-verified .v3-lm-ico { color: var(--lens-verify); }
.v3-lm.is-verified .v3-lm-body::before {
    content: "✓";
    order: 3;
    color: var(--lens-coral);
    font-size: 11px;
    font-weight: 700;
}
/* Partial / unverified sign text — dashed, muted, explicitly "unverified". */
.v3-lm.is-partial .v3-lm-body {
    border-style: dashed;
    border-color: rgba(255, 255, 255, .28);
}
.v3-lm.is-partial .v3-lm-text { color: var(--v3-text-dim); font-style: italic; }
.v3-lm.is-partial .v3-lm-body::after {
    content: "unverified";
    order: 4;
    color: var(--v3-text-dim);
    font-size: 8.5px;
    text-transform: uppercase;
    letter-spacing: .6px;
    opacity: .8;
}

/* Hotspot — the HUMAN-CURATED, interactive point. P4-16: it now sits in the SAME
   dark-glass family as the AI census chips (cohesive with the marker family), but
   wears an unmistakable coral identity so a viewer still instantly reads it as "a
   place someone marked" — distinct from a machine-noticed entity (plain glass) and
   a GNIS landmark (ghost outline + star). The signature, three ways: a dropped
   coral PIN on the exact point (a calm locator ping), a coral SPINE down the chip's
   leading edge + a warm coral border-glow, and the media-affordance pill. No heavy
   coral fill — the "two voices" survive without shouting. */
.v3-lm-hotspot .v3-lm-anchor {
    width: 10px;
    height: 10px;
    background: var(--lens-coral);
    box-shadow: 0 0 0 2.5px rgba(10, 10, 10, .5), 0 0 0 4px rgba(232, 125, 108, .3), 0 0 10px rgba(232, 125, 108, .55);
}
/* a calm coral locator ping — one slow, soft ring (not arcade-y) */
.v3-lm-hotspot .v3-lm-anchor::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 1.5px solid var(--lens-coral);
    animation: v3-lens-pulse 3s ease-out infinite;
}
/* dark glass (like the AI chips) + a coral leading SPINE + a warm coral border and
   soft glow = the human voice, without the heavy fill */
.v3-lm-hotspot .v3-lm-body {
    background: var(--lens-ink);
    border-color: rgba(232, 125, 108, .5);
    box-shadow: var(--lens-shadow), inset 2.5px 0 0 var(--lens-coral), 0 0 12px -2px rgba(232, 125, 108, .4);
    padding-left: 10px;
    color: #fff;
    font-weight: 600;
}
.v3-lm-hotspot .v3-lm-ico { color: var(--lens-coral); opacity: 1; }
.v3-lm-hotspot .v3-lm-text { color: #fff; font-weight: 600; }
.v3-lm-hotspot .v3-lm-meta { color: var(--v3-text-dim); }
/* Media affordance — a coral-tint inset pill signalling image / audio / video
   behind the click. Only hotspots get populated media (paintMedia), so :empty keeps
   every other marker clean. */
.v3-lm-media {
    display: none;
    align-items: center;
    gap: 2px;
    flex: none;
    margin-left: 1px;
    padding: 1px 5px 1px 4px;
    border-radius: 6px;
    background: rgba(232, 125, 108, .16);
    color: var(--lens-coral);
}
.v3-lm-media:not(:empty) { display: inline-flex; }
.v3-lm-media-ico { width: 12px; height: 12px; display: inline-flex; }
.v3-lm-media-ico svg { width: 100%; height: 100%; display: block; }
.v3-lm-media-n { font: 700 10px/1 var(--v3-mono); }
@keyframes v3-lens-pulse { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(1.7); opacity: 0; } }

/* Landmark (GNIS) — a ghost/outline chip; a filled coral tick + "confirmed"
   micro-badge only where vision_seen. Named geography, quieter than entities. */
.v3-lm-landmark .v3-lm-anchor {
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, .7);
    box-shadow: none;
    width: 8px;
    height: 8px;
}
.v3-lm-landmark .v3-lm-body {
    background: rgba(12, 12, 12, .6);
    border-style: solid;
    border-color: rgba(255, 255, 255, .22);
}
.v3-lm-landmark .v3-lm-text {
    color: #d8d8d8;
    text-transform: uppercase;
    font-size: 10.5px;
    letter-spacing: .5px;
    font-weight: 500;
}
.v3-lm-landmark .v3-lm-ico { color: #cfcfcf; }
.v3-lm-landmark.is-confirmed .v3-lm-anchor { background: var(--lens-coral); border-color: var(--lens-coral); }
.v3-lm-landmark.is-confirmed .v3-lm-body::after {
    content: "✦ confirmed";
    order: 4;
    color: var(--lens-coral);
    font-size: 8.5px;
    letter-spacing: .4px;
}

/* =======================================================================
   MODE: CARDS (base) — glass chips float ABOVE the point with a leader stem.
   ======================================================================= */
[data-mode="cards"] .v3-lm-body {
    left: 50%;
    bottom: calc(100% + var(--lm-lift, 18px));
    transform: translateX(-50%);
}

/* =======================================================================
   MODE: DOTS (auto-declutter) — minimal coral marks; text only for the money
   items (verified signs, hotspots) or on hover/focus. Lets the photo breathe.
   ======================================================================= */
[data-mode="dots"] .v3-lm-body {
    left: calc(50% + 11px);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    padding: 2px 4px;
    opacity: 0;
    transition: opacity .16s ease;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .9), 0 0 2px rgba(0, 0, 0, .9);
}
[data-mode="dots"] .v3-lm-ico { display: none; }
[data-mode="dots"] .v3-lm-meta { display: none; }
[data-mode="dots"] .v3-lm-media { display: none; }
/* reveal text for verified signs, hotspots, and on hover/focus */
[data-mode="dots"] .v3-lm.is-verified .v3-lm-body,
[data-mode="dots"] .v3-lm-hotspot .v3-lm-body,
[data-mode="dots"] .v3-lm:hover .v3-lm-body,
[data-mode="dots"] .v3-lm:focus-visible .v3-lm-body { opacity: 1; }
[data-mode="dots"] .v3-lm.is-verified .v3-lm-body,
[data-mode="dots"] .v3-lm-hotspot .v3-lm-body {
    background: var(--lens-ink);
    -webkit-backdrop-filter: blur(var(--lens-ink-blur));
    backdrop-filter: blur(var(--lens-ink-blur));
    border: 1px solid rgba(232, 125, 108, .4);
    border-radius: 7px;
    padding: 3px 8px;
    text-shadow: none;
}
[data-mode="dots"] .v3-lm-hotspot .v3-lm-body {
    border-color: rgba(232, 125, 108, .5);
    box-shadow: inset 2.5px 0 0 var(--lens-coral);
    padding-left: 9px;
}
[data-mode="dots"] .v3-lm.is-verified .v3-lm-body::before { content: "✓"; order: 3; color: var(--lens-coral); }
/* entity dots read as hollow rings; verified/hotspot keep their fills */
[data-mode="dots"] .v3-lm-entity .v3-lm-anchor {
    width: 8px;
    height: 8px;
    background: rgba(232, 125, 108, .2);
    border: 1.5px solid var(--lens-coral);
    box-shadow: 0 0 6px rgba(0, 0, 0, .6);
}
[data-mode="dots"] .v3-lm.is-verified .v3-lm-anchor {
    width: 9px; height: 9px;
    background: var(--lens-coral);
    border-radius: 2px;
    transform: translate(-50%, -50%) rotate(45deg);
}
[data-mode="dots"] .v3-lm-badge {
    position: absolute;
    left: calc(50% + 5px);
    top: calc(50% - 12px);
}

/* =======================================================================
   THE LENS CONTROL — hero placement (top-center): one on/off toggle.
   ======================================================================= */
.v3-lens-ctl {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 24;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}
.v3-lens-ctl > * { pointer-events: auto; }
.v3-lens-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px 0 13px;
    border: 1px solid rgba(232, 125, 108, .5);
    border-radius: 20px;
    background: var(--v3-glass-bg);
    color: var(--v3-text);
    font: 600 13px/1 var(--v3-sans);
    letter-spacing: .2px;
    cursor: pointer;
}
.v3-lens-toggle-ico { width: 18px; height: 18px; color: var(--lens-coral); }
.v3-lens-toggle-ico svg { width: 100%; height: 100%; display: block; }
.v3-lens-toggle.is-on {
    background: linear-gradient(180deg, #f08b78, var(--lens-coral));
    border-color: transparent;
    color: #1a0f0d;
    box-shadow: 0 4px 18px -6px rgba(232, 125, 108, .8);
}
.v3-lens-toggle.is-on .v3-lens-toggle-ico { color: #2a1510; }
.v3-lens-toggle:focus-visible { outline: 2px solid var(--v3-coral); outline-offset: 2px; }

/* =======================================================================
   THE SCENE PANEL — persistent intelligence surface (left column desktop).
   ======================================================================= */
.v3-lens-panel {
    position: fixed;
    top: 62px;
    left: 16px;
    z-index: 22;
    width: 300px;
    max-height: calc(100vh - 62px - 70px);
    overflow-y: auto;
    padding: 16px;
    color: var(--v3-text);
    pointer-events: auto;
    scrollbar-width: thin;
}
/* Bottom-sheet grab handle — desktop keeps the left rail, so it's hidden here and
   only revealed at the mobile breakpoint below (Phase 3 Task 9, Half B). */
.v3-lp-grab { display: none; }
.v3-lp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.v3-lp-eyebrow {
    color: var(--lens-coral);
    font: 600 11px/1 var(--v3-mono);
    letter-spacing: 2px;
    text-transform: uppercase;
}
.v3-lp-tier {
    color: var(--v3-text-dim);
    font: 500 9.5px/1 var(--v3-mono);
    letter-spacing: .6px;
    text-transform: uppercase;
    padding: 3px 7px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 20px;
    white-space: nowrap;
}
.v3-lp-tier:empty { display: none; }
.v3-lp-caption {
    margin: 0 0 14px;
    color: #e8e8e8;
    font: 400 13.5px/1.5 var(--v3-sans);
}
.v3-lp-scalars { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.v3-lp-scalar {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 8px;
}
.v3-lp-scalar-k { color: var(--v3-text-dim); font: 500 8.5px/1 var(--v3-mono); letter-spacing: .8px; text-transform: uppercase; }
.v3-lp-scalar-v { color: var(--v3-text); font: 500 12px/1.1 var(--v3-mono); }
.v3-lp-block { margin-bottom: 16px; }
.v3-lp-label {
    display: block;
    margin-bottom: 8px;
    color: var(--v3-text-dim);
    font: 600 10px/1 var(--v3-mono);
    letter-spacing: 1.2px;
    text-transform: uppercase;
}
.v3-lp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.v3-lp-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 20px;
    background: transparent;
    color: var(--v3-text-dim);
    font: 500 11px/1 var(--v3-mono);
    cursor: pointer;
    transition: background .12s, color .12s, border-color .12s;
}
.v3-lp-chip:hover { border-color: rgba(255, 255, 255, .3); color: var(--v3-text); }
.v3-lp-chip.is-on {
    background: var(--lens-coral);
    border-color: transparent;
    color: #1a0f0d;
}
.v3-lp-chip.is-on .v3-lp-chip-n { color: rgba(26, 15, 13, .65); }
.v3-lp-chip-n { color: var(--v3-text-dim); font-size: 10px; }
.v3-lp-chip:focus-visible { outline: 2px solid var(--v3-coral); outline-offset: 2px; }

.v3-lp-search { display: flex; gap: 6px; }
.v3-lp-search input {
    flex: 1;
    min-width: 0;
    height: 34px;
    padding: 0 11px;
    background: rgba(0, 0, 0, .35);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 8px;
    color: var(--v3-text);
    font: 400 12px/1 var(--v3-mono);
}
.v3-lp-search input:focus { outline: none; border-color: var(--lens-coral); }
.v3-lp-search input::placeholder { color: #6a6a6a; }
.v3-lp-search button {
    flex: none;
    height: 34px;
    padding: 0 13px;
    border: 0;
    border-radius: 8px;
    background: rgba(232, 125, 108, .18);
    color: var(--lens-coral);
    font: 600 11px/1 var(--v3-mono);
    letter-spacing: .5px;
    cursor: pointer;
}
.v3-lp-search button:hover { background: rgba(232, 125, 108, .3); }
.v3-lp-results { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.v3-lp-results:empty { display: none; }
.v3-lp-results-head { color: var(--v3-text-dim); font: 500 10.5px/1.3 var(--v3-mono); margin-bottom: 2px; }
.v3-lp-hit {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    text-align: left;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 7px;
    color: var(--v3-text);
    cursor: pointer;
}
.v3-lp-hit:hover { background: rgba(232, 125, 108, .12); border-color: rgba(232, 125, 108, .35); }
.v3-lp-hit-thumb {
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 5px;
    object-fit: cover;
    background: rgba(255, 255, 255, .06);
}
.v3-lp-hit-n { flex: none; color: var(--lens-coral); font: 600 11px/1.2 var(--v3-mono); }
.v3-lp-hit-c { color: var(--v3-text-dim); font: 400 11px/1.3 var(--v3-sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v3-lp-hit:focus-visible { outline: 2px solid var(--v3-coral); outline-offset: 1px; }
.v3-lp-seeall {
    margin-top: 4px;
    padding: 7px 10px;
    text-align: center;
    background: rgba(232, 125, 108, .12);
    border: 1px dashed rgba(232, 125, 108, .4);
    border-radius: 7px;
    color: var(--lens-coral);
    font: 600 10.5px/1.2 var(--v3-mono);
    letter-spacing: .4px;
    cursor: pointer;
    transition: background .12s, border-color .12s;
}
.v3-lp-seeall:hover { background: rgba(232, 125, 108, .2); border-color: rgba(232, 125, 108, .6); }
.v3-lp-seeall:focus-visible { outline: 2px solid var(--v3-coral); outline-offset: 2px; }

.v3-lp-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.v3-lp-tag {
    padding: 3px 8px;
    background: rgba(255, 255, 255, .05);
    border-radius: 5px;
    color: #c4c4c4;
    font: 400 10.5px/1.2 var(--v3-mono);
}
.v3-lp-tag.is-more { color: var(--lens-coral); background: rgba(232, 125, 108, .12); }
.v3-lens-panel.is-litetier .v3-lp-caption::after {
    content: " · in-scene labels need full-tier extraction";
    color: var(--v3-text-dim);
    font-style: italic;
}

/* ---- detail card (label → detail) ------------------------------------ */
.v3-lens-card {
    position: fixed;
    left: 50%;
    bottom: 76px;
    transform: translateX(-50%);
    z-index: 30;
    width: min(90vw, 360px);
    max-height: min(76vh, 660px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px 18px 15px;
    color: var(--v3-text);
    pointer-events: auto;
}
.v3-lens-card[hidden] { display: none; }
/* Hotspot detail card wears the same coral identity as its pin (P4-16) — a warm
   coral edge + soft glow ties the card to the human-voice marker that opened it. */
.v3-lens-card.is-hotspot {
    border-color: rgba(232, 125, 108, .34);
    box-shadow: 0 12px 40px -12px rgba(0, 0, 0, .82), 0 0 0 1px rgba(232, 125, 108, .16), 0 0 44px -14px rgba(232, 125, 108, .42);
}
.v3-lens-card-x {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 26px;
    height: 26px;
    border: 0;
    background: transparent;
    color: var(--v3-text-dim);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.v3-lens-card-x:hover { color: var(--v3-text); }
.v3-lens-card-kind {
    display: block;
    color: var(--lens-coral);
    font: 600 10px/1 var(--v3-mono);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-bottom: 6px;
    padding-right: 26px;
}
.v3-lens-card-title { margin: 0; font: 600 16px/1.25 var(--v3-sans); color: #fff; }
.v3-lens-card-title:empty { display: none; }
.v3-lens-card-verbatim {
    margin: 8px 0 4px;
    padding: 8px 12px;
    border-left: 3px solid var(--lens-coral);
    background: rgba(232, 125, 108, .08);
    border-radius: 0 8px 8px 0;
    font: 600 17px/1.3 var(--v3-mono);
    letter-spacing: .6px;
    color: #fff;
    text-transform: uppercase;
}
.v3-lens-card-verbatim.is-partial {
    border-left-style: dashed;
    color: var(--v3-text-dim);
    text-transform: none;
    font-style: italic;
    font-weight: 400;
}
.v3-lens-card-note { margin: 8px 0 4px; color: #d8d8d8; font: 400 13px/1.5 var(--v3-sans); white-space: pre-line; }
.v3-lens-card-note[hidden], .v3-lens-card-verbatim[hidden] { display: none; }
.v3-lens-card-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 10px 0 0; }
.v3-lens-card-meta dt { color: var(--v3-text-dim); font: 500 10px/1.5 var(--v3-mono); letter-spacing: .6px; text-transform: uppercase; }
.v3-lens-card-meta dd { margin: 0; color: var(--v3-text); font: 400 12px/1.5 var(--v3-sans); }

/* Primary CTA — re-center the camera on this feature's bearing. Coral fill,
   the same action-button idiom as .v3-obs-card-link / .v3-admin-btn. */
.v3-lens-card-actions { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.v3-lens-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    background: var(--lens-coral);
    color: #1a0f0d;
    border: 0;
    border-radius: 8px;
    font: 600 12px/1 var(--v3-sans);
    letter-spacing: .2px;
    cursor: pointer;
}
.v3-lens-card-cta:hover { background: var(--v3-coral-hover); }
.v3-lens-card-cta:focus-visible { outline: 2px solid var(--v3-coral); outline-offset: 2px; }
.v3-lens-card-cta-ico { width: 14px; height: 14px; flex: none; display: inline-flex; }
.v3-lens-card-cta-ico svg { width: 100%; height: 100%; display: block; }

/* Secondary "Listen" action (Task 9 Half A) — speaks THIS feature via the AD/Polly
   path (audio.js's single stream). A ghost/outline button beside the coral CTA;
   fills coral while its clip is the active stream (label flips to "Stop"). §5 tokens. */
.v3-lens-card-listen {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    background: rgba(232, 125, 108, .12);
    color: var(--v3-text);
    border: 1px solid rgba(232, 125, 108, .5);
    border-radius: 8px;
    font: 600 12px/1 var(--v3-sans);
    letter-spacing: .2px;
    cursor: pointer;
}
.v3-lens-card-listen[hidden] { display: none; }
.v3-lens-card-listen:hover { background: rgba(232, 125, 108, .22); }
.v3-lens-card-listen:focus-visible { outline: 2px solid var(--v3-coral); outline-offset: 2px; }
.v3-lens-card-listen-ico { width: 15px; height: 15px; flex: none; color: var(--lens-coral); display: inline-flex; }
.v3-lens-card-listen-ico svg { width: 100%; height: 100%; display: block; }
.v3-lens-card-listen.is-on {
    background: var(--lens-coral);
    border-color: transparent;
    color: #1a0f0d;
}
.v3-lens-card-listen.is-on .v3-lens-card-listen-ico { color: #2a1510; }

/* ---- hotspot media (Task 8): image gallery / audio / video ------------- */
/* The richer-than-entity payoff — a curated point's photos, audio and video.
   Built from structured fields in panel.js (never the authored HTML). */
.v3-lens-card-media { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.v3-lens-card-media[hidden] { display: none; }

.v3-lc-gallery { display: flex; flex-direction: column; gap: 6px; }
.v3-lc-gallery-main {
    display: block;
    line-height: 0;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
}
.v3-lc-gallery-main img { width: 100%; max-height: 210px; object-fit: cover; display: block; }
.v3-lc-gallery-main:focus-visible { outline: 2px solid var(--v3-coral); outline-offset: 2px; }
.v3-lc-gallery-cap { color: var(--v3-text-dim); font: 400 11px/1.4 var(--v3-sans); }
.v3-lc-gallery-cap[hidden] { display: none; }
.v3-lc-thumbs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.v3-lc-thumb {
    flex: none;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1.5px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    background: none;
    cursor: pointer;
    opacity: .65;
    transition: opacity .15s ease, border-color .15s ease;
}
.v3-lc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.v3-lc-thumb:hover { opacity: 1; }
.v3-lc-thumb[aria-current="true"] { opacity: 1; border-color: var(--v3-coral); }
.v3-lc-thumb:focus-visible { outline: 2px solid var(--v3-coral); outline-offset: 1px; }

.v3-lc-audio-el { width: 100%; height: 38px; display: block; }

.v3-lc-video { border-radius: 8px; }
.v3-lc-video-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(232, 125, 108, .5);
    border-radius: 8px;
    background: rgba(232, 125, 108, .12);
    color: var(--v3-text);
    font: 600 12px/1 var(--v3-sans);
    letter-spacing: .2px;
    cursor: pointer;
}
.v3-lc-video-btn:hover { background: rgba(232, 125, 108, .2); }
.v3-lc-video-btn:focus-visible { outline: 2px solid var(--v3-coral); outline-offset: 2px; }
.v3-lc-video-ico { width: 16px; height: 16px; flex: none; color: var(--lens-coral); display: inline-flex; }
.v3-lc-video-ico svg { width: 100%; height: 100%; display: block; }
.v3-lc-video-frame { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 8px; display: block; }

/* ---- quiet "not yet analyzed" state ---------------------------------- */
.v3-lens-panel.is-quiet .v3-lp-caption,
.v3-lens-panel.is-quiet .v3-lp-scalars,
.v3-lens-panel.is-quiet .v3-lp-block { display: none; }
.v3-lens-panel.is-quiet::after {
    content: "This scene hasn't been analyzed yet.";
    display: block;
    color: var(--v3-text-dim);
    font: 400 13px/1.5 var(--v3-sans);
    font-style: italic;
}
.v3-lens-toggle.is-quiet, .v3-lens-ctl.is-quiet .v3-lens-toggle { opacity: .55; }

/* ---- mobile: bottom sheet + thumb-zone controls (Phase 3 Task 9, Half B) --- */
@media (max-width: 720px) {
    /* The Lens toggle leaves the desktop top-center for the THUMB ZONE at the
       bottom — ONE control, repositioned via CSS (no duplicate, one source of
       truth). Lens OFF: sits low. Lens ON (peek): rides just above the collapsed
       sheet. Sheet EXPANDED: slides away — the sheet's own grab handle is the
       reachable control then. Positions key off body classes lens.js/panel.js set. */
    .v3-lens-ctl {
        top: auto;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        gap: 6px;
        transition: bottom .2s ease, opacity .2s ease, transform .2s ease;
    }
    body.v3-lens-active .v3-lens-ctl { bottom: 120px; }        /* clear the ~108px peek sheet */
    body.v3-lens-sheet-expanded .v3-lens-ctl {
        opacity: 0;
        visibility: hidden;
        transform: translateX(-50%) translateY(24px);
        pointer-events: none;
    }
    .v3-lens-toggle-t { display: none; }
    .v3-lens-toggle { padding: 0 12px; }

    /* Grab handle — tap or drag (panel.js) to expand/collapse; touch-sized. */
    .v3-lp-grab {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 24px;
        margin: -4px 0 6px;
        padding: 0;
        background: none;
        border: 0;
        cursor: grab;
        touch-action: none;      /* panel.js owns the vertical drag */
    }
    .v3-lp-grab-bar { width: 40px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .38); }
    .v3-lp-grab:focus-visible { outline: 2px solid var(--v3-coral); outline-offset: 2px; border-radius: 4px; }

    /* The panel becomes a bottom SHEET: a thumb-reachable peek by default, drag/
       tap up to the full surface. */
    .v3-lens-panel {
        top: auto;
        bottom: 0;
        left: 0;
        width: 100vw;
        max-height: 108px;             /* PEEK: grab + eyebrow + caption teaser only */
        overflow: hidden;
        border-radius: 16px 16px 0 0;
        padding-top: 10px;
        transition: max-height .24s ease;
    }
    /* Peek hides the interactive blocks (scalars/chips/search/tags) for a clean
       teaser; expanding reveals them. */
    .v3-lens-panel:not(.is-expanded) .v3-lp-scalars,
    .v3-lens-panel:not(.is-expanded) .v3-lp-block { display: none; }
    .v3-lens-panel:not(.is-expanded) .v3-lp-caption {
        margin-bottom: 0;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .v3-lens-panel.is-expanded {
        max-height: 72vh;
        overflow-y: auto;
    }

    /* Detail card is bottom-center and wide enough to overlap the bottom-right
       control rail — an 8-button column on small screens (8×36 + 7×8 gaps + 16px
       margin = 360px tall; see .v3-map-dock). Peek: clear that column with the
       same +12px buffer the dock uses. Expanded: ride above the 72vh sheet.
       (Was calc(46vh + 12px) — the 46vh is a dead carryover from the old panel
       max-height and only cleared the rail on tall viewports.) */
    .v3-lens-card { bottom: 372px; }
    body.v3-lens-sheet-expanded .v3-lens-card { bottom: calc(72vh + 12px); }

    .v3-lm-text { max-width: 130px; }
}

@media (prefers-reduced-motion: reduce) {
    .v3-lm-hotspot .v3-lm-anchor::after { animation: none; }
    .v3-lp-chip { transition: none; }
}
