/* ==========================================================================
   RewindScreener stylesheet
   Dense screener styling: a navy "transport bar" header with an amber brand,
   white panels on a cool grey page, light theme by default with a selected
   dark theme (data-theme="dark" on <html>). Everything is driven by the
   tokens on :root.
   ========================================================================== */

:root {
  color-scheme: light;
  --font-ui: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --bg: #eef0f3;
  --surface: #ffffff;
  --surface-2: #f4f6f8;
  --ink: #1b2330;
  --ink-2: #44505f;
  --muted: #6b7686;
  --line: #e1e5ea;
  --line-2: #c9d0d9;

  --brand: #1f2a3a;
  --brand-2: #16202d;
  --brand-ink: #e9edf3;
  --brand-muted: #9aa8bb;
  --amber: #f2b705;
  --amber-ink: #8a6400;
  --amber-bg: #fff6d6;

  --link: #1d5fd0;
  --link-hover: #0f44a3;
  --accent: #2f6fdd;
  --accent-soft: #e6effc;

  --up: #147a36;
  --down: #d62828;
  --up-bg: #e8f6ec;
  --down-bg: #fcebeb;

  --row-hover: #eef4fd;
  --th-ink: #5b6675;

  /* session timeline segments (pre-market, regular session, after-hours) */
  --seg-pre: #a9b7c9;
  --seg-reg: #2f6fdd;
  --seg-post: #8fb0e6;

  --focus: 0 0 0 2px rgba(47, 111, 221, .35);
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .25);
  --radius: 4px;

  /* chart series (validated with the dataviz palette checker, light + dark) */
  --series-close: #1b2330;
  --series-sma20: #2a78d6;
  --series-sma50: #eb6834;
  --series-sma200: #6250d6;
  --chart-grid: #eceff3;
  --chart-text: #6b7686;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e131a;
  --surface: #161c26;
  --surface-2: #1b2330;
  --ink: #e6e9ef;
  --ink-2: #c0c8d4;
  --muted: #8d98a9;
  --line: #273140;
  --line-2: #344256;

  --brand: #0f151e;
  --brand-2: #0a0f16;
  --brand-ink: #e9edf3;
  --brand-muted: #8e9bb0;
  --amber: #f2b705;
  --amber-ink: #ffd75e;
  --amber-bg: #3a2f08;

  --link: #7fb0ff;
  --link-hover: #a9c8ff;
  --accent: #5b93ea;
  --accent-soft: #1e2d44;

  --up: #3ec46a;
  --down: #ff6161;
  --up-bg: #14301e;
  --down-bg: #3a1a1a;

  --row-hover: #1f2a3d;
  --th-ink: #9aa6b8;

  --seg-pre: #4a5b72;
  --seg-reg: #5b93ea;
  --seg-post: #3b5a8a;

  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .6);

  --series-close: #e6e9ef;
  --series-sma20: #3987e5;
  --series-sma50: #d95926;
  --series-sma200: #9085e9;
  --chart-grid: #232d3b;
  --chart-text: #8d98a9;
}

/* --------------------------------------------------------------- base */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 13px/1.4 var(--font-ui);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
body.has-dialog { overflow: hidden; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -80px; left: 12px; z-index: 120; padding: 10px 14px; background: var(--surface); color: var(--link); border: 1px solid var(--accent); border-radius: 4px; }
.skip-link:focus { top: 8px; }
.text-button { border: 0; background: none; padding: 0; font: inherit; text-align: inherit; cursor: pointer; }
.text-button:hover { text-decoration: underline; }
[hidden] { display: none !important; }
kbd {
  font: 11px var(--font-mono); padding: 0 4px; border: 1px solid var(--line-2);
  border-bottom-width: 2px; border-radius: 3px; background: var(--surface);
}
code { font-family: var(--font-mono); font-size: 12px; background: var(--surface-2); padding: 0 3px; border-radius: 3px; }

.num { font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
.muted { color: var(--muted); }
.link { color: var(--link); cursor: pointer; }

/* --------------------------------------------------------------- buttons & inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 28px; padding: 0 10px; border-radius: var(--radius);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--icon { width: 28px; padding: 0; font-size: 10px; }
.btn--sm { height: 24px; padding: 0 8px; font-size: 12px; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--link-hover); border-color: var(--link-hover); }
:root[data-theme="dark"] .btn--primary { background: #285fb6; border-color: #5b93ea; color: #fff; }
:root[data-theme="dark"] .btn--primary:hover { background: #1f4e9b; }
.btn--toggle { font-family: var(--font-mono); font-size: 12px; min-width: 52px; }
.btn--toggle.is-desc { background: var(--accent-soft); border-color: var(--accent); }

.inp, .sel {
  height: 28px; padding: 0 8px; border-radius: var(--radius);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  min-width: 0;
}
.inp:focus, .sel:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.sel { padding-right: 22px; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 11px) 12px, calc(100% - 7px) 12px; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; }
.sel--sm { height: 24px; font-size: 12px; }
.sel option:disabled { color: var(--muted); }

/* --------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  padding: 0 16px; height: 50px;
  background: var(--brand);
  color: var(--brand-ink);
  border-bottom: 1px solid var(--brand-2);
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--amber); text-decoration: none; }
.brand:hover { text-decoration: none; color: var(--amber); }
.brand__mark { width: 24px; height: 24px; }
.brand__name { font: 600 17px/1 var(--font-mono); letter-spacing: -.02em; color: var(--brand-ink); }
.brand__name em { font-style: normal; color: var(--amber); }

.topbar .btn { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); color: var(--brand-ink); }
.topbar .btn:hover { background: rgba(255,255,255,.14); }

/* Compact date and time summary; the player and status strip carry the session details. */
.rewind { position: relative; display: inline-flex; align-items: stretch; height: 40px; justify-self: center; border: 1px solid rgba(255,255,255,.18); border-radius: 5px; background: rgba(255,255,255,.04); }
.rewind .rewind__step { width: 36px; height: auto; border: 0; border-radius: 4px 0 0 4px; background: none; color: var(--brand-muted); }
.rewind__step svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rewind .rewind__step + .rewind__btn { border-left: 1px solid rgba(255,255,255,.14); border-right: 1px solid rgba(255,255,255,.14); }
.rewind .rewind__step:last-child { border-radius: 0 4px 4px 0; }
.rewind .rewind__step:hover:not(:disabled) { background: rgba(255,255,255,.12); color: var(--brand-ink); }
.rewind .rewind__step:disabled { opacity: .35; cursor: default; }
.rewind__btn {
  display: grid; grid-template-columns: 16px minmax(104px, 1fr) 6px; align-items: center; gap: 10px;
  padding: 0 12px; border: 0; border-radius: 0; background: none; color: var(--brand-ink);
  cursor: pointer; white-space: nowrap; text-align: left; transition: background .12s;
}
.rewind__calendar { width: 16px; height: 16px; fill: none; stroke: var(--brand-muted); stroke-width: 1.5; stroke-linecap: round; }
.rewind__content { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rewind__btn::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid var(--brand-muted); border-bottom: 1.5px solid var(--brand-muted); transform: translateY(-2px) rotate(45deg); transition: transform .12s; }
.rewind__btn:hover { background: rgba(255,255,255,.1); }
.rewind__btn:hover::after, .rewind__btn[aria-expanded="true"]::after { border-color: var(--brand-ink); }
.rewind__btn:focus-visible, .rewind .rewind__step:focus-visible { outline: none; box-shadow: inset 0 0 0 2px rgba(242,183,5,.6); }
.rewind__btn[aria-expanded="true"] { background: rgba(255,255,255,.14); }
.rewind__btn[aria-expanded="true"]::after { transform: translateY(2px) rotate(225deg); }
.rewind__date { font: 600 13px/1.2 var(--font-ui); color: #fff; }
.rewind__time { font: 400 10.5px/1.2 var(--font-mono); color: var(--brand-muted); }
.rewind__btn.is-time .rewind__time { color: var(--amber); }

/* the picker popover: trading-day calendar on the left, session timeline on the right */
.picker {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 50;
  width: 680px; max-width: calc(100vw - 24px); padding: 16px; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px 24px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); border-radius: 6px; box-shadow: var(--shadow-lg);
  animation: pop .14s ease-out; text-align: left;
}
.picker .btn { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.picker .btn:hover { background: var(--surface-2); border-color: var(--muted); }
.picker .btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.picker .btn--primary:hover { background: var(--link-hover); border-color: var(--link-hover); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -4px); } to { opacity: 1; transform: translate(-50%, 0); } }

