/* ============================================================
   EVENT RADAR — V1 premium
   Design grammar: Linear / Vercel / Arc
   ============================================================ */

/* ——— TOKENS ——— */
:root{
  /* Surfaces — cool dark, sub-teinte 264° */
  --canvas:        oklch(0.142 0.014 264);
  --surface-1:     oklch(0.176 0.014 264);
  --surface-2:     oklch(0.212 0.014 264);
  --surface-hi:    oklch(0.255 0.016 264);
  --surface-glass: oklch(0.176 0.014 264 / 0.78);

  /* Borders */
  --border:        oklch(1 0 0 / 0.07);
  --border-strong: oklch(1 0 0 / 0.14);
  --border-loud:   oklch(1 0 0 / 0.24);

  /* Ink */
  --ink:           oklch(0.97 0.004 264);
  --ink-2:         oklch(0.84 0.008 264);
  --ink-3:         oklch(0.62 0.013 264);
  --ink-4:         oklch(0.46 0.012 264);

  /* Accents */
  --mauve:         oklch(0.70 0.21 305);
  --mauve-2:       oklch(0.62 0.22 300);
  --mauve-soft:    oklch(0.70 0.21 305 / 0.14);
  --mauve-line:    oklch(0.70 0.21 305 / 0.34);
  --mauve-glow:    oklch(0.70 0.21 305 / 0.55);

  --emerald:       oklch(0.74 0.16 158);
  --emerald-2:     oklch(0.66 0.17 156);
  --emerald-soft:  oklch(0.74 0.16 158 / 0.14);
  --emerald-line:  oklch(0.74 0.16 158 / 0.34);
  --emerald-glow:  oklch(0.74 0.16 158 / 0.55);

  --gold:          oklch(0.82 0.14 84);
  --rose:          oklch(0.74 0.18 22);

  /* Shape */
  --r-xs: 6px; --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px;

  /* Shadows */
  --shadow-sm: 0 1px 0 oklch(1 0 0 / 0.04), 0 4px 12px -4px rgb(0 0 0 / 0.4);
  --shadow:    0 1px 0 oklch(1 0 0 / 0.04), 0 12px 32px -8px rgb(0 0 0 / 0.55), 0 2px 6px -2px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 1px 0 oklch(1 0 0 / 0.04), 0 28px 60px -16px rgb(0 0 0 / 0.7), 0 6px 16px -6px rgb(0 0 0 / 0.5);

  /* Motion */
  --ease:      cubic-bezier(.22, .61, .36, 1);
  --ease-out:  cubic-bezier(.16, 1, .3, 1);
  --rail-w:    64px;
  --top-h:     56px;
  --tl-h:      52px;
  --drawer-w:  440px;

  /* Current accent (mauve by default, swapped via JS) */
  --accent:       var(--mauve);
  --accent-2:     var(--mauve-2);
  --accent-soft:  var(--mauve-soft);
  --accent-line:  var(--mauve-line);
  --accent-glow:  var(--mauve-glow);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent-soft); }

body{
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "ss01", "cv11";
  font-variant-ligatures: contextual;
  background:
    radial-gradient(900px 600px at 88% -10%, oklch(0.74 0.16 158 / 0.05), transparent 60%),
    radial-gradient(900px 700px at 6% -6%, oklch(0.70 0.21 305 / 0.07), transparent 55%),
    var(--canvas);
  color: var(--ink-2);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  grid-template-rows: 1fr;
}

.mono{
  font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
  font-feature-settings: "zero", "ss01";
  font-variant-numeric: tabular-nums;
}
.serif{ font-family: "Instrument Serif", "Times New Roman", serif; font-style: italic; letter-spacing: -.005em; }
.score-txt h3 .serif{ color: var(--accent); font-weight: 400; font-size: 1.08em; margin-left: 2px; }
.num { font-variant-numeric: tabular-nums; }

/* ==========================================================
   LOADER
   ========================================================== */
#loader{
  position: fixed; inset: 0; z-index: 9999;
  background: var(--canvas);
  display: flex; align-items: center; justify-content: center; gap: 14px;
  color: var(--ink-3); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  transition: opacity .5s var(--ease), visibility .5s;
}
#loader.hide{ opacity: 0; visibility: hidden; }
.loader-ring{
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid oklch(1 0 0 / 0.08);
  border-top-color: var(--mauve);
  border-right-color: var(--emerald);
  animation: spin .9s linear infinite;
}
@keyframes spin{ to { transform: rotate(360deg); } }

/* ==========================================================
   RAIL (left nav)
   ========================================================== */
.rail{
  grid-column: 1;
  background: oklch(0.13 0.014 264);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 0 18px;
  gap: 6px;
  position: relative; z-index: 40;
}
.rail-brand{
  width: 38px; height: 38px; border-radius: 12px;
  background: radial-gradient(circle at 32% 28%, oklch(0.30 0.02 264), oklch(0.14 0.01 264));
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 0 14px oklch(0.70 0.21 305 / 0.34), 0 1px 0 oklch(1 0 0 / 0.05);
  position: relative;
  margin-bottom: 8px;
}
.rail-brand::after{
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--mauve);
  box-shadow: 0 0 12px var(--mauve), 0 0 0 0 oklch(0.70 0.21 305 / 0.6);
  animation: ping 2.6s var(--ease) infinite;
}
@keyframes ping{
  0%   { box-shadow: 0 0 12px var(--mauve), 0 0 0 0 oklch(0.70 0.21 305 / 0.5); }
  70%  { box-shadow: 0 0 12px var(--mauve), 0 0 0 14px oklch(0.70 0.21 305 / 0); }
  100% { box-shadow: 0 0 12px var(--mauve), 0 0 0 0 oklch(0.70 0.21 305 / 0); }
}

.rail-btn{
  width: 40px; height: 40px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-4); transition: all .2s var(--ease);
  position: relative;
}
.rail-btn:hover{ color: var(--ink); background: oklch(1 0 0 / 0.04); }
.rail-btn:focus-visible{ outline: none; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--accent); }
.rail-btn.active{
  color: var(--ink);
  background: linear-gradient(180deg, oklch(1 0 0 / 0.08), oklch(1 0 0 / 0.02));
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.rail-btn.active::before{
  content: ""; position: absolute; left: -14px; top: 50%;
  width: 2px; height: 18px; border-radius: 1px;
  background: var(--accent);
  transform: translateY(-50%);
  box-shadow: 0 0 8px var(--accent);
}
.rail-btn svg{ width: 18px; height: 18px; }
.rail-btn .badge{
  position: absolute; top: -2px; right: -2px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--gold); color: oklch(0.18 0.04 84);
  font-family: "JetBrains Mono"; font-weight: 600; font-size: 9.5px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid oklch(0.13 0.014 264);
}
.rail-spacer{ flex: 1; }
.rail-tip{
  position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%) translateX(-4px);
  padding: 5px 10px; border-radius: var(--r-xs);
  background: oklch(0.22 0.015 264); border: 1px solid var(--border-strong);
  color: var(--ink); font-size: 11.5px; font-weight: 500;
  white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .15s ease, transform .15s ease;
  box-shadow: var(--shadow-sm);
  z-index: 100;
}
.rail-btn:hover .rail-tip{ opacity: 1; transform: translateY(-50%) translateX(0); }

