/* Dashboard styles. Colour tokens live in /theme.css (light base, [data-theme="dark"] override).
   Labels are sentence case, Inter 500/600, muted: no uppercase, no tracking. */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 13px; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
[class] { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-weight: 400; }
/* shared label style: panel headings, KPI labels, section labels */
.label, .panel-head, .kpi-label, .sect, .clock-label, .sr-kind, .stop .tm .est { font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0; text-transform: none; }

#map { position: fixed; inset: 0; }
.maplibregl-ctrl-attrib { background: var(--panel) !important; backdrop-filter: none !important; color: var(--dim) !important; font-size: 10px; }
.maplibregl-ctrl-attrib a { color: var(--muted) !important; }

/* panels over the map: plain translucent surfaces, 1px hairline, soft shadow (no blur, no inset highlight) */
.glass {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}

/* ---------- boot ---------- */
#boot { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--bg); transition: opacity .9s ease, visibility .9s; }
#boot.done { opacity: 0; visibility: hidden; }
.boot-inner { width: min(440px, 86vw); }
.boot-logo { font-size: 28px; font-weight: 700; letter-spacing: -.02em; display: flex; align-items: center; gap: 12px; }
.boot-sub { color: var(--muted); margin: 8px 0 22px; font-size: 13px; }
.boot-bar { height: 3px; background: var(--track); border-radius: 3px; overflow: hidden; }
#boot-progress { height: 100%; width: 0; background: var(--accent); transition: width .5s ease; }
.boot-log { margin-top: 16px; font-size: 12px; color: var(--muted); line-height: 1.8; min-height: 100px; }
.boot-log .ok { color: var(--ok); }

.logo-mark { width: 28px; height: 28px; flex: none; color: var(--text); }
.logo-mark.boot-mark { width: 40px; height: 40px; }
.slash, .accent { color: var(--accent); }

