  :root {
    --gold: #C9A84C;
    --gold-bright: #F0C040;
    --gold-dim: #8A6A20;
    --ore: #2A2318;
    --rock: #1A1810;
    --stone: #2E2B22;
    --dust: #6B6248;
    --cream: #E8D9B0;
    --panel-bg: rgba(20, 18, 12, 0.92);
    --panel-border: rgba(201, 168, 76, 0.25);
  }

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

  html, body {
    font-family: 'DM Sans', sans-serif;
    background: var(--rock);
    color: var(--cream);
    height: 100%;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    position: fixed;
  }

  #map {
    position: absolute;
    top: 56px;          /* leave room for #topbar (Step 2) */
    right: 0;
    bottom: 0;
    left: 56px;         /* leave room for #left-rail (Step 3) */
    overflow: hidden;
    transition: left 200ms ease-out;
  }
  body.flyout-open #map {
    left: 416px;        /* 56 (rail) + 360 (flyout) — map narrows when flyout opens */
  }

  /* ── TOP BAR (Step 2 of Session 37 desktop UI rebuild) ──
     Spec section 2.1. 56px tall, fixed top, full viewport width.
     Hosts wordmark | search | coords | Au | account dropdown.
     Visual baseline locked per spec section 4. */
  #topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    z-index: 200;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 16px;
    background: #161410;
    border-bottom: 1px solid rgba(201, 168, 76, 0.30);
    box-sizing: border-box;
  }
  .topbar-wordmark {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    flex-shrink: 0;
    user-select: none;
  }
  .topbar-wordmark-name   { color: #F5E6C8; }
  .topbar-wordmark-accent { color: #C9A84C; }

  /* Right cluster: coords, Au, account button (left-to-right visually,
     reading order matches spec "right cluster, right-to-left" by virtue
     of being at flex end). */
  .topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
  }
  #topbar-coords {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: #9A8A6A;
    white-space: nowrap;
    letter-spacing: 0.02em;
  }
  #topbar-au {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    font-weight: 500;
    color: #C9A84C;
    white-space: nowrap;
    letter-spacing: 0.02em;
  }
  #topbar-au.empty { color: #5A5448; }     /* greyed when fetchGoldPrice fails (P1.14) */
  #topbar-au .topbar-au-tick {
    margin-left: 4px;
    font-size: 10px;
    font-weight: 700;
  }
  #topbar-au .topbar-au-tick.up   { color: #7BB661; }   /* sage green */
  #topbar-au .topbar-au-tick.down { color: #C04B3D; }   /* rust red */

  #topbar-account-btn {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    background: transparent;
    border: 1px solid rgba(201, 168, 76, 0.30);
    color: #C9A84C;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: border-color 100ms ease-out, color 100ms ease-out;
  }
  #topbar-account-btn:hover {
    border-color: #C9A84C;
    color: #F5E6C8;
  }
  #topbar-account-btn.signed-out {
    width: auto;
    padding: 0 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.04em;
  }

  /* Account dropdown — anchored to top-right of the account button */
  #topbar-account-menu {
    position: fixed;
    top: 60px;       /* 56 (topbar) + 4 gap */
    right: 16px;
    min-width: 180px;
    background: #161410;
    border: 1px solid rgba(201, 168, 76, 0.30);
    border-radius: 8px;
    padding: 6px 0;
    z-index: 250;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 100ms ease-out, transform 100ms ease-out;
  }
  #topbar-account-menu.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  #topbar-account-email {
    display: none;     /* shown by JS when signed in and we have an email */
    padding: 6px 14px 8px;
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: #9A8A6A;
    border-bottom: 1px solid rgba(201, 168, 76, 0.18);
    margin-bottom: 4px;
    word-break: break-all;
  }
  .topbar-account-item {
    display: block;
    padding: 8px 14px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: #F5E6C8;
    cursor: pointer;
    transition: background 100ms ease-out, color 100ms ease-out;
  }
  .topbar-account-item:hover {
    background: rgba(201, 168, 76, 0.08);
    color: #C9A84C;
  }
  .topbar-account-divider {
    height: 1px;
    background: rgba(201, 168, 76, 0.18);
    margin: 4px 0;
  }
  .topbar-account-signout {
    color: #9A8A6A;          /* secondary tone — Sign Out is destructive-adjacent */
  }

  /* Searchbar restyled to live inside #topbar (Step 2). Override the
     standalone absolute positioning from the original #searchbar rule
     further down in this file. */
  #topbar #searchbar {
    position: static;
    flex: 1;
    max-width: 480px;
    margin-left: 16px;
  }
  #topbar #searchbar:focus-within {
    width: auto;     /* override the 480px focus-expansion from the legacy rule */
  }

  /* ── LEFT ICON RAIL (Step 3 of Session 37 desktop UI rebuild) ──
     Spec section 2.2. 56px wide, fixed left, full height between top
     bar and bottom edge. Six rail buttons stack vertically; each one
     toggles a flyout. Active state: 1px gold border + faint gold tint.
     Visual baseline locked per spec section 4. */
  #left-rail {
    position: fixed;
    top: 56px;          /* below #topbar */
    left: 0;
    bottom: 0;
    width: 56px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    gap: 4px;
    background: #161410;
    border-right: 1px solid rgba(201, 168, 76, 0.30);
    box-sizing: border-box;
  }
  .rail-btn {
    width: 48px;
    height: 56px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #C9A84C;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px 0 6px;
    font-family: 'DM Sans', sans-serif;
    box-sizing: border-box;
    transition: color 100ms ease-out, border-color 100ms ease-out, background 100ms ease-out;
  }
  .rail-btn:hover {
    background: rgba(201, 168, 76, 0.08);
  }
  .rail-btn.active {
    color: #C9A84C;     /* "full gold" per spec 2.2 — same hex, but border + tint distinguish active */
    border-color: #C9A84C;
    background: rgba(201, 168, 76, 0.10);
  }
  .rail-btn svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
  }
  .rail-label {
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1;
  }

  /* ── FLYOUTS (Step 3 shells; bodies populated in Steps 4-11) ──
     Spec section 2.3. 360px wide, fixed; slide in from left at 200ms.
     Default state translateX(-100%) hides the flyout off-screen left.
     The body.flyout-open class also narrows #map by the flyout width
     (see #map rule above) so flyouts push the map rather than overlay
     it ("Map narrows to accommodate" per spec 2.3). */
  .flyout {
    position: fixed;
    top: 56px;          /* below #topbar */
    left: 56px;         /* right of #left-rail */
    bottom: 0;
    width: 360px;
    z-index: 180;       /* below topbar (200) so account dropdown can overlay; above map */
    background: #0D0C09;
    border-right: 1px solid rgba(201, 168, 76, 0.30);
    transform: translateX(-100%);
    transition: transform 200ms ease-out;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
  }
  .flyout.open {
    transform: translateX(0);
  }
  .flyout-header {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid rgba(201, 168, 76, 0.18);
    flex-shrink: 0;
  }
  .flyout-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #F5E6C8;
    margin: 0;
    letter-spacing: 0.04em;
  }
  .flyout-close {
    background: transparent;
    border: none;
    color: #9A8A6A;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 100ms ease-out;
  }
  .flyout-close:hover {
    color: #F5E6C8;
  }
  .flyout-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
  }

  /* ── LAYERS FLYOUT BODY (Step 4 of Session 37 desktop UI rebuild) ──
     Spec section 3. Search at top, Currently Active section pinned,
     Recipes (collapsed), then 10 collapsible category sections rendered
     from layers.json. Sub-sections nest inside Indicators and LiDAR.
     Layer toggles, opacity sliders, info-panel expansion, Currently
     Active population, and Recipes content land in Steps 5-11. */

  /* Override the default .flyout-body padding for the layers flyout —
     headers run edge-to-edge for a cleaner OnX-style look. Inner
     content keeps comfortable inset. */
  #layers-flyout .flyout-body { padding: 0; }

  .layers-search { padding: 12px 14px; }
  .layers-search input {
    width: 100%;
    background: #0D0C09;
    border: 1px solid rgba(201, 168, 76, 0.30);
    border-radius: 4px;
    padding: 8px 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: #F5E6C8;
    outline: none;
    box-sizing: border-box;
    transition: border-color 100ms ease-out;
  }
  .layers-search input::placeholder { color: #5A5448; }
  .layers-search input:focus { border-color: #C9A84C; }

  /* Currently Active — pinned section. Empty-state line by default in
     Step 4 (no toggles wired yet). Step 5 populates the active list
     and shows the Hide All / Clear All actions. */
  .currently-active-section {
    border-top: 1px solid rgba(201, 168, 76, 0.18);
    border-bottom: 1px solid rgba(201, 168, 76, 0.18);
    padding: 10px 14px;
    background: rgba(201, 168, 76, 0.03);
  }
  .currently-active-header {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.10em;
    color: #9A8A6A;
    text-transform: uppercase;
    margin-bottom: 6px;
  }
  .layers-empty-state {
    font-size: 12px;
    color: #5A5448;
    padding: 6px 0;
    line-height: 1.4;
  }
  .layers-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
  }
  .hide-all-btn, .clear-all-btn {
    flex: 1;
    background: transparent;
    border: 1px solid rgba(201, 168, 76, 0.30);
    border-radius: 4px;
    padding: 6px 0;
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9A8A6A;
    cursor: pointer;
    transition: color 100ms ease-out, border-color 100ms ease-out;
  }
  .hide-all-btn:hover, .clear-all-btn:hover {
    color: #C9A84C;
    border-color: #C9A84C;
  }

  /* Category sections — 10 from layers.json, plus the Recipes section
     which uses the same .category-section class for consistent styling. */
  .category-section {
    border-bottom: 1px solid rgba(201, 168, 76, 0.10);
  }
  .category-header {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    cursor: pointer;
    user-select: none;
    transition: background 100ms ease-out;
  }
  .category-header:hover { background: rgba(201, 168, 76, 0.04); }
  .category-title {
    flex: 1;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #F5E6C8;
    letter-spacing: 0.04em;
  }
  .category-count {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: #9A8A6A;
    margin-left: 6px;
    margin-right: 4px;
  }
  .category-active-count {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: #5A5448;
    margin-right: 8px;
  }
  .category-active-count.has-active { color: #C9A84C; }
  .category-arrow {
    color: #9A8A6A;
    font-size: 9px;
    transition: transform 150ms ease-out;
  }
  .category-section.is-collapsed .category-arrow { transform: rotate(-90deg); }
  .category-section.is-collapsed .category-body { display: none; }
  .category-body { padding: 4px 0 8px; }

  /* Sub-sections (Indicators -> Pathfinder/Geochemistry,
     LiDAR -> Hillshade/Terrain Tools). */
  .subsection {
    margin-left: 4px;
  }
  .subsection-header {
    display: flex;
    align-items: center;
    padding: 6px 14px;
    cursor: pointer;
    user-select: none;
    transition: background 100ms ease-out;
  }
  .subsection-header:hover { background: rgba(201, 168, 76, 0.04); }
  .subsection-title {
    flex: 1;
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9A8A6A;
  }
  .subsection.is-collapsed .category-arrow { transform: rotate(-90deg); }
  .subsection.is-collapsed .subsection-body { display: none; }
  .subsection-body { padding: 2px 0 6px; }

  /* Layer rows — Step 4 renders the row markup; Step 5 wires the
     checkbox toggle. .layer-coming-soon is non-interactive in v1. */
  .layer-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px 7px 18px;
    cursor: pointer;
    transition: background 100ms ease-out;
    border-left: 2px solid transparent;
  }
  .layer-row:hover { background: rgba(201, 168, 76, 0.04); }
  .layer-row.layer-coming-soon {
    cursor: default;
    opacity: 0.55;
  }
  .layer-row.layer-coming-soon:hover { background: transparent; }

  .layer-checkbox {
    width: 14px;
    height: 14px;
    border: 1px solid rgba(201, 168, 76, 0.40);
    border-radius: 2px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    background: transparent;
    transition: border-color 100ms ease-out, background 100ms ease-out, color 100ms ease-out;
  }
  .layer-row.is-on .layer-checkbox {
    background: #C9A84C;
    border-color: #C9A84C;
    color: #0D0C09;
  }
  .layer-checkbox svg {
    width: 10px;
    height: 10px;
    display: block;
  }

  .layer-name {
    flex: 1;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: #F5E6C8;
    line-height: 1.3;
  }
  .layer-row.layer-coming-soon .layer-name { color: #5A5448; }

  .layer-count {
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    color: #5A5448;
    flex-shrink: 0;
  }
  .layer-soon-tag {
    font-family: 'DM Sans', sans-serif;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5A5448;
    border: 1px solid rgba(90, 84, 72, 0.5);
    border-radius: 3px;
    padding: 1px 4px;
    flex-shrink: 0;
  }

  .info-btn {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid rgba(154, 138, 106, 0.5);
    color: #9A8A6A;
    font-family: 'DM Sans', sans-serif;
    font-style: italic;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    transition: color 100ms ease-out, border-color 100ms ease-out;
  }
  .info-btn:hover {
    color: #C9A84C;
    border-color: #C9A84C;
  }

  .mapboxgl-ctrl-top-left {
    top: 130px !important;
    left: 12px !important;
  }

  .mapboxgl-ctrl-zoom-in,
  .mapboxgl-ctrl-zoom-out {
    width: 38px !important;
    height: 38px !important;
    font-size: 20px !important;
  }

  .mapboxgl-ctrl-group {
    border-radius: 10px !important;
  }

  .mapboxgl-ctrl-bottom-left {
    bottom: 80px !important;
    left: 12px !important;
  }

  /* Legacy pre-Step-1 topbar/logo/top-actions/wordmark/tagline/icon-btn
     rules deleted Session 37 Step 2 fix (2026-05-02). The legacy
     floating-button rules (the six bottom-right cluster IDs the spec
     replaces in Step 8) deleted Session 39 (2026-05-05). The remaining
     orphans here are #bottom-nav (not yet reused), #logo .icon,
     .icon-btn:hover/.active, .ui-icon, and two surviving #*-btn:hover
     .top-icon image-swap rules — all inert until their IDs are reused
     by Step 9 / Step 11 or culled in a later cleanup. */

  #logo .icon {
    font-size: 22px;
    line-height: 1;
  }

  .icon-btn:hover, .icon-btn.active {
    border-color: var(--gold);
    color: var(--gold-bright);
    background: rgba(201, 168, 76, 0.12);
  }

  .ui-icon {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
  }

  #layer-btn.active .top-icon, #layer-btn:hover .top-icon { content: url('assets/icons/icon_layers_pressed.png'); }
  #ai-btn.active .top-icon, #ai-btn:hover .top-icon { content: url('assets/icons/icon_ai_pressed.png'); }

  /* ── SEARCH BAR ── */
  /* Compact pill by default (~240px), expands on focus-within to 480px.
     Results dropdown is nested inside #searchbar so it follows the width. */
  #searchbar {
    position: absolute;
    top: 72px;
    left: 16px;
    width: 240px;
    max-width: calc(100vw - 32px);
    z-index: 100;
    box-sizing: border-box;
    transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  #searchbar:focus-within {
    width: 480px;
  }

  #search-input-wrap {
    display: flex;
    align-items: center;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 0 14px;
    gap: 10px;
    backdrop-filter: blur(12px);
    transition: border-color 0.2s;
  }

  #search-input-wrap:focus-within {
    border-color: var(--gold);
  }

  #search-input-wrap .search-icon {
    color: var(--dust);
    font-size: 16px;
    flex-shrink: 0;
  }

  #search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--cream);
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    padding: 12px 0;
  }

  #search-input::placeholder { color: var(--dust); }

  /* ── LAYER PANEL ── */
  /* ── LAYER PANEL (full bottom sheet) ── */
  #layer-panel {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 150;
    background: #0D0C09;
    border-top: 1px solid rgba(255,255,255,0.07);
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 88vh;
    overflow: visible;
    display: flex;
    flex-direction: column;
  }

  #layer-panel.open { transform: translateY(0); }

  #layer-panel-handle {
    width: 40px; height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    margin: 12px auto 0;
  }

  #layer-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    position: sticky;
    top: 0;
    background: #0D0C09;
    z-index: 10;
  }

  #layer-panel-header h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 20px;
    letter-spacing: 0.1em;
    color: var(--cream);
    margin: 0;
  }

  #layer-panel-close {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: none;
    color: var(--cream);
    font-size: 16px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
  }

  #layer-panel-scroll {
    padding: 8px 0 110px;
    overflow-y: auto;
    overflow-x: visible;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-height: 0;
  }

  /* Region banner inside panel */
  #region-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(76,175,80,0.1);
    border: 1px solid rgba(76,175,80,0.25);
    border-radius: 10px;
    padding: 9px 14px;
    margin: 8px 16px 4px;
  }
  #region-banner .region-left {
    display: flex; align-items: center; gap: 7px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px; color: #E8D9B0;
  }
  #region-banner .region-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #4CAF50; flex-shrink: 0;
  }
  #region-banner .region-state { font-weight: 500; color: #4CAF50; }
  #region-banner .switch-region {
    font-family: 'DM Mono', monospace; font-size: 11px;
    color: var(--gold); cursor: pointer;
    background: none; border: none; padding: 0;
    letter-spacing: 0.05em; transition: color 0.15s;
  }
  #region-banner .switch-region:hover { color: var(--gold-bright); }

  /* ── ACCORDION GROUPS ── */
  .layer-group {
    margin: 4px 0;
  }

  .group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 20px 10px;
    cursor: pointer;
    user-select: none;
  }

  .group-header-left { flex: 1; }

  .group-title {
    font-size: 15px;
    font-weight: 600;
    color: #FFFFFF;
    letter-spacing: 0.01em;
  }

  .group-count {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: #555;
    margin-top: 2px;
    letter-spacing: 0.04em;
  }

  .group-arrow {
    font-size: 10px;
    color: #555;
    transition: transform 0.2s;
    flex-shrink: 0;
    padding-left: 8px;
  }

  .group-body {
    overflow: hidden;
    transition: max-height 0.3s ease;
    max-height: 600px;
  }

  .group-body.collapsed {
    max-height: 0;
  }

  /* Collapsed group card */
  .layer-group.is-collapsed .group-header {
    background: rgba(255,255,255,0.04);
    border-radius: 10px;
    margin: 0 12px;
    padding: 12px 16px;
  }
  .layer-group.is-collapsed .group-count { color: #444; }
  .layer-group.is-collapsed .group-arrow { transform: rotate(180deg); }

  /* Divider between groups */
  .group-divider {
    height: 1px;
    background: rgba(255,255,255,0.05);
    margin: 4px 20px;
  }

  /* Legacy .layer-row / .layer-name / .layer-badge / .info-btn rules
     deleted Step 4 of Session 37 (2026-05-03). They were inert after
     Step 1 stripped the accordion #layer-panel, but reusing the names
     in Step 4 would have collided like #topbar did in Step 2. */

  .layer-bullet {
    font-size: 9px;
    flex-shrink: 0;
    color: #3A3A3A;
    transition: color 0.2s, font-size 0.15s;
    line-height: 1;
    margin-top: 1px;
  }

  .layer-bullet.on {
    color: #FFFFFF;
    font-size: 11px;
  }

  .layer-pro-badge {
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    font-weight: 500;
    color: #C9A84C;
    border: 1px solid rgba(201,168,76,0.5);
    border-radius: 3px;
    padding: 1px 4px;
    margin-left: 6px;
    letter-spacing: 0.05em;
    flex-shrink: 0;
  }

  /* ── TOGGLE SWITCH (keep for compatibility) ── */
  .toggle {
    width: 34px; height: 20px;
    background: #1E1E1E;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.06);
    display: none; /* hidden — bullet indicates state */
  }

  .toggle.on { background: var(--gold-dim); border-color: var(--gold); }

  .toggle::after {
    content: '';
    position: absolute;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--dust);
    top: 2px; left: 2px;
    transition: transform 0.2s, background 0.2s;
  }

  .toggle.on::after {
    transform: translateX(14px);
    background: var(--gold-bright);
  }

  /* ── BOTTOM NAV ── */
  #bottom-nav {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 100;
    background: linear-gradient(to top, rgba(16,14,8,0.98) 60%, rgba(16,14,8,0) 100%);
    padding: 12px 8px 28px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-sizing: border-box;
    max-width: 100vw;
    overflow: hidden;
  }

  .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 6px 16px;
    border-radius: 10px;
    transition: all 0.15s;
    border: 1px solid transparent;
  }

  .nav-item.active {
    background: rgba(201, 168, 76, 0.1);
    border-color: var(--panel-border);
  }

  .nav-item .nav-icon {
    font-size: 22px;
    line-height: 1;
    transition: transform 0.15s;
    color: var(--dust);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-item.active .nav-icon {
    transform: scale(1.1);
    color: var(--gold);
    filter: drop-shadow(0 0 5px rgba(240,192,64,0.5));
  }

  .nav-icon-img {
    width: 32px;
    height: 32px;
  }

  .nav-icon-svg {
    width: 24px;
    height: 24px;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .nav-item.active .nav-icon-svg { stroke: var(--gold); }

  .nav-item:nth-child(1).active .nav-icon-img { content: url('assets/icons/icon_nav_map_pressed.png'); }
  .nav-item:nth-child(2).active .nav-icon-img { content: url('assets/icons/icon_nav_claims_pressed.png'); }
  .nav-item:nth-child(3).active .nav-icon-img { content: url('assets/icons/icon_nav_finds_pressed.png'); }
  .nav-item:nth-child(4).active .nav-icon-img { content: url('assets/icons/icon_nav_offline_pressed.png'); }
  .nav-item:nth-child(5).active .nav-icon-img { content: url('assets/icons/icon_nav_signin_pressed.png'); }

  .nav-item:active {
    transform: scale(0.9);
    background: rgba(201,168,76,0.15);
    border-color: var(--gold);
    transition: transform 0.08s;
  }

  .nav-item .nav-label {
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--dust);
    transition: color 0.15s;
  }

  .nav-item.active .nav-label { color: var(--gold); }


  #fab-hint {
    position: absolute;
    bottom: 148px;
    right: 14px;
    z-index: 100;
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.08em;
    color: var(--dust);
    text-align: center;
    width: 64px;
    line-height: 1.4;
    pointer-events: none;
  }

  /* ── FLOATING CLUSTER (Step 8) — bottom-right map controls ──
     Six 40px buttons stacked vertically, 16px from edges, 8px gap.
     Spec section 2.4. New IDs (#fab-zoom-in/out/gps/north/style/3d)
     deliberately avoid reusing the stripped IDs from commit 598825d
     (Option B picked by Demetri to dodge Step 2 cascade collisions). */
  #floating-cluster {
    position: absolute;
    bottom: 16px;
    right: 16px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .fab-btn {
    width: 40px;
    height: 40px;
    background: rgba(13, 12, 9, 0.80);              /* #0D0C09 @ 80% per spec 2.4 */
    border: 1px solid rgba(201, 168, 76, 0.20);     /* gold @ 20% resting (Step 8 polish: was 30%, dropped for hover contrast) */
    border-radius: 8px;
    color: #C9A84C;
    cursor: pointer;
    transition: border-color 100ms ease-out, background 100ms ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'DM Mono', monospace;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    padding: 0;
    backdrop-filter: blur(8px);
    user-select: none;
  }
  .fab-btn:hover {
    border-color: #C9A84C;                          /* gold @ 100% on hover */
    background: rgba(201, 168, 76, 0.08);           /* Step 8 polish: faint gold fill so hover reads at a glance on the dark map */
  }
  .fab-btn.active {
    border-color: #C9A84C;
    background: rgba(201, 168, 76, 0.15);
  }
  /* "3D" needs a smaller font so two characters fit cleanly */
  #fab-3d { font-size: 11px; letter-spacing: 0.04em; }

  /* ── MAP STYLE SWITCHER (Step 8 reposition) ──
     Anchored to the LEFT of #fab-style in the cluster. Container
     #style-switcher and the three .style-btn thumbnails inside it
     survived the Step 1 strip; only the positioning + layout
     changed in Step 8 (column → row, top-right → bottom-right).
     Hidden by default; toggleStyles() flips .open. */
  #style-switcher {
    position: absolute;
    bottom: 64px;       /* aligns with #fab-style's bottom edge: 16 (cluster) + 40 (3D btn) + 8 (gap) */
    right: 64px;        /* 16 (cluster margin) + 40 (cluster width) + 8 (gap) */
    z-index: 10;
    display: flex;
    flex-direction: row;
    gap: 6px;
    padding: 6px;
    background: rgba(13, 12, 9, 0.80);
    border: 1px solid rgba(201, 168, 76, 0.30);
    border-radius: 8px;
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transform: translateX(8px);
    transition: opacity 200ms ease-out, transform 200ms ease-out;
  }
  #style-switcher.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
  }
  .style-btn {
    background: rgba(13, 12, 9, 0.60);
    border: 1px solid rgba(201, 168, 76, 0.30);
    color: #F5E6C8;
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.06em;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 100ms ease-out, color 100ms ease-out, background 100ms ease-out;
    white-space: nowrap;
  }
  .style-btn:hover, .style-btn.active {
    border-color: #C9A84C;
    color: #C9A84C;
    background: rgba(201, 168, 76, 0.10);
  }

  /* Token input hidden */
  #token-input { display: none; }

  /* ── SEARCH RESULTS ── */
  #search-results {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    margin-top: 6px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    overflow: hidden;
    backdrop-filter: blur(16px);
    z-index: 200;
    display: none;
    max-height: 320px;
    overflow-y: auto;
  }

  #search-results.show { display: block; }

  .search-result-item {
    padding: 11px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .search-result-item:last-child { border-bottom: none; }
  .search-result-item:hover { background: rgba(201,168,76,0.08); }

  .result-icon { font-size: 14px; flex-shrink: 0; }

  .result-text { flex: 1; min-width: 0; }

  .result-name {
    font-size: 13px;
    color: var(--cream);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .result-sub {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: var(--dust);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .result-tag {
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
  }

  .result-tag.active {
    background: rgba(76,175,80,0.15);
    border: 1px solid rgba(76,175,80,0.4);
    color: #4CAF50;
  }

  .result-tag.place {
    background: rgba(33,150,243,0.15);
    border: 1px solid rgba(33,150,243,0.4);
    color: #2196F3;
  }

  .search-section-label {
    padding: 8px 16px 4px;
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--dust);
    background: rgba(0,0,0,0.2);
  }

  /* ── SCALE / COMPASS ── */
  .mapboxgl-ctrl-scale {
    background: var(--panel-bg) !important;
    border-color: var(--gold-dim) !important;
    color: var(--cream) !important;
    font-family: 'DM Mono', monospace !important;
    font-size: 10px !important;
  }

  .mapboxgl-ctrl-group {
    background: var(--panel-bg) !important;
    border: 1px solid var(--panel-border) !important;
    border-radius: 8px !important;
  }

  .mapboxgl-ctrl-group button {
    background-color: transparent !important;
  }

  /* ── STATUS PILL ── */
  #status-pill {
    position: absolute;
    top: 130px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 6px 14px;
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--dust);
    backdrop-filter: blur(8px);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
  }

  #status-pill.show { opacity: 1; }

  /* ── FIND LOG PANEL ── */
  #find-panel {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 150;
    background: var(--panel-bg);
    border-top: 1px solid var(--panel-border);
    border-radius: 20px 20px 0 0;
    padding: 20px 20px 100px;
    backdrop-filter: blur(20px);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 70vh;
    overflow-y: auto;
  }

  #find-panel.open { transform: translateY(0); }

  #find-panel .panel-handle {
    width: 40px;
    height: 4px;
    background: var(--stone);
    border-radius: 2px;
    margin: 0 auto 20px;
  }

  #find-panel h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 22px;
    letter-spacing: 0.08em;
    color: var(--gold);
    margin-bottom: 18px;
  }

  .find-form-row {
    margin-bottom: 14px;
  }

  .find-form-row label {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--dust);
    display: block;
    margin-bottom: 6px;
  }

  .find-form-row input,
  .find-form-row select,
  .find-form-row textarea {
    width: 100%;
    background: var(--stone);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 11px 14px;
    color: var(--cream);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
  }

  .find-form-row input:focus,
  .find-form-row select:focus,
  .find-form-row textarea:focus {
    border-color: var(--gold);
  }

  .find-form-row textarea { resize: none; height: 80px; }

  .find-submit {
    width: 100%;
    background: linear-gradient(135deg, var(--gold-bright), var(--gold-dim));
    border: none;
    border-radius: 10px;
    padding: 14px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 19px;
    letter-spacing: 0.1em;
    color: var(--rock);
    cursor: pointer;
    margin-top: 6px;
  }

  /* ── OVERLAY ── */
  #overlay {
    position: absolute;
    inset: 0;
    z-index: 140;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }

  #overlay.show {
    opacity: 1;
    pointer-events: auto;
  }

  /* ── GPS PULSE ── */
  /* ── ACCOUNT PANEL ── */
  #account-panel {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 150;
    background: var(--panel-bg);
    border-top: 1px solid var(--panel-border);
    border-radius: 20px 20px 0 0;
    padding: 20px 0 100px;
    backdrop-filter: blur(20px);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 85vh;
    overflow-y: auto;
  }

  #account-panel.open { transform: translateY(0); }

  #account-panel .panel-handle {
    width: 40px;
    height: 4px;
    background: var(--stone);
    border-radius: 2px;
    margin: 0 auto 16px;
  }

  .account-tabs {
    display: flex;
    border-bottom: 1px solid var(--panel-border);
    margin-bottom: 0;
    padding: 0 20px;
    gap: 4px;
  }

  .account-tab {
    padding: 10px 16px;
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--dust);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    white-space: nowrap;
  }

  .account-tab.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
  }

  .account-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  .account-tab-icon {
    width: 18px;
    height: 18px;
  }

  .account-tab.active .account-tab-icon {
    filter: drop-shadow(0 0 4px rgba(240,192,64,0.45));
  }

  .account-tab-content {
    display: none;
    padding: 16px 20px;
  }

  .account-tab-content.active { display: block; }

  .account-item {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    cursor: pointer;
    transition: background 0.15s;
  }

  .account-item:last-child { border-bottom: none; }
  .account-item:hover .account-item-name { color: var(--gold); }

  .account-item-name {
    font-size: 14px;
    color: var(--cream);
    margin-bottom: 3px;
    transition: color 0.15s;
  }

  .account-item-sub {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: var(--dust);
  }

  .account-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--dust);
    font-size: 13px;
    line-height: 1.6;
  }

  .account-empty .empty-icon { font-size: 36px; margin-bottom: 12px; }

  /* ── SPOT PANEL ── */
  #spot-panel {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 150;
    background: var(--panel-bg);
    border-top: 1px solid var(--panel-border);
    border-radius: 20px 20px 0 0;
    padding: 20px 20px 100px;
    backdrop-filter: blur(20px);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 75vh;
    overflow-y: auto;
  }

  #spot-panel.open { transform: translateY(0); }

  #spot-panel .panel-handle {
    width: 40px;
    height: 4px;
    background: var(--stone);
    border-radius: 2px;
    margin: 0 auto 20px;
  }

  #spot-panel h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 22px;
    letter-spacing: 0.08em;
    color: var(--gold);
    margin-bottom: 16px;
  }

  .spot-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
  }

  .spot-cat-btn {
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--panel-border);
    background: var(--stone);
    color: var(--dust);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
  }

  .spot-cat-btn.selected {
    border-color: var(--gold);
    color: var(--gold-bright);
    background: rgba(201,168,76,0.12);
  }

  /* Spot markers on map */
  .spot-marker {
    width: 28px;
    height: 28px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 2px solid white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  }

  /* ── CLAIM PANEL ── */
  #claim-panel {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 150;
    background: #0D0C09;
    border-top: 1px solid rgba(201,168,76,0.2);
    border-radius: 20px 20px 0 0;
    padding: 0 0 110px;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 82vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #claim-panel.open { transform: translateY(0); }

  #claim-panel .panel-handle {
    width: 40px; height: 4px;
    background: rgba(255,255,255,0.12);
    border-radius: 2px;
    margin: 12px auto 0;
  }

  #claim-panel-header {
    padding: 14px 20px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  #claim-panel-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 24px;
    letter-spacing: 0.06em;
    color: var(--gold-bright);
    line-height: 1;
  }

  #claim-panel-serial {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--dust);
    margin-top: 3px;
  }

  .claim-section {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }

  .claim-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
  }

  .claim-row-label {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--dust);
  }

  .claim-row-value {
    font-size: 13px;
    color: var(--cream);
    font-weight: 500;
    text-align: right;
    max-width: 60%;
  }

  .claim-badge-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    padding: 10px 0 4px;
  }

  .claim-badge {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.05em;
  }

  .claim-badge.active {
    background: rgba(76,175,80,0.15);
    border: 1px solid rgba(76,175,80,0.4);
    color: #4CAF50;
  }

  .claim-badge.type {
    background: rgba(201,168,76,0.1);
    border: 1px solid rgba(201,168,76,0.3);
    color: var(--gold);
  }

  .claim-type-desc {
    font-size: 12px;
    color: var(--dust);
    margin-top: 4px;
    line-height: 1.5;
  }

  .claim-nearby-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .claim-nearby-card {
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s;
  }

  .claim-nearby-card:hover { background: rgba(255,255,255,0.07); }

  .claim-nearby-num {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 22px;
    letter-spacing: 0.04em;
    line-height: 1;
  }

  .claim-nearby-lbl {
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dust);
    margin-top: 3px;
  }

  .claim-links {
    display: flex;
    gap: 8px;
    padding: 14px 20px;
    flex-wrap: wrap;
  }

  .claim-link-btn {
    flex: 1;
    min-width: 80px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 9px 8px;
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.06em;
    color: var(--gold);
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    display: block;
  }

  .claim-link-btn:hover {
    border-color: var(--gold);
    background: rgba(201,168,76,0.08);
  }

  .claim-action-btns {
    display: flex;
    gap: 10px;
    padding: 0 20px 14px;
  }

  .claim-save-btn {
    flex: 1;
    background: rgba(201,168,76,0.12);
    border: 1px solid rgba(201,168,76,0.4);
    border-radius: 10px;
    padding: 13px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--gold-bright);
    cursor: pointer;
    transition: all 0.15s;
  }

  .claim-save-btn:hover { background: rgba(201,168,76,0.2); }

  .claim-watch-btn {
    flex: 1;
    background: rgba(33,150,243,0.1);
    border: 1px solid rgba(33,150,243,0.3);
    border-radius: 10px;
    padding: 13px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #64B5F6;
    cursor: pointer;
    transition: all 0.15s;
  }

  .claim-watch-btn:hover { background: rgba(33,150,243,0.18); }

  /* ── RESTRICTION LEGEND ── */
  #restriction-legend {
    position: absolute;
    bottom: 100px;
    left: 16px;
    z-index: 100;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 10px 14px;
    backdrop-filter: blur(12px);
    display: none;
    min-width: 180px;
  }

  #restriction-legend h4 {
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--dust);
    margin-bottom: 8px;
  }

  .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    font-size: 11px;
    color: var(--cream);
  }

  .legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
  }

  /* ── COMPASS & 3D BUTTON ── */
  #compass-arrow {
    font-size: 18px;
    color: #F44336;
    transition: transform 0.3s;
    line-height: 1;
  }

  /* ── DRAW SEARCH ── */
  #draw-hint {
    position: absolute;
    top: 118px;
    right: 20px;
    z-index: 100;
    background: var(--panel-bg);
    border: 1px solid var(--gold);
    border-radius: 8px;
    padding: 8px 12px;
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.08em;
    color: var(--gold);
    backdrop-filter: blur(8px);
    display: none;
    max-width: 160px;
    line-height: 1.5;
  }

  #draw-results {
    position: absolute;
    bottom: 100px;
    left: 16px;
    right: 16px;
    z-index: 100;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 14px 16px;
    backdrop-filter: blur(16px);
    display: none;
    max-height: 200px;
    overflow-y: auto;
  }

  #draw-results h4 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 16px;
    letter-spacing: 0.08em;
    color: var(--gold);
    margin-bottom: 10px;
  }

  .draw-result-item {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 12px;
    color: var(--cream);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .draw-result-item:hover { color: var(--gold); }
  .draw-result-item:last-child { border-bottom: none; }

  /* ── FEEDBACK ── */
  #feedback-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 151;
    background: var(--panel-bg);
    border-top: 1px solid var(--panel-border);
    border-radius: 20px 20px 0 0;
    padding: 16px 20px 96px;
    backdrop-filter: blur(20px);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 78vh;
    overflow-y: auto;
  }
  #feedback-panel.open { transform: translateY(0); }
  #feedback-panel h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 24px;
    letter-spacing: 0.08em;
    color: var(--gold);
    margin-bottom: 6px;
  }
  #feedback-panel .panel-handle {
    width: 40px;
    height: 4px;
    background: var(--stone);
    border-radius: 2px;
    margin: 0 auto 14px;
  }
  .feedback-sub {
    font-size: 12px;
    color: var(--dust);
    margin-bottom: 10px;
  }
  .feedback-types {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
  }
  .feedback-type-btn {
    border: 1px solid var(--panel-border);
    background: var(--stone);
    color: var(--cream);
    border-radius: 8px;
    padding: 8px 9px;
    font-size: 12px;
    cursor: pointer;
  }
  .feedback-type-btn.active {
    border-color: var(--gold);
    color: var(--gold-bright);
    background: rgba(201, 168, 76, 0.13);
  }
  #feedback-message {
    width: 100%;
    background: var(--stone);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 11px 13px;
    color: var(--cream);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    min-height: 104px;
    resize: vertical;
    outline: none;
    margin-bottom: 10px;
  }
  #feedback-message:focus { border-color: var(--gold); }
  .feedback-error {
    display: none;
    margin-bottom: 10px;
    padding: 8px 10px;
    border: 1px solid rgba(244, 67, 54, 0.4);
    border-radius: 7px;
    background: rgba(244, 67, 54, 0.12);
    color: #FF8A80;
    font-size: 12px;
  }
  .feedback-footnote {
    text-align: center;
    font-size: 10px;
    color: var(--dust);
    margin-top: 8px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  /* ── AUTH PANEL ── */
  #auth-panel {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 150;
    background: var(--panel-bg);
    border-top: 1px solid var(--panel-border);
    border-radius: 20px 20px 0 0;
    padding: 24px 20px 100px;
    backdrop-filter: blur(20px);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 80vh;
    overflow-y: auto;
  }

  #auth-panel.open { transform: translateY(0); }

  #auth-panel .panel-handle {
    width: 40px;
    height: 4px;
    background: var(--stone);
    border-radius: 2px;
    margin: 0 auto 20px;
  }

  #auth-panel h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 26px;
    letter-spacing: 0.08em;
    color: var(--gold);
    margin-bottom: 6px;
  }

  #auth-panel .auth-sub {
    font-size: 13px;
    color: var(--dust);
    margin-bottom: 24px;
  }

  .auth-form-row {
    margin-bottom: 14px;
  }

  .auth-form-row label {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--dust);
    display: block;
    margin-bottom: 6px;
  }

  .auth-form-row input {
    width: 100%;
    background: var(--stone);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--cream);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    box-sizing: border-box;
  }

  .auth-form-row input:focus { border-color: var(--gold); }

  .auth-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--gold-bright), var(--gold-dim));
    border: none;
    border-radius: 10px;
    padding: 14px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 19px;
    letter-spacing: 0.1em;
    color: var(--rock);
    cursor: pointer;
    margin-top: 6px;
    transition: opacity 0.2s;
  }

  .auth-btn:hover { opacity: 0.88; }

  .auth-google-btn {
    width: 100%;
    background: var(--stone);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 13px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--cream);
    cursor: pointer;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: border-color 0.2s;
  }

  .auth-google-btn:hover { border-color: var(--gold); }

  .auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--dust);
    font-size: 12px;
  }

  .auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--panel-border);
  }

  .auth-switch {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--dust);
  }

  .auth-switch a {
    color: var(--gold);
    cursor: pointer;
    text-decoration: none;
  }

  .auth-error {
    background: rgba(244,67,54,0.1);
    border: 1px solid rgba(244,67,54,0.3);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12px;
    color: #F44336;
    margin-bottom: 14px;
    display: none;
  }

  /* User menu */
  #user-menu {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 100;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    padding: 16px;
    width: 220px;
    backdrop-filter: blur(16px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s;
  }

  #user-menu.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
  }

  #user-email {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--dust);
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--panel-border);
    word-break: break-all;
  }

  .user-menu-item {
    padding: 8px 0;
    font-size: 13px;
    color: var(--cream);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .user-menu-item:hover { color: var(--gold); }

  /* Override Mapbox default popup styles */
  .mapboxgl-popup-content {
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  .mapboxgl-popup-tip {
    display: none !important;
  }

  .gps-pulse {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--gold-bright);
    border: 2px solid white;
    box-shadow: 0 0 0 0 rgba(240,192,64,0.5);
    animation: pulse 2s infinite;
  }

  @keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(240,192,64,0.5); }
    70% { box-shadow: 0 0 0 12px rgba(240,192,64,0); }
    100% { box-shadow: 0 0 0 0 rgba(240,192,64,0); }
  }

  /* .info-btn / .info-btn:hover deleted Step 4 of Session 37 — collision
     with Step 4 layer-flyout info icon. The element is rebuilt with
     the same class name plus new styles below. */
  #layer-tooltip {
    position: fixed;
    z-index: 300;
    background: var(--ore);
    border: 1px solid var(--gold);
    border-radius: 8px;
    padding: 9px 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    color: var(--cream);
    line-height: 1.5;
    max-width: 210px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s, transform 0.15s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  }
  #layer-tooltip.show {
    opacity: 1;
    transform: translateY(0);
  }

  /* ── AI TOOLS MENU ── */
  #ai-tools-menu {
    position: absolute;
    top: 70px;
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  #ai-tools-menu.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .ai-menu-btn {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    color: var(--cream);
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.08em;
    padding: 9px 14px;
    border-radius: 8px;
    cursor: pointer;
    text-align: right;
    backdrop-filter: blur(8px);
    transition: all 0.15s;
    white-space: nowrap;
    align-self: flex-end;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .ai-menu-btn:hover {
    border-color: var(--gold);
    color: var(--gold-bright);
  }

  .ai-pro-pill {
    font-size: 8px;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(240,192,64,0.15);
    border: 1px solid rgba(240,192,64,0.4);
    color: var(--gold-dim);
    letter-spacing: 0.08em;
  }

  /* ── AI PANELS ── */
  #rock-id-panel,
  #outcrop-panel {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 150;
    background: #0D0C09;
    border-top: 1px solid rgba(201,168,76,0.2);
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #rock-id-panel.open,
  #outcrop-panel.open { transform: translateY(0); }

  .ai-panel-handle {
    width: 40px; height: 4px;
    background: rgba(255,255,255,0.12);
    border-radius: 2px;
    margin: 12px auto 0;
  }

  .ai-panel-header {
    padding: 14px 20px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: #0D0C09;
    z-index: 10;
  }

  .ai-panel-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 22px;
    letter-spacing: 0.08em;
    color: var(--gold);
    line-height: 1;
  }

  .ai-panel-subtitle {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: var(--dust);
    letter-spacing: 0.06em;
    margin-top: 3px;
  }

  .ai-panel-close {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: none;
    color: var(--cream);
    font-size: 16px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    line-height: 1;
  }

  .ai-panel-body {
    padding: 16px 20px 110px;
  }

  .ai-usage-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 16px;
  }

  .ai-usage-label {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.06em;
    color: var(--dust);
  }

  .ai-usage-count {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    color: var(--gold);
  }

  .ai-desc {
    font-size: 13px;
    color: var(--dust);
    line-height: 1.65;
    margin-bottom: 16px;
  }

  .ai-upload-zone {
    border: 2px dashed rgba(201,168,76,0.3);
    border-radius: 14px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
  }

  .ai-upload-zone:hover,
  .ai-upload-zone:active {
    border-color: var(--gold);
    background: rgba(201,168,76,0.05);
  }

  .ai-upload-zone input[type=file] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    font-size: 100px;
  }

  .ai-upload-icon { font-size: 38px; margin-bottom: 10px; }

  .ai-upload-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    color: var(--cream);
    font-weight: 500;
  }

  .ai-upload-sub {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: var(--dust);
    margin-top: 5px;
    letter-spacing: 0.05em;
  }

  .ai-image-preview {
    display: none;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    position: relative;
  }

  .ai-image-preview img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    display: block;
  }

  .ai-preview-change {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.72);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 6px;
    padding: 5px 11px;
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.06em;
    color: var(--cream);
    cursor: pointer;
  }

  .ai-loading {
    display: none;
    text-align: center;
    padding: 32px 20px;
  }

  .ai-loading-ring {
    width: 38px;
    height: 38px;
    border: 3px solid rgba(201,168,76,0.2);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: ai-spin 0.75s linear infinite;
    margin: 0 auto 14px;
  }

  @keyframes ai-spin { to { transform: rotate(360deg); } }

  .ai-loading-text {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--dust);
    letter-spacing: 0.1em;
  }

  .ai-result { display: none; }

  .ai-result-section { margin-bottom: 18px; }

  .ai-result-label {
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold-dim);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(201,168,76,0.15);
  }

  .ai-result-text {
    font-size: 14px;
    color: var(--cream);
    line-height: 1.7;
  }

  .ai-location-note {
    margin-top: 14px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: var(--dust);
    letter-spacing: 0.05em;
    display: none;
  }

  .ai-new-btn {
    width: 100%;
    background: rgba(201,168,76,0.1);
    border: 1px solid rgba(201,168,76,0.35);
    border-radius: 10px;
    padding: 14px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 18px;
    letter-spacing: 0.1em;
    color: var(--gold-bright);
    cursor: pointer;
    margin-top: 18px;
    transition: all 0.15s;
  }

  .ai-new-btn:hover { background: rgba(201,168,76,0.18); }

  .ai-error {
    display: none;
    background: rgba(244,67,54,0.1);
    border: 1px solid rgba(244,67,54,0.3);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
    color: #F44336;
    margin-top: 12px;
    line-height: 1.5;
  }

  .ai-pro-gate {
    background: rgba(201,168,76,0.06);
    border: 1px solid rgba(201,168,76,0.2);
    border-radius: 14px;
    padding: 28px 20px;
    text-align: center;
    margin: 4px 0 16px;
  }

  .ai-pro-gate-icon { font-size: 34px; margin-bottom: 10px; }

  .ai-pro-gate-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 22px;
    letter-spacing: 0.08em;
    color: var(--gold);
    margin-bottom: 8px;
  }

  .ai-pro-gate-text {
    font-size: 13px;
    color: var(--dust);
    line-height: 1.65;
    margin-bottom: 18px;
  }

  .ai-upgrade-btn {
    background: linear-gradient(135deg, var(--gold-bright), var(--gold-dim));
    border: none;
    border-radius: 10px;
    padding: 12px 28px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 18px;
    letter-spacing: 0.1em;
    color: var(--rock);
    cursor: pointer;
    transition: opacity 0.15s;
  }

  .ai-upgrade-btn:hover { opacity: 0.88; }

  /* ── DESKTOP: layer panel as left sidebar ── */
  @media (min-width: 768px) {
    #layer-panel {
      top: 0;
      bottom: 0;
      left: 0;
      right: auto;
      width: 340px;
      border-radius: 0;
      border-top: none;
      border-right: 1px solid rgba(255,255,255,0.07);
      transform: translateX(-100%);
      transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
      max-height: 100vh;
      overflow: visible;
      display: flex;
      flex-direction: column;
    }
    #layer-panel.open { transform: translateX(0); }
    #layer-panel-handle { display: none; }
    #layer-panel-scroll {
      max-height: calc(100vh - 62px);
    }
  }