.cal__nav { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.cal__sel { height: 28px; font-size: 12.5px; padding-right: 22px; }
.cal__sel--month { flex: 1; }
.cal__dow, .cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal__dow span { text-align: center; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 4px 0; }
.cal__day { position: relative; height: 32px; border: 0; border-radius: 4px; background: none; font: 500 12.5px var(--font-mono); color: var(--ink); cursor: pointer; }
.cal__day:hover:not(:disabled) { background: var(--accent-soft); }
.cal__day:focus-visible { outline: none; box-shadow: var(--focus); }
.cal__day.is-off { color: var(--muted); opacity: .4; cursor: default; }
.cal__day.is-selected { background: var(--accent); color: #fff; font-weight: 600; }
.cal__day.is-latest::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; transform: translateX(-50%); }

/* the picker's two column heads and its footer */
.picker__head { display: flex; align-items: center; justify-content: flex-end; height: 28px; margin-bottom: 16px; }
.picker__foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
#pick-latest { margin-right: auto; }

/* the time-of-day column */
.pick { display: flex; flex-direction: column; min-width: 0; }
.pick__modes { display: inline-flex; border: 1px solid var(--line-2); border-radius: 5px; padding: 2px; background: var(--surface-2); }
.pick__mode { position: relative; }
.pick__mode input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.pick__mode span { display: block; padding: 3px 11px; border-radius: 3px; font-weight: 500; font-size: 12.5px; cursor: pointer; color: var(--ink-2); }
.pick__mode input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.pick__mode input:focus-visible + span { box-shadow: var(--focus); }
.pick__timebox { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.pick__readout { min-height: 50px; }
.pick__timerow { display: flex; align-items: baseline; gap: 7px; }
.pick__time { width: auto; min-width: 0; height: auto; padding: 0 2px; margin-left: -2px; border: 0; border-radius: 3px; background: none; color: var(--ink); font: 600 28px/1.1 var(--font-mono); letter-spacing: -.02em; }
.pick__time::-webkit-calendar-picker-indicator { display: none; }
.pick__time::-webkit-datetime-edit { padding: 0; }
.pick__time::-webkit-datetime-edit-fields-wrapper { padding: 0; }
.pick__time::-webkit-datetime-edit-hour-field, .pick__time::-webkit-datetime-edit-minute-field, .pick__time::-webkit-datetime-edit-ampm-field { padding: 0 1px; }
.pick__time:focus-visible { outline: none; box-shadow: var(--focus); }
.pick__time[hidden], .pick__eodtext[hidden], .pick__et[hidden] { display: none; }
.pick__eodtext { font: 600 28px/1.1 var(--font-mono); letter-spacing: -.02em; color: var(--ink); }
.pick__et { font: 500 12px var(--font-mono); color: var(--muted); }
.pick__phase { display: flex; align-items: center; gap: 7px; margin-top: 7px; min-height: 16px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }

/* the session timeline: three labelled segments, a fill up to the chosen minute and an amber playhead;
   the real <input type="range"> lies transparent on top, so dragging, clicking and the arrow keys all work */
.tl { position: relative; }
.tl__track { position: relative; height: 30px; border: 1px solid var(--line-2); border-radius: 4px; background: var(--surface-2); }
.tl__track:has(.tl__range:focus-visible) { box-shadow: var(--focus); }
.tl__fill { position: absolute; top: 0; bottom: 0; left: 0; background: var(--accent-soft); border-radius: 3px 0 0 3px; transition: width .08s linear; }
.tl__segs { position: absolute; inset: 0; display: grid; grid-template-columns: calc((100% - 18px) * .34375 + 9px) calc((100% - 18px) * .40625) minmax(0, 1fr); }
.tl__seg { position: relative; display: flex; align-items: center; justify-content: center; padding: 0 4px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: inset 0 -2px 0 var(--seg-pre); }
.tl__seg + .tl__seg { border-left: 1px solid var(--line-2); }
.tl__seg--reg { box-shadow: inset 0 -2px 0 var(--seg-reg); }
.tl__seg--post { box-shadow: inset 0 -2px 0 var(--seg-post); }
.tl__head { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: var(--amber); border-radius: 1px; pointer-events: none; transition: left .08s linear; }
.tl__head::before { content: ""; position: absolute; top: -2px; left: 50%; width: 10px; height: 7px; transform: translateX(-50%); background: var(--amber); border-radius: 2px 2px 1px 1px; }
.tl__range { position: absolute; left: 0; top: -6px; width: 100%; height: calc(100% + 12px); margin: 0; opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none; background: none; }
.tl__range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 42px; }
.tl__range::-moz-range-thumb { width: 18px; height: 42px; border: 0; border-radius: 0; }
.tl__ticks { position: relative; height: 15px; margin-top: 5px; font: 10.5px var(--font-mono); color: var(--muted); }
.tl__tick { position: absolute; top: 0; white-space: nowrap; }
.tl__tick--start { left: 0; }
.tl__tick--open { left: calc((100% - 18px) * .34375 + 9px); transform: translateX(-50%); }
.tl__tick--close { left: calc((100% - 18px) * .75 + 9px); transform: translateX(-50%); }
.tl__tick--end { right: 0; }
.pick__timebox.is-off .tl { opacity: .7; }
.pick__timebox.is-off .tl__head { display: none; }
.pick__timebox.is-off .tl__fill { display: none; }

/* the stops: the usual moments as a row of times, no pills */
.pick__stops { display: flex; flex-wrap: wrap; gap: 2px; margin: -4px 0 0 -6px; }
.pick__stop { height: 22px; padding: 0 6px; border: 0; border-radius: 3px; background: none; font: 500 11.5px var(--font-mono); color: var(--link); cursor: pointer; }
.pick__stop:hover { background: var(--accent-soft); color: var(--link-hover); }
.pick__stop:focus-visible { outline: none; box-shadow: var(--focus); }
.pick__stop.is-active { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--amber); }
.pick__stop:disabled { color: var(--muted); background: none; opacity: .55; cursor: default; }
.pick__note { margin: 12px 0 0; font-size: 12px; color: var(--muted); }