/* ---------- top bar ---------- */
.topbar { position: fixed; top: 14px; left: 14px; right: 14px; height: 58px; z-index: 10; display: flex; align-items: center; gap: 18px; padding: 0 16px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 230px; color: var(--text); text-decoration: none; }
.brand-title { font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.brand-sub { color: var(--muted); font-size: 11px; font-weight: 500; }
.live-pill { display: flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 600; color: var(--ok); padding: 6px 10px; border: 1px solid var(--ok-line); border-radius: 999px; }
.live-pill.stale { color: var(--d1); border-color: var(--d1); background: color-mix(in srgb, var(--d1) 12%, transparent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: pulse 1.6s infinite; display: inline-block; }
.dot.small { width: 6px; height: 6px; color: var(--ok); margin-right: 6px; vertical-align: middle; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 45%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.search { position: relative; flex: 1; max-width: 460px; display: flex; align-items: center; gap: 8px; background: var(--hover); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; height: 36px; color: var(--muted); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { flex: 1; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 13px; }
.search input::placeholder { color: var(--dim); }
.search-results { position: absolute; top: 44px; left: 0; right: 0; max-height: 380px; overflow: auto; padding: 6px; background: var(--panel-strong); }
.sr-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.sr-item:hover, .sr-item.sel { background: var(--accent-soft); }
.sr-kind { width: 54px; }
.sr-main { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-meta { margin-left: auto; display: flex; gap: 18px; align-items: center; }
.top-link { align-self: center; font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; }
.top-link:hover { color: var(--accent); border-color: var(--accent-line); }
.clock { display: flex; flex-direction: column; align-items: flex-end; font-size: 15px; font-weight: 600; letter-spacing: 0; }
.clock-label { font-size: 10px; }
.sweep { display: flex; flex-direction: column; align-items: flex-end; font-size: 12px; color: var(--muted); }
.sweep span:last-child { color: var(--text); margin-top: 3px; }

/* ---------- columns ---------- */
.col { position: fixed; top: 86px; bottom: 84px; width: 330px; z-index: 5; display: flex; flex-direction: column; gap: 12px; pointer-events: none; }
.col > * { pointer-events: auto; }
.left { left: 14px; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.left::-webkit-scrollbar { display: none; }
.left .panel.grow { flex: 1 0 auto; min-height: 220px; max-height: 420px; }
.right { right: 14px; width: 370px; }
.panel { padding: 14px; }
.panel.grow { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.panel-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; }
.panel-head .muted { font-weight: 400; font-size: 11px; }
.legend { display: flex; gap: 6px; align-items: center; font-weight: 400; font-size: 11px; color: var(--muted); }
.legend i { width: 8px; height: 3px; border-radius: 2px; display: inline-block; margin-left: 6px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.kpi-value { font-variant-numeric: tabular-nums; font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; margin-top: 2px; }
.kpi-value.sm { font-size: 19px; }
.kpi-value.warn { color: var(--d2); }
.kpi-value.bad { color: var(--d3); }
.kpi-sub { color: var(--muted); font-size: 11px; margin-top: 2px; }
.kpi.big { grid-column: 1; }
.ring-kpi { position: relative; display: grid; place-items: center; height: 76px; }
.ring { width: 76px; height: 76px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--track); stroke-width: 6; }
.ring-fg { fill: none; stroke: var(--d0); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 169.6; stroke-dashoffset: 169.6; transition: stroke-dashoffset 1s ease, stroke .5s; }
.ring-text { position: absolute; text-align: center; }
.ring-text .kpi-label { font-size: 9px; }

/* histogram */
.hist { display: flex; align-items: flex-end; gap: 3px; height: 74px; }
.hist .b { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; cursor: pointer; border-radius: 4px; transition: opacity .25s; }
.hist .b:hover { background: var(--hover); }
.hist.has-sel .b:not(.on) { opacity: .35; }
.hist .b.on { background: var(--hover-strong); }
.hist .b.on .lbl { color: var(--text); font-weight: 700; }
.hist .bar { width: 100%; border-radius: 3px 3px 1px 1px; min-height: 2px; transition: height .8s cubic-bezier(.2,.8,.2,1); }
.hist .lbl { position: absolute; bottom: -15px; left: 50%; transform: translateX(-50%); font-size: 9px; line-height: 1; white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.hist .cnt { font-size: 9px; color: var(--muted); margin-bottom: 2px; }
.hist + * { margin-top: 18px; }
#hist { margin-bottom: 14px; }

.trend { width: 100%; height: 80px; display: block; }

.countries { overflow: auto; flex: 1; min-height: 0; margin-right: -6px; padding-right: 6px; }
.crow { display: grid; grid-template-columns: 26px 1fr 42px 54px; align-items: center; gap: 8px; padding: 5px 4px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.crow:hover { background: var(--hover); }
.crow.on { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.crow.on .cname { color: var(--accent); }
.crow .flag { font-size: 17px; line-height: 1; text-align: center; }
.fl { font-family: "Twemoji Mozilla", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.fl-img { width: 20px; height: 15px; object-fit: cover; border-radius: 2px; vertical-align: -2px; box-shadow: 0 0 0 1px var(--line-strong); }
.crow .cbar { height: 5px; border-radius: 3px; background: var(--track); overflow: hidden; }
.crow .cbar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .8s; }
.crow .num { text-align: right; color: var(--text); }
.crow .del { text-align: right; font-size: 11px; }
.crow .cname { font-size: 10px; color: var(--muted); margin-bottom: 3px; }

/* leaders */
.leaders { display: flex; flex-direction: column; gap: 4px; }
.lrow { display: grid; grid-template-columns: 58px 1fr auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; cursor: pointer; background: var(--hover); }
.lrow:hover { background: color-mix(in srgb, var(--d3) 10%, transparent); }
.code { font-weight: 700; font-size: 11px; padding: 2px 6px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.code.train { background: var(--cyan-soft); color: var(--cyan); }
.lroute { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); font-size: 12px; }
.ldelay { font-weight: 700; }

/* feed */
.feed-panel { min-height: 0; }
.feed { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 2px; margin-right: -6px; padding-right: 6px; }
.ev { display: grid; grid-template-columns: 44px 10px 1fr; gap: 8px; align-items: baseline; padding: 6px 6px; border-radius: 6px; font-size: 12px; cursor: pointer; }
.ev.new { animation: evIn .5s ease; }
.ev:hover { background: var(--hover); }
.ev .t { font-size: 10.5px; color: var(--muted); }
.ev .i { width: 7px; height: 7px; border-radius: 50%; transform: translateY(-1px); }
.ev .x { color: var(--text-2); line-height: 1.35; }
@keyframes evIn { from { transform: translateX(14px); background: var(--accent-soft); } to { transform: none; background: transparent; } }

/* detail panel */
.detail { position: absolute; inset: 0; overflow: auto; z-index: 3; animation: slideIn .35s cubic-bezier(.2,.8,.2,1); background: var(--panel-solid); }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.d-top { display: flex; align-items: flex-start; gap: 10px; }
.d-code { font-weight: 700; font-size: 20px; padding: 6px 10px; border-radius: 9px; background: var(--accent); color: var(--on-accent); }
.d-code.train { background: var(--cyan); color: #fff; }
.d-title { flex: 1; min-width: 0; }
.d-route { font-size: 15px; font-weight: 700; line-height: 1.25; }
.d-sub { color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.x-btn { background: var(--hover); border: 1px solid var(--line); width: 28px; height: 28px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.x-btn:hover { background: var(--hover-strong); }
.d-status { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 10px; }
.d-stat { background: var(--hover); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.d-stat .v { font-size: 16px; font-weight: 700; margin-top: 3px; }
.prog { margin: 6px 0 4px; }
.prog-bar { height: 6px; background: var(--track); border-radius: 3px; position: relative; overflow: visible; }
.prog-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--accent); }
.prog-bar b { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--panel-solid); box-shadow: 0 0 0 3px var(--accent); }
.prog-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }
.d-actions { display: flex; gap: 6px; margin: 12px 0; }
.btn { flex: 1; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--hover); cursor: pointer; font-size: 12px; font-weight: 600; }
.btn:hover { background: var(--hover-strong); }
.btn.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.sect { margin: 14px 0 8px; font-weight: 600; }
.dprofile { height: 54px; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--line); position: relative; }
.dprofile i { flex: 1; border-radius: 2px 2px 0 0; min-height: 1px; }
.dprofile i.future { opacity: .35; }
.stops { position: relative; }
.stop { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; padding: 7px 0; position: relative; }
.stop::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--track); }
.stop:first-child::before { top: 14px; }
.stop:last-child::before { bottom: calc(100% - 14px); }
.stop.passed::before { background: var(--accent); opacity: .6; }
.stop .pin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--panel-solid); margin: 3px 0 0 3px; position: relative; z-index: 1; }
.stop.passed .pin { border-color: var(--accent); background: var(--accent); }
.stop.current .pin { border-color: var(--panel-solid); background: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); animation: pulse 1.6s infinite; }
.stop .sn { font-weight: 600; font-size: 12.5px; }
.stop .sc { color: var(--muted); font-size: 11px; margin-top: 1px; }
.stop.passed .sn { color: var(--muted); }
.stop .tm { text-align: right; font-size: 12px; }
.stop .tm s { color: var(--dim); font-size: 10.5px; display: block; text-decoration: line-through; }
.stop .tm .est { font-size: 9.5px; }
.stop .plat { font-size: 10px; color: var(--cyan); }

/* station board */
.board-tabs { display: flex; gap: 6px; margin: 12px 0 8px; }
.board { font-size: 12px; }
.brow { display: grid; grid-template-columns: 46px 64px 1fr 52px; gap: 8px; padding: 7px 4px; border-bottom: 1px solid var(--line); align-items: center; cursor: pointer; }
.brow:hover { background: var(--hover); }
.brow .tt { font-weight: 700; color: var(--d1); }
.brow .dst { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brow .st { text-align: right; font-size: 11px; }
.flip { display: inline-block; animation: flip .5s ease both; }
@keyframes flip { from { transform: rotateX(90deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* dock (reference control style: sentence case, 600, muted → text on hover) */
.dock { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 10; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; padding: 6px; border-radius: 12px; max-width: calc(100vw - 28px); }
.seg { display: flex; background: var(--hover); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button, .tog { background: none; border: 0; padding: 7px 12px; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.seg button:hover, .tog:hover { color: var(--text); background: var(--hover-strong); }
.seg button.on { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-line); }
.tog.on { color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.sep { width: 1px; height: 22px; background: var(--line-strong); }
/* [sources] operator filter */
#ops button small { font-size: 10px; font-weight: 600; color: var(--muted); margin-left: 5px; }
#ops button.on small { color: inherit; opacity: .8; }
#ops button.stale { opacity: .45; }
/* [/sources] */
/* [delay-filter] delay range control: label + dual-handle slider on one row, quick chips below */
.delay-ctl { display: flex; flex-direction: column; gap: 4px; padding: 2px 6px; min-width: 250px; }
.delay-row { display: flex; align-items: center; gap: 10px; }
.delay-label { font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; min-width: 96px; }
.delay-ctl.on .delay-label { color: var(--green); }
.range { position: relative; flex: 1; height: 20px; min-width: 120px; }
.range-track { position: absolute; left: 7px; right: 7px; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; background: var(--track); overflow: hidden; }
.range-fill { position: absolute; top: 0; bottom: 0; background: var(--green); border-radius: 2px; }
.range input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; background: none; appearance: none; -webkit-appearance: none; pointer-events: none; outline: 0; }
.range input[type=range]::-webkit-slider-runnable-track { background: transparent; height: 100%; }
.range input[type=range]::-moz-range-track { background: transparent; height: 100%; }
.range input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; pointer-events: auto; width: 14px; height: 14px; margin-top: 3px; border-radius: 50%; background: var(--panel-solid); border: 0; box-shadow: 0 0 0 2px var(--green), var(--shadow-soft); cursor: grab; }
.range input[type=range]::-moz-range-thumb { pointer-events: auto; width: 14px; height: 14px; border-radius: 50%; background: var(--panel-solid); border: 0; box-shadow: 0 0 0 2px var(--green), var(--shadow-soft); cursor: grab; }
.range input[type=range]:active::-webkit-slider-thumb { cursor: grabbing; }
.range input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--green), 0 0 0 5px var(--green-soft); }
.range input[type=range]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 2px var(--green), 0 0 0 5px var(--green-soft); }
.range input.top { z-index: 3; }
.chips { display: flex; gap: 3px; flex-wrap: nowrap; }
.chips button { background: var(--hover); border: 0; padding: 3px 8px; border-radius: 999px; cursor: pointer; font-size: 10.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.chips button:hover { color: var(--text); background: var(--hover-strong); }
.chips button.on { background: var(--green-soft); color: var(--green); box-shadow: inset 0 0 0 1px var(--green-line); }
.chips button[data-chip=nodata].on { background: var(--cyan-soft); color: var(--cyan); box-shadow: inset 0 0 0 1px var(--cyan-line); }
.kpi-filter { color: var(--green); font-weight: 600; }
@media (pointer: coarse) {
  .range { height: 28px; }
  .range input[type=range]::-webkit-slider-thumb { width: 20px; height: 20px; margin-top: 4px; }
  .range input[type=range]::-moz-range-thumb { width: 20px; height: 20px; }
  .chips button { padding: 6px 10px; font-size: 11.5px; }
}
/* [/delay-filter] */

.legend-box { position: fixed; bottom: calc(var(--dock-h, 56px) + 28px); left: 50%; transform: translateX(-50%); z-index: 4; display: flex; gap: 12px; padding: 6px 12px; border-radius: 999px; font-size: 10.5px; color: var(--muted); }
.lg { display: flex; align-items: center; gap: 5px; cursor: pointer; padding: 2px 6px; margin: -2px -2px; border-radius: 999px; transition: background .15s, color .15s; }
.lg:hover { background: var(--hover-strong); color: var(--text); }
.lg.on { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-line); }
.tog.chip { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-line); }
.tog.chip b { font-weight: 800; }
.tog.chip .x { margin-left: 4px; opacity: .7; }
.tog.chip:hover .x { opacity: 1; }
.sweep { position: relative; }
.help-btn { display: inline-flex; align-items: center; justify-content: center; width: 13px; height: 13px; margin-left: 3px; padding: 0; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--hover); color: var(--text-2); font: 700 9px/1 Inter, system-ui, sans-serif; cursor: pointer; vertical-align: 1px; }
.help-btn:hover { color: var(--accent); border-color: var(--accent-line); }
.sweep-pop { position: absolute; top: calc(100% + 10px); right: 0; width: 300px; padding: 12px 14px; border-radius: 12px; font-size: 12px; line-height: 1.45; color: var(--text-2); z-index: 60; box-shadow: var(--shadow-soft); text-align: left; }
.sweep-pop b { color: var(--text); }
.sweep-pop p { margin: 6px 0 0; }
.lg i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.lg i.diamond { border-radius: 50%; width: 8px; height: 8px; background: transparent; border: 1.5px solid var(--cyan); }

.tooltip { position: fixed; z-index: 30; pointer-events: none; padding: 10px 12px; font-size: 12px; min-width: 200px; max-width: 300px; transform: translate(14px, 14px); border-radius: 10px; background: var(--panel-strong); }
.tooltip .tt-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.tooltip .tt-r { color: var(--text-2); }
.tooltip .tt-m { color: var(--muted); font-size: 11px; margin-top: 4px; line-height: 1.6; }

.tour-caption { position: fixed; top: 96px; left: 50%; transform: translateX(-50%); z-index: 6; font-size: 13px; font-weight: 500; color: var(--text); padding: 8px 18px; border-radius: 999px; background: var(--panel-strong); border: 1px solid var(--line); box-shadow: var(--shadow-soft); animation: evIn .8s ease; }
.toast { position: fixed; bottom: 120px; left: 50%; transform: translateX(-50%); z-index: 40; padding: 8px 14px; border-radius: 10px; background: var(--panel-strong); border: 1px solid var(--line-strong); font-size: 12px; box-shadow: var(--shadow-soft); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* embed mode (/live?embed=1): map only, for the landing-page preview and iframes */
body.embed .col, body.embed .dock, body.embed .legend-box, body.embed .mode-hint, body.embed .topbar, body.embed .maplibregl-ctrl-top-right, body.embed .maplibregl-ctrl-bottom-right { display: none !important; }
body.embed #boot { background: var(--bg); }

/* cinematic mode hides chrome */
body.cinema .col, body.cinema .legend-box { opacity: 0; transform: translateY(8px); pointer-events: none; }
.col, .legend-box { transition: opacity .6s ease, transform .6s ease; }

@media (max-width: 1280px) {
  .left { width: 290px; } .right { width: 320px; }
  .top-meta .sweep { display: none; }
}
@media (max-width: 900px) {
  .col.left { display: none; }
  .right { left: 14px; right: 14px; width: auto; top: auto; height: 42vh; bottom: 76px; }
  .brand { min-width: 0; } .brand-sub, .top-meta { display: none; }
  .dock { left: 14px; right: 14px; transform: none; overflow-x: auto; }
  .legend-box { display: none; }
  .seg button, .tog { padding: 7px 9px; }
}
.detail .d-top { position: sticky; top: -14px; margin: -14px -14px 0; padding: 14px; z-index: 2; background: var(--panel-strong); border-bottom: 1px solid var(--line); }
.cc { display: inline-block; font-size: 9.5px; font-weight: 700; padding: 1px 4px; border-radius: 4px; border: 1px solid var(--line-strong); color: var(--text-2); background: var(--hover); vertical-align: 1px; }
.mode-hint { position: fixed; bottom: calc(var(--dock-h, 56px) + 56px); left: 50%; transform: translateX(-50%); z-index: 4; font-size: 11.5px; color: var(--text-2); text-shadow: 0 1px 8px var(--bg), 0 0 2px var(--bg); white-space: nowrap; pointer-events: none; }
.mode-hint.flash { animation: hintIn .6s ease; }
@keyframes hintIn { from { color: var(--accent); transform: translate(-50%, 4px); } to { color: var(--text-2); transform: translate(-50%, 0); } }
body.cinema .mode-hint { opacity: 0; }
@media (max-width: 900px) { .mode-hint { display: none; } }

/* ---------- [E] account chip + sign-in modal ---------- */
.acct-chip { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--hover); color: var(--text); text-decoration: none; font-size: 12px; font-weight: 600; white-space: nowrap; align-self: center; }
.acct-chip:hover { background: var(--hover-strong); border-color: var(--accent-line); }
.acct-chip .acct-email { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.acct-chip .acct-plan { font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.acct-chip .acct-plan.free { background: var(--hover-strong); color: var(--muted); }
.acct-chip .acct-plan.business { background: var(--cyan-soft); color: var(--cyan); }
.signin-modal { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; background: var(--overlay); padding: 16px; }
.signin-box { width: min(440px, 100%); padding: 24px; background: var(--panel-strong); }
.signin-title { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.signin-sub { color: var(--muted); margin: 6px 0 14px; font-size: 13px; }
.signin-row { display: flex; gap: 8px; flex-wrap: wrap; }
.signin-row input { flex: 1; min-width: 180px; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--hover); color: var(--text); font: inherit; outline: 0; }
.signin-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.signin-row .btn { flex: 0 0 auto; }
.signin-box .btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.signin-msg { min-height: 20px; margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }
.signin-msg.ok { color: var(--ok); } .signin-msg.bad { color: var(--d3); }
.signin-msg a { color: var(--accent); }
.signin-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 12px; }
.signin-foot a { color: var(--muted); }
.signin-foot .btn { flex: 0 0 auto; }
@media (max-width: 1100px) { .acct-chip .acct-email { display: none; } }
/* ---------- [E] end ---------- */
/* ======================= feat/alerts: alert signup UI ======================= */
.alert-box { margin: 4px 0 12px; padding: 12px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--d1) 35%, transparent); background: color-mix(in srgb, var(--d1) 7%, transparent); animation: evIn .4s ease; }
.alert-head { font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.alert-toggle { width: 100%; text-align: left; padding: 8px 10px; border-radius: 9px; border: 1px solid color-mix(in srgb, var(--d1) 40%, transparent); background: color-mix(in srgb, var(--d1) 8%, transparent); cursor: pointer; font-size: 12px; font-weight: 600; color: var(--d1); }
.alert-toggle:hover { background: color-mix(in srgb, var(--d1) 15%, transparent); }
.alert-toggle.on { border-radius: 9px 9px 0 0; }
.alert-toggle + .alert-form { margin-top: 10px; }
.alert-form { display: flex; flex-direction: column; gap: 8px; }
.alert-form input[type=email], .alert-form input[type=time], .alert-form select { font: inherit; font-size: 12.5px; color: var(--text); background: var(--hover); border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 9px; outline: 0; }
.alert-form input[type=email] { width: 100%; }
.alert-form input:focus, .alert-form select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.alert-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.alert-row label { flex: 1 0 auto; }
.alert-check { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.alert-check input { accent-color: var(--accent); }
.alert-actions { display: flex; gap: 6px; margin-top: 2px; }
.alert-actions .btn { flex: 1; }
.alert-msg { font-size: 11.5px; color: var(--muted); min-height: 0; }
.alert-msg:empty { display: none; }
.alert-msg.err { color: var(--d3); }
.alert-ok { padding: 4px 0; font-size: 12.5px; line-height: 1.5; }
.alert-ok b { color: var(--ok); }
/* ---------- C: delay certificate (ride panel) ---------- */
.d-actions.proof { margin-top: -6px; }
.proof-btn { border-color: var(--cyan-line); background: var(--cyan-soft); color: var(--cyan); }
.proof-btn:hover { background: color-mix(in srgb, var(--cyan) 20%, transparent); }
.proof-btn:disabled { opacity: .6; cursor: progress; }