/* ========================================================== */
/* CSS extracted from index.html inline <style> block         */
/* Extracted: April 19, 2026 (Session 7)                      */
/* Original location: index.html lines 55-373                 */
/*                                                            */
/* TO MERGE: append this file's contents to your existing     */
/*   style.css, OR paste these rules at the top of style.css. */
/* The existing <link rel="stylesheet" href="style.css">      */
/*   tag at index.html line 53 will pick it up automatically. */
/* Bump the cache-bust version: style.css?v=20260404 -> v=... */
/* ========================================================== */

  /* ── GOLD SPOT PRICE BAR ── */
  #gold-price-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px 12px;
    border-bottom: 1px solid rgba(201,168,76,0.15);
    background: rgba(201,168,76,0.04);
  }
  #gold-price-label {
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--dust);
  }
  #gold-price-value {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 22px;
    color: #F0C040;
    letter-spacing: 0.04em;
    line-height: 1;
  }
  #gold-price-change {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 4px;
  }
  #gold-price-change.up   { color: #4CAF50; background: rgba(76,175,80,0.13); }
  #gold-price-change.down { color: #F44336; background: rgba(244,67,54,0.13); }
  #gold-price-ts {
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    color: var(--stone);
    margin-left: auto;
  }


  /* ── COORDINATE DISPLAY ── */
  #coord-display {
    position: fixed;
    bottom: 28px;
    left: 10px;
    z-index: 10;
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.05em;
    color: rgba(196,168,130,0.75);
    background: rgba(13,12,9,0.52);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 3px 9px;
    border-radius: 4px;
    pointer-events: none;
    user-select: none;
  }
  /* ── LIDAR HILLSHADE PICKER ── */
  .lidar-style-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px 9px 22px;
    cursor: pointer;
    transition: background 0.1s;
    border-left: 2px solid transparent;
  }
  .lidar-style-row:hover {
    background: rgba(201,168,76,0.04);
  }
  .lidar-style-row.focused {
    background: rgba(201,168,76,0.08);
    border-left-color: #C9A84C;
  }
  .lidar-badge {
    font-family: 'DM Mono', monospace;
    font-size: 8.5px;
    letter-spacing: 0.08em;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 500;
    margin-right: 4px;
  }
  .lidar-badge.overlay {
    color: #E8A95C;
    background: rgba(232,169,92,0.12);
    border: 1px solid rgba(232,169,92,0.25);
  }
  .lidar-badge.special {
    color: #9FE1CB;
    background: rgba(159,225,203,0.10);
    border: 1px solid rgba(159,225,203,0.22);
  }

  /* ── CUSTOM HILLSHADE STANDALONE PANEL (always visible, top-right of map) ── */
  .custom-hs-panel {
    position: fixed;
    top: 80px;
    right: 24px;
    width: 300px;
    background: rgba(20,18,14,0.96);
    border: 1px solid rgba(201,168,76,0.35);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.55);
    z-index: 500;
    font-family: 'DM Sans', sans-serif;
    color: var(--bone, #F5E6C8);
  }
  .custom-hs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(201,168,76,0.18);
    background: rgba(13,12,9,0.6);
    border-radius: 8px 8px 0 0;
    user-select: none;
  }
  .custom-hs-title {
    font-weight: 500;
    color: #C9A84C;
    font-size: 13px;
    letter-spacing: 0.02em;
  }
  .custom-hs-toggle {
    cursor: pointer;
    width: 38px;
    height: 20px;
    background: rgba(201,168,76,0.18);
    border-radius: 10px;
    position: relative;
    transition: background 0.15s;
  }
  .custom-hs-toggle.on {
    background: #C9A84C;
  }
  .custom-hs-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #F5E6C8;
    border-radius: 50%;
    transition: left 0.15s;
  }
  .custom-hs-toggle.on::after {
    left: 20px;
  }
  .custom-hs-body {
    padding: 12px 16px 16px;
  }
  .custom-hs-reset-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 4px;
  }