/* ==========================================================
   SHELL (main container right of rail)
   ========================================================== */
.shell{
  grid-column: 2;
  display: grid;
  grid-template-rows: var(--top-h) 1fr;
  min-width: 0; min-height: 0;
  position: relative;
}

/* ==========================================================
   TOPBAR
   ========================================================== */
.topbar{
  grid-row: 1;
  display: flex; align-items: center; gap: 16px;
  padding: 0 22px;
  background: linear-gradient(180deg, oklch(0.155 0.014 264 / 0.95), oklch(0.155 0.014 264 / 0.78));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  z-index: 30;
}
.tb-title{
  display: flex; align-items: baseline; gap: 10px;
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  letter-spacing: -0.005em;
}
.tb-title .sub{
  color: var(--ink-4); font-weight: 400; font-size: 12px;
  letter-spacing: 0;
}
.tb-title .sub b{ color: var(--ink-2); font-weight: 500; }

.tb-spacer{ flex: 1; }

/* mission segmented control */
.seg{
  display: flex; padding: 3px; border-radius: 9px;
  background: oklch(0.12 0.012 264);
  border: 1px solid var(--border);
}
.seg-btn{
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 6px;
  font-size: 12.5px; font-weight: 500;
  color: var(--ink-3); transition: all .22s var(--ease);
  position: relative;
}
.seg-btn:hover{ color: var(--ink-2); }
.seg-btn.active{
  color: var(--ink); background: oklch(0.235 0.015 264);
  box-shadow: 0 1px 0 oklch(1 0 0 / 0.05), inset 0 0 0 1px var(--border-strong);
}
.seg-btn[data-mission="edtech"].active{ box-shadow: 0 1px 0 oklch(1 0 0 / 0.05), inset 0 0 0 1px var(--mauve-line); }
.seg-btn[data-mission="clipping"].active{ box-shadow: 0 1px 0 oklch(1 0 0 / 0.05), inset 0 0 0 1px var(--emerald-line); }
.seg-btn .dot{
  width: 7px; height: 7px; border-radius: 50%;
  display: inline-block;
}
.seg-btn .dot.mauve{ background: var(--mauve); box-shadow: 0 0 8px var(--mauve-glow); }
.seg-btn .dot.emerald{ background: var(--emerald); box-shadow: 0 0 8px var(--emerald-glow); }

/* stat group */
.stats{
  display: flex; align-items: center; gap: 6px;
}
.stat{
  display: flex; flex-direction: column; align-items: flex-end; gap: 0;
  padding: 4px 10px; border-radius: 7px;
  border: 1px solid var(--border);
  background: oklch(0.135 0.014 264 / 0.6);
  min-width: 56px;
}
.stat .v{
  font-family: "JetBrains Mono"; font-weight: 600;
  font-size: 13px; line-height: 1.1; color: var(--ink);
}
.stat .l{
  font-size: 9.5px; color: var(--ink-4);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-top: 1px;
}

/* topbar buttons */
.tb-btn{
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px; border-radius: 7px;
  font-size: 12.5px; font-weight: 500;
  color: var(--ink-3);
  border: 1px solid var(--border);
  background: oklch(0.135 0.014 264 / 0.6);
  transition: all .2s var(--ease);
}
.tb-btn:hover{ color: var(--ink); border-color: var(--border-strong); background: oklch(0.18 0.014 264 / 0.7); }
.tb-btn:focus-visible{ outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.tb-btn.on{ color: var(--ink); background: var(--accent-soft); border-color: var(--accent-line); }
.tb-btn svg{ width: 14px; height: 14px; flex: 0 0 auto; }
.tb-btn .kbd{
  font-family: "JetBrains Mono"; font-size: 10px;
  padding: 1px 4px; border-radius: 3px;
  background: oklch(1 0 0 / 0.06); color: var(--ink-3);
  margin-left: 4px;
}

/* search */
.search{
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px; height: 32px;
  border-radius: 7px;
  background: oklch(0.12 0.012 264);
  border: 1px solid var(--border);
  min-width: 220px;
  transition: border-color .2s var(--ease);
}
.search:focus-within{ border-color: var(--accent-line); }
.search svg{ width: 14px; height: 14px; color: var(--ink-4); }
.search input{
  background: none; border: none; outline: none;
  flex: 1; min-width: 0;
  font-size: 13px; color: var(--ink);
}
.search input::placeholder{ color: var(--ink-4); }
.search .clr{
  width: 18px; height: 18px; border-radius: 4px;
  color: var(--ink-4); font-size: 14px; line-height: 1;
  display: none; align-items: center; justify-content: center;
}
.search.has-q .clr{ display: flex; }
.search .clr:hover{ background: oklch(1 0 0 / 0.06); color: var(--ink); }

/* ==========================================================
   FILTER POPOVER
   ========================================================== */
.popover-host{ position: relative; }
.popover{
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 380px; padding: 18px;
  background: oklch(0.176 0.014 264 / 0.97);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  z-index: 50;
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
}
.popover.show{ opacity: 1; visibility: visible; transform: none; }
.po-row{ margin-bottom: 14px; }
.po-row:last-child{ margin-bottom: 0; }
.po-lbl{
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-4); margin-bottom: 9px; font-weight: 600;
}
.po-lbl b{ color: var(--ink); font-family: "JetBrains Mono"; font-weight: 600; font-size: 11px; }

.po-chips{ display: flex; flex-wrap: wrap; gap: 5px; }
.chip{
  padding: 5px 10px; border-radius: 16px;
  font-size: 11.5px; font-weight: 500;
  color: var(--ink-3); background: oklch(0.12 0.012 264);
  border: 1px solid var(--border);
  transition: all .18s var(--ease);
  white-space: nowrap;
}
.chip:hover{ color: var(--ink); border-color: var(--border-strong); }
.chip:focus-visible{ outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.chip.active{
  color: var(--ink); background: var(--accent-soft);
  border-color: var(--accent-line);
}
.chip .cnt{
  margin-left: 5px; color: var(--ink-4); font-family: "JetBrains Mono";
  font-size: 10.5px;
}

/* score slider */
.po-range{
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 5px; border-radius: 3px; outline: none;
  background: linear-gradient(90deg, oklch(0.42 0.04 305), oklch(0.74 0.22 305));
}
.po-range::-webkit-slider-thumb{
  -webkit-appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--ink); cursor: pointer;
  box-shadow: 0 0 0 3px oklch(1 0 0 / 0.12), var(--shadow-sm);
}
.po-range::-moz-range-thumb{
  width: 16px; height: 16px; border-radius: 50%; border: none;
  background: var(--ink); cursor: pointer;
  box-shadow: 0 0 0 3px oklch(1 0 0 / 0.12), var(--shadow-sm);
}
body.acc-emerald .po-range{ background: linear-gradient(90deg, oklch(0.42 0.04 158), oklch(0.78 0.18 158)); }

