/* Venues — clean, standard UI */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e5e7eb;
  --border-2: #d1d5db;
  --text: #111827;
  --text-2: #374151;
  --muted: #6b7280;
  --faint: #9ca3af;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --red: #dc2626; --red-soft: #fef2f2;
  --amber: #b45309; --amber-soft: #fffbeb;
  --green: #047857; --green-soft: #ecfdf5;
  /* fields: dot / soft background / text */
  --nlp: #3b82f6; --nlp-bg: #eff6ff; --nlp-fg: #1d4ed8;
  --ml: #10b981; --ml-bg: #ecfdf5; --ml-fg: #047857;
  --dm: #f59e0b; --dm-bg: #fffbeb; --dm-fg: #b45309;
  --stats: #8b5cf6; --stats-bg: #f5f3ff; --stats-fg: #6d28d9;
  --bench: #f43f5e; --bench-bg: #fff1f2; --bench-fg: #be123c;
  --tier-top-bg: #fef3c7; --tier-top-fg: #92400e; --tier-top-bd: #fcd34d;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-lg: 0 20px 50px -12px rgba(16, 24, 40, .25);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Archivo", "Inter", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  /* the board */
  --board: #0e0f12; --board-2: #15171c; --board-line: #262931; --board-text: #f1f0ea; --board-muted: #8d909a;
  --flap: #1b1d23; --flap-top: #24272e; --digit: #ffd23f; --signal: #ffd23f; --signal-ink: #1a1600; --alarm: #ff5a3c;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117; --surface: #161b22; --surface-2: #1c2129; --border: #2a3039; --border-2: #3a414b;
    --text: #e6edf3; --text-2: #c9d1d9; --muted: #8b949e; --faint: #6e7681;
    --primary: #4f8cff; --primary-hover: #6ea0ff; --primary-soft: rgba(79, 140, 255, .14);
    --red: #f87171; --red-soft: rgba(248, 113, 113, .14); --amber: #fbbf24; --amber-soft: rgba(251, 191, 36, .13);
    --green: #34d399; --green-soft: rgba(52, 211, 153, .13);
    --nlp-bg: rgba(59,130,246,.15); --nlp-fg: #93c5fd; --ml-bg: rgba(16,185,129,.15); --ml-fg: #6ee7b7;
    --dm-bg: rgba(245,158,11,.15); --dm-fg: #fcd34d; --stats-bg: rgba(139,92,246,.17); --stats-fg: #c4b5fd;
    --bench-bg: rgba(244,63,94,.15); --bench-fg: #fda4af;
    --tier-top-bg: rgba(251, 191, 36, .16); --tier-top-fg: #fcd34d; --tier-top-bd: rgba(251, 191, 36, .4);
    --board: #08090b; --board-2: #101216;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 20px 50px -12px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 14px/1.5 var(--font); font-feature-settings: "cv11", "ss01"; }
body.noscroll { overflow: hidden; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.f-nlp { --c: var(--nlp); --c-bg: var(--nlp-bg); --c-fg: var(--nlp-fg); }
.f-ml { --c: var(--ml); --c-bg: var(--ml-bg); --c-fg: var(--ml-fg); }
.f-dm { --c: var(--dm); --c-bg: var(--dm-bg); --c-fg: var(--dm-fg); }
.f-stats { --c: var(--stats); --c-bg: var(--stats-bg); --c-fg: var(--stats-fg); }
.f-bench { --c: var(--bench); --c-bg: var(--bench-bg); --c-fg: var(--bench-fg); }

/* ───────── buttons, pills */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-2);
  background: var(--surface); color: var(--text); font-weight: 500; font-size: 13.5px; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow); }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--text); border-color: var(--text); color: var(--surface); }