/* ── Privacy Modal ───────────────────────────────────────────── */
#privacy-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 9, 6, 0.82);
  backdrop-filter: blur(4px);
  z-index: 9000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

@media (min-width: 600px) {
  #privacy-modal {
    align-items: center;
    padding: 24px;
  }
}

#privacy-modal-inner {
  background: #1E1C13;
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: 12px 12px 0 0;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (min-width: 600px) {
  #privacy-modal-inner {
    border-radius: 12px;
    max-height: 80vh;
  }
}

.privacy-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(201, 168, 76, 0.15);
  flex-shrink: 0;
}

.privacy-modal-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  letter-spacing: 0.05em;
  color: var(--gold-bright);
}

.privacy-modal-close {
  background: none;
  border: none;
  color: var(--dust);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.privacy-modal-close:hover {
  color: var(--cream);
  background: rgba(255,255,255,0.06);
}

.privacy-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  font-size: 13px;
  line-height: 1.65;
  color: #BDB09A;
}

.privacy-updated {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--dust);
  margin-bottom: 20px;
}

.privacy-modal-body h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px;
  letter-spacing: 0.06em;
  color: var(--cream);
  margin: 20px 0 8px;
}

.privacy-modal-body h3:first-of-type { margin-top: 0; }

.privacy-modal-body p { margin-bottom: 8px; }