/* toggle */
.toggle{
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 12.5px; color: var(--ink-2); cursor: pointer; user-select: none;
}
.tg-track{
  width: 32px; height: 18px; border-radius: 10px;
  background: oklch(1 0 0 / 0.12); position: relative;
  transition: background .22s var(--ease);
}
.tg-thumb{
  position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--ink); transition: transform .22s var(--ease);
}
.toggle.on .tg-track{ background: var(--accent); }
.toggle.on .tg-thumb{ transform: translateX(14px); }

.po-actions{
  margin-top: 18px; display: flex; justify-content: space-between; align-items: center;
  padding-top: 14px; border-top: 1px solid var(--border);
}
.po-clear{
  font-size: 12px; color: var(--ink-3);
  padding: 4px 8px; border-radius: 5px;
}
.po-clear:hover{ color: var(--ink); background: oklch(1 0 0 / 0.04); }
.po-active-count{
  font-family: "JetBrains Mono"; font-size: 11px; color: var(--ink-4);
}

/* ==========================================================
   MAP VIEW — main grid (list + map)
   ========================================================== */
/* cross-fade entre vues (fade-out 180ms, snap-in) */
.view{
  grid-row: 2; min-height: 0; min-width: 0;
  display: none; position: relative;
  opacity: 1;
  transition: opacity .18s var(--ease);
}
.view.active{ display: block; }
.view.leaving{ opacity: 0; pointer-events: none; }

#viewMap.active{
  display: grid;
  grid-template-columns: 340px 1fr;
  grid-template-rows: 1fr var(--tl-h);
  grid-template-areas:
    "list map"
    "tl   tl";
  height: 100%;
  position: relative;
}

/* list pane */
.list-pane{
  grid-area: list;
  background: oklch(0.15 0.014 264 / 0.62);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  min-height: 0;
}
.list-head{
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 14px 18px 10px; flex: 0 0 auto;
}
.list-head h2{
  font-size: 13px; font-weight: 600; color: var(--ink);
  letter-spacing: -0.005em;
}
.list-head .sub{
  font-size: 11px; color: var(--ink-4);
  font-family: "JetBrains Mono";
}
.list-scroll{
  flex: 1 1 auto; overflow-y: auto;
  padding: 0 10px 14px;
  scrollbar-width: thin;
  scrollbar-color: oklch(1 0 0 / 0.12) transparent;
}
.list-scroll::-webkit-scrollbar{ width: 6px; }
.list-scroll::-webkit-scrollbar-thumb{ background: oklch(1 0 0 / 0.10); border-radius: 3px; }
.list-scroll::-webkit-scrollbar-thumb:hover{ background: oklch(1 0 0 / 0.18); }