.topbar__right { display: flex; align-items: center; gap: 8px; justify-self: end; }
.topbar__link { padding: 4px 6px; color: var(--brand-ink); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.topbar__link:hover { color: #fff; }
.topbar__link:focus-visible { outline: 0; box-shadow: 0 0 0 2px rgba(242,183,5,.6); border-radius: 3px; }
.theme-toggle__moon { display: none; }
:root[data-theme="dark"] .theme-toggle__sun { display: none; }
:root[data-theme="dark"] .theme-toggle__moon { display: block; }
.theme-toggle svg { width: 16px; height: 16px; }

/* search */
.search { position: relative; }
.search__icon { position: absolute; left: 8px; top: 7px; width: 14px; height: 14px; color: var(--brand-muted); pointer-events: none; }
.search__input {
  width: 220px; height: 28px; padding: 0 8px 0 27px; border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff;
}
.search__input::placeholder { color: var(--brand-muted); }
.search__input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 2px rgba(242,183,5,.3); background: rgba(255,255,255,.12); }
.search__results {
  position: absolute; top: 32px; right: 0; width: 360px; max-width: calc(100vw - 24px); max-height: min(360px, 65dvh); overflow: auto; z-index: 60;
  margin: 0; padding: 4px 0; list-style: none; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.search__item { display: grid; grid-template-columns: 64px 1fr; gap: 8px; align-items: baseline; padding: 5px 10px; cursor: pointer; }
.search__item:hover, .search__item.is-active { background: var(--row-hover); }
.search__item-t { font: 600 12.5px var(--font-mono); color: var(--link); }
.search__item-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search__item-note { grid-column: 2; font-size: 11px; color: var(--muted); }
.search__item.is-inactive .search__item-t { color: var(--muted); }
.search__empty { padding: 8px 10px; color: var(--muted); }

/* --------------------------------------------------------------- status strip */
.strip {
  display: flex; align-items: center; gap: 16px; padding: 4px 16px; min-height: 26px;
  background: var(--surface); border-bottom: 1px solid var(--line); font-size: 11.5px; color: var(--muted);
}
.strip__text b { color: var(--ink-2); font-weight: 600; }
.strip__text .sep { margin: 0 6px; opacity: .6; }
.strip__latest { margin-left: auto; border: 0; background: none; padding: 0; color: var(--link); cursor: pointer; font-size: 11.5px; white-space: nowrap; }
.strip__latest:hover { text-decoration: underline; }
.strip__plan { margin-left: auto; font-size: 11.5px; white-space: nowrap; }
.strip__latest:not([hidden]) + .strip__plan { margin-left: 0; }

/* --------------------------------------------------------------- layout */
.main { flex: 1; min-width: 0; padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 110px; }
.main:focus { outline: none; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 5px; box-shadow: var(--shadow); }

/* The same transport as the homepage, backed by the scanner's selected query. */
.session-player { display: flex; align-items: center; gap: 20px; min-width: 0; padding: 16px 20px 26px; }
.session-player[hidden] { display: none; }
.session-play { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line-2); border-radius: 4px; background: var(--surface); color: var(--ink); cursor: pointer; }
.session-play:hover { background: var(--surface-2); }
.session-play:focus-visible { outline: none; box-shadow: var(--focus); }
.session-play svg { width: 16px; height: 16px; }
.session-play__pause, .session-player[data-playing] .session-play__play { display: none; }
.session-player[data-playing] .session-play__pause { display: block; }
.session-scrub { position: relative; flex: 1 1 auto; min-width: 0; }
.session-scrub__track { position: relative; height: 8px; border-radius: 4px; background: var(--line-2); }
.session-scrub__fill { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--amber); }
.session-scrub__mark { position: absolute; top: -3px; width: 2px; height: 14px; margin-left: -1px; background: var(--muted); opacity: .5; }
.session-scrub__range { position: absolute; left: 0; top: 50%; width: 100%; height: 44px; margin: -22px 0 0; opacity: 0; cursor: grab; appearance: none; background: none; }
.session-scrub__range:active { cursor: grabbing; }
.session-scrub__range::-webkit-slider-thumb { appearance: none; width: 16px; height: 44px; }
.session-scrub__range::-moz-range-thumb { width: 16px; height: 44px; border: 0; border-radius: 0; }
.session-scrub__thumb { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; border: 2px solid var(--surface); background: var(--amber); box-shadow: 0 1px 3px rgba(0,0,0,.3); pointer-events: none; }
.session-scrub__track:has(.session-scrub__range:focus-visible) .session-scrub__thumb { box-shadow: var(--focus); }
.session-scrub__ticks { position: absolute; top: 100%; left: 0; right: 0; height: 14px; margin-top: 9px; color: var(--muted); font: 10px/14px var(--font-mono); }
.session-scrub__ticks span { position: absolute; white-space: nowrap; transform: translateX(-50%); }
.session-scrub__ticks .session-scrub__start { left: 0; transform: none; }
.session-scrub__ticks .session-scrub__end { right: 0; transform: none; }
.session-readout { display: flex; flex: none; flex-direction: column; align-items: flex-end; gap: 3px; min-width: 118px; }
.session-readout__clock { display: flex; align-items: baseline; gap: 5px; color: var(--ink); font: 600 24px/1 var(--font-mono); letter-spacing: -.04em; }
.session-readout__zone { color: var(--muted); font-size: 10px; font-weight: 400; }
.session-readout__phase { color: var(--muted); font-size: 12px; }
.session-player[data-preview] .session-readout__clock { color: var(--amber-ink); }
.session-player__actions { display: flex; align-items: center; gap: 12px; }
.session-step { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 10px; }
.session-step .sel { width: 86px; }
.session-player__eod { min-height: 36px; white-space: nowrap; }
.session-player__eod[aria-pressed="true"] { color: var(--link); background: var(--accent-soft); border-color: var(--accent); }