.btn.primary:hover { background: var(--text-2); }
.btn.signal { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); font-weight: 600; box-shadow: none; }
.btn.signal:hover { background: #ffdf6b; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.icon-btn { width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: var(--c-bg, var(--surface-2)); color: var(--c-fg, var(--text-2)); white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; display: inline-block; }
.tier { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 22px; padding: 0 7px; border-radius: 6px;
  font-size: 12px; font-weight: 700; border: 1px solid var(--border-2); color: var(--muted); background: var(--surface); }
.tier.t-top { background: var(--tier-top-bg); color: var(--tier-top-fg); border-color: var(--tier-top-bd); }
.tier.t-a { background: var(--surface-2); color: var(--text-2); }
.kind-tag { font-size: 10.5px; font-weight: 600; color: var(--muted); border: 1px solid var(--border); border-radius: 5px; padding: 0 5px; margin-left: 6px;
  vertical-align: 1px; text-transform: uppercase; letter-spacing: .03em; }
.count { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font: 600 11.5px var(--mono);
  background: var(--surface-2); color: var(--text-2); white-space: nowrap; border: 1px solid var(--border); }
.count.urgent { background: var(--red-soft); color: var(--red); border-color: transparent; }
.count.soon { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.count.past { background: transparent; color: var(--faint); }
span.est { color: var(--muted); font-weight: 500; }
.est-tag { font-size: 11px; font-weight: 500; color: var(--muted); border: 1px dashed var(--border-2); border-radius: 5px; padding: 0 5px; margin-left: 6px; white-space: nowrap; }

/* ───────── dark nav */
.topnav { background: var(--board); color: var(--board-text); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--board-line); }
.topnav-inner { display: flex; align-items: center; gap: 30px; height: 60px; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--board-text); }
.brand:hover { text-decoration: none; }
.logo { width: 15px; height: 15px; background: var(--signal); transform: rotate(45deg); border-radius: 2px; margin: 0 3px; box-shadow: 0 0 18px rgba(255, 210, 63, .35); }
.wordmark { font: 800 22px/1 var(--display); font-stretch: 125%; letter-spacing: -.035em; }
.tabs { display: flex; gap: 2px; height: 100%; }
.tabs a { display: flex; align-items: center; padding: 0 13px; color: var(--board-muted); font-weight: 500; border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--board-text); text-decoration: none; }
.tabs a.on { color: var(--board-text); border-bottom-color: var(--signal); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.sync { font-size: 12.5px; color: var(--board-muted); display: inline-flex; align-items: center; gap: 7px; }
.sync::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 8px #34d399; }
.sync.stale::before { background: var(--signal); box-shadow: 0 0 8px var(--signal); }

/* ───────── hero: the departure board */
.hero { background-color: var(--board); color: var(--board-text); padding: 26px 0 30px;
  background-image: radial-gradient(rgba(255, 255, 255, .045) 1px, transparent 1.2px); background-size: 16px 16px; }
.hero[hidden] { display: none; }
.board-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.kicker { font: 600 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--signal); }
.kicker span { color: var(--board-muted); letter-spacing: .06em; }
.hero h1 { margin: 6px 0 0; font: 750 clamp(26px, 3.4vw, 40px)/1.05 var(--display); font-stretch: 118%; letter-spacing: -.03em; }
.clock { text-align: right; font-family: var(--mono); }
.clock b { display: block; font-size: 26px; font-weight: 700; letter-spacing: .02em; color: var(--board-text); font-variant-numeric: tabular-nums; }
.clock span { font-size: 11.5px; color: var(--board-muted); text-transform: uppercase; letter-spacing: .08em; }
.board { background: var(--board-2); border: 1px solid var(--board-line); border-radius: 14px; overflow: hidden; box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .7); }
.board-cols, #departures li { display: grid; grid-template-columns: 170px minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1.05fr) 128px; gap: 18px; align-items: center; padding: 0 20px; }
.board-cols { height: 34px; font: 600 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--board-muted); border-bottom: 1px solid var(--board-line); }
#departures { list-style: none; margin: 0; padding: 0; }
#departures li { min-height: 58px; border-bottom: 1px solid var(--board-line); cursor: pointer; transition: background .12s; }
#departures li:last-child { border-bottom: 0; }
#departures li:hover { background: rgba(255, 255, 255, .03); }
#departures .left { display: flex; align-items: center; gap: 9px; }
#departures .unit { font: 600 10.5px var(--mono); letter-spacing: .1em; color: var(--board-muted); text-transform: uppercase; }
#departures .v { font: 700 18px var(--display); font-stretch: 112%; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 10px; }
#departures .v .dot { width: 8px; height: 8px; }
#departures .k { color: #c8c9cf; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#departures .due { font: 500 13px var(--mono); color: var(--board-text); white-space: nowrap; }
#departures .due small { display: block; color: var(--board-muted); font-size: 11px; }
#departures .empty { display: block; padding: 22px 20px; color: var(--board-muted); cursor: default; }
.status { display: inline-flex; align-items: center; gap: 7px; justify-self: start; font: 700 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase;
  padding: 5px 9px; border-radius: 6px; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.final { color: #ff7a5c; background: rgba(255, 90, 60, .14); }
.status.final::before { animation: blink 1s steps(2, start) infinite; }
.status.closing { color: #ffb347; background: rgba(255, 179, 71, .12); }
.status.sched { color: #4ade80; background: rgba(74, 222, 128, .1); }
.status.est { color: var(--signal); background: transparent; box-shadow: inset 0 0 0 1px rgba(255, 210, 63, .45); }
@keyframes blink { to { visibility: hidden; } }

/* split-flap digits */
.flaps { display: inline-flex; gap: 2px; perspective: 300px; }
.flaps i { font-style: normal; position: relative; display: inline-grid; place-items: center; width: 24px; height: 32px; border-radius: 4px;
  background: linear-gradient(var(--flap-top) 50%, var(--flap) 50%); color: var(--digit); font: 700 20px/1 var(--mono);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .05); }
.flaps i::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0, 0, 0, .65); }
.flaps.anim i { animation: flip .5s cubic-bezier(.3, 1.4, .5, 1) both; animation-delay: calc(var(--n) * 45ms); transform-origin: 50% 50%; }
@keyframes flip { from { transform: rotateX(-90deg); filter: brightness(1.8); } }
.flaps.urgent i { color: var(--alarm); }
.flaps.est i { color: #d8c27a; }
.flaps.sm i { width: 16px; height: 22px; font-size: 13.5px; border-radius: 3px; }
.flaps.na i { color: #555963; }

/* ───────── toolbar */
.toolbar { padding: 14px 16px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 12px; }
.tb-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.search { position: relative; flex: 1 1 240px; max-width: 380px; }
.search input { width: 100%; height: 36px; border: 1px solid var(--border-2); border-radius: 8px; padding: 0 12px 0 34px; background: var(--surface); font-size: 13.5px; }
.search input:focus, .tb-select:focus { outline: 3px solid var(--primary-soft); border-color: var(--primary); }
.search svg { position: absolute; left: 11px; top: 10px; color: var(--faint); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 28px; padding: 0 11px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
.tb-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.fchip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); font-size: 13px; color: var(--text-2); cursor: pointer; }
.fchip:hover { border-color: var(--border-2); }
.fchip.on { background: var(--c-bg, var(--primary-soft)); color: var(--c-fg, var(--primary)); border-color: var(--c, var(--primary)); font-weight: 500; }
.fchip .dot { width: 8px; height: 8px; }
.chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--primary); width: 15px; height: 15px; margin: 0; }
.tb-select { height: 32px; border: 1px solid var(--border-2); border-radius: 8px; padding: 0 8px; background: var(--surface); font-size: 13px; }
.tb-spacer { flex: 1; }
.result-count { font-size: 12.5px; color: var(--muted); }
.legend { display: inline-flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-dl { width: 9px; height: 9px; transform: rotate(45deg); background: var(--muted); display: inline-block; border-radius: 1px; }
.lg-ev { width: 16px; height: 8px; border-radius: 3px; background: var(--muted); display: inline-block; }
.lg-ms { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--muted); display: inline-block; }
.lg-est { width: 16px; height: 8px; border-radius: 3px; border: 1px dashed var(--muted); display: inline-block; }