/* event row */
.row{
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s ease, border-color .15s ease;
  position: relative;
}
.row:hover{
  background: oklch(1 0 0 / 0.03);
  border-color: var(--border);
}
.row.sel{
  background: var(--accent-soft);
  border-color: var(--accent-line);
}
.row:focus-visible{
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
@keyframes rowFlash{
  0%   { background: var(--accent-soft); }
  100% { background: transparent; }
}
.row.flash:not(.sel){ animation: rowFlash .7s var(--ease); }

.row-rank{
  font-family: "JetBrains Mono"; font-size: 10.5px; color: var(--ink-4);
  text-align: center; min-width: 18px;
  align-self: start; padding-top: 4px;
}
.row.top-3 .row-rank{ color: var(--gold); font-weight: 600; }

.row-pin{
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: "JetBrains Mono"; font-weight: 600; font-size: 10.5px;
  color: oklch(0.98 0 0); text-shadow: 0 1px 2px rgb(0 0 0 / 0.55);
  border: 1.5px solid oklch(1 0 0 / 0.78);
  flex: 0 0 auto;
}
.row-pin.est{ border-style: dashed; }

.row-meta{ min-width: 0; }
.row-name{
  font-size: 13px; font-weight: 500; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: -0.003em;
}
.row-sub{
  font-size: 11.5px; color: var(--ink-3);
  margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-sub .flag{ margin-right: 4px; }
.row-sub .sep{ color: var(--ink-4); margin: 0 5px; }
.row-sub .date{ font-family: "JetBrains Mono"; color: var(--ink-3); }

.row-side{
  display: flex; flex-direction: column; align-items: flex-end; gap: 3px;
  flex: 0 0 auto;
}
.row-bud{
  font-family: "JetBrains Mono"; font-size: 10.5px; color: var(--ink-4);
  white-space: nowrap;
}
.row .est-tag{
  font-size: 9.5px; padding: 1px 6px; border-radius: 4px;
  background: oklch(0.82 0.14 84 / 0.12); color: var(--gold);
  font-family: "JetBrains Mono"; letter-spacing: 0.03em;
}
.row-online{
  font-size: 11px; color: var(--ink-3);
}

.list-empty{
  padding: 60px 18px; text-align: center;
  color: var(--ink-4); font-size: 12.5px;
}
.list-empty .ic{ font-size: 22px; opacity: .5; margin-bottom: 10px; }

/* online pill (after list scroll) */
.online-rail{
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  flex: 0 0 auto;
}
.online-pill{
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 11px; border-radius: 8px;
  background: oklch(0.13 0.012 264);
  border: 1px solid var(--border);
  color: var(--ink-2); font-size: 12px;
  transition: all .18s var(--ease);
}
.online-pill:hover{ border-color: var(--accent-line); color: var(--ink); }
.online-pill .ic{ color: var(--accent); font-size: 14px; }
.online-pill.hidden{ display: none; }

/* ==========================================================
   MAP
   ========================================================== */
.map-pane{
  grid-area: map; position: relative;
  min-height: 0; min-width: 0;
  background: var(--canvas);
}
#map{ position: absolute; inset: 0; }
.leaflet-container{
  background: oklch(0.10 0.012 264);
  font-family: inherit;
  outline: none;
}
.leaflet-control-attribution{
  background: oklch(0.12 0.012 264 / 0.7) !important;
  color: var(--ink-4) !important; font-size: 9px !important;
  padding: 1px 6px !important; border-radius: 4px 0 0 0 !important;
  font-family: "JetBrains Mono" !important;
}
.leaflet-control-attribution a{ color: var(--ink-3) !important; }
.leaflet-bar{ border: none !important; box-shadow: var(--shadow-sm) !important; }
.leaflet-bar a{
  background: oklch(0.18 0.014 264 / 0.92) !important;
  color: var(--ink-2) !important;
  border: 1px solid var(--border-strong) !important;
  border-bottom: none !important;
  backdrop-filter: blur(8px);
  width: 32px !important; height: 32px !important;
  line-height: 30px !important; font-size: 16px !important;
  font-family: inherit !important;
}
.leaflet-bar a:hover{ background: oklch(0.24 0.015 264 / 0.95) !important; color: var(--ink) !important; }
.leaflet-bar a:first-child{ border-top-left-radius: 8px !important; border-top-right-radius: 8px !important; }
.leaflet-bar a:last-child{
  border-bottom-left-radius: 8px !important; border-bottom-right-radius: 8px !important;
  border-bottom: 1px solid var(--border-strong) !important;
}

/* dim the basemap so events pop */
.leaflet-tile-pane{ filter: brightness(0.86) saturate(0.85); }
/* labels layer */
.labels-pane{ pointer-events: none; opacity: 0; transition: opacity .35s var(--ease); }
.labels-pane.visible{ opacity: 1; }

/* event marker */
.evt-icon{ background: none !important; border: none !important; transition: opacity .28s var(--ease); }
.evt-icon:has(.pin.below-min){ opacity: .18; }
.pin.below-min{ filter: saturate(0); transition: filter .28s var(--ease); }
.evt-icon:focus,
.leaflet-interactive:focus,
.leaflet-marker-icon:focus{ outline: none !important; }

.pin{
  position: relative;
  width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid oklch(1 0 0 / 0.85);
  display: flex; align-items: center; justify-content: center;
  color: oklch(0.98 0 0); font-family: "JetBrains Mono"; font-weight: 600; font-size: 10.5px;
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.55);
  background: var(--bg);
  cursor: pointer;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
  will-change: transform;
}
.pin.est{ border-style: dashed; border-color: oklch(1 0 0 / 0.7); }
.pin::after{
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 14px 2px var(--glow);
  opacity: var(--glow-on, 0);
  transition: opacity .25s var(--ease);
}
.pin:hover{ transform: scale(1.14); z-index: 1000; }
.pin:hover::after{ opacity: 1; }
.leaflet-marker-icon:focus-visible .pin,
.pin:focus-visible{
  outline: none;
  box-shadow: 0 0 0 2px oklch(1 0 0 / 0.85), 0 0 0 5px var(--glow);
}
.pin.top::before{
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  box-shadow: 0 0 0 1.5px oklch(1 0 0 / 0.35);
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse{
  0%   { transform: scale(.9); opacity: .7; }
  70%  { transform: scale(1.65); opacity: 0; }
  100% { transform: scale(1.65); opacity: 0; }
}
.pin.sel{
  transform: scale(1.24); z-index: 1200;
  box-shadow: 0 0 0 3px oklch(1 0 0 / 0.55), 0 0 0 7px var(--glow), 0 0 22px 4px var(--glow);
}

/* cluster */
.cluster-wrap{ background: none !important; }
.cluster{
  position: relative; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: oklch(0.98 0 0); font-family: "JetBrains Mono"; font-weight: 600;
  background: radial-gradient(circle at 30% 28%, oklch(0.32 0.018 264 / 0.94), oklch(0.18 0.015 264 / 0.94));
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 4px var(--glow), 0 8px 28px -8px rgb(0 0 0 / 0.6);
  backdrop-filter: blur(2px);
  transition: transform .22s var(--ease);
}
.cluster::before{
  content: ""; position: absolute; inset: 4px; border-radius: 50%;
  border: 1px dashed oklch(1 0 0 / 0.18);
}
.cluster:hover{ transform: scale(1.08); }
.cluster.fading{ opacity: 0; transform: scale(.7); transition: opacity .22s var(--ease), transform .22s var(--ease); }
.cluster .n{ position: relative; z-index: 2; }
.cluster .split{
  position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%);
  display: flex; width: 56%; height: 3px; border-radius: 2px;
  overflow: hidden; gap: 1px;
}
.cluster .split b{ background: var(--c); border-radius: 2px; }

/* leaflet tooltip — our own */
.evt-tip{
  background: oklch(0.18 0.014 264 / 0.96) !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: 9px !important;
  box-shadow: var(--shadow) !important;
  color: var(--ink) !important;
  padding: 9px 12px !important;
  font-family: "Inter" !important;
  backdrop-filter: blur(10px);
}
.evt-tip::before{ border-top-color: var(--border-strong) !important; }
.evt-tip .tt-name{ font-size: 12.5px; font-weight: 600; color: var(--ink); }
.evt-tip .tt-meta{
  font-size: 11px; color: var(--ink-3); margin-top: 3px;
  font-family: "JetBrains Mono";
}
.evt-tip .tt-score{
  font-size: 10.5px; font-weight: 600; margin-top: 4px;
  font-family: "JetBrains Mono";
}
.evt-tip .tt-score.mauve{ color: var(--mauve); }
.evt-tip .tt-score.emerald{ color: var(--emerald); }

/* map overlays */
.map-legend{
  position: absolute; left: 16px; bottom: 16px; z-index: 600;
  padding: 12px 14px; border-radius: var(--r);
  background: oklch(0.155 0.014 264 / 0.84);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-size: 11.5px; color: var(--ink-3);
  display: flex; flex-direction: column; gap: 7px;
  box-shadow: var(--shadow);
  min-width: 200px;
}
.lg-row{ display: flex; align-items: center; gap: 8px; }
.lg-row .dot{
  width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto;
}
.lg-row .dot.mauve{ background: var(--mauve); box-shadow: 0 0 8px var(--mauve-glow); }
.lg-row .dot.emerald{ background: var(--emerald); box-shadow: 0 0 8px var(--emerald-glow); }
.lg-bar{
  display: flex; align-items: center; gap: 8px; padding-top: 8px;
  border-top: 1px dashed var(--border-strong);
}
.lg-bar .gradient{
  flex: 1; height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, oklch(0.42 0.04 305), oklch(0.74 0.22 305));
  border: 1px solid var(--border);
}
body.acc-emerald .lg-bar .gradient{ background: linear-gradient(90deg, oklch(0.42 0.04 158), oklch(0.78 0.18 158)); }
.lg-bar .min, .lg-bar .max{ font-family: "JetBrains Mono"; color: var(--ink-4); font-size: 10px; }

.map-floating{
  position: absolute; right: 16px; top: 16px; z-index: 600;
  display: flex; flex-direction: column; gap: 8px;
}
.map-fab{
  width: 36px; height: 36px; border-radius: 9px;
  background: oklch(0.18 0.014 264 / 0.92);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-2); transition: all .2s var(--ease);
}
.map-fab:hover{ color: var(--ink); background: oklch(0.24 0.015 264 / 0.95); transform: translateY(-1px); }
.map-fab:focus-visible{ outline: none; box-shadow: 0 0 0 2px var(--accent); }
.map-fab svg{ width: 16px; height: 16px; }

/* ==========================================================
   TIMELINE
   ========================================================== */
