  /* ── LIGHT MODE (default) ── */
  :root {
    --honey:       #c8821a;
    --honey-dark:  #a06010;
    --honey-light: #f5a623;
    --comb:        #fff8ee;
    --bg:          #f5f2ea;
    --surface:     rgba(255, 252, 244, 0.97);
    --surface2:    #eeeade;
    --surface3:    #e8e3d4;
    --border:      rgba(140, 110, 50, 0.2);
    --text:        #1c1508;
    --text-muted:  #7a6535;
    --green:       #2e7d32;
    --blue:        #1565c0;
    --orange:      #e65100;
    --red:         #c62828;

    --pin-live:    #2e7d32;
    --pin-dead:    #5d4037;
    --pin-building:#1565c0;
    --pin-ground:  #e65100;

    --shadow-sm:   0 1px 4px rgba(0,0,0,0.12), 0 0 0 1px rgba(140,110,50,0.12);
    --shadow-md:   0 4px 16px rgba(0,0,0,0.14), 0 0 0 1px rgba(140,110,50,0.10);
    --shadow-lg:   0 8px 32px rgba(0,0,0,0.18), 0 0 0 1px rgba(140,110,50,0.08);

    --radius-sm:   10px;
    --radius-md:   14px;
    --radius-lg:   20px;
    --radius-pill: 999px;
  }

  /* ── DARK MODE ── */
  body.dark-mode {
    --honey:       #f5a623;
    --honey-dark:  #c8821a;
    --honey-light: #ffd166;
    --comb:        #2a1f00;
    --bg:          #0f0d07;
    --surface:     rgba(28, 26, 16, 0.92);
    --surface2:    #1e1c12;
    --surface3:    #252316;
    --border:      rgba(90, 80, 45, 0.35);
    --text:        #f0e8d0;
    --text-muted:  #9a8d6a;
    --green:       #4caf50;
    --blue:        #2196f3;
    --orange:      #ff9800;
    --red:         #f44336;
    --pin-live:    #4caf50;
    --pin-dead:    #795548;
    --pin-building:#2196f3;
    --pin-ground:  #ff9800;
    --shadow-sm:   0 1px 4px rgba(0,0,0,0.35), 0 0 0 1px rgba(90,80,45,0.18);
    --shadow-md:   0 4px 16px rgba(0,0,0,0.45), 0 0 0 1px rgba(90,80,45,0.15);
    --shadow-lg:   0 8px 32px rgba(0,0,0,0.55), 0 0 0 1px rgba(90,80,45,0.12);
  }

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

  body {
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: clamp(0.875rem, 1.5vw + 0.5rem, 1rem);
    line-height: 1.6;
    background: var(--bg);
    color: var(--text);
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* ── HEADER — glassmorphism ── */
  #app-header {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: env(safe-area-inset-top, 0) 16px 0;
    padding-top: max(env(safe-area-inset-top, 0px), 0px);
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    flex-shrink: 0;
    z-index: 1000;
    position: relative;
  }
  #app-header img.logo {
    height: 40px;
    width: 40px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
  }
  #app-header .title {
    font-size: clamp(1rem, 2vw + 0.5rem, 1.2rem);
    font-weight: 700;
    color: var(--honey);
    letter-spacing: 0.3px;
    flex: 1;
    line-height: 1.2;
  }
  #app-header .title span {
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 400;
    display: block;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: 1px;
  }
  .version-badge {
    display: inline-block !important;
    background: rgba(245,166,35,0.15);
    color: var(--honey) !important;
    font-size: 0.62rem !important;
    font-weight: 700 !important;
    padding: 2px 7px;
    border-radius: var(--radius-pill);
    letter-spacing: 0.3px !important;
    text-transform: none !important;
    vertical-align: middle;
    margin-left: 2px;
  }

  /* ── DEBUG PANEL ── */
  #debug-panel {
    position: fixed;
    top: calc(56px + env(safe-area-inset-top, 0px) + 10px);
    right: 8px;
    left: 8px;
    z-index: 5000;
    background: rgba(0,0,0,0.92);
    border: 1px solid rgba(76,175,80,0.4);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    font-family: 'SF Mono', 'Menlo', monospace;
    font-size: 0.68rem;
    color: #4caf50;
    max-height: 40dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: var(--shadow-lg);
  }
  #debug-panel.pf-hidden { display: none; }
  .debug-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 6px;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(76,175,80,0.25);
    font-weight: 700;
    color: #8aff8a;
  }
  .debug-close-btn {
    background: rgba(76,175,80,0.2);
    border: 1px solid rgba(76,175,80,0.4);
    color: #8aff8a;
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    font-size: 0.68rem;
    font-family: inherit;
    cursor: pointer;
    min-height: 28px;
  }
  .debug-close-btn:active { transform: scale(0.94); }
  .debug-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 3px 0;
    border-bottom: 1px solid rgba(76,175,80,0.12);
  }
  .debug-row:last-child { border-bottom: none; }
  .debug-row span:first-child {
    color: rgba(76,175,80,0.6);
    flex-shrink: 0;
  }
  .debug-row span:last-child {
    text-align: right;
    word-break: break-all;
    color: #8aff8a;
  }

  /* ── SEARCH BARS ── */
  #zip-input {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: 1.5px solid rgba(245,166,35,0.25);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 10px 12px;
    font-size: 0.88rem;
    outline: none;
    font-family: inherit;
    min-height: 44px;
    min-width: 0;
    width: 0;
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  #zip-input:focus {
    border-color: var(--honey);
    box-shadow: 0 0 0 3px rgba(245,166,35,0.15);
  }
  #radius-select {
    background: rgba(255,255,255,0.06);
    border: 1.5px solid rgba(245,166,35,0.25);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 10px 10px;
    font-size: 0.88rem;
    outline: none;
    cursor: pointer;
    min-height: 44px;
    font-family: inherit;
    transition: border-color 0.2s;
  }
  #radius-select:focus { border-color: var(--honey); }


  #keyword-input {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border: 1.5px solid rgba(100,180,100,0.25);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 10px 12px;
    font-size: 0.88rem;
    outline: none;
    font-family: inherit;
    min-height: 44px;
    min-width: 0;
    width: 0;
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  #keyword-input:focus {
    border-color: var(--pin-live);
    box-shadow: 0 0 0 3px rgba(76,175,80,0.15);
  }

  .btn {
    background: var(--honey);
    color: var(--comb);
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    min-height: 44px;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
  }
  .btn:hover { background: var(--honey-light); box-shadow: var(--shadow-md); }
  .btn:active { transform: scale(0.97); box-shadow: none; }
  .btn-outline {
    background: transparent;
    border: 1.5px solid var(--honey);
    color: var(--honey);
    box-shadow: none;
  }
  .btn-outline:hover { background: rgba(245,166,35,0.1); }
  .btn-outline:active { transform: scale(0.97); }

  /* ── Sign-in modal ── */
  #signin-modal {
    position: fixed; inset: 0; z-index: 9100;
    background: rgba(0,0,0,0.65); backdrop-filter: blur(4px);
    display: flex; align-items: flex-end; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
  }
  #signin-modal.open { opacity: 1; pointer-events: all; }
  .signin-sheet {
    background: var(--surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 28px 20px 44px;
    width: 100%; max-width: 480px;
    box-shadow: var(--shadow-lg);
  }
  .signin-title {
    font-size: 1.1rem; font-weight: 700;
    color: var(--honey); margin-bottom: 4px; text-align: center;
  }
  .signin-sub {
    font-size: 0.78rem; color: var(--text-muted);
    text-align: center; margin-bottom: 20px; line-height: 1.5;
  }
  #signin-email {
    width: 100%; padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.06);
    border: 1.5px solid var(--border);
    color: var(--text); font-size: 0.95rem;
    font-family: inherit; margin-bottom: 12px;
    box-sizing: border-box; outline: none;
    transition: border-color 0.2s;
  }
  #signin-email:focus { border-color: var(--honey); }
  .signin-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

  /* ── Check-in modal ── */
  #checkin-modal {
    position: fixed; inset: 0; z-index: 9000;
    background: rgba(0,0,0,0.65); backdrop-filter: blur(4px);
    display: flex; align-items: flex-end; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
  }
  #checkin-modal.open { opacity: 1; pointer-events: all; }
  .checkin-sheet {
    background: var(--surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 24px 20px 40px;
    width: 100%; max-width: 480px;
    box-shadow: var(--shadow-lg);
  }
  .checkin-title {
    font-size: 1.05rem; font-weight: 700;
    color: var(--honey); margin-bottom: 6px; text-align: center;
  }
  .checkin-sub {
    font-size: 0.78rem; color: var(--text-muted);
    text-align: center; margin-bottom: 20px;
  }
  .checkin-options {
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px;
    margin-bottom: 18px;
  }
  .checkin-opt {
    display: flex; flex-direction: column; align-items: center;
    gap: 6px; padding: 14px 8px; border-radius: var(--radius-md);
    border: 2px solid var(--border); background: rgba(255,255,255,0.04);
    cursor: pointer; transition: all 0.15s; font-size: 0.8rem;
    color: var(--text-muted); font-weight: 600;
  }
  .checkin-opt .ci-icon { font-size: 1.6rem; }
  .checkin-opt:hover { border-color: var(--honey); color: var(--honey); }
  .checkin-opt.selected-active   { border-color: #4caf50; background: rgba(76,175,80,0.15); color: #4caf50; }
  .checkin-opt.selected-gone     { border-color: #e57373; background: rgba(229,115,115,0.15); color: #e57373; }
  .checkin-opt.selected-uncertain{ border-color: #f5a623; background: rgba(245,166,35,0.15); color: #f5a623; }
  .checkin-notes {
    width: 100%; padding: 10px 12px; border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.06); border: 1px solid var(--border);
    color: var(--text); font-size: 0.85rem; resize: none;
    font-family: inherit; margin-bottom: 14px; box-sizing: border-box;
  }
  .checkin-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

  /* ── STATS BAR ── */
  #stats-bar {
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
    padding: 8px 14px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  #stats-bar::-webkit-scrollbar { display: none; }
  .stat-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    border: 1.5px solid transparent;
    background: rgba(255,255,255,0.04);
    min-height: 34px;
    transition: all 0.18s;
    box-shadow: var(--shadow-sm);
  }
  .stat-pill:hover {
    border-color: rgba(245,166,35,0.3);
    background: rgba(245,166,35,0.06);
    color: var(--text);
  }
  .stat-pill:active { transform: scale(0.96); }
  .stat-pill.active {
    border-color: var(--honey);
    background: rgba(245,166,35,0.12);
    color: var(--honey);
    box-shadow: 0 0 0 3px rgba(245,166,35,0.1), var(--shadow-sm);
  }
  .stat-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
  }
  .stat-pill .count {
    font-weight: 700;
    color: var(--text);
    font-size: 0.78rem;
  }

  /* ── MAP ── */
  #map {
    flex: 1;
    z-index: 1;
  }

  /* ── BOTTOM TABS — glassmorphism + safe area ── */
  #bottom-tabs {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
    display: flex;
    flex-shrink: 0;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 10px 4px 8px;
    cursor: pointer;
    font-size: 0.6rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-height: 56px;
    transition: color 0.18s, transform 0.1s;
    font-family: inherit;
    position: relative;
    -webkit-tap-highlight-color: transparent;
  }
  .tab-btn svg { width: 22px; height: 22px; transition: transform 0.15s; }
  .tab-btn.active { color: var(--honey); }
  .tab-btn.active svg { transform: translateY(-1px); }
  .tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: calc(4px + env(safe-area-inset-bottom, 0px) / 2);
    width: 20px; height: 2px;
    background: var(--honey);
    border-radius: 2px;
  }
  .tab-btn:hover { color: var(--honey); background: none; }
  .tab-btn:active { transform: scale(0.93); }

  /* ── MODAL / PANEL — glassmorphism sheet ── */
  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s;
  }
  .modal-overlay.open {
    opacity: 1;
    pointer-events: all;
  }
  .modal-sheet {
    background: var(--surface);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    width: 100%;
    max-height: 92dvh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(.32,1.25,.6,1);
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 40px rgba(0,0,0,0.25), 0 -1px 0 var(--border);
  }
  .modal-overlay.open .modal-sheet {
    transform: translateY(0);
  }
  .modal-handle {
    width: 36px; height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 18px;
  }
  .modal-title {
    font-size: clamp(1.1rem, 2vw + 0.5rem, 1.3rem);
    color: var(--honey);
    margin-bottom: 18px;
    font-weight: 700;
    letter-spacing: -0.2px;
  }

  /* ── FORM ── */
  .form-group {
    margin-bottom: 16px;
  }
  .form-group label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
  }
  .form-group input,
  .form-group select,
  .form-group textarea {
    width: 100%;
    background: var(--surface2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 11px 14px;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    min-height: 44px;
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  .form-group input:focus,
  .form-group select:focus,
  .form-group textarea:focus {
    border-color: var(--honey);
    box-shadow: 0 0 0 3px rgba(245,166,35,0.15);
  }
  .form-group textarea { resize: vertical; min-height: 90px; }

  /* Type selector */
  .type-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
  }
  .type-card {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.18s;
    background: rgba(255,255,255,0.04);
    box-shadow: var(--shadow-sm);
  }
  .type-card:hover {
    border-color: rgba(245,166,35,0.5);
    background: rgba(245,166,35,0.06);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
  }
  .type-card:active { transform: scale(0.96); }
  .type-card.selected {
    border-color: var(--honey);
    background: rgba(245,166,35,0.12);
    box-shadow: 0 0 0 3px rgba(245,166,35,0.15), var(--shadow-sm);
  }
  .type-card .type-icon { font-size: 2.1rem; display: block; margin-bottom: 7px; }
  .type-card .type-name { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); letter-spacing: 0.3px; }
  .type-card.selected .type-name { color: var(--honey); }

  /* Form section headers — Where / What / Details / Photo */
  .form-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--honey);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 22px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(245,166,35,0.18);
  }
  .form-section-title:first-of-type { margin-top: 4px; }

  .form-source-banner {
    background: rgba(76,175,80,0.1);
    border: 1px solid rgba(76,175,80,0.3);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: 0.82rem;
    color: #8aff8a;
    margin-bottom: 16px;
    line-height: 1.5;
  }

  /* ── HIVE POPUP ── */
  .hive-popup {
    background: rgba(22, 20, 10, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(245,166,35,0.15);
    border-radius: var(--radius-md);
    padding: 14px;
    min-width: 260px;
    max-width: 320px;
    max-height: 65dvh;
    overflow-y: auto;
    color: var(--text);
    font-family: 'Outfit', system-ui, sans-serif;
    box-shadow: var(--shadow-lg);
  }
  .hive-popup .popup-type {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .hive-popup .popup-name {
    font-size: 1rem;
    font-weight: bold;
    color: var(--honey);
    margin-bottom: 6px;
  }
  .hive-popup .popup-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
    /* No max-height clamp — popup itself scrolls */
  }
  .hive-popup .popup-meta {
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 8px;
  }
  .popup-radius-btn {
    margin-top: 8px;
    font-size: 0.75rem;
    background: rgba(245,166,35,0.15);
    border: 1px solid var(--honey);
    color: var(--honey);
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    font-family: inherit;
  }

  /* Leaflet popup override */
  .leaflet-popup-content-wrapper {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 12px !important;
  }
  .leaflet-popup-content { margin: 0 !important; max-width: calc(100vw - 32px) !important; }
  .leaflet-popup-tip-container { display: none; }

  /* ── YOU ARE HERE — live position marker ── */
  .you-are-here-dot {
    width: 16px; height: 16px;
    background: #2196f3;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(33,150,243,0.4), 0 2px 6px rgba(0,0,0,0.4);
    position: relative;
  }
  .you-are-here-pulse {
    position: absolute;
    top: 50%; left: 50%;
    width: 16px; height: 16px;
    margin: -8px 0 0 -8px;
    border-radius: 50%;
    background: rgba(33,150,243,0.5);
    animation: pulse-ring 1.8s ease-out infinite;
  }
  @keyframes pulse-ring {
    0%   { transform: scale(1);   opacity: 0.7; }
    100% { transform: scale(2.6); opacity: 0; }
  }

  /* Persistent direction arrow — stays visible even when the direct line
     itself shrinks to almost nothing as you approach the candidate site. */
  .direct-line-arrow {
    width: 0; height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-bottom: 16px solid #f5a623;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6));
    transform-origin: 50% 60%;
  }

  /* Cluster override */
  .marker-cluster-small, .marker-cluster-medium, .marker-cluster-large {
    background-color: rgba(245,166,35,0.2) !important;
  }
  .marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div {
    background-color: rgba(245,166,35,0.7) !important;
    color: #1a1a0e !important;
    font-weight: bold;
    font-family: Georgia, serif;
  }

  /* ── TOAST ── */
  #toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: rgba(30, 28, 16, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(245,166,35,0.2);
    border-radius: var(--radius-pill);
    padding: 10px 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    opacity: 0;
    transition: all 0.25s cubic-bezier(.32,1.25,.6,1);
    pointer-events: none;
    z-index: 9999;
    white-space: nowrap;
    box-shadow: var(--shadow-lg);
  }
  #toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  /* ── MAP FAB ── */
  #fab-add {
    position: absolute;
    bottom: 80px;
    right: 16px;
    z-index: 900;
    width: 54px; height: 54px;
    border-radius: var(--radius-pill);
    background: var(--honey);
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 20px rgba(245,166,35,0.5), 0 2px 8px rgba(0,0,0,0.3);
    transition: transform 0.18s, box-shadow 0.18s;
    color: var(--comb);
  }
  #fab-add:hover { transform: scale(1.07); box-shadow: 0 6px 28px rgba(245,166,35,0.65), 0 2px 8px rgba(0,0,0,0.3); }
  #fab-add:active { transform: scale(0.94); box-shadow: 0 2px 10px rgba(245,166,35,0.3); }
  #fab-add svg { width: 26px; height: 26px; }

  /* ── LOCATE FAB ── */
  #fab-locate {
    position: absolute;
    bottom: 148px;
    right: 16px;
    z-index: 900;
    width: 44px; height: 44px;
    border-radius: var(--radius-pill);
    background: var(--surface);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1.5px solid var(--border);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.18s;
    color: var(--text);
    box-shadow: var(--shadow-md);
  }
  #fab-locate:hover { border-color: var(--honey); color: var(--honey); transform: scale(1.05); }
  #fab-locate:active { transform: scale(0.93); }
  #fab-locate svg { width: 20px; height: 20px; }

  /* Legend tooltip */
  .legend-box {
    background: rgba(255,255,255,0.04);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    box-shadow: var(--shadow-sm);
  }
  .legend-row {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.8rem;
    margin-bottom: 5px;
    color: var(--text-muted);
  }
  .legend-row:last-child { margin-bottom: 0; }
  .legend-dot {
    width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
  }

  /* ── RADIUS CIRCLE TOGGLE ── */
  #radius-toggle {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 900;
    background: rgba(14, 12, 6, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 8px 14px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    min-height: 36px;
    transition: all 0.18s;
    box-shadow: var(--shadow-sm);
  }
  #radius-toggle:hover { border-color: rgba(245,166,35,0.5); color: var(--text); }
  #radius-toggle.active { border-color: var(--honey); color: var(--honey); box-shadow: 0 0 0 3px rgba(245,166,35,0.15); }
  #radius-toggle:active { transform: scale(0.96); }

  #map-container {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  /* ── PATHFINDER PANEL ── */
  #pathfinder-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 950;
    background: rgba(16, 14, 7, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(245,166,35,0.2);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    max-height: 85dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(.32,1.25,.6,1);
  }
  #pathfinder-panel.pf-hidden {
    display: none !important;
    pointer-events: none;
  }
  /* During navigation, shrink the panel so the live map (path + trail) is visible */
  #pathfinder-panel.pf-compact {
    max-height: 42dvh;
  }
  .pf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
  }
  .pf-step-badge {
    background: rgba(245,166,35,0.15);
    color: var(--honey);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
  }
  .pf-close {
    background: rgba(255,255,255,0.08);
    border: none;
    color: var(--text-muted);
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.15s;
  }
  .pf-close:hover { background: rgba(255,255,255,0.15); color: var(--text); }
  .pf-close:active { transform: scale(0.9); }
  .pf-instruction {
    font-size: 0.88rem;
    color: var(--text);
    line-height: 1.5;
    margin-bottom: 14px;
  }
  .pf-howto-box {
    background: rgba(245,166,35,0.07);
    border: 1px solid rgba(245,166,35,0.25);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 14px;
    max-height: 55dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }
  .pf-howto-box.pf-howto-collapsed { display: none; }
  .pf-howto-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--honey);
    margin-bottom: 8px;
  }
  .pf-howto-list {
    margin: 0 0 4px 18px;
    padding: 0;
    font-size: 0.8rem;
    color: var(--text);
    line-height: 1.55;
  }
  .pf-howto-list li { margin-bottom: 8px; }
  .pf-howto-list li:last-child { margin-bottom: 0; }
  .pf-needle-caption {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--honey);
    letter-spacing: 0.3px;
  }
  .pf-flat-hint {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-align: center;
  }
  .pf-flight-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
  }
  .pf-readings {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 0.7rem;
    color: var(--text-muted);
    min-height: 18px;
  }
  .pf-reading-chip {
    background: rgba(245,166,35,0.12);
    color: var(--honey);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-weight: 600;
  }
  .pf-compass-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
  }
  .pf-compass-dial {
    width: 120px; height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 40%, rgba(245,166,35,0.08), rgba(255,255,255,0.03));
    border: 2px solid rgba(245,166,35,0.25);
    box-shadow: inset 0 2px 12px rgba(0,0,0,0.4), var(--shadow-md);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .pf-compass-n {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
  }
  .pf-compass-needle {
    transition: transform 0.15s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .pf-heading-readout {
    font-size: 1rem;
    font-weight: 700;
    color: var(--honey);
    font-variant-numeric: tabular-nums;
  }
  .pf-accuracy {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.04);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    margin-bottom: 10px;
  }
  .pf-accuracy.pf-good { color: var(--green); }
  .pf-accuracy.pf-warn { color: var(--orange); }
  .pf-manual-row {
    margin-bottom: 10px;
  }
  .pf-manual-row label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 5px;
  }
  .pf-manual-row input {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 10px 12px;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    min-height: 44px;
  }
  .pf-link-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-decoration: underline;
    cursor: pointer;
    padding: 6px;
    margin-bottom: 10px;
    font-family: inherit;
  }
  .pf-link-btn:hover { color: var(--honey); }
  .pf-flight-counter {
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,0.04);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 12px;
    font-size: 0.78rem;
    color: var(--text-muted);
  }
  .pf-flight-dots { display: flex; gap: 6px; }
  .pf-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    border: 1.5px solid var(--border);
    display: inline-block;
  }
  .pf-dot.pf-dot-filled {
    background: var(--honey);
    border-color: var(--honey);
  }
  .pf-walk-readout {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text);
    background: rgba(76,175,80,0.08);
    border: 1px solid rgba(76,175,80,0.2);
    border-radius: var(--radius-md);
    padding: 10px;
    margin-bottom: 12px;
  }
  .pf-nav-readout {
    text-align: center;
    margin-bottom: 12px;
  }
  .pf-nav-distance {
    font-size: 2rem;
    font-weight: 700;
    color: var(--honey);
    line-height: 1.1;
  }
  .pf-nav-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
  }
  .pf-turn-hint {
    margin-top: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--honey);
  }
  .pf-action-btn {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
  }
  .pf-secondary-btn {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
  }


  /* Hide map overlays when check-in modal is open */
  body.checkin-open #map-crosshair,
  body.checkin-open #map-coords,
  body.checkin-open #radius-toggle { display: none !important; }

  /* ── CROSSHAIR ── */
  #map-crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 800;
    pointer-events: none;
    width: 44px;
    height: 44px;
  }
  #map-crosshair::before,
  #map-crosshair::after {
    content: '';
    position: absolute;
    background: rgba(20,20,10,0.7);
    border-radius: 2px;
  }
  #map-crosshair::before {
    width: 100%; height: 2px;
    top: 50%; left: 0;
    transform: translateY(-50%);
  }
  #map-crosshair::after {
    width: 2px; height: 100%;
    left: 50%; top: 0;
    transform: translateX(-50%);
  }
  .ch-dot {
    position: absolute;
    width: 8px; height: 8px;
    background: #f5a623;
    border: 2px solid #fff;
    border-radius: 50%;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  }
  #map-coords {
    position: absolute;
    top: calc(50% + 28px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 800;
    pointer-events: none;
    background: rgba(26,26,14,0.82);
    color: #f5a623;
    font-size: 0.68rem;
    font-family: 'Georgia', serif;
    padding: 2px 10px;
    border-radius: 10px;
    white-space: nowrap;
    letter-spacing: 0.3px;
  }

  /* scrollbar */
  ::-webkit-scrollbar { width: 5px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: rgba(245,166,35,0.25); border-radius: 999px; }
  ::-webkit-scrollbar-thumb:hover { background: rgba(245,166,35,0.4); }

  /* ── SINGLE SMART SEARCH BAR (v2.3) ── */
  #search-wrapper {
    display: flex;
    flex-shrink: 0;
    z-index: 999;
    padding: 8px 12px;
    gap: 8px;
    align-items: center;
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
  }
  #smart-search-input {
    flex: 1 1 0;
    min-width: 0;
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--text);
    font-size: 0.88rem;
    padding: 9px 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
  }
  #smart-search-input:focus { border-color: var(--honey); }
  #smart-search-input::placeholder { color: var(--text-muted); }
  #search-go-btn {
    flex-shrink: 0;
    padding: 9px 16px;
    font-size: 0.85rem;
  }
  #filter-drawer-btn {
    flex-shrink: 0;
    position: relative;
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: border-color 0.15s, color 0.15s;
  }
  #filter-drawer-btn.active {
    border-color: var(--honey);
    color: var(--honey);
  }
  #filter-drawer-badge {
    display: none;
    position: absolute;
    top: -4px; right: -4px;
    width: 8px; height: 8px;
    background: var(--honey);
    border-radius: 50%;
  }
  #filter-drawer-btn.active #filter-drawer-badge { display: block; }
  #filter-clear-btn {
    flex-shrink: 0;
    background: rgba(245,166,35,0.12);
    border: 1.5px solid var(--honey);
    border-radius: var(--radius-pill);
    color: var(--honey);
    font-size: 0.9rem;
    font-weight: 700;
    padding: 8px 11px;
    cursor: pointer;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
  }

  /* ── FILTER DRAWER (v2.3) ── */
  #filter-drawer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 8500;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
  }
  #filter-drawer.open { opacity: 1; pointer-events: all; }
  .filter-sheet {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 20px 16px 40px;
    box-shadow: var(--shadow-lg);
    transform: translateY(100%);
    transition: transform 0.25s cubic-bezier(0.32,0.72,0,1);
  }
  #filter-drawer.open .filter-sheet { transform: translateY(0); }
  .filter-sheet-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--honey);
    margin-bottom: 16px;
    text-align: center;
  }
  .filter-section-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 10px;
  }
  .filter-type-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 20px;
  }
  .filter-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px 4px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border);
    background: rgba(255,255,255,0.04);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
  }
  .filter-type-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
  }
  .filter-type-btn.active {
    border-color: var(--honey);
    background: rgba(245,166,35,0.12);
    color: var(--honey);
  }
  .filter-radius-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-top: 1px solid var(--border);
  }
  .filter-radius-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
  }
  .filter-radius-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
  }

  /* ── SEARCH BAR LABELS (legacy — kept for transition) ── */
  .search-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .search-label-geo { color: rgba(245,166,35,0.7); }
  .search-label-text { color: rgba(76,175,80,0.7); }