@media (max-width: 760px) {
  .session-player { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; padding: 12px 12px 28px; }
  .session-play { width: 44px; height: 44px; }
  .session-readout { grid-column: 2; grid-row: 1; align-items: flex-start; min-width: 0; }
  .session-readout__clock { font-size: 21px; }
  .session-readout__phase { font-size: 11px; }
  .session-player__actions { grid-column: 3; grid-row: 1; gap: 8px; }
  .session-step > span { display: none; }
  .session-step .sel { width: 72px; min-height: 36px; font-size: 11px; padding-left: 7px; padding-right: 18px; }
  .session-player__eod { min-height: 36px; font-size: 11px; padding: 0 8px; }
  .session-scrub { grid-column: 1 / -1; grid-row: 2; margin-top: 10px; margin-bottom: 4px; }
}
@media (max-width: 440px) {
  .session-player { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; }
  .session-player__actions { flex-direction: column-reverse; gap: 6px; }
  .session-step .sel { width: 78px; }
  .session-player__eod { width: 78px; }
  .session-scrub { grid-column: 1 / -1; }
  .session-scrub__ticks { font-size: 9px; }
}

/* view tabs: a segmented control */
.tabs { display: flex; gap: 2px; }
.tabs--views { gap: 0; padding: 2px; margin: 5px 0; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); max-width: 100%; overflow-x: auto; } /* twelve views: the strip scrolls where it does not fit */
.tab {
  height: 24px; padding: 0 10px; border: 0; border-radius: 3px; background: transparent; color: var(--ink-2);
  cursor: pointer; white-space: nowrap; font-weight: 500; font-size: 12px;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.tab__count { margin-left: 5px; padding: 0 5px; border-radius: 999px; font: 600 10.5px var(--font-mono); background: var(--accent-soft); color: var(--link); }

/* --------------------------------------------------------------- filters: the chip bar */
.filters { position: relative; }
.fbar { display: flex; align-items: flex-start; gap: 6px; padding: 7px 10px; flex-wrap: wrap; }
.fbtn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer; white-space: nowrap; }
.fbtn:hover { background: var(--surface-2); border-color: var(--muted); }
.fbtn:focus-visible { outline: none; box-shadow: var(--focus); }
.fbtn[aria-expanded="true"] { border-color: var(--accent); color: var(--link); }
.fbtn svg { width: 14px; height: 14px; }
.fbtn__n { font: 600 11px/18px var(--font-mono); color: var(--link); text-align: center; }
.fbar__count { font-size: 12px; line-height: 28px; color: var(--muted); white-space: nowrap; margin-right: 2px; }
.fbar__count b { color: var(--ink-2); font-weight: 600; }
.fchips { display: flex; align-items: center; gap: 6px; row-gap: 6px; flex-wrap: wrap; flex: 1 1 320px; min-width: 0; }
.fbar__right { display: flex; align-items: center; gap: 10px; margin-left: auto; min-height: 28px; font-size: 12px; }
.fbar__q { width: 210px; height: 28px; font-size: 12.5px; }

.fchip { display: inline-flex; align-items: stretch; height: 28px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); max-width: 100%; transition: background .12s; }
.fchip:hover { background: var(--line); }
.fchip__main { position: relative; display: inline-flex; align-items: center; max-width: 320px; padding: 0 22px 0 10px; border: 0; border-radius: 6px; background: none; color: inherit; cursor: pointer; font-size: 12.5px; white-space: nowrap; }
.fchip__main::after { content: ""; position: absolute; right: 9px; top: 50%; width: 5px; height: 5px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-70%) rotate(45deg); opacity: .7; }
.fchip__main:focus-visible { outline: none; box-shadow: var(--focus); }
.fchip__main:disabled { opacity: .5; cursor: not-allowed; }
.fchip__main[aria-expanded="true"] { box-shadow: inset 0 0 0 1px var(--accent); }
.fchip__sep { white-space: pre; }
.fchip__val { overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.fchip.is-active { background: var(--accent-soft); color: var(--link); }
.fchip.is-active .fchip__main { padding-right: 4px; }
.fchip.is-active .fchip__main::after { display: none; }
.fchip__x { width: 24px; padding: 0; border: 0; border-radius: 0 6px 6px 0; background: none; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; opacity: .7; }
.fchip__x:hover { opacity: 1; background: rgba(0, 0, 0, .06); }
.fchip--warn { background: var(--amber-bg); color: var(--amber-ink); }
.fchip--warn.is-active { background: var(--amber-bg); color: var(--amber-ink); }
.fchip--off { color: var(--muted); }

/* "+ Add filter" and the one-click signal picks */
.fbar__add { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px 0 8px; border: 1px dashed var(--line-2); border-radius: 6px; background: none; color: var(--link); cursor: pointer; font-size: 12.5px; font-weight: 500; white-space: nowrap; transition: background .12s, border-color .12s; }
.fbar__add:hover { border-color: var(--accent); background: var(--accent-soft); }
.fbar__add:focus-visible { outline: none; box-shadow: var(--focus); }
.fbar__add[aria-expanded="true"] { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.fbar__add-plus { font-size: 16px; line-height: 1; font-weight: 400; margin-top: -1px; }
.fbar__signals { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; margin-left: 4px; padding-left: 10px; border-left: 1px solid var(--line-2); }
.fbar__glabel { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); white-space: nowrap; margin-right: 2px; }
.fchip--signal { align-items: center; gap: 6px; padding: 0 10px; border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); cursor: pointer; font: 500 12.5px var(--font-ui); white-space: nowrap; }
.fchip--signal:hover { background: var(--surface-2); border-color: var(--muted); }
.fchip--signal:focus-visible { outline: none; box-shadow: var(--focus); }
.fchip--signal.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--link); font-weight: 600; }
.fchip--signal.fchip--warn { border-color: var(--amber); }
.fchip__dot { font-size: 14px; line-height: 1; opacity: .7; }