.tl-strip{
  grid-area: tl;
  background: oklch(0.135 0.014 264 / 0.85);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 10px 22px 8px;
  display: flex; flex-direction: column;
  position: relative; z-index: 5;
}
.tl-head{
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 5px;
}
.tl-head .lbl{
  font-size: 10px; color: var(--ink-4);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600;
}
.tl-head .hint{
  font-size: 11.5px; color: var(--ink-3);
  font-family: "JetBrains Mono"; transition: opacity .2s;
}
.timeline{
  position: relative; height: 24px;
  margin-top: 2px;
}
.tl-axis{
  position: absolute; left: 0; right: 0; top: 12px; height: 1px;
  background: var(--border-strong);
}
.tl-month{
  position: absolute; top: 16px; transform: translateX(-50%);
  font-size: 9.5px; color: var(--ink-4);
  font-family: "JetBrains Mono"; letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
}
.tl-month::before{
  content: ""; position: absolute; left: 50%; top: -6px;
  width: 1px; height: 4px; background: var(--border-strong);
}
.tl-dot{
  position: absolute; top: 12px;
  width: 8px; height: 8px; border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: transform .15s var(--ease);
  border: 1.5px solid oklch(0.13 0.014 264);
}
.tl-dot.est{ border-style: dashed; }
.tl-dot.mauve{ background: var(--mauve); }
.tl-dot.emerald{ background: var(--emerald); }
.tl-dot:hover,
.tl-dot.sel{
  transform: translate(-50%, -50%) scale(1.65);
  z-index: 5;
}
.tl-dot.sel{ box-shadow: 0 0 0 2px oklch(1 0 0 / 0.6); }
.tl-dot:focus-visible{ outline: none; box-shadow: 0 0 0 2px var(--accent); }

/* ==========================================================
   DRAWER (event detail)
   ========================================================== */
.scrim{
  position: fixed; inset: 0;
  background: oklch(0.10 0.014 264 / 0.55);
  backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden;
  transition: opacity .35s var(--ease), visibility .35s;
  z-index: 9990;
}
.scrim.show{ opacity: 1; visibility: visible; }

.drawer{
  position: fixed; top: 0; right: 0; height: 100vh;
  width: var(--drawer-w); max-width: 92vw;
  z-index: 10000;
  background-color: #151a28;
  border-left: 1px solid var(--border-strong);
  box-shadow: -28px 0 60px -20px rgb(0 0 0 / 0.7);
  transform: translateX(100%);
  transition: transform .42s var(--ease);
  display: flex; flex-direction: column;
  isolation: isolate;
}
.drawer-bg{
  position: absolute; inset: 0;
  background-color: #151a28;
  z-index: 0;
  pointer-events: none;
}
.dr-close, .dr-body{ position: relative; z-index: 2; }
.drawer::-webkit-scrollbar{ width: 6px; }
.drawer::-webkit-scrollbar-thumb{ background: oklch(1 0 0 / 0.10); border-radius: 3px; }
.drawer.open{ transform: none; }
.drawer::before{
  content: ""; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; z-index: 4;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.dr-close{
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3);
  border: 1px solid var(--border);
  background: oklch(0.13 0.014 264 / 0.7);
  z-index: 5;
  transition: all .18s var(--ease);
}
.dr-close:hover{ color: var(--ink); background: oklch(0.20 0.014 264 / 0.85); }

.dr-body{
  padding: 30px 30px 36px;
  background-color: #151a28;
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: oklch(1 0 0 / 0.10) transparent;
}
.dr-body::-webkit-scrollbar{ width: 6px; }
.dr-body::-webkit-scrollbar-thumb{ background: oklch(1 0 0 / 0.10); border-radius: 3px; }

.dr-mission{
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 4px 10px; border-radius: 20px;
  margin-bottom: 14px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
}
.dr-mission .dot{
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.dr-name{
  font-size: 26px; font-weight: 600; line-height: 1.12;
  letter-spacing: -0.02em; color: var(--ink);
  margin-bottom: 8px;
  text-wrap: pretty;
}
.dr-loc{
  font-size: 13.5px; color: var(--ink-3);
  margin-bottom: 18px;
}
.dr-loc .region{ color: var(--ink-4); margin-left: 4px; }

/* venue card */
.dr-venue{
  display: flex; gap: 12px;
  padding: 13px 14px;
  border-radius: var(--r);
  background: oklch(0.13 0.012 264 / 0.55);
  border: 1px solid var(--border);
  margin-bottom: 22px;
}
.dv-pin{ font-size: 16px; flex: 0 0 auto; opacity: 0.85; }
.dv-text{ min-width: 0; flex: 1; }
.dv-name{
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  margin-bottom: 3px;
}
.dv-addr{
  font-size: 12px; color: var(--ink-3); line-height: 1.45;
  font-family: "JetBrains Mono"; letter-spacing: -0.005em;
}
.dv-link{
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 8px;
  font-size: 11.5px; font-weight: 500;
  color: var(--accent);
  transition: opacity .18s;
}
.dv-link:hover{ opacity: 0.7; }
.dv-online{
  display: inline-block; margin-top: 8px;
  font-size: 11.5px; color: var(--ink-4); font-style: italic;
}

/* score box */
.dr-scorebox{
  display: flex; align-items: center; gap: 16px;
  padding: 16px; border-radius: var(--r);
  background: oklch(0.13 0.012 264 / 0.55);
  border: 1px solid var(--border);
  margin-bottom: 22px;
}
.score-ring{
  width: 64px; height: 64px; border-radius: 50%;
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--ring) calc(var(--p) * 1%), oklch(1 0 0 / 0.08) 0);
  position: relative;
}
.score-ring::before{
  content: ""; position: absolute; inset: 5px; border-radius: 50%;
  background: oklch(0.17 0.014 264);
}
.score-ring span{
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
}
.score-big{
  font-family: "JetBrains Mono"; font-weight: 600;
  font-size: 22px; line-height: 1; color: var(--ink);
}
.score-out{
  font-family: "JetBrains Mono"; font-size: 8.5px;
  color: var(--ink-4); margin-top: 1px;
}
.score-txt h3{
  font-size: 13px; font-weight: 600; color: var(--ink);
  margin-bottom: 3px;
}
.score-txt p{
  font-size: 12px; color: var(--ink-3); line-height: 1.55;
}

/* grid stats */
.dr-grid{
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-bottom: 22px;
}
.dr-cell{
  padding: 11px 13px; border-radius: 10px;
  background: oklch(0.13 0.012 264 / 0.55);
  border: 1px solid var(--border);
}
.dr-cell .k{
  font-size: 9.5px; color: var(--ink-4);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 5px; font-weight: 600;
}
.dr-cell .v{ font-size: 13px; font-weight: 500; color: var(--ink); }
.dr-cell .v.mono{ font-family: "JetBrains Mono"; }
.dr-cell .v.warn{ color: var(--gold); }
.dr-cell .v.ok{ color: oklch(0.78 0.16 158); }