/* ───────── venue table */
.table-card { overflow: hidden; }
.vt { width: 100%; border-collapse: collapse; }
.vt th { text-align: left; font: 600 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.vt td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.vt tbody tr:last-child td { border-bottom: 0; }
.vt th.r, .vt td.r { text-align: right; }
.vt .c-star { width: 44px; padding-right: 0; }
.vrow { cursor: pointer; transition: background .1s; }
.vrow:hover { background: var(--surface-2); }
.vrow.active { background: var(--primary-soft); }
.group-row td { background: var(--surface); padding: 20px 12px 8px 16px; }
.gh { display: flex; align-items: center; gap: 10px; font: 700 15px var(--display); font-stretch: 112%; color: var(--text); letter-spacing: -.01em; }
.gh .dot { width: 10px; height: 10px; border-radius: 2px; transform: rotate(45deg); }
.gh small { font: 500 11.5px var(--mono); color: var(--faint); }
.vn b { font: 700 15.5px var(--display); font-stretch: 112%; letter-spacing: -.01em; }
.vn .nm { display: block; font-size: 12.5px; color: var(--muted); max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fields { display: flex; flex-wrap: wrap; gap: 4px; }
.when { font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sub { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
.line { display: flex; align-items: center; gap: 8px; }
.na { color: var(--faint); }
.rolling { color: var(--green); font-weight: 500; }
.star { border: 0; background: transparent; cursor: pointer; color: var(--border-2); font-size: 18px; line-height: 1; padding: 4px 6px; border-radius: 6px; }
.star:hover { color: #f59e0b; background: var(--amber-soft); }
.star.on { color: #f59e0b; }

/* ───────── drawer */
.drawer-wrap[hidden] { display: none; }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 40; animation: fade .15s ease-out; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(660px, 100%); background: var(--surface); z-index: 41; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; animation: slide .18s ease-out; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(24px); opacity: .6; } }
.dr-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--border); display: flex; gap: 16px; align-items: flex-start; }
.dr-head .titles { flex: 1; min-width: 0; }
.dr-head .pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.dr-head h2 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.dr-head p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.dr-head .acts { display: flex; gap: 6px; align-items: center; }
.dr-body { overflow-y: auto; padding: 20px 24px 40px; flex: 1; }
.dr-body .lede { font-size: 15px; color: var(--text-2); margin: 0 0 18px; line-height: 1.55; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 26px; }
.stat { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); min-width: 0; }
.stat span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.stat b { display: block; font-size: 15px; font-weight: 600; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.stat small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-sec { margin-bottom: 26px; }
.dr-sec h3 { font-size: 13px; font-weight: 600; margin: 0 0 10px; color: var(--text); }
.dr-sec p { margin: 0; color: var(--text-2); line-height: 1.6; }
.ed { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
.ed-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.ed-h b { font-size: 14px; font-weight: 600; }
.ed-h .meta { font-size: 12.5px; color: var(--muted); }
.ed-h .st { margin-left: auto; }
.st { font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.st.open { background: var(--green-soft); color: var(--green); }
.st.now { background: var(--primary-soft); color: var(--primary); }
.st.closed { background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
.st.past { background: transparent; color: var(--faint); border: 1px solid var(--border); }
.kd { list-style: none; margin: 0; padding: 4px 14px; }
.kd li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 7px 0; font-size: 13px; }
.kd li + li { border-top: 1px dashed var(--border); }
.kd .mk { width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--faint); justify-self: center; }
.kd li.subm .mk { background: var(--c, var(--primary)); border-color: var(--c, var(--primary)); transform: rotate(45deg); border-radius: 1px; }
.kd li.subm .lb { font-weight: 600; }
.kd .dt { color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.kd .dt small { color: var(--muted); margin-left: 4px; }
.kd li.gone .lb, .kd li.gone .dt { color: var(--faint); font-weight: 400; }
.kd li.gone .mk { background: transparent; border-color: var(--border-2); transform: none; border-radius: 50%; }
.ed-note { padding: 2px 14px 11px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.rolling-box { border-radius: 10px; padding: 14px 16px; background: var(--green-soft); color: var(--green); }
.rolling-box b { display: block; font-size: 14px; }
.rolling-box span { font-size: 13px; }
.papers { list-style: none; margin: 0; padding: 0; }
.papers li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.papers li:first-child { padding-top: 0; }
.papers li:last-child { border-bottom: 0; }
.papers a { font-weight: 500; color: var(--text); line-height: 1.4; }
.papers a:hover { color: var(--primary); }
.papers span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.facts { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; margin: 0; font-size: 13px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; color: var(--text-2); }
.links { display: flex; flex-wrap: wrap; gap: 8px; }

/* ───────── dates: list */
.dl-list { overflow: hidden; }
.month { background: var(--surface-2); border-bottom: 1px solid var(--border); padding: 9px 16px; font-weight: 600; font-size: 13px; display: flex; gap: 8px; }
.month span { color: var(--muted); font-weight: 500; }
.items { list-style: none; margin: 0; padding: 0; }
.item { display: grid; grid-template-columns: 52px 18px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--border); cursor: pointer; }
.item:hover { background: var(--surface-2); }
.datebox { text-align: center; line-height: 1.1; }
.datebox small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .03em; }
.datebox b { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mk-deadline { width: 10px; height: 10px; background: var(--c); transform: rotate(45deg); border-radius: 2px; justify-self: center; }
.mk-event { width: 16px; height: 8px; border-radius: 3px; background: var(--c); justify-self: center; }
.mk-milestone { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--c); justify-self: center; }
.item.est .mk-deadline { background: transparent; box-shadow: inset 0 0 0 2px var(--c); }
.item.est .mk-event { background: transparent; border: 1.5px dashed var(--c); }
.item .title { font-weight: 600; }
.item .title span { font-weight: 400; color: var(--text-2); }
.item .meta { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.item.past { opacity: .55; }

/* ───────── dates: calendar */
.cal { overflow: hidden; }
.cal-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.cal-head h3 { margin: 0 auto 0 0; font-size: 17px; font-weight: 600; }
.cal-dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cal-dow span { padding: 7px 10px; font-size: 12px; font-weight: 500; color: var(--muted); }
.cal-week { position: relative; min-height: 118px; border-bottom: 1px solid var(--border); }
.cal-week:last-child { border-bottom: 0; }
.cal-bg { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-bg div + div { border-left: 1px solid var(--border); }
.cal-bg .out { background: var(--surface-2); }
.cal-bg .today { background: var(--primary-soft); }
.cal-fg { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: min-content; row-gap: 3px; padding: 6px 0 10px; }
.cal-fg .dn { grid-row: 1; font-size: 12px; padding: 0 10px 3px; color: var(--text-2); font-weight: 500; }
.cal-fg .dn.out { color: var(--faint); }
.cal-fg .dn.today b { background: var(--primary); color: #fff; border-radius: 999px; padding: 1px 7px; }
.bar { background: var(--c-bg); color: var(--c-fg); border-left: 3px solid var(--c); font-size: 11.5px; font-weight: 600; padding: 2px 7px; margin: 0 4px;
  border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.bar.cl { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-width: 0; }
.bar.cr { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.bar.est { background: transparent; border: 1px dashed var(--c); border-left: 3px solid var(--c); }
.chipc { display: flex; align-items: center; gap: 5px; font-size: 11.5px; margin: 0 4px; padding: 1px 6px; border-radius: 5px; background: var(--surface);
  border: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; color: var(--text-2); }
.chipc::before { content: ""; flex: none; width: 7px; height: 7px; background: var(--c); transform: rotate(45deg); border-radius: 1px; }
.chipc.ms::before { transform: none; border-radius: 50%; background: transparent; border: 1.5px solid var(--c); width: 5px; height: 5px; }
.chipc.est { border-style: dashed; }
.chipc.est::before { background: transparent; border: 1.5px solid var(--c); width: 5px; height: 5px; }
.chipc:hover, .bar:hover { box-shadow: 0 0 0 1px var(--c); }

/* ───────── dates: year */
.yr { overflow: hidden; }
.yr-axis, .yr-row { display: grid; grid-template-columns: 140px minmax(0, 1fr); }
.yr-axis { background: var(--surface-2); border-bottom: 1px solid var(--border); }
.yr-axis .scale { position: relative; height: 34px; }
.yr-axis .m { position: absolute; top: 9px; font-size: 12px; color: var(--muted); padding-left: 6px; }
.yr-axis .m.y { color: var(--text); font-weight: 600; }
.yr-body { position: relative; }
.yr-lines { position: absolute; left: 140px; right: 0; top: 0; bottom: 0; pointer-events: none; }
.yr-lines i { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--border); }
.yr-lines .now { border-left: 2px solid var(--red); z-index: 1; }
.yr-row { height: 38px; border-bottom: 1px solid var(--border); align-items: center; }
.yr-row:last-child { border-bottom: 0; }
.yr-row:hover { background: var(--surface-2); }
.yr-name { padding: 0 12px 0 16px; font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yr-track { position: relative; height: 100%; }
.y-ev { position: absolute; top: 12px; height: 14px; border-radius: 4px; background: var(--c); min-width: 6px; cursor: pointer; }
.y-ev.est { background: var(--c-bg); border: 1px dashed var(--c); }
.y-dl { position: absolute; top: 13px; width: 12px; height: 12px; margin-left: -6px; background: var(--c); transform: rotate(45deg); border-radius: 2px;
  box-shadow: 0 0 0 2px var(--surface); cursor: pointer; }
.y-dl.est { background: var(--surface); box-shadow: inset 0 0 0 2px var(--c), 0 0 0 2px var(--surface); }
.y-ms { position: absolute; top: 15px; width: 8px; height: 8px; margin-left: -4px; border: 2px solid var(--c); border-radius: 50%; background: var(--surface); }
.y-lbl { position: absolute; top: 11px; font-size: 11.5px; color: var(--text-2); white-space: nowrap; pointer-events: none; font-weight: 500; }

/* ───────── changes */
.log { list-style: none; margin: 0; padding: 0; }
.log li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.log li:last-child { border-bottom: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 13px; background: var(--primary-soft); color: var(--primary); text-transform: uppercase; }
.avatar.seed, .avatar.auto { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.log .head { font-size: 13.5px; }
.log .head b { font-weight: 600; }
.log .act { color: var(--muted); }
.log ul { margin: 6px 0 0; padding: 8px 10px; list-style: none; background: var(--surface-2); border-radius: 8px; font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-2); }
.log .src { font-size: 12px; color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
.log time { font-size: 12px; color: var(--muted); white-space: nowrap; }

.empty-state { padding: 48px 20px; text-align: center; color: var(--muted); }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }

/* ───────── export dialog */
dialog { border: 0; padding: 0; border-radius: 14px; background: var(--surface); color: var(--text); width: min(560px, calc(100% - 32px)); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(15, 23, 42, .4); }
.export header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 6px; }
.export h3 { margin: 0; font-size: 17px; font-weight: 600; }
.ex-group { padding: 12px 22px; display: grid; grid-template-columns: 90px 1fr; gap: 12px; align-items: start; }
.ex-label { font-size: 12.5px; color: var(--muted); font-weight: 500; padding-top: 6px; }
.ex-options { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { position: relative; cursor: pointer; }
.opt input { position: absolute; opacity: 0; }
.opt span { display: inline-flex; gap: 6px; align-items: center; height: 32px; padding: 0 12px; border: 1px solid var(--border-2); border-radius: 8px; font-size: 13px; }
.opt em { font-style: normal; color: var(--muted); }
.opt input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 500; }
.opt input:disabled + span { opacity: .45; cursor: not-allowed; }
.opt input:focus-visible + span { outline: 3px solid var(--primary-soft); }
.ex-checks { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; padding-top: 5px; }
.ex-checks.row { flex-direction: row; flex-wrap: wrap; gap: 6px 16px; }
.ex-checks label { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.ex-checks input { accent-color: var(--primary); }
.ex-sub { margin: 8px 22px 4px; padding: 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.ex-sub b { font-size: 13.5px; }
.ex-sub p { margin: 3px 0 10px; font-size: 12.5px; color: var(--muted); }
.copyline { display: flex; gap: 8px; align-items: center; }
.copyline code { flex: 1; min-width: 0; font-size: 11.5px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 7px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.export footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 20px; }

.foot { padding-top: 28px; padding-bottom: 40px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; }
.foot p { margin: 0; font-size: 12.5px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--surface); padding: 10px 16px;
  border-radius: 8px; font-size: 13px; z-index: 60; box-shadow: var(--shadow-lg); }

/* ───────── responsive */
@media (max-width: 1100px) { .vt .c-acc, .vt .c-h5 { display: none; } }
@media (max-width: 900px) {
  .vt .c-fields { display: none; }
  .sync { display: none; }
}
@media (max-width: 680px) {
  .container { padding: 0 14px; }
  .topbar-inner { gap: 10px; height: 56px; }
  .brand-text small { display: none; }
  .tabs a { padding: 0 8px; font-size: 13.5px; }
  .top-actions .btn span { display: none; }
  .top-actions .btn { padding: 0 10px; }
  .deadline-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vt thead { display: none; }
  .vt, .vt tbody { display: block; }
  .vt tr.vrow { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: "s n t" ". d d" ". e e"; gap: 4px 8px; padding: 12px 10px;
    border-bottom: 1px solid var(--border); }
  .vt tr.vrow td { padding: 0; border: 0; }
  .vt td.c-star { grid-area: s; } .vt td.c-name { grid-area: n; } .vt td.c-tier { grid-area: t; } .vt td.c-due { grid-area: d; } .vt td.c-meet { grid-area: e; }
  .vt tr.group-row { display: block; } .vt tr.group-row td { display: block; }
  .vn .nm { white-space: normal; }
  .sub { max-width: none; }
  .dr-head { padding: 16px; } .dr-body { padding: 16px 16px 32px; }
  .item { grid-template-columns: 44px 14px minmax(0, 1fr); padding: 10px 12px; }
  .item .count { grid-column: 3; justify-self: start; }
  .cal-week { min-height: 86px; }
  .bar, .chipc { font-size: 10px; padding: 1px 3px; margin: 0 2px; }
  .chipc::before { display: none; }
  .yr-axis, .yr-row { grid-template-columns: 76px minmax(0, 1fr); }
  .yr-lines { left: 76px; }
  .yr-name { padding-left: 10px; font-size: 12px; }
  .y-lbl { display: none; }
  .ex-group { grid-template-columns: 1fr; gap: 6px; }
  .foot { grid-template-columns: 1fr; gap: 10px; }
}

/* table: countdown cell */
.duecell { display: flex; align-items: center; gap: 8px; }
.duecell .u { font: 600 10.5px var(--mono); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.duecell + .sub { margin-top: 4px; }
.vt td.r { font: 500 13px var(--mono); }
.when { font-family: var(--mono); font-size: 13px; }

/* drawer header = a board */
.dr-head { background: var(--board); color: var(--board-text); border-bottom: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .045) 1px, transparent 1.2px); background-size: 16px 16px; flex-wrap: wrap; }
.dr-head h2 { font: 800 34px/1.05 var(--display); font-stretch: 122%; letter-spacing: -.035em; }
.dr-head p { color: var(--board-muted); }
.dr-head .icon-btn { color: var(--board-muted); }
.dr-head .icon-btn:hover { background: rgba(255, 255, 255, .08); color: var(--board-text); }
.dr-head .star:hover { background: rgba(255, 210, 63, .12); }
.dr-head .btn.primary { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.dr-count { width: 100%; display: flex; align-items: center; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--board-line); }
.dr-count .lbl { font: 600 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--board-muted); }
.dr-count .what { font-size: 13.5px; color: var(--board-text); }
.dr-count .what small { display: block; color: var(--board-muted); font: 500 12px var(--mono); }
.dr-count .status { margin-left: auto; }
.dr-sec h3 { font: 600 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stat span { font: 600 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.stat b { font-family: var(--mono); font-size: 14.5px; }
.ed-h b { font: 700 15px var(--display); font-stretch: 110%; }
.kd .dt { font: 500 12.5px var(--mono); }

/* dates list: dark day tiles */
.datebox { background: var(--board); border-radius: 8px; padding: 6px 0 7px; width: 48px; }
.datebox small { color: var(--board-muted); font: 600 9.5px var(--mono); letter-spacing: .1em; }
.datebox b { color: var(--board-text); font: 700 19px var(--mono); }
.item.past .datebox b { color: var(--board-muted); }
.month { font: 700 15px var(--display); font-stretch: 112%; letter-spacing: -.01em; padding: 11px 16px; }
.month span { font: 500 12px var(--mono); }
.item .title { font-family: var(--display); font-stretch: 106%; }
.cal-head h3 { font: 750 20px var(--display); font-stretch: 116%; letter-spacing: -.02em; }
.cal-dow span, .yr-axis .m { font: 600 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.yr-name { font-family: var(--display); font-stretch: 108%; }
.yr-lines .now { border-left-color: var(--alarm); }
.cal-fg .dn { font-family: var(--mono); }
.cal-fg .dn.today b { background: var(--board); color: var(--signal); }
.cal-bg .today { background: rgba(255, 210, 63, .14); }

@media (max-width: 900px) {
  .board-cols, #departures li { grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1fr) 118px; }
  .board-cols span:nth-child(3), #departures .k { display: none; }
}
@media (max-width: 680px) {
  .topnav-inner { gap: 12px; height: 54px; }
  .wordmark { font-size: 19px; }
  .tabs a { padding: 0 8px; font-size: 13.5px; }
  .top-actions .btn span, .sync { display: none; }
  .clock { display: none; }
  .board-cols { display: none; }
  #departures li { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "c v" "c d"; gap: 2px 14px; padding: 10px 14px; }
  #departures .left { grid-area: c; } #departures .v { grid-area: v; font-size: 16px; } #departures .due { grid-area: d; }
  #departures .status, #departures .k { display: none; }
  .flaps i { width: 20px; height: 28px; font-size: 17px; }
  .dr-head h2 { font-size: 28px; }
}

/* ───────── extras used on all sizes */
.cal-agenda { display: none; border-top: 1px solid var(--border); }
.yr-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.yr-inner { min-width: 760px; }
.yr-name { position: sticky; left: 0; z-index: 2; background: var(--surface); align-self: stretch; }
.yr-row:hover .yr-name { background: var(--surface-2); }
.yr-axis > span:first-child { position: sticky; left: 0; z-index: 2; background: var(--surface-2); }
.it-main { min-width: 0; }
html, body { overflow-x: clip; }

/* ───────── phones */
@media (max-width: 680px) {
  body { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .container { padding: 0 14px; }
  /* bottom tab bar */
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(60px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--board); border-top: 1px solid var(--board-line); gap: 0; }
  .tabs a { flex: 1; justify-content: center; font-size: 13.5px; font-weight: 600; border-bottom: 0; border-top: 2px solid transparent; padding: 0; }
  .tabs a.on { border-top-color: var(--signal); color: var(--board-text); }
  .topnav-inner { height: 52px; }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .top-actions .btn { height: 34px; padding: 0 12px; }
  .top-actions .btn span { display: inline; font-size: 13px; }

  /* board */
  .hero { padding: 18px 0 20px; }
  .board-head { margin-bottom: 12px; }
  .hero h1 { font-size: 25px; }
  #departures li { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "c v s" "c d d"; gap: 1px 12px; padding: 10px 12px; min-height: 0; }
  #departures .status { display: inline-flex; grid-area: s; font-size: 9px; padding: 3px 6px; letter-spacing: .06em; }
  #departures .status::before { width: 5px; height: 5px; }
  #departures .unit { font-size: 9.5px; }
  #departures .left { gap: 6px; }
  #departures .due small { display: none; }
  .flaps i { width: 19px; height: 27px; font-size: 16px; }

  /* toolbar: swipeable rows instead of wrapping walls of chips */
  .toolbar { padding: 12px; gap: 10px; margin-bottom: 14px; }
  .tb-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px; }
  .tb-row::-webkit-scrollbar { display: none; }
  .tb-row:first-child { flex-wrap: wrap; overflow: visible; }
  .search { flex: 1 1 100%; max-width: none; }
  .tb-row > * { flex: none; }
  .tb-row .chips { flex-wrap: nowrap; }
  .tb-spacer, .result-count, .legend { display: none; }

  /* overview rows: name on top, deadline | conference side by side */
  .vt tr.vrow { grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1fr) auto; grid-template-areas: "s n n t" ". d e e"; gap: 6px 10px; padding: 12px 10px; }
  .vn .nm { white-space: nowrap; }
  .vt td.c-meet .when { font-size: 12.5px; }
  .group-row td { padding: 16px 10px 8px; }

  /* drawer */
  .drawer { width: 100%; }
  .dr-head { padding: 14px 14px 14px 16px; gap: 10px; }
  .dr-head h2 { font-size: 28px; }
  .dr-head .acts { gap: 2px; }
  .dr-count { flex-wrap: wrap; gap: 8px 12px; }
  .dr-count .tl { display: none; }
  .dr-count .cnt { display: inline-flex; align-items: center; gap: 8px; }
  .dr-count .status { margin-left: auto; }
  .dr-count .what { order: 3; flex-basis: 100%; }
  .dr-body { padding: 16px 16px 28px; }
  .stats { grid-template-columns: 1fr; gap: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
  .stat { display: flex; align-items: baseline; gap: 10px; border: 0; border-radius: 0; padding: 9px 12px; }
  .stat + .stat { border-top: 1px solid var(--border); }
  .stat span { flex: none; width: 110px; }
  .stat b { margin: 0; font-size: 13.5px; }
  .stat small { margin-left: auto; }
  .ed-h { padding: 10px 12px; }
  .ed-h .st { margin-left: 0; }
  .kd { padding: 2px 12px; }
  .kd li { grid-template-columns: 14px minmax(0, 1fr) auto; grid-template-areas: "m l c" ". t t"; gap: 2px 10px; }
  .kd .mk { grid-area: m; } .kd .lb { grid-area: l; } .kd .dt { grid-area: t; font-size: 12px; } .kd li > .count { grid-area: c; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 8px; }

  /* dates */
  .item { grid-template-columns: 44px 12px minmax(0, 1fr) auto; gap: 10px; padding: 10px 12px; }
  .item .count { grid-column: auto; }
  .datebox { width: 44px; }
  .item .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cal-head { padding: 10px 12px; }
  .cal-week { min-height: 58px; }
  .cal-fg { row-gap: 2px; padding: 4px 0 6px; }
  .cal-fg .dn { padding: 0 4px 2px; font-size: 11px; }
  .bar { font-size: 0; height: 6px; padding: 0; margin: 0 1px; border-left-width: 0; border-radius: 3px; background: var(--c); }
  .bar.est { background: transparent; border: 1px dashed var(--c); }
  .chipc { font-size: 0; height: 8px; width: 8px; padding: 0; margin: 1px 4px; border: 0; border-radius: 2px; background: var(--c); transform: rotate(45deg); }
  .chipc.est { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); }
  .chipc.ms { border-radius: 50%; transform: none; background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); }
  .chipc::before { display: none; }
  .cal-agenda { display: block; }
  .yr-inner { min-width: 720px; }
  .yr-axis, .yr-row { grid-template-columns: 84px minmax(0, 1fr); }
  .yr-lines { left: 84px; }
  .yr-name { padding-left: 10px; font-size: 12px; }
  .y-lbl { display: inline; }

  /* changes */
  .log li { grid-template-columns: 30px minmax(0, 1fr); gap: 10px; padding: 12px; }
  .log li > time { grid-column: 2; grid-row: 1; justify-self: end; font-size: 11px; }
  .log .head { padding-right: 70px; }
  .avatar { width: 28px; height: 28px; font-size: 12px; }

  /* export as a bottom sheet */
  dialog { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 16px 16px 0 0; max-height: 92vh; }
  .ex-group { padding: 10px 18px; }
  .ex-sub { margin: 8px 18px 4px; }
  .export header, .export footer { padding-left: 18px; padding-right: 18px; }
  .export footer { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
}
@media (max-width: 680px) {
  .tb-row > .search { flex: 1 1 100%; }
  .tb-row:first-child { gap: 10px; }
}
@media (max-width: 680px) {
  #departures li:nth-child(n+5) { display: none; }
}