/* the dropdown under a chip */
.fpop { position: absolute; z-index: 45; width: 300px; max-height: min(480px, 72vh); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--shadow-lg); animation: pop-in .12s ease-out; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.fpop__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px 6px; }
.fpop__title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.fpop__head .fpop__title { flex: 1; }
.fpop__close { flex: 0 0 auto; font-size: 17px; border: 0; background: none; }
.fpop__clear { border: 0; background: none; color: var(--link); cursor: pointer; font-size: 12px; padding: 0; }
.fpop__clear:hover { text-decoration: underline; }
.fpop__search { margin: 0 10px 6px; height: 26px; font-size: 12px; flex: 0 0 auto; }
.fpop__list { overflow: auto; padding: 2px 6px 6px; min-height: 0; }
.fpop__opt { display: flex; align-items: center; gap: 9px; width: 100%; height: 30px; padding: 0 8px; border: 0; border-radius: 5px; background: none; color: var(--ink); text-align: left; cursor: pointer; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fpop__opt::before { content: ""; flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--line-2); box-sizing: border-box; background: var(--surface); }
.fpop__opt:hover, .fpop__opt:focus-visible { background: var(--row-hover); outline: none; }
.fpop__opt.is-selected { color: var(--link); font-weight: 600; }
.fpop__opt.is-selected::before { border: 4px solid var(--accent); }
.fpop__opt:disabled { color: var(--muted); cursor: not-allowed; }
.fpop__note { padding: 2px 12px 12px; font-size: 12px; color: var(--muted); line-height: 1.45; }
.fpop__custom { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 8px 12px 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); flex: 0 0 auto; }
.fpop__custom-title { width: 100%; font-weight: 600; color: var(--ink-2); font-size: 11.5px; }
.fpop__custom .inp { width: 84px; height: 26px; font: 12px var(--font-mono); padding: 0 6px; }
.fpop__tickers { padding: 0 12px 10px; display: flex; flex-direction: column; gap: 6px; }
.fpop__tickers textarea { width: 100%; height: auto; padding: 6px 8px; font: 12.5px var(--font-mono); resize: vertical; }
.fpop__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; }
/* the "Add filter" menu: every filter and signal in sections, searchable */
.fpop--menu { width: 340px; max-height: min(600px, 80vh); }
.fmenu { padding: 0 6px 8px; }
.fmenu__group { padding: 2px 0; }
.fmenu__title { position: sticky; top: 0; z-index: 1; padding: 8px 8px 3px; background: var(--surface); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.fmenu__item { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; height: 28px; padding: 0 8px 0 26px; border: 0; border-radius: 5px; background: none; color: var(--ink); text-align: left; cursor: pointer; font-size: 12.5px; white-space: nowrap; overflow: hidden; }
.fmenu__item::before { content: "+"; position: absolute; left: 9px; top: 50%; transform: translateY(-52%); color: var(--muted); font-size: 15px; line-height: 1; }
.fmenu__item:hover, .fmenu__item:focus-visible { background: var(--row-hover); outline: none; }
.fmenu__item:hover::before { color: var(--link); }
.fmenu__item.is-added { color: var(--ink-2); }
.fmenu__item.is-added::before { content: ""; width: 6px; height: 6px; left: 12px; border-radius: 50%; background: var(--accent); transform: translateY(-50%); }
.fmenu__item:disabled { color: var(--muted); cursor: not-allowed; }
.fmenu__item:disabled::before { opacity: .4; }
.fmenu__note { margin-left: auto; flex: 0 0 auto; font-size: 11px; color: var(--muted); font-weight: 400; }
.fmenu__empty { padding: 10px 8px; font-size: 12px; color: var(--muted); }

/* the all-filters drawer */
.fdrawer { position: fixed; inset: 0; z-index: 70; }
.fdrawer__backdrop { position: absolute; inset: 0; background: rgba(10, 15, 22, .35); animation: fade-in .18s ease-out; }
.fdrawer__panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(540px, 100%); display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line-2); box-shadow: var(--shadow-lg); animation: slide-in .2s cubic-bezier(.2,.8,.2,1); }
.fdrawer__head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.fdrawer__title { margin: 0; font-size: 15px; display: flex; align-items: baseline; gap: 8px; flex: 1; }
.fdrawer__title .muted { font-size: 12px; font-weight: 500; }
.fdrawer__head .link { font-size: 12px; }
.fdrawer__search { margin: 10px 16px 0; height: 30px; }
.fdrawer__body { flex: 1; overflow: auto; padding: 6px 16px 16px; }