.privacy-modal-body ul {
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.privacy-modal-body ul li {
  padding-left: 16px;
  position: relative;
}

.privacy-modal-body ul li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-family: 'DM Mono', monospace;
}

.privacy-modal-body strong { color: var(--cream); font-weight: 500; }

.privacy-contact {
  margin-top: 20px;
  padding: 14px 16px;
  background: rgba(201, 168, 76, 0.06);
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.8;
}

.privacy-contact a {
  color: var(--gold-bright);
  text-decoration: none;
  border-bottom: 1px solid rgba(240, 192, 64, 0.3);
}

.privacy-contact a:hover { border-color: var(--gold-bright); }

/* Auth panel privacy note */
.auth-privacy-note {
  text-align: center;
  font-size: 11px;
  color: var(--dust);
  margin-top: 12px;
}

.auth-privacy-note a {
  color: var(--gold);
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px solid rgba(201, 168, 76, 0.3);
}

.auth-privacy-note a:hover { color: var(--gold-bright); border-color: var(--gold-bright); }

/* ========================================================== */
/* LAYER UPGRADE GATE — P0.3-B                                */
/* Position: absolute overlay over #layer-panel               */
/* Shown when subscription is expired or not started          */
/* ========================================================== */

#layer-upgrade-gate {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 8;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  background: rgba(13, 12, 9, 0.78);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  /* display controlled by JS — default: none */
}

