:root {
    --bg: #04060c;
    --panel: rgba(13, 18, 28, 0.72);
    --panel-border: rgba(120, 150, 200, 0.14);
    --ink: #e8edf5;
    --ink-2: #9aa7bd;
    --ink-3: #5d6a80;
    --accent: #6fb3ff;
    --radius: 14px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    --bg: #04060c;
  }
  * { margin: 0; padding: 0; box-sizing: border-box; }
  html, body { height: 100%; overflow: hidden; background: var(--bg); }
  body {
    font-family: var(--font);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
  }
  #loader {
    position: fixed; inset: 0; z-index: 200; background: var(--bg);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; transition: opacity .6s ease;
  }
  #loader .ld-title {
    font-size: 24px; font-weight: 750; letter-spacing: 0.5px;
    background: linear-gradient(105deg, #fff6e2 15%, #ffd166 55%, #f5a54a 95%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: #ffd166;
    animation: ldpulse 1.6s ease-in-out infinite;
  }
  #loader .ld-sub { font-size: 12px; color: var(--ink-3); min-height: 16px; }
  #loader .ld-bar { width: 200px; height: 3px; border-radius: 2px; background: rgba(140,180,232,0.15); overflow: hidden; }
  #loader #ld-fill { height: 100%; width: 4%; background: var(--accent, #ffd166); border-radius: 2px; transition: width .35s ease; }
  @keyframes ldpulse { 0%,100% { opacity: 0.55; } 50% { opacity: 1; } }
  #readout {
    position: fixed; z-index: 15; pointer-events: none; padding: 5px 10px;
    font-size: 11.5px; font-weight: 600; display: none; white-space: nowrap;
  }
  #scene { position: fixed; inset: 0; width: 100vw; height: 100vh; cursor: grab; touch-action: none; }
  #scene.dragging { cursor: grabbing; }

  .panel {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  }

  #themes {
    display: none;   /* hidden per Robby — set to flex to re-enable the theme switcher */
    position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 10;
    gap: 4px; padding: 5px;
  }
  .tchip {
    padding: 6px 12px; font-size: 11.5px; font-weight: 600; color: var(--ink-3);
    border-radius: calc(var(--radius) - 5px); cursor: pointer; user-select: none;
    transition: all .18s ease; border: 1px solid transparent;
  }
  .tchip:hover { color: var(--ink); }
  .tchip.on { color: var(--ink); background: rgba(127,127,127,0.16); border-color: var(--panel-border); }

  /* ---------- unified top bar ---------- */
  #topbar {
    position: fixed; top: 14px; left: 16px; right: 16px; z-index: 40;
    display: flex; align-items: center; gap: 10px; pointer-events: none;
  }
  #topbar > * { pointer-events: auto; }
  .tb-space { flex: 1 1 0; min-width: 4px; pointer-events: none !important; }
  #gearwrap { position: relative; flex: 0 0 auto; }
  #gearbtn {
    padding: 8px 12px; font-size: 13.5px; color: var(--ink-2); cursor: pointer;
    user-select: none; transition: all .18s ease;
  }
  #gearbtn:hover, #gearbtn.on { color: var(--ink); }
  #settingspop {
    position: absolute; right: 0; top: 44px; width: 236px; padding: 8px 9px; display: none;
  }
  #settingspop.open { display: block; }
  .set-row {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    padding: 8px 8px; font-size: 12.5px; color: var(--ink-2); cursor: pointer;
    border-radius: 8px; user-select: none;
  }
  .set-row:hover { background: rgba(127,127,127,0.10); color: var(--ink); }
  .set-row b { color: var(--ink); font-weight: 650; }
  .cbdot {
    display: inline-block; width: 12px; height: 12px; border-radius: 50%;
    background: linear-gradient(90deg,#3b528b 50%,#fde725 50%);
    opacity: 0.55; transition: opacity .18s;
  }
  #cbchip.on { color: var(--ink); background: rgba(111,179,255,0.14); }
  #cbchip.on .cbdot { opacity: 1; }
  .set-note {
    font-size: 10px; color: var(--ink-3); line-height: 1.55; padding: 8px 8px 3px;
    border-top: 1px solid var(--panel-border); margin-top: 5px;
  }
  /* ---------- search ---------- */
  #searchwrap { position: relative; z-index: 41; width: 240px; flex: 0 1 240px; min-width: 120px; display: none; }
  #searchwrap.open { display: block; }
  #searchclose { display: none; }
  #searchbtn {
    padding: 8px 12px; font-size: 14px; color: var(--ink-2); cursor: pointer;
    user-select: none; transition: color .18s; flex: 0 0 auto;
  }
  #searchbtn:hover { color: var(--ink); }
  #searchbox {
    width: 100%; padding: 9px 15px; font-size: 12.5px; color: var(--ink);
    background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--radius);
    outline: none; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    font-family: var(--font); transition: box-shadow .2s;
  }
  #searchbox::placeholder { color: var(--ink-3); }
  #searchbox:focus { box-shadow: 0 0 0 2px rgba(111,179,255,0.35); }
  #searchres {
    position: absolute; left: 0; right: 0; top: 100%;
    margin-top: 6px; border-radius: calc(var(--radius) - 4px); overflow: hidden; display: none;
    background: var(--panel); border: 1px solid var(--panel-border);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  }
  .sr-item { padding: 8px 13px; font-size: 12.5px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
  .sr-item:hover, .sr-item.sel { background: rgba(111,179,255,0.14); }
  .sr-item .src { color: var(--ink-3); font-size: 10.5px; white-space: nowrap; }
  .sr-item b { font-weight: 650; }
  /* ---------- city labels ---------- */
  #labels { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
  .clabel {
    position: absolute; left: 0; top: 0; font-weight: 600; color: rgba(255,255,255,0.85);
    text-shadow: 0 1px 4px rgba(0,0,0,0.9), 0 0 2px rgba(0,0,0,0.9);
    white-space: nowrap; display: none; letter-spacing: 0.3px;
    will-change: transform;
  }
  .lab-country { letter-spacing: 3px; font-weight: 700; color: rgba(235,242,255,0.52); }
  .lab-state { color: rgba(235,242,255,0.60); font-weight: 600; letter-spacing: 1.2px; }
  .lab-city { color: rgba(255,255,255,0.85); }
  /* ---------- chart tooltip ---------- */
  #cptip {
    position: fixed; z-index: 45; pointer-events: none; display: none;
    padding: 4px 9px; font-size: 11px; font-weight: 600;
  }
  #speedchip {
    flex: 0 0 auto; padding: 6px 9px; font-size: 11px; font-weight: 650; color: var(--ink-3);
    border: 1px solid var(--panel-border); border-radius: 9px; cursor: pointer; user-select: none;
  }
  #speedchip:hover { color: var(--ink); }

  /* ---------- header ---------- */
  #hdr { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
  #hdr h1 {
    font-size: 19px; font-weight: 750; letter-spacing: 0.3px;
    background: linear-gradient(105deg, #fff6e2 15%, #ffd166 55%, #f5a54a 95%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: #ffd166;
    filter: drop-shadow(0 1px 8px rgba(255, 209, 102, 0.22));
  }
  #hdr .badge {
    display: inline-block; padding: 3px 9px; font-size: 9.5px;
    letter-spacing: 0.6px; text-transform: uppercase; color: #8fb8e8;
    background: rgba(111, 179, 255, 0.10); border: 1px solid rgba(111, 179, 255, 0.25);
    border-radius: 20px; cursor: help; white-space: nowrap;
  }

  /* ---------- layer chips ---------- */
  #layers {
    position: fixed; top: 62px; left: 50%; transform: translateX(-50%); z-index: 35;
    display: flex; gap: 5px; padding: 5px; align-items: center; max-width: calc(100vw - 24px);
  }
  #fab-tune {
    display: none; position: fixed; left: 10px; bottom: 118px; z-index: 46;
    padding: 10px 15px; font-size: 12.5px; font-weight: 650; color: var(--ink-2); cursor: pointer;
  }
  .chip {
    padding: 7px 13px; font-size: 12.5px; font-weight: 550; color: var(--ink-2);
    border-radius: 9px; cursor: pointer; user-select: none; white-space: nowrap;
    transition: all .18s ease; border: 1px solid transparent;
  }
  .chip:hover { color: var(--ink); }
  .chip.on { color: var(--ink); background: rgba(111, 179, 255, 0.14); border-color: rgba(111, 179, 255, 0.35); }

  /* ---------- date bar ---------- */
  #datebar {
    position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
    z-index: 10; width: min(620px, calc(100vw - 48px)); padding: 14px 20px 12px;
  }
  #daterow { display: flex; align-items: center; gap: 14px; }
  #playbtn {
    width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%;
    border: 1px solid var(--panel-border); background: rgba(255,255,255,0.04);
    color: var(--ink); font-size: 12px; cursor: pointer; display: flex;
    align-items: center; justify-content: center; transition: all .18s;
  }
  #playbtn:hover { background: rgba(111,179,255,0.15); border-color: rgba(111,179,255,0.4); }
  #datelabel { font-size: 15px; font-weight: 650; min-width: 88px; text-align: center; }
  #slider-wrap { flex: 1; position: relative; padding-top: 2px; }
  input[type=range].date {
    width: 100%; -webkit-appearance: none; appearance: none; height: 4px;
    background: linear-gradient(90deg, #23486e, #2e6a8f 25%, #cc8a3d 50%, #2e6a8f 75%, #23486e);
    border-radius: 3px; outline: none;
  }
  input[type=range].date::-webkit-slider-thumb {
    -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
    background: #fff; border: 3px solid var(--accent); cursor: pointer;
    box-shadow: 0 0 12px rgba(111,179,255,0.7);
  }
  input[type=range].date::-moz-range-thumb {
    width: 12px; height: 12px; border-radius: 50%;
    background: #fff; border: 3px solid var(--accent); cursor: pointer;
  }
  #months { display: flex; justify-content: space-between; margin-top: 6px; padding: 0 2px; }
  #months span { font-size: 9.5px; letter-spacing: 0.4px; color: var(--ink-3); cursor: pointer; }
  #months span:hover { color: var(--ink-2); }

  /* ---------- legend ---------- */
  #legend {
    position: fixed; right: 20px; bottom: 26px; z-index: 10; padding: 12px 14px;
    width: 190px;
  }
  #legend .t { font-size: 11px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
  #legendbar { width: 100%; height: 10px; border-radius: 5px; display: block; }
  #legendticks { display: flex; justify-content: space-between; margin-top: 4px; }
  #legendticks span { font-size: 10px; color: var(--ink-3); }

  /* ---------- left sidebar (tool rail) ---------- */
  #sidebar {
    position: fixed; left: 16px; top: 64px; z-index: 30; width: 272px;
    max-height: calc(100vh - 180px);
    display: flex; flex-direction: column; transition: transform .3s cubic-bezier(.4,0,.2,1);
  }
  #sidebar.collapsed { transform: translateX(-292px); }
  #sidebar.collapsed #sbtab { right: -34px; }
  #sb-scroll { overflow-y: auto; overscroll-behavior: contain; padding: 8px 10px; flex: 1; }
  #sbtab {
    position: absolute; right: -15px; top: 16px; width: 26px; height: 44px;
    background: var(--panel); border: 1px solid var(--panel-border); border-radius: 0 10px 10px 0;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    font-size: 11px; color: var(--ink-3); user-select: none;
  }
  #sbtab:hover { color: var(--ink); }
  #dd-grab { display: none; position: relative; }
  #dd-hint { font-size: 10px; color: var(--ink-3); margin-left: 8px; white-space: nowrap; }
  #sb-done { display: none; margin: 8px 10px; text-align: center; }
  #filterbtn {
    padding: 10px 8px; font-size: 13px; font-weight: 600; color: var(--ink-2);
    cursor: pointer; user-select: none; transition: color .18s ease;
    display: flex; gap: 8px; align-items: center; border-radius: 10px;
  }
  #filterbtn:hover { color: var(--ink); background: rgba(127,127,127,0.07); }
  #filterbtn.on { color: #7ee3b0; }
  #filterbtn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); transition: all .18s; }
  #filterbtn.on .dot { background: #7ee3b0; box-shadow: 0 0 8px rgba(126,227,176,0.8); }
  #filterpanel { padding: 6px 8px 10px; display: none; }
  #filterpanel.open { display: block; }
  #filterpanel h3 { font-size: 12px; font-weight: 650; letter-spacing: 0.5px; text-transform: uppercase; color: var(--ink-2); margin-bottom: 12px; }
  .frow { margin-bottom: 14px; }
  .frow .lab { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; }
  .frow .lab b { color: var(--ink); font-weight: 600; }
  .frow .lab input[type=checkbox] { accent-color: #7ee3b0; margin-right: 6px; }
  .dual { position: relative; height: 20px; }
  .dual input[type=range] {
    -webkit-appearance: none; appearance: none; position: absolute; left: 0; top: 8px;
    width: 100%; height: 4px; background: none; pointer-events: none; outline: none; margin: 0;
  }
  .dual .track {
    position: absolute; left: 0; right: 0; top: 8px; height: 4px;
    background: rgba(255,255,255,0.12); border-radius: 2px;
  }
  .dual .fill { position: absolute; top: 8px; height: 4px; background: #7ee3b0; border-radius: 2px; opacity: 0.85; }
  .dual input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
    background: #fff; border: 2.5px solid #7ee3b0; cursor: pointer; pointer-events: auto;
    margin-top: -5px;
  }
  .dual input[type=range]::-moz-range-thumb {
    width: 10px; height: 10px; border-radius: 50%; background: #fff;
    border: 2.5px solid #7ee3b0; cursor: pointer; pointer-events: auto;
  }
  .single input[type=range] {
    -webkit-appearance: none; appearance: none; width: 100%; height: 4px;
    background: rgba(255,255,255,0.12); border-radius: 2px; outline: none;
  }
  .single input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
    background: #fff; border: 2.5px solid #7ee3b0; cursor: pointer;
  }
  .single input[type=range]::-moz-range-thumb {
    width: 10px; height: 10px; border-radius: 50%; background: #fff;
    border: 2.5px solid #7ee3b0; cursor: pointer;
  }
  #matchcount { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
  .sv-sec { font-size: 10px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--ink-3); margin: 8px 4px 2px; }
  .wdates input { flex: 1; min-width: 0; background: rgba(127,127,127,0.10); color: var(--ink-2);
    border: 1px solid var(--panel-border); border-radius: 7px; padding: 4px 6px;
    font-size: 11px; font-family: var(--font); outline: none; color-scheme: dark; }
  #dd-top .lab { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; }
  #dd-top .lab input[type=checkbox] { accent-color: #7ee3b0; margin-right: 6px; }
  #win-dates { display: flex; gap: 6px; align-items: center; margin-top: 6px; color: var(--ink-3); }
  #win-dates input {
    flex: 1; min-width: 0; background: rgba(127,127,127,0.10); color: var(--ink-2);
    border: 1px solid var(--panel-border); border-radius: 7px; padding: 4px 6px;
    font-size: 11px; font-family: var(--font); outline: none; color-scheme: dark;
  }
  #presets { display: flex; gap: 5px; margin-bottom: 12px; flex-wrap: wrap; }
  .preset { font-size: 10.5px; padding: 5px 9px; }
  .preset.on { color: var(--ink); background: rgba(126,227,176,0.14); border-color: rgba(126,227,176,0.4); }
  #fmore summary { font-size: 11px; color: var(--ink-3); cursor: pointer; margin: 4px 0 10px; user-select: none; }
  #fmore[open] summary { color: var(--ink-2); }
  #destdrawer {
    position: fixed; right: 16px; top: 64px; bottom: 116px; z-index: 29; width: 300px;
    overflow-y: auto; overscroll-behavior: contain;
    padding: 12px 14px; display: none;
  }
  #dd-sort {
    background: rgba(127,127,127,0.12); color: var(--ink-2); border: 1px solid var(--panel-border);
    border-radius: 7px; font-size: 10.5px; padding: 3px 5px; outline: none; font-family: var(--font);
  }
  #destdrawer.open { display: block; }
  .dd-head { font-size: 11.5px; font-weight: 650; color: var(--ink-2); margin-bottom: 6px;
    display: flex; justify-content: space-between; align-items: center; }
  .dd-row { display: flex; justify-content: space-between; align-items: center; gap: 8px;
    padding: 7px 4px; border-bottom: 1px solid var(--panel-border); cursor: pointer; }
  .dd-row:hover { background: rgba(127,127,127,0.08); }
  .dd-n { font-weight: 650; font-size: 12.5px; }
  .dd-c { font-size: 10px; color: var(--ink-3); }
  .dd-w { text-align: right; font-size: 11px; color: var(--accent); white-space: nowrap; }
  .dd-t { font-size: 10.5px; color: var(--ink-2); text-align: right; }
  .dd-note { font-size: 10.5px; color: var(--ink-3); padding: 6px 2px; }

  /* ---------- city card ---------- */
  #citycard {
    position: fixed; z-index: 20; width: 252px; padding: 14px 16px 12px;
    pointer-events: none; display: none;
  }
  #citycard .cname { font-size: 14.5px; font-weight: 650; }
  #citycard .cdate { font-size: 11px; color: var(--ink-2); margin-top: 1px; margin-bottom: 10px; }
  #citycard .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 10px; margin-bottom: 10px; }
  #citycard .stat .v { font-size: 15px; font-weight: 650; }
  #citycard .stat .k { font-size: 10px; color: var(--ink-3); letter-spacing: 0.3px; text-transform: uppercase; margin-top: 1px; }
  #citychart { width: 100%; height: 64px; display: block; }
  #citycard .chartlab { display: flex; justify-content: space-between; font-size: 9px; color: var(--ink-3); margin-top: 2px; }

  /* ---------- saved pins ---------- */
  #savedbtn {
    padding: 8px 13px; flex: 0 0 auto; white-space: nowrap;
    font-size: 12px; font-weight: 600; color: var(--ink-2); cursor: pointer; user-select: none;
    transition: color .18s;
  }
  #savedbtn:hover { color: var(--ink); }
  #savedpanel {
    position: fixed; top: 64px; right: 16px; z-index: 41; width: 240px;
    padding: 10px 12px; display: none;
  }
  #savedpanel.open { display: block; }
  .sv-item { display: flex; align-items: center; gap: 8px; padding: 7px 4px;
    border-bottom: 1px solid var(--panel-border); cursor: pointer; font-size: 12.5px; }
  .sv-item:last-of-type { border-bottom: none; }
  .sv-item:hover { background: rgba(127,127,127,0.08); }
  .sv-n { font-weight: 650; flex: 1; }
  .sv-d { color: var(--ink-2); font-size: 11.5px; }
  .sv-x { color: var(--ink-3); cursor: pointer; padding: 0 3px; }
  .sv-x:hover { color: var(--ink); }
  .sv-empty, .sv-note { font-size: 11px; color: var(--ink-3); padding: 6px 2px; }
  #consent {
    position: fixed; inset: 0; z-index: 100; display: none;
    align-items: center; justify-content: center; background: rgba(0,0,0,0.55);
  }
  #consent.open { display: flex; }
  .cbox { max-width: 330px; padding: 20px 22px; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
  .cbox b { color: var(--ink); }
  .cbtns { display: flex; gap: 8px; margin-top: 14px; justify-content: flex-end; }
  #nowbtn {
    padding: 10px 8px; margin-bottom: 2px; border-bottom: 1px solid var(--panel-border);
    font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer;
    user-select: none; display: flex; gap: 8px; align-items: center; border-radius: 10px;
  }
  #nowbtn:hover { color: var(--ink); background: rgba(127,127,127,0.07); }
  #nowctl { display: flex; gap: 10px; align-items: center; margin: 12px 0 6px; }
  #nowctl .single { flex: 1; }
  #nowdate { font-size: 12px; font-weight: 650; min-width: 52px; text-align: center; }

  /* ---------- city seasonal panel ---------- */
  #citypanel {
    position: fixed; top: 14px; right: 14px; width: 356px; z-index: 30;
    max-height: calc(100vh - 28px);
    padding: 18px 18px 14px; transform: translateX(calc(100% + 20px));
    transition: transform .32s cubic-bezier(.2,.8,.25,1); overflow-y: auto;
  }
  #citypanel.open { transform: none; }
  #cp-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 4px; }
  #cp-name { font-size: 19px; font-weight: 700; }
  #cp-country { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
  #cp-close {
    width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center;
    justify-content: center; cursor: pointer; color: var(--ink-2); font-size: 17px;
    border: 1px solid var(--panel-border); flex: 0 0 28px;
  }
  #cp-close:hover { color: var(--ink); background: rgba(127,127,127,0.15); }
  #cp-context { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
  .ctx-chip {
    font-size: 10.5px; padding: 3px 9px; border: 1px solid var(--panel-border);
    border-radius: 12px; color: var(--ink-2); white-space: nowrap;
  }
  .ctx-chip b { color: var(--ink); font-weight: 650; }
  #cp-now { font-size: 11px; color: var(--ink-2); margin-top: 7px; display: none; }
  #cp-now b { color: var(--ink); }
  #cp-datestats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px 10px; margin: 12px 0 4px; }
  #cp-homedelta { font-size: 11px; color: var(--ink-2); margin: 6px 0 2px; padding: 6px 9px;
    border: 1px solid var(--panel-border); border-radius: 8px; }
  #cp-homedelta b { color: var(--ink); }
  #cp-datestats .stat .v { font-size: 15px; font-weight: 650; }
  #cp-datestats .stat .k { font-size: 9.5px; color: var(--ink-3); letter-spacing: 0.3px; text-transform: uppercase; margin-top: 1px; }
  .cp-sec { font-size: 11px; font-weight: 650; letter-spacing: 0.5px; text-transform: uppercase;
    color: var(--ink-2); margin: 14px 0 6px; display: flex; justify-content: space-between; }
  .cp-sec b { color: var(--accent); font-weight: 650; text-transform: none; letter-spacing: 0; }
  #citypanel canvas { width: 100%; display: block; border-radius: 6px; cursor: crosshair; }
  #cp-hint { font-size: 10px; color: var(--ink-3); margin-top: 10px; text-align: center; }
  #cp-actions { display: flex; gap: 6px; margin-top: 10px; }
  .cp-btn {
    padding: 6px 9px; font-size: 10.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
    border: 1px solid var(--panel-border); border-radius: calc(var(--radius) - 8px);
    cursor: pointer; user-select: none; transition: all .15s;
  }
  .cp-btn:hover { color: var(--ink); background: rgba(127,127,127,0.12); }
  #cp-compare { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
  .cchip {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px;
    font-size: 11px; color: var(--ink-2); border: 1px solid var(--panel-border);
    border-radius: 20px;
  }
  .cchip .dot { width: 8px; height: 8px; border-radius: 50%; }
  .cchip .x { cursor: pointer; color: var(--ink-3); }
  .cchip .x:hover { color: var(--ink); }
  .cp-res-head { font-size: 12px; color: var(--ink-2); margin: 12px 0 6px; display: flex; justify-content: space-between; align-items: center; }
  .cp-res-head b { color: var(--ink); }
  #cp-res-back { cursor: pointer; color: var(--accent); font-size: 11.5px; }
  .cp-res {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 6px; border-bottom: 1px solid var(--panel-border); cursor: pointer;
  }
  .cp-res:hover { background: rgba(127,127,127,0.08); }
  .cp-res .rn { font-weight: 650; font-size: 13px; }
  .cp-res .rc { font-size: 10.5px; color: var(--ink-3); }
  .cp-res .rw { text-align: right; font-size: 12px; color: var(--ink-2); }
  .cp-res .rt { font-size: 10.5px; color: var(--ink-3); }

  /* ---------- mobile view switcher ---------- */

  .vbtn {
    padding: 8px 16px; font-size: 12px; font-weight: 650; color: var(--ink-3);
    border-radius: 10px; cursor: pointer; user-select: none;
  }
  .vbtn.on { color: var(--ink); background: rgba(111,179,255,0.16); }

  /* ---------- coach marks ---------- */
  #coach { position: fixed; inset: 0; z-index: 120; display: none; pointer-events: none; }
  #coach.open { display: block; }
  .co-ring {
    position: absolute; border: 2px solid rgba(111,179,255,0.75); border-radius: 18px;
    box-shadow: 0 0 26px rgba(111,179,255,0.4); transition: all .35s ease;
  }
  .co-bubble { position: absolute; width: 248px; padding: 13px 15px; pointer-events: auto; }
  #co-text { font-size: 12.5px; line-height: 1.55; color: var(--ink); }
  #co-text b { color: var(--accent); }
  .co-btns { display: flex; justify-content: space-between; align-items: center; margin-top: 11px; }
  #co-skip { font-size: 11px; color: var(--ink-3); cursor: pointer; user-select: none; }
  #co-skip:hover { color: var(--ink-2); }

  @media (max-width: 1240px) {
    #hdr .badge { display: none; }
    .chip { padding: 7px 10px; font-size: 12px; }
    #searchwrap { flex-basis: 200px; }
  }
  @media (max-width: 1020px) {
    #datebar { width: min(460px, calc(100vw - 32px)); bottom: 14px; }
    #legend { bottom: 88px; right: 16px; width: 170px; }
    #sidebar { max-height: calc(100vh - 170px); }
    #savedbtn span { display: none; }
  }
  @media (max-width: 780px) {
    #topbar { top: 8px; left: 8px; right: 8px; flex-wrap: wrap; gap: 7px; }
    #hdr h1 { font-size: 15px; }
    #gearwrap { order: 2; }
    #savedbtn { order: 3; padding: 7px 12px; }
    .tb-space { order: 4; flex-basis: 0; }
    #searchwrap { order: 5; flex: 1 1 100%; width: auto; }
    #savedpanel { top: 88px; left: auto; right: 8px; }
    #settingspop { position: fixed; left: 8px; right: 8px; top: 88px; width: auto; }
    #themes { display: none; }
    #layers {
      top: 54px; left: 8px; right: 8px; transform: none;
      overflow-x: auto; padding: 4px; justify-content: flex-start;
    }
    .chip { padding: 6px 10px; font-size: 11.5px; }
    #legend { top: 102px; right: 8px; left: auto; bottom: auto; width: 158px; padding: 8px 10px; }
    #legend .t { font-size: 10px; margin-bottom: 5px; }
    body[data-view="tune"] #legend, body[data-view="place"] #legend { display: none; }
    #datebar { bottom: 8px; width: calc(100vw - 16px); padding: 8px 12px 6px; }
    #datelabel { font-size: 13px; min-width: 64px; }
    #months { display: none; }
    /* mobile views: globe / tune / results / place (body[data-view]) */
    #fab-tune { display: block; }
    body[data-view="tune"] #fab-tune, body[data-view="place"] #fab-tune { display: none; }

    #sidebar, #sbtab { display: none; }
    body[data-view="tune"] #sidebar {
      display: flex; left: 8px; right: 8px; top: 62px; bottom: 12px;
      width: auto; max-height: none; transform: none;
    }
    /* results = draggable-ish bottom sheet: peek bar, tap to expand */
    #destdrawer.open {
      display: block; left: 8px; right: 8px; bottom: 68px; top: auto; width: auto;
      height: 46px; overflow: hidden; border-radius: 18px; z-index: 45;
      transition: height .3s cubic-bezier(.4,0,.2,1);
    }
    #destdrawer.open.exp { height: min(72vh, calc(100vh - 140px)); overflow-y: auto; }
    #dd-grab {
      display: flex !important; align-items: center; justify-content: center; gap: 8px;
      height: 34px; margin: -12px -14px 6px; cursor: pointer;
      font-size: 12px; font-weight: 650; color: var(--ink-2);
      border-bottom: 1px solid var(--panel-border);
    }
    #dd-grab::before { content: ''; width: 34px; height: 4px; border-radius: 2px;
      background: var(--ink-3); position: absolute; margin-top: -20px; }
    body[data-view="tune"] #datebar, body[data-view="tune"] #layers,
    body[data-view="tune"] #destdrawer, body[data-view="place"] #destdrawer,
    body[data-view="place"] #layers, body[data-view="place"] #datebar,
    body[data-view="place"] #topbar { display: none !important; }
    #sb-done { display: block; }
    #citypanel { display: none !important; }
    body[data-view="place"] #citypanel.open {
      display: block !important; inset: 0; width: auto; max-height: 100vh;
      border-radius: 0; z-index: 60; padding-top: max(14px, env(safe-area-inset-top));
    }
    #searchwrap.open {
      position: fixed; inset: 0; z-index: 90; width: auto; flex: none;
      background: var(--bg); padding: 14px 14px 0 48px;
    }
    #searchwrap.open #searchclose {
      display: flex; position: absolute; left: 10px; top: 22px; width: 30px; height: 30px;
      align-items: center; justify-content: center; color: var(--ink-2); cursor: pointer;
    }
    #searchres { max-height: 70vh; overflow-y: auto; }
    #readout { display: none !important; }
    #destdrawer { left: 8px; right: 8px; width: auto; bottom: 140px; max-height: 46vh; }
  }