/* budget block */
.dr-budget{
  padding: 16px 17px; border-radius: var(--r);
  background: oklch(0.13 0.012 264 / 0.55);
  border: 1px solid var(--border);
  margin-bottom: 22px;
}
.db-head{
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--ink-3); margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: baseline;
}
.db-head .nb{ color: var(--ink-4); font-weight: 400; letter-spacing: 0; text-transform: none; font-size: 11px; }
.db-row{
  display: grid; grid-template-columns: 22px 1fr auto; gap: 11px;
  align-items: start;
  padding: 9px 0; border-bottom: 1px dashed var(--border);
}
.db-row:last-of-type{ border-bottom: none; }
.db-ic{ font-size: 14px; line-height: 1.35; text-align: center; opacity: 0.85; }
.db-k{ font-size: 12.5px; font-weight: 500; color: var(--ink); }
.db-sub{ font-size: 11px; color: var(--ink-4); line-height: 1.45; margin-top: 2px; }
.db-v{ font-family: "JetBrains Mono"; font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; padding-top: 1px; font-variant-numeric: tabular-nums; }
.db-total{
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border-strong);
}
.db-total span{
  font-size: 11px; font-weight: 600; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.db-total strong{
  font-family: "JetBrains Mono"; font-size: 18px; font-weight: 600; color: var(--ink);
}
.db-disc{
  font-size: 10px; color: var(--ink-4); margin-top: 10px; line-height: 1.45;
}

/* why */
.dr-why{ margin-bottom: 22px; }
.dr-why h3{
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--accent); margin-bottom: 8px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.dr-why h3::before{
  content: ""; width: 14px; height: 1.5px; background: currentColor; border-radius: 1px;
}
.dr-why p{
  font-size: 14.5px; line-height: 1.6; color: var(--ink-2);
  text-wrap: pretty;
}
.dr-why p .serif{ color: var(--accent); }

.dr-tags{
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 22px;
}
.dr-tag{
  font-size: 10.5px; padding: 4px 9px; border-radius: 7px;
  background: oklch(1 0 0 / 0.03); border: 1px solid var(--border);
  color: var(--ink-3);
  font-family: "JetBrains Mono";
  letter-spacing: 0.02em;
}
.dr-tag.ok{ color: oklch(0.78 0.16 158); background: oklch(0.74 0.16 158 / 0.08); border-color: var(--emerald-line); }
.dr-tag.warn{ color: var(--gold); background: oklch(0.82 0.14 84 / 0.08); border-color: oklch(0.82 0.14 84 / 0.34); }

/* actions */
.dr-actions{
  display: flex; flex-direction: column; gap: 8px;
}
.dr-add{
  width: 100%; padding: 12px; border-radius: var(--r);
  font-size: 13.5px; font-weight: 600;
  color: var(--ink);
  background: oklch(1 0 0 / 0.05);
  border: 1px solid var(--border-strong);
  transition: all .2s var(--ease);
}
.dr-add:hover{ background: oklch(1 0 0 / 0.10); }
.dr-add.on{
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
}
.dr-link{
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px; border-radius: var(--r);
  font-size: 13.5px; font-weight: 600;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: oklch(0.16 0.012 264);
  border: 1px solid var(--accent);
  transition: all .2s var(--ease);
}
.dr-link:hover{
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -10px var(--accent-glow);
}

/* push behavior on desktop */
@media (min-width: 1100px){
  body{ transition: padding-right .42s var(--ease); }
  body.drawer-open{ padding-right: var(--drawer-w); }
  body.drawer-open .scrim{ display: none !important; }
  .drawer{ box-shadow: none; }
}

/* PLANNING VIEW */
#viewPlanner.active{
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 50px 1fr auto;
  grid-template-areas:
    "ptools ptools"
    "pcal   pmap"
    "pdock  pdock";
  height: 100%;
}