.lug-card {
  background: rgba(28, 24, 17, 0.97);
  border: 1px solid rgba(240, 192, 64, 0.30);
  border-radius: 14px;
  padding: 30px 24px 24px;
  text-align: center;
  max-width: 268px;
  width: calc(100% - 48px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.65), 0 0 0 1px rgba(240,192,64,0.08);
}

.lug-icon {
  font-size: 34px;
  margin-bottom: 14px;
  display: block;
}

.lug-title {
  color: #F0C040;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.lug-sub {
  color: rgba(255, 255, 255, 0.58);
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 22px;
}

.lug-btn {
  display: block;
  width: 100%;
  background: #F0C040;
  color: #1A1612;
  border: none;
  border-radius: 9px;
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: opacity 0.15s, transform 0.15s;
}

.lug-btn:hover  { opacity: 0.88; transform: translateY(-1px); }
.lug-btn:active { opacity: 1;    transform: translateY(0); }

.lug-footer {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.28);
  font-size: 11px;
  letter-spacing: 0.01em;
}

/* ── TRANSITIONAL: hide kept-dormant chrome until Steps 3-11 wire it ──
   Per Session 37 desktop UI rebuild. Each rule below is removed (or
   replaced by the proper styling) when its element is restyled in its
   step:
     #status-pill       — Step 2 covered loading-pill copy; status pill
                          re-enable deferred to a later step
     #coord-display     — superseded by #topbar-coords (Step 2 wired
                          coords in the top bar). The element stays in
                          the DOM hidden; updateCoords() still writes to
                          it for back-compat but no one sees it.
     #ai-tools-menu     — Step 11 (AI rail flyout)
   Removed from this list in earlier steps:
     #searchbar (Step 2 — now lives in #topbar)
     #style-switcher (Step 8 — now opens left of #fab-style)
     #active-layer-bar (Step 9 — replaced by new #chip-bar; the
                         legacy element + chips div were deleted from
                         index.html in the same commit)
   #layer-tooltip is omitted: it's hover-triggered by showLayerInfo() and
   already starts hidden via its own CSS, so no transitional rule needed.
   ──────────────────────────────────────────────────────────────────── */