/* the drawer's list: one "label | select" row per filter, in titled sections */
.fgrid { display: grid; grid-template-columns: 1fr; gap: 2px; }
.fgrid__title { margin-top: 12px; padding: 0 0 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--line); }
.fgrid__title:first-child { margin-top: 4px; }
.fgrid__note { padding: 4px 0 2px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.fgrid__empty { padding: 10px 0; color: var(--muted); font-size: 12px; }
.fcell { display: grid; grid-template-columns: minmax(0, 1fr) 190px; align-items: center; gap: 8px; min-height: 30px; padding: 1px 0; }
.fcell__label { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 12px; line-height: 1.2; color: var(--ink-2); }
.fcell__label span.t { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fcell .sel { height: 26px; font-size: 12px; padding: 0 20px 0 8px; width: 100%; border-color: transparent; background-color: var(--surface-2); border-radius: 6px; }
.fcell .sel:hover { border-color: var(--line-2); }
.fcell .sel:focus { border-color: var(--accent); }
.fcell.is-active .sel { border-color: var(--accent); background-color: var(--accent-soft); color: var(--link); font-weight: 500; }
.fcell.is-active .fcell__label { color: var(--link); font-weight: 600; }
.fcell.is-soon .fcell__label, .fcell.is-off .fcell__label { color: var(--muted); }
.fcell.is-soon .sel, .fcell.is-off .sel { opacity: .55; cursor: not-allowed; }
.fcell.is-off.is-active .fcell__label { color: var(--amber-ink); }
.fcell__custom { grid-column: 1 / -1; display: flex; align-items: center; gap: 4px; padding: 2px 0 4px; font-size: 11px; color: var(--muted); }
.fcell__custom { flex-wrap: wrap; }
.field-error { width: 100%; color: var(--down); font-size: 12px; }
[aria-invalid="true"] { border-color: var(--down) !important; }
.fdrawer__foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.fdrawer__foot span { color: var(--muted); font-size: 12px; }
.fcell__custom .inp { width: 70px; height: 22px; padding: 0 5px; font: 11.5px var(--font-mono); }
.fcell__custom .btn { height: 22px; padding: 0 6px; font-size: 11px; }

/* the Sort / Rows controls in the results head */
.control { display: inline-flex; align-items: center; gap: 6px; }
.control__label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.control--sm .control__label { font-size: 10.5px; }

/* --------------------------------------------------------------- results */
.results__head { display: flex; align-items: center; gap: 10px; padding: 0 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.results__viewlabel { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.results__tools { margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.results { min-width: 0; scroll-margin-top: 110px; }
.results__body { position: relative; min-height: 160px; max-height: max(320px, calc(100dvh - 270px)); overflow: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; scrollbar-color: var(--line-2) var(--surface-2); }
.results__body:focus-visible { outline-offset: -2px; }
.results__scrollhint { padding: 5px 10px; font-size: 11.5px; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--surface-2); }

.colpicker { padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.colpicker__head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 12px; flex-wrap: wrap; }
.colpicker__sets { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.colpicker__sets .sel, .colpicker__sets .inp { height: 24px; font-size: 12px; }
.colpicker__sets .inp { width: 150px; }
.colpicker__actions { margin-left: auto; display: flex; gap: 6px; }
.colpicker__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 10px; }
.colpicker__grid { max-height: 300px; overflow: auto; padding: 4px 2px; scrollbar-width: thin; }
.colpicker__item { display: flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.colpicker__item.is-soon { color: var(--muted); }

/* the table: hairline rows, a quiet uppercase header, no banding */
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th, .table td { padding: 4px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; line-height: 1.5; }
.table th {
  background: var(--surface); color: var(--th-ink); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; text-align: left;
  border-bottom: 2px solid var(--line-2); user-select: none; cursor: pointer; padding-top: 6px; padding-bottom: 5px;
}
.results__body .table th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); }
.table__sort { display: inline-flex; align-items: center; justify-content: inherit; gap: 2px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; min-height: 22px; }
.table .c-ticker { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--line); }
.results__body .table th.c-ticker { z-index: 3; }
.table tbody tr:hover .c-ticker { background: var(--row-hover); }
.table tbody tr:focus-within { background: var(--row-hover); }
.table th.al-r, .table td.al-r { text-align: right; }
.table th.al-c, .table td.al-c { text-align: center; }
.table th:hover { color: var(--link); }
.table th.is-sorted { color: var(--link); border-bottom-color: var(--link); }
.table th .arrow { font-size: 9px; margin-left: 3px; opacity: .9; }
.table th.not-sortable { cursor: default; }
.table th.not-sortable:hover { color: var(--th-ink); }
.table th.is-soon { color: var(--muted); font-weight: 500; }
.table th.th-add { width: 30px; text-align: center; cursor: default; padding: 0 4px; }
.th-add__btn { width: 22px; height: 22px; border: 1px dashed var(--line-2); border-radius: 4px; background: none; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; vertical-align: middle; }
.th-add__btn:hover { color: var(--link); border-color: var(--accent); border-style: solid; }
.table tbody tr:hover { background: var(--row-hover); }
.table td.num { font-variant-numeric: tabular-nums; }
.table td.c-ticker a { font-weight: 600; font-family: var(--font-mono); font-size: 12px; letter-spacing: .01em; }
.table td.c-name, .table td.c-industry { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.table td.c-no { color: var(--muted); font-size: 11px; }
.table td.null { color: var(--muted); }
.table td .soon { font: 600 9px var(--font-mono); color: var(--muted); border: 1px solid var(--line-2); border-radius: 3px; padding: 0 3px; margin-left: 4px; vertical-align: 1px; }
.table.is-stale, .cgrid.is-stale, .tgrid.is-stale { opacity: .55; pointer-events: none; transition: opacity .15s; }

/* empty / error / loading states */
.state { padding: 36px 20px; text-align: center; color: var(--ink-2); }
.state--loading { color: var(--muted); }
.state__title { font-weight: 600; font-size: 14px; margin-bottom: 4px; color: var(--ink); }
.state__msg { color: var(--muted); max-width: 560px; margin: 0 auto 12px; }
.state__msg code { word-break: break-all; }
.state__actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.state--upgrade { padding-block: 56px; }

/* ---- Movers view (movers.js): the signals of the moment side by side */
.movers { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); gap: 14px 22px; padding: 10px 12px 14px; }
.mv { min-width: 0; }
.mv__title { margin: 0 0 3px; font-size: 12.5px; font-weight: 600; }
.mv__table { width: 100%; border-collapse: collapse; font-size: 12.5px; table-layout: fixed; }
.mv__table th, .mv__table td { padding: 3px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; }
.mv__table th { font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--th-ink); text-align: left; }
.mv__table th:first-child { width: 68px; }
.mv__table th.al-r { width: 92px; text-align: right; }
.mv__table td.al-r { text-align: right; font-variant-numeric: tabular-nums; }
.mv__table tbody tr:hover { background: var(--row-hover); }
.mv__t a { font-weight: 600; font-family: var(--font-mono); font-size: 12px; }
.mv__n { color: var(--ink-2); }
.mv__none { margin: 4px 0 0; font-size: 12px; color: var(--muted); }

/* ---- Later view: the summary above its table (what came of the screen) */
.later { padding: 8px 10px 9px; border-bottom: 1px solid var(--line); }
.later__sum { border-collapse: collapse; font-size: 12px; }
.later__sum th, .later__sum td { padding: 2px 0 2px 18px; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.later__sum thead th { font-weight: 600; color: var(--th-ink); vertical-align: bottom; }
.later__sum thead th span { display: block; font-weight: 400; font-size: 10.5px; color: var(--muted); }
.later__sum tbody th { padding-left: 0; text-align: left; font-weight: 400; color: var(--ink-2); }
.later__sum td.null { color: var(--muted); }
.later__note { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); }

/* ---- Map view (map.js): a heatmap of the screen. Tile colours are data, the same in both themes. */
.hmapwrap { padding: 8px 10px 10px; }
.hmap__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 4px; font-size: 11.5px; color: var(--muted); }
.hmap__legend { display: inline-flex; }
.hmap__legend span { min-width: 34px; padding: 2px 4px; font: 500 10px/1.3 var(--font-mono); color: #fff; text-align: center; }
.hmap__read { min-height: 18px; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hmap__read b { color: var(--ink); font-family: var(--font-mono); margin-right: 4px; }
.hmap__read .sep { margin: 0 6px; opacity: .6; }
.hmap { position: relative; overflow: hidden; background: var(--surface-2); }
.hmap__sector { position: absolute; height: 15px; padding: 0 3px; font: 600 10px/15px var(--font-ui); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hmap__tile { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; color: #fff; text-decoration: none; line-height: 1.15; }
.hmap__tile b { font-family: var(--font-mono); font-weight: 600; }
.hmap__tile i { font-style: normal; font-family: var(--font-mono); opacity: .92; }
.hmap__tile:hover, .hmap__tile:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; z-index: 1; text-decoration: none; }

.state--upgrade .state__title { font-size: 16px; margin-bottom: 8px; }
.state--upgrade .btn { height: 34px; padding: 0 14px; }
.state--upgrade a.btn:hover { text-decoration: none; }
.state__signin { margin-bottom: 0; font-size: 12.5px; }

/* pager */
.pager { display: flex; align-items: center; gap: 12px; padding: 6px 10px; border-top: 1px solid var(--line); font-size: 12px; flex-wrap: wrap; }
.pager__total { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pager__total b { font-weight: 600; color: var(--ink); }
.pager__pages { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.pager__btn { min-width: 26px; height: 24px; padding: 0 6px; border: 1px solid transparent; background: none; border-radius: 3px; cursor: pointer; color: var(--link); font-variant-numeric: tabular-nums; }
.pager__btn:hover { background: var(--accent-soft); }
.pager__btn.is-current { background: var(--link); color: #fff; font-weight: 600; cursor: default; }
.pager__btn:disabled { color: var(--muted); cursor: default; background: none; }
.pager__btn.is-current:disabled { background: var(--accent-soft); color: var(--link); }
.pager__gap { color: var(--muted); padding: 0 2px; }

/* charts view */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 10px; padding: 10px; }
.cgrid__legend { grid-column: 1 / -1; display: flex; gap: 14px; font-size: 11px; color: var(--muted); }
.cgrid__legend i { display: inline-block; width: 14px; height: 0; border-top: 2px solid; vertical-align: middle; margin-right: 5px; }
.ccard { border: 1px solid var(--line); border-radius: 4px; background: var(--surface); overflow: hidden; }
.ccard__head { display: flex; align-items: baseline; gap: 8px; padding: 6px 8px 2px; }
.ccard__t { font: 600 13px var(--font-mono); }
.ccard__n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11.5px; }
.ccard__px { font-variant-numeric: tabular-nums; font-weight: 600; }
.ccard__chg { font-variant-numeric: tabular-nums; font-size: 12px; }
.ccard__read { height: 16px; padding: 0 8px; font: 10.5px var(--font-mono); color: var(--muted); white-space: nowrap; overflow: hidden; }
.ccard canvas { display: block; width: 100%; height: 130px; cursor: crosshair; }

/* tickers view */
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 4px; padding: 10px; }
.tchip {
  display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid var(--line);
  border-radius: 3px; background: var(--surface); cursor: pointer; text-decoration: none; color: var(--ink);
}
.tchip:hover { border-color: var(--accent); background: var(--row-hover); text-decoration: none; }
.tchip__t { font: 600 12.5px var(--font-mono); color: var(--link); }
.tchip__c { font-size: 11.5px; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- footer */
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 16px 14px; font-size: 11px; color: var(--muted); }
.foot__kbd kbd { margin: 0 2px 0 6px; }
.foot__links { display: flex; gap: 14px; }
.foot__links a { color: var(--muted); }
.foot__links a:hover { color: var(--link-hover); }
.coverage { max-width: 650px; }
.coverage summary { cursor: pointer; color: var(--ink-2); padding: 2px 0; }
.coverage__body { font-size: 12px; line-height: 1.6; padding-top: 4px; }
.coverage__body p { margin: 6px 0; }

/* --------------------------------------------------------------- quote slide-over */
.quote { position: fixed; inset: 0; z-index: 80; }
.quote__backdrop { position: absolute; inset: 0; background: rgba(10, 15, 22, .45); backdrop-filter: blur(1px); animation: fade-in .18s ease-out; }
.quote__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(1000px, 100%); background: var(--bg);
  box-shadow: var(--shadow-lg); overflow: auto; animation: slide-in .22s cubic-bezier(.2,.8,.2,1);
  border-left: 1px solid var(--line-2);
}
@keyframes slide-in { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.quote__content { padding: 0 0 24px; }
.qhead { position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 52px 10px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; }
.qhead__title { grid-column: 1; grid-row: 1; margin: 0; font-size: 18px; font-weight: 600; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.qhead__title .t { font-family: var(--font-mono); color: var(--link); }
.qhead__logo { width: 22px; height: 22px; border-radius: 4px; object-fit: contain; align-self: center; background: var(--surface-2); }
.qhead__title .n { color: var(--ink); }
.qhead__meta { grid-column: 1; grid-row: 2; font-size: 12px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.qhead__meta a { color: var(--link); }
.qhead__asof { grid-column: 1; grid-row: 3; font-size: 12px; color: var(--ink-2); display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.qhead__asof b { font-weight: 600; }
.qhead__asof a { color: var(--link); }
.qhead__price { grid-column: 2; grid-row: 1 / span 3; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.qhead__px { font: 600 22px/1.1 var(--font-mono); font-variant-numeric: tabular-nums; }
.qhead__chg { font: 500 13px var(--font-mono); }
.qhead__session { font: 500 12px var(--font-mono); color: var(--ink-2); text-align: right; }
.qhead__session b { font-weight: 600; color: var(--ink); }
.qhead__close { position: absolute; right: 12px; top: 8px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-size: 16px; line-height: 1; }
.qhead__close:hover { background: var(--surface-2); }

.qsec { margin: 12px 16px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; box-shadow: var(--shadow); }
.qsec__title { margin: 0; padding: 7px 12px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.qsec__title .sub { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); }
.qsec__title .legend { margin-left: auto; display: flex; gap: 12px; font: 10.5px var(--font-mono); text-transform: none; letter-spacing: 0; }
.qsec__title .legend i { display: inline-block; width: 12px; border-top: 2px solid; vertical-align: middle; margin-right: 4px; }
.qsec .empty, .mini .empty { color: var(--muted); padding: 8px 10px; font-size: 12px; }
.qchart { position: relative; height: 380px; }
.qchart--minute { height: 260px; }
.qchart__read { position: absolute; left: 10px; top: 8px; z-index: 2; font: 11px var(--font-mono); color: var(--ink-2); background: color-mix(in srgb, var(--surface) 80%, transparent); padding: 2px 6px; border-radius: 3px; pointer-events: none; white-space: nowrap; }
.qchart__read b { font-weight: 600; color: var(--ink); }
.qchart__read .later { color: var(--muted); }
.qchart canvas.fallback { display: block; width: 100%; height: 100%; }
.qchart__note { position: absolute; right: 10px; top: 8px; font-size: 11px; color: var(--muted); }
.qchart__credit { margin: 0; padding: 6px 12px; color: var(--muted); font-size: 10.5px; }

/* the key figures: grouped stat lists instead of one big label/value table */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { min-width: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.stat:nth-child(3n) { border-right: 0; }
.stat:nth-last-child(-n+3) { border-bottom: 0; }
.stat__title { margin: 0; padding: 7px 10px 4px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stat__list { margin: 0; }
.stat__row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 2px 10px; font-size: 12px; line-height: 1.5; }
.stat__row:nth-child(even) { background: var(--surface-2); }
.stat__row dt { color: var(--ink-2); white-space: nowrap; }
.stat__row dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat__row dd.null { color: var(--muted); font-weight: 500; }

.qdesc { padding: 10px 12px; line-height: 1.55; color: var(--ink-2); }
.qdesc.is-clamped { max-height: 5.4em; overflow: hidden; position: relative; }
.qdesc__more { display: inline-block; padding: 0 12px 10px; font-size: 12px; }
.qgrid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin: 12px 16px 0; }
.qgrid .qsec { margin: 0; min-width: 0; }
.qgrid .qsec > table { display: block; overflow-x: auto; }
.mini { width: 100%; border-collapse: collapse; font-size: 12px; }
.mini th, .mini td { padding: 3px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.mini th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); }
.mini td.num, .mini th.num { text-align: right; font-variant-numeric: tabular-nums; }
.mini tr:last-child td { border-bottom: 0; }
.qseason__wrap { overflow-x: auto; }
.qseason th[scope="row"] { font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--ink); background: none; }
.qseason tr.is-current th[scope="row"], .qseason tr.is-current td { font-weight: 600; background: var(--surface-2); }
.qseason tr:last-child th { border-bottom: 0; }
.qlist { margin: 0; padding: 8px 12px; list-style: none; font-size: 12px; }
.qlist li { padding: 2px 0; }
.qlist .mono { font-family: var(--font-mono); font-size: 11.5px; }

/* --------------------------------------------------------------- modal */
.modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(10, 15, 22, .45); }
.modal__box { position: relative; width: min(640px, calc(100% - 32px)); background: var(--surface); border: 1px solid var(--line-2); border-radius: 6px; box-shadow: var(--shadow-lg); padding: 16px 18px; }
.modal__box--sm { width: min(420px, calc(100% - 32px)); }
.modal__box--sm .modal__actions { margin-top: 16px; }
.modal__box a.btn:hover { text-decoration: none; }
.modal__title { margin: 0 0 6px; font-size: 15px; }
.modal__hint { margin: 0 0 10px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.modal__hint code { white-space: normal; word-break: break-all; }
.modal__input { width: 100%; font-family: var(--font-mono); font-size: 12px; }
.modal__feedback { min-height: 18px; margin: 8px 0; font-size: 12px; color: var(--ink-2); }
.modal__feedback.is-error { color: var(--down); }
.modal__actions { display: flex; justify-content: flex-end; gap: 8px; }

/* toasts */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.toast { padding: 8px 14px; border-radius: 4px; background: var(--brand); color: var(--brand-ink); font-size: 12.5px; box-shadow: var(--shadow-lg); animation: toast-in .2s ease-out; max-width: 80vw; }
.toast--error { background: var(--down); color: #fff; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* --------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .topbar { grid-template-columns: auto 1fr; grid-template-rows: auto auto; height: auto; padding: 6px 12px; row-gap: 6px; }
  .rewind { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
  .picker { left: 0; transform: none; }
  @keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
  .topbar__right { justify-self: end; }
  .search__input { width: 170px; }
}
@media (max-width: 800px) {
  .picker { position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: auto; max-width: none; transform: none; border-radius: 10px 10px 0 0; grid-template-columns: 1fr; gap: 10px; max-height: 92vh; overflow: auto; }
  .picker__foot { flex-wrap: wrap; }
  .cal__day { height: 36px; }
}
@media (max-width: 760px) {
  .main { padding: 8px; }
  .strip { flex-wrap: wrap; }
  .topbar__right { gap: 6px; }
  .topbar { grid-template-columns: auto minmax(0, 1fr); gap: 8px; }
  .brand__name { font-size: 14.5px; } /* the name is 14 letters: at 17px it takes the search field's room on a phone */
  .topbar__right { min-width: 0; width: 100%; }
  .search { flex: 1; min-width: 0; }
  .search__input { width: 100%; min-width: 0; }
  .search__results { position: fixed; top: 48px; left: 8px; right: 8px; width: auto; max-width: none; }
  #import-btn { display: inline-flex; flex: 0 0 auto; width: 44px; font-size: 0; padding: 0; }
  #import-btn::before { content: 'Import'; font-size: 11px; }
  .theme-toggle { flex: 0 0 auto; }
  .rewind { width: 100%; height: 44px; }
  .rewind .rewind__step { width: 44px; }
  .rewind__btn { flex: 1; min-width: 0; padding: 0 12px; }
  .fbar { padding: 6px 8px; }
  .fchips { flex-wrap: wrap; overflow: visible; flex-basis: 100%; }
  .fbar__signals { width: 100%; min-width: 0; overflow-x: auto; margin: 2px 0 0; padding: 6px 0 2px; border: 0; border-top: 1px solid var(--line); scrollbar-width: thin; }
  .fbar__signals > * { flex-shrink: 0; }
  .fbar__right { width: 100%; margin-left: 0; }
  .fbar__q { flex: 1; width: auto; }
  .fpop { position: fixed; left: 8px !important; right: 8px; top: auto !important; bottom: 8px; width: auto; max-height: 70vh; }
  .fcell { grid-template-columns: minmax(0, 1fr) 150px; }
  .results__head { padding: 0 6px; }
  .results__viewlabel { display: none; }
  .tabs--views { overflow-x: auto; width: 100%; }
  .results__tools { margin-left: 0; flex-wrap: wrap; row-gap: 4px; }
  .results__head { gap: 2px; padding-bottom: 6px; }
  .results__tools { width: 100%; gap: 6px; }
  #order-select { max-width: 136px; }
  .results__body { max-height: 65dvh; }
  .table th, .table td { padding: 6px 8px; }
  .btn, .inp, .sel, .tab, .fbtn, .fchip, .fbar__add, .pager__btn { min-height: 34px; }
  .fchip__x { min-width: 30px; }
  .fchip__main { min-width: 0; max-width: calc(100vw - 80px); }
  .sel { background-position-y: 15px; }
  .fpop .fpop__list { max-height: 42dvh; }
  .fpop__opt, .fmenu__item { min-height: 36px; }
  .fpop__head, .fpop__custom, .fpop__tickers { flex-shrink: 0; }
  .fpop { bottom: max(8px, env(safe-area-inset-bottom)); }
  .picker { max-height: 94dvh; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .picker__foot { position: sticky; bottom: -16px; margin: 0 -16px -16px; padding: 10px 16px max(16px, env(safe-area-inset-bottom)); background: var(--surface); z-index: 2; }
  .colpicker__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 35dvh; }
  .colpicker__item { white-space: normal; align-items: flex-start; line-height: 1.4; padding: 4px 0; }
  .fcell .sel { min-height: 34px; }
  .fdrawer__search { min-height: 36px; }
  .pager__pages { margin-left: 0; width: 100%; justify-content: center; gap: 0; }
  .pager__btn { min-width: 28px; padding: 0 4px; }
  .colpicker__head, .colpicker__sets { flex-wrap: wrap; }
  .colpicker__actions { margin-left: 0; }
  .quote__panel { width: 100%; }
  .qhead { grid-template-columns: 1fr; }
  .qhead__price { grid-column: 1; grid-row: 4; align-items: flex-start; }
  .qhead__session { text-align: left; }
  .qhead__close { width: 36px; height: 36px; }
  .qsec { margin: 10px 8px 0; }
  .qsec__title { flex-wrap: wrap; }
  .qsec__title .legend { margin-left: 0; }
  .qchart__read { white-space: normal; max-width: calc(100% - 60px); font-size: 10px; }
  .qchart { height: 300px; }
  .qchart--minute { height: 240px; }
  .qgrid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .stat, .stat:nth-child(3n) { border-right: 0; border-bottom: 1px solid var(--line); }
  .stat:last-child { border-bottom: 0; }
}
@media (max-width: 440px) {
  /* Hosted site on a phone: the account link takes the room the search placeholder had. The field shows its icon
     alone, and takes the width of Import and the account link while it has focus. */
  .topbar__right:has([data-account-link]:not([hidden])) .search__input:not(:focus)::placeholder { color: transparent; }
  .topbar__right:has([data-account-link]:not([hidden])) .search:focus-within ~ #import-btn,
  .topbar__right:has([data-account-link]:not([hidden])) .search:focus-within ~ .topbar__link { display: none; }
}
@media (max-width: 360px) {
  .brand__mark { display: none; }
  .brand__name { font-size: 12px; }
  .fcell { grid-template-columns: minmax(0, 1fr) 135px; }
  .fdrawer__head, .fdrawer__body { padding-left: 10px; padding-right: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