/* toolbar */
.pl-tools{
  grid-area: ptools;
  display: flex; align-items: center; gap: 12px;
  padding: 0 22px;
  background: oklch(0.135 0.014 264 / 0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.pl-scenarios{
  display: flex; align-items: center; gap: 8px;
}
.pl-lbl{
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--ink-4); font-weight: 600;
}
.pl-select{
  background: oklch(0.12 0.012 264);
  border: 1px solid var(--border);
  color: var(--ink); font-size: 13px; font-weight: 500;
  border-radius: 7px; padding: 5px 26px 5px 10px;
  outline: none; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 8px center;
}
.pl-mini{
  width: 28px; height: 28px; border-radius: 7px;
  border: 1px solid var(--border); background: oklch(0.13 0.014 264);
  color: var(--ink-3); font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .18s var(--ease);
}
.pl-mini svg{ width: 14px; height: 14px; }
.pl-mini:hover{ color: var(--ink); border-color: var(--border-strong); background: oklch(0.18 0.014 264); }
.pl-mini.danger:hover{ color: var(--rose); border-color: oklch(0.74 0.18 22 / 0.34); }

.pl-tools .spacer{ flex: 1; }

/* compare overlay */
.pl-compare{
  position: absolute; top: 56px; left: 22px; right: 22px;
  margin-top: 8px;
  border: 1px solid var(--border-strong); border-radius: var(--r-lg);
  background: oklch(0.17 0.014 264);
  box-shadow: var(--shadow-lg);
  z-index: 30;
  overflow: hidden;
  display: none;
}
.pl-compare.show{ display: block; }
.cmp-head{
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--ink);
}
.cmp-close{ width: 26px; height: 26px; border-radius: 5px; color: var(--ink-3); }
.cmp-close:hover{ background: oklch(1 0 0 / 0.05); color: var(--ink); }
.cmp-tbl{ width: 100%; border-collapse: collapse; font-size: 13px; }
.cmp-tbl th{
  text-align: left; padding: 10px 16px;
  color: var(--ink-4); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.cmp-tbl td{
  padding: 11px 16px; border-top: 1px solid var(--border);
  color: var(--ink-2);
}
.cmp-tbl td.mono{ font-family: "JetBrains Mono"; color: var(--ink); }
.cmp-tbl tr.cur{ background: oklch(1 0 0 / 0.03); }
.cmp-tbl tr.cur td:first-child{ color: var(--ink); font-weight: 600; }
.cmp-tag{
  font-family: "JetBrains Mono"; font-size: 9.5px;
  padding: 1px 6px; border-radius: 4px;
  background: oklch(0.82 0.14 84 / 0.14); color: var(--gold);
  margin-left: 6px; text-transform: uppercase; letter-spacing: 0.04em;
}

/* calendar */
.pl-cal{
  grid-area: pcal; overflow-y: auto;
  padding: 16px 18px 20px;
  background: oklch(0.14 0.014 264);
  border-right: 1px solid var(--border);
  scrollbar-width: thin;
}
.pl-cal::-webkit-scrollbar{ width: 6px; }
.pl-cal::-webkit-scrollbar-thumb{ background: oklch(1 0 0 / 0.10); border-radius: 3px; }
.cal-top{
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.cal-title{
  font-size: 18px; font-weight: 600; color: var(--ink);
  letter-spacing: -0.012em; min-width: 158px;
}
.cal-title .yr{ color: var(--ink-4); font-weight: 400; }
.cal-nav{
  width: 28px; height: 28px; border-radius: 6px;
  border: 1px solid var(--border); background: oklch(0.13 0.014 264);
  color: var(--ink-3); display: flex; align-items: center; justify-content: center;
  transition: all .18s var(--ease);
}
.cal-nav:hover:not(:disabled){ color: var(--ink); border-color: var(--border-strong); }
.cal-nav:disabled{ opacity: .3; cursor: default; }
.cal-nav svg{ width: 14px; height: 14px; }
.cal-mmeta{
  margin-left: auto; font-size: 11.5px; color: var(--ink-4);
}
.cal-mmeta b{ color: var(--ink); font-family: "JetBrains Mono"; font-weight: 600; }

.cal-dow{
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px;
}
.cal-dow span{
  font-size: 10px; color: var(--ink-4);
  padding: 4px 8px 8px;
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
}

.cal-grid{
  display: grid; grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(78px, 1fr); gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  min-height: 460px;
}
.cal-day{
  background: oklch(0.155 0.014 264);
  padding: 5px 6px;
  display: flex; flex-direction: column; gap: 3px;
  overflow: hidden;
  transition: background .18s ease;
}
.cal-day:hover{ background: oklch(0.18 0.014 264); }
.cal-day.out{ background: oklch(0.12 0.012 264); }
.cal-day.out .cd-num{ opacity: 0.35; }
.cd-num{
  font-size: 11px; color: var(--ink-3);
  font-family: "JetBrains Mono"; font-variant-numeric: tabular-nums;
}
.cal-day.has .cd-num{ color: var(--ink); font-weight: 600; }
.cal-day.today .cd-num{
  color: var(--accent);
  display: inline-block; padding: 1px 6px;
  background: var(--accent-soft);
  border-radius: 4px;
  align-self: flex-start;
}

.cd-evs{ display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.cal-chip{
  display: flex; align-items: center; gap: 5px;
  padding: 3px 6px; border-radius: 5px;
  background: oklch(1 0 0 / 0.04);
  border-left: 2px solid var(--mk);
  cursor: pointer; text-align: left;
  transition: background .15s ease;
  max-width: 100%;
}
.cal-chip:hover{ background: oklch(1 0 0 / 0.08); }
.cal-chip:focus-visible{ outline: none; box-shadow: 0 0 0 2px var(--accent); }
.cal-chip.on{
  background: var(--mk);
  border-left-color: oklch(1 0 0 / 0.7);
}
.cal-chip .cc-name{
  font-size: 10.5px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1 1 auto;
}
.cal-chip.on .cc-name{ color: oklch(0.12 0.012 264); font-weight: 600; }
.cal-chip .cc-ck{
  font-size: 9px; color: oklch(0.12 0.012 264);
  font-weight: 700;
}
.cal-chip.est{ border-left-style: dashed; }
.cal-more{
  font-size: 9.5px; color: var(--ink-4); padding-left: 4px;
  font-family: "JetBrains Mono";
}

/* itinerary map */
.pl-map{
  grid-area: pmap; position: relative;
  min-height: 0; background: var(--canvas);
  overflow: hidden;
}
#plMap{ position: absolute; inset: 0; }
.plmap-legend{
  position: absolute; top: 14px; left: 14px; z-index: 610;
  display: flex; gap: 12px;
  padding: 6px 11px; border-radius: 7px;
  background: oklch(0.15 0.014 264 / 0.85);
  border: 1px solid var(--border-strong);
  font-size: 10.5px; color: var(--ink-3);
  backdrop-filter: blur(8px);
  font-family: "JetBrains Mono"; letter-spacing: 0.02em;
}
.plmap-legend .home{ color: var(--ink); font-weight: 600; }

.plmap-bar{
  position: absolute; left: 16px; right: 16px; bottom: 16px;
  z-index: 620;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--r);
  background: oklch(0.15 0.014 264 / 0.92);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.plm-play, .plm-replay{
  width: 30px; height: 30px; border-radius: 7px; flex: 0 0 auto;
  border: 1px solid var(--border-strong);
  background: oklch(1 0 0 / 0.04);
  color: var(--ink-2); transition: all .2s var(--ease);
  display: flex; align-items: center; justify-content: center;
}
.plm-play:hover, .plm-replay:hover{ background: oklch(1 0 0 / 0.08); color: var(--ink); }
.plm-play.playing{
  background: var(--accent); border-color: var(--accent); color: oklch(0.16 0.012 264);
}
.plm-play svg, .plm-replay svg{ width: 13px; height: 13px; }
.plm-scrub{
  flex: 1 1 auto; height: 4px; border-radius: 3px;
  background: oklch(1 0 0 / 0.08); overflow: hidden;
}
.plm-scrub-fill{
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--mauve), var(--emerald));
  transition: width .15s linear;
}
.plm-step{
  font-size: 11px; color: var(--ink-3);
  font-family: "JetBrains Mono"; min-width: 130px; text-align: right;
}

.plmap-empty{
  position: absolute; inset: 0; z-index: 640;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-align: center;
  color: var(--ink-4);
  background: oklch(0.14 0.014 264 / 0.9);
  pointer-events: none;
}
.plmap-empty .ic{
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: oklch(0.18 0.014 264);
  border: 1px solid var(--border);
  font-size: 22px; opacity: 0.7;
}
.plmap-empty p{ font-size: 12.5px; line-height: 1.6; max-width: 220px; }
.plmap-empty p b{ color: var(--ink-2); font-weight: 500; }
.pl-map.has-trip .plmap-empty{ display: none; }
.pl-map:not(.has-trip) .plmap-bar,
.pl-map:not(.has-trip) .plmap-legend{ display: none; }

/* itinerary markers */
.itin-home-ic, .itin-pin-ic, .itin-veh-ic{ background: none !important; border: none !important; }
.itin-home{
  display: flex; align-items: center; gap: 6px;
  filter: drop-shadow(0 2px 4px rgb(0 0 0 / 0.6));
  transform: translate(-50%, -50%);
}
.itin-home .pulse{
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 3px oklch(0.97 0 0 / 0.2), 0 0 0 6px oklch(0.97 0 0 / 0.08);
  position: relative;
}
.itin-home b{
  font-size: 10.5px; font-weight: 600; color: var(--ink);
  background: oklch(0.16 0.014 264 / 0.92);
  padding: 3px 8px; border-radius: 6px;
  border: 1px solid var(--border-strong);
  font-family: "JetBrains Mono"; letter-spacing: 0.02em;
}
.itin-pin{
  position: relative;
  width: 22px; height: 22px;
  transform: translate(-11px, -11px);
}
.itin-num{
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--mk); color: oklch(0.12 0.012 264);
  font-family: "JetBrains Mono"; font-weight: 600; font-size: 10.5px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px oklch(0.13 0.014 264), 0 0 12px var(--mk);
}
.itin-pin .itin-lbl{
  position: absolute; left: 28px; top: 11px;
  transform: translateY(calc(-50% + var(--ly, 0px)));
  font-family: "JetBrains Mono"; font-size: 10px; font-weight: 500;
  color: var(--ink); letter-spacing: 0.02em;
  background: oklch(0.16 0.014 264 / 0.85);
  padding: 2px 7px; border-radius: 5px;
  border: 1px solid var(--border-strong);
  white-space: nowrap;
  pointer-events: none;
  transition: transform .25s var(--ease);
}
.itin-pin.arrived .itin-num{ animation: itinBounce .55s var(--ease); }
@keyframes itinBounce{
  0%   { transform: scale(.4); opacity: 0; }
  60%  { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}
.itin-veh{
  font-size: 16px; transform: translate(-50%, -50%);
  filter: drop-shadow(0 1px 3px rgb(0 0 0 / 0.6));
}

/* bottom dock */
.pl-dock{
  grid-area: pdock;
  background: oklch(0.135 0.014 264 / 0.92);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(14px);
}
.pld-bar{
  width: 100%; display: flex; align-items: center; gap: 14px;
  padding: 11px 22px;
  text-align: left;
  font-size: 12.5px;
  color: var(--ink-2);
  transition: background .15s ease;
}
.pld-bar:hover{ background: oklch(1 0 0 / 0.02); }
.pld-caret{
  color: var(--ink-3); font-size: 10px;
  transition: transform .25s var(--ease);
  width: 12px;
}
.pl-dock:not(.collapsed) .pld-caret{ transform: rotate(90deg); }
.pld-line{ flex: 1; font-weight: 500; }
.pld-line b{ font-family: "JetBrains Mono"; color: var(--ink); }
.pld-hint{
  font-size: 10px; color: var(--ink-4);
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
}
.pld-panel{
  max-height: 0; overflow: hidden;
  transition: max-height .35s var(--ease);
}
.pl-dock:not(.collapsed) .pld-panel{
  max-height: 52vh; overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: oklch(1 0 0 / 0.10) transparent;
}
.pld-panel::-webkit-scrollbar{ width: 6px; }
.pld-panel::-webkit-scrollbar-thumb{ background: oklch(1 0 0 / 0.10); border-radius: 3px; }

.pl-summary{
  padding: 8px 22px 22px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px 28px;
  align-items: start;
}
.pl-summary .empty{
  grid-column: 1 / -1;
  text-align: center; color: var(--ink-4);
  padding: 30px 12px;
}
.pl-summary .empty .ic{
  font-size: 26px; opacity: 0.5; margin-bottom: 10px;
}
.pl-summary .empty p{ font-size: 13px; line-height: 1.55; }
.pl-summary .empty b{ color: var(--ink-2); }

.pls-block{ margin-bottom: 0; }
.pls-block h4{
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--ink-4); margin-bottom: 9px; font-weight: 600;
}
.pls-total{
  padding: 13px 14px; border-radius: var(--r);
  background: oklch(1 0 0 / 0.03);
  border: 1px solid var(--border);
}
.pls-total .lbl{
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--ink-4); font-weight: 600; margin-bottom: 5px;
}
.pls-total .v{
  font-family: "JetBrains Mono"; font-size: 19px; font-weight: 600; color: var(--ink);
  letter-spacing: -0.01em;
}