#status-pill,
#coord-display,
#ai-tools-menu {
  display: none;
}

/* ── STEP 6: PER-LAYER OPACITY SLIDER (Currently Active mirror rows) ──
   Spec section 3.7. Schema-driven via layers.json defaultOpacityPct
   (Option A). Slider lives inline on the layer-row by leveraging
   flex-wrap so it drops to a new row beneath checkbox + name.
   Class names are new — no overlap with the deleted .lidar-slider*
   family from b4082ad. */

#layers-flyout .layer-row { flex-wrap: wrap; }       /* allow opacity row to drop below name */

.layer-opacity-row {
  flex-basis: 100%;            /* force its own row inside the flex layer-row */
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 24px;          /* indent past the checkbox column for visual hierarchy */
  padding-top: 6px;
  padding-bottom: 4px;
}

.layer-opacity-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;                                       /* 3px track per spec */
  background: rgba(201, 168, 76, 0.18);              /* gold #C9A84C @ 18% */
  border-radius: 2px;
  outline: none;
  margin: 0;
  padding: 0;
  cursor: pointer;
}
.layer-opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: #C9A84C;                               /* solid gold thumb, no border */
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: width 100ms ease-out, height 100ms ease-out;
}
.layer-opacity-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #C9A84C;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: width 100ms ease-out, height 100ms ease-out;
}
.layer-opacity-slider:hover::-webkit-slider-thumb { width: 16px; height: 16px; }
.layer-opacity-slider:hover::-moz-range-thumb     { width: 16px; height: 16px; }