.plb-row{
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 12px; color: var(--ink-3);
}
.plb-row:last-child{ border-bottom: none; }
.plb-row .lbl{ display: flex; align-items: center; gap: 8px; }
.plb-row .ic{ width: 16px; text-align: center; opacity: 0.85; }
.plb-row b{ font-family: "JetBrains Mono"; color: var(--ink); font-weight: 600; }

.pls-warn{
  font-size: 11.5px; padding: 8px 11px; border-radius: 7px;
  margin-bottom: 5px; line-height: 1.5;
}
.pls-warn.over{
  background: oklch(0.74 0.18 22 / 0.12);
  border: 1px solid oklch(0.74 0.18 22 / 0.3);
  color: oklch(0.82 0.16 22);
}
.pls-warn.tight{
  background: oklch(0.82 0.14 84 / 0.10);
  border: 1px solid oklch(0.82 0.14 84 / 0.3);
  color: var(--gold);
}
.pls-ok{
  font-size: 11.5px; color: oklch(0.78 0.16 158);
  display: flex; align-items: center; gap: 6px;
}
.pls-grp{
  font-size: 11.5px; padding: 8px 11px; border-radius: 7px;
  background: oklch(1 0 0 / 0.03); border: 1px solid var(--border);
  color: var(--ink-3); margin-bottom: 5px;
}
.pls-grp b{ color: var(--ink); }

.pls-list{ display: flex; flex-direction: column; gap: 5px; }
.pls-item{
  display: grid; grid-template-columns: 8px 1fr auto 22px;
  align-items: center; gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  background: oklch(1 0 0 / 0.025);
  border: 1px solid var(--border);
}
.pli-dot{ width: 8px; height: 8px; border-radius: 50%; }
.pli-main{ min-width: 0; }
.pli-name{
  display: block; font-size: 12px; font-weight: 500; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pli-date{
  display: block; font-size: 10.5px; color: var(--ink-4);
  font-family: "JetBrains Mono";
}
.pli-bud{
  font-size: 10.5px; color: var(--ink-4); font-family: "JetBrains Mono";
  white-space: nowrap;
}
.pli-rm{
  width: 22px; height: 22px; border-radius: 5px;
  color: var(--ink-4); font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.pli-rm:hover{ background: oklch(0.74 0.18 22 / 0.18); color: oklch(0.82 0.16 22); }

.plc-chart{
  display: flex; align-items: flex-end; gap: 3px;
  height: 60px; padding: 6px;
  border-radius: 9px;
  background: oklch(1 0 0 / 0.02);
  border: 1px solid var(--border);
}
.plc-col{
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  height: 100%;
}
.plc-barwrap{ flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.plc-bar{
  width: 70%; border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--mauve), var(--emerald));
  transition: height .5s var(--ease);
  min-height: 1px;
}
.plc-bar.empty{ background: oklch(1 0 0 / 0.06); }
.plc-col span{
  font-size: 8.5px; color: var(--ink-4);
  font-family: "JetBrains Mono"; letter-spacing: 0.04em;
}

/* ==========================================================
   ACCENT THEME SWITCH (clipping mode)
   ========================================================== */
body.acc-emerald{
  --accent: var(--emerald);
  --accent-2: var(--emerald-2);
  --accent-soft: var(--emerald-soft);
  --accent-line: var(--emerald-line);
  --accent-glow: var(--emerald-glow);
}
body.acc-emerald .rail-brand::after{
  background: var(--emerald); box-shadow: 0 0 12px var(--emerald);
  animation-name: pingE;
}
@keyframes pingE{
  0%   { box-shadow: 0 0 12px var(--emerald), 0 0 0 0 oklch(0.74 0.16 158 / 0.5); }
  70%  { box-shadow: 0 0 12px var(--emerald), 0 0 0 14px oklch(0.74 0.16 158 / 0); }
  100% { box-shadow: 0 0 12px var(--emerald), 0 0 0 0 oklch(0.74 0.16 158 / 0); }
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 1100px){
  :root{ --rail-w: 56px; --drawer-w: 380px; }
  .stats{ display: none; }
}
@media (max-width: 900px){
  #viewMap.active{ grid-template-columns: 1fr; grid-template-rows: 1fr var(--tl-h); grid-template-areas: "map" "tl"; }
  .list-pane{ display: none; }
  #viewPlanner.active{ grid-template-columns: 1fr; grid-template-rows: 50px 1fr 240px auto; grid-template-areas: "ptools" "pcal" "pmap" "pdock"; }
  .pl-cal{ border-right: none; border-bottom: 1px solid var(--border); }
  .search{ display: none; }
}