.layer-opacity-value {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: #C9A84C;
  text-align: right;
  min-width: 36px;
  flex-shrink: 0;
}

/* ── STEP 9: ACTIVE LAYER CHIP BAR ──
   Spec section 2.5. 32px tall, fixed position below the top bar
   (top:56px), starts at the rail's right edge (left:56px), spans
   to the viewport right. One chip per active layer; LiDAR styles
   each get their own chip (Fork 1 — no aggregation). New IDs
   (#chip-bar / .chip / .chip-label / .chip-remove) deliberately
   avoid reusing the stripped #active-layer-chips / .layer-chip /
   .chip-x family per Option B. Auto-hides when empty via
   #chip-bar:empty. The map's top inset is bumped from 56px to 88px
   when body.has-chips is set (toggled by _renderChipBar). */
#chip-bar {
  position: fixed;
  top: 56px;
  left: 56px;
  right: 0;
  height: 32px;
  z-index: 150;        /* above map (10) and #floating-cluster (10), below #topbar (200) */
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  background: #161410;
  border-bottom: 1px solid rgba(201, 168, 76, 0.18);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* legacy Edge */
  box-sizing: border-box;
  transition: left 200ms ease-out;        /* mirror #map shift timing */
}
#chip-bar::-webkit-scrollbar { display: none; }
#chip-bar:empty { display: none; }      /* auto-hide when no chips render */

/* When a flyout is open, shift the chip bar right to align with the
   already-shifted #map (same body.flyout-open class, same 416px offset
   = 56 rail + 360 flyout). Mirrors the #map rule at line ~36 so the
   bar tracks the map and stays clear of the flyout panel. */
body.flyout-open #chip-bar { left: 416px; }

/* When chip bar is populated, push the map's top edge down by 32px
   so the bar doesn't overlap basemap content. _renderChipBar toggles
   the body.has-chips class. */
body.has-chips #map { top: 88px; }      /* 56 (top bar) + 32 (chip bar) */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 4px 3px 10px;
  background: rgba(13, 12, 9, 0.80);
  border: 1px solid rgba(201, 168, 76, 0.30);
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: #C9A84C;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 100ms ease-out, background 100ms ease-out;
}
.chip:hover {
  border-color: #C9A84C;
  background: rgba(201, 168, 76, 0.06);    /* slightly lighter than .fab-btn 8% so chips don't compete with map */
}

.chip-label {
  letter-spacing: 0.02em;
}

.chip-remove {
  background: transparent;
  border: none;
  color: rgba(201, 168, 76, 0.55);
  font-size: 11px;
  line-height: 1;
  padding: 2px 4px;
  cursor: pointer;
  border-radius: 3px;
  transition: color 100ms ease-out;
}
.chip-remove:hover {
  color: #C9A84C;
}

/* ── STEP 11 PARTIAL: HIDE LEFT-RAIL PIN + DRAW ──
   Pin moved to the floating cluster as a click-to-arm tool; Draw is
   placeholder-only and lives in the cluster too. The original rail
   buttons in index.html are kept (not deleted) so we retain the
   wiring/markup for the still-pending left-rail rescope decision —
   they may come back in some other form, or get fully removed. Hide
   them via display:none in the meantime so users don't see two Pin
   entry points (rail one would open an empty broken flyout). */
#left-rail .rail-btn[data-flyout="pin"],
#left-rail .rail-btn[data-flyout="draw"] {
  display: none;
}

/* ── STEP 11 PARTIAL: COMING-SOON TOAST ──
   Lightweight ephemeral notice triggered by showComingSoonToast() in
   app.js for placeholder fab buttons (Draw for now). Centered above
   the floating cluster. Fades in/out via .toast-show class toggle. */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  z-index: 250;                                    /* above #topbar (200) so it isn't clipped */
  background: rgba(13, 12, 9, 0.92);
  border: 1px solid rgba(201, 168, 76, 0.45);
  color: #C9A84C;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.02em;
  padding: 8px 14px;
  border-radius: 4px;
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease-out, transform 200ms ease-out;
}
.toast.toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
