/* Delta Scanner: one stylesheet for the Live, Replay and History pages.
 *
 * Design language: a hard-news editorial system (from reference.html).
 *   · flat paper, no shadows or tinted cards: hairline rules and type weight carry the hierarchy
 *   · Roboto only, with a wide weight spread: 300 section eyebrows, 700 headlines, 900 urgent labels
 *   · orange = identity only (the italic "Scanner" and the bar before each section eyebrow), never a control
 *   · live-red = live state only (LIVE badge, the newest close, breaking bands for problems)
 *   · actions are black buttons, inputs outlined; every control has small 3px corners (--r). Only the LIVE dot and timeline dots stay round
 *   · dark theme = the "network" polarity: near-black canvas, gold instead of orange, amber active links
 * Buy-green / sell-red stay on numbers and the chart: they are data, not chrome.
 *
 * Every class is prefixed `ds-` (or lives under body.ds), so the shared Desk sheet (static/iq.css, still
 * loaded for the top bar and theme toggle) can't fight it. delta.js sets html[data-ds-theme] from the shared theme.
 */

/* ── font: Roboto (OFL), variable weight 100–900, self-hosted ── */
@font-face { font-family: "Roboto DS"; font-style: normal; font-display: swap; font-weight: 100 900;
             src: url("fonts/roboto-latin.woff2") format("woff2-variations"), url("fonts/roboto-latin.woff2") format("woff2");
             unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Roboto DS"; font-style: normal; font-display: swap; font-weight: 100 900;
             src: url("fonts/roboto-latin-ext.woff2") format("woff2-variations"), url("fonts/roboto-latin-ext.woff2") format("woff2");
             unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Roboto DS"; font-style: normal; font-display: swap; font-weight: 100 900;
             src: url("fonts/roboto-greek.woff2") format("woff2-variations"), url("fonts/roboto-greek.woff2") format("woff2");
             unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }

/* the heading font of the original pages: Instrument Serif (OFL), self-hosted */
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
             src: url("fonts/instrument-serif.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
             src: url("fonts/instrument-serif-italic.woff2") format("woff2"); }

/* ── tokens: light = the news surface (DESIGN.md colors) ── */
:root, html[data-ds-theme="light"] {
  --bg:    #ffffff;   /* canvas */
  --sf:    #ffffff;   /* panels are the same paper: flat */
  --sf2:   #f0f0f0;   /* soft: hover, selected row */
  --ln:    #d8d8d8;   /* hairline */
  --ln2:   #bebebe;   /* silver: control edges, timeline rail */
  --rule:  #000000;   /* the 1px ink rule under the masthead and section heads */
  --ink:   #000000;
  --ink2:  #333333;   /* charcoal */
  --mut:   #595959;   /* slate */
  --brand: #fa9000;   /* orange: identity only */
  --r:     3px;       /* corner radius of every control (buttons, inputs, chips, badges, switches, calendar days) */
  --live:  #c31833;   /* live-red: live state only */
  --nav-on: #000000;  /* active tab */
  --pill:  #000000;   /* black pill */
  --on-pill: #ffffff;
  --buy:   #0a7d4b;   /* data colours */
  --sell:  #d0312d;
  --blue:  #2557e6;   /* Min Delta line, as on the chart */
  --scrim: rgba(0, 0, 0, .45);
  --drop:  0 6px 12px rgba(0, 0, 0, .175);   /* the system's only shadow: menus */
  --font: "Roboto DS", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
/* dark = the network polarity */
html[data-ds-theme="dark"] {
  --bg:    #181818;   /* network canvas */
  --sf:    #181818;
  --sf2:   #262626;
  --ln:    #323232;   /* graphite */
  --ln2:   #4d4d4d;
  --rule:  #dddddd;
  --ink:   #ffffff;
  --ink2:  #dddddd;   /* mist */
  --mut:   #9b9b9b;
  --brand: #dba200;   /* gold */
  --live:  #ec3550;   /* live-red, lifted for contrast on the dark canvas */
  --nav-on: #ffa000;  /* amber active link */
  --pill:  #ffffff;
  --on-pill: #000000;
  --buy:   #2ec27e;
  --sell:  #ff5c57;
  --blue:  #5b8cff;
  --scrim: rgba(0, 0, 0, .6);
  --drop:  0 6px 12px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ── base ── */
html { scrollbar-gutter: stable; }
html[data-ds-theme] { background: var(--bg); }   /* no Desk-grey band under a short page */
html body.ds { margin: 0; background: var(--bg); color: var(--ink2); font: 400 14px/1.45 var(--font);
               font-feature-settings: "tnum" 1, "lnum" 1; -webkit-font-smoothing: antialiased; }
body.ds *, body.ds *::before, body.ds *::after { box-sizing: border-box; }
body.ds [hidden] { display: none !important; }
body.ds button, body.ds input, body.ds select, body.ds textarea { font-family: inherit; }
body.ds :focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
body.ds a { color: inherit; }

/* the shared top bar (injected by static/iq.js): company logo left, sun / moon theme button right.
   Same sizes as the original pages; colours follow this page. */
html body.ds #iqd-bar { height: 72px; padding: 0 calc(max(0px, (100% - 1320px) / 2) + 24px); font-size: 13px;
                        background: var(--bg); border-bottom: 1px solid var(--ln); color: var(--ink); }
html body.ds #iqd-bar .iqd-t { display: none; }
html body.ds #iqd-bar a.iqd-brand { padding-right: 0; margin-right: 0; border-right: 0; }
html body.ds #iqd-bar img.iqd-logo { height: 28px; }
/* the shared logo is drawn for dark bars (white text): on the light bar, the light logo (repo logo/light_logo.jpg) */
html[data-ds-theme="light"] body.ds #iqd-bar img.iqd-logo { content: url("logo-light.jpg"); }
html body.ds #iqd-bar button.iqd-theme { width: 36px; height: 36px; border-radius: var(--r); color: var(--ink); }
html body.ds #iqd-bar button.iqd-theme svg { width: 17px; height: 17px; }

.ds-page { max-width: 1320px; margin: 0 auto; padding: 0 24px 64px; }

/* ── masthead: logo block · wordmark · tabs · page tools, closed by a 1px ink rule ── */
.ds-head { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; padding: 16px 0 14px; margin-bottom: 0;
           min-height: 92px; box-sizing: border-box;   /* same height on all three pages, whatever tools sit on the right */
           border-bottom: 1px solid var(--rule); }
.ds-mark { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.ds-mark > span { font: 400 44px/1 "Instrument Serif", Georgia, serif; letter-spacing: -.01em; }
.ds-mark em { font-style: italic; color: var(--brand); }
.ds-tabs { display: flex; gap: 2px; align-self: stretch; align-items: stretch; }
.ds-tabs a { display: flex; align-items: center; padding: 0 12px; text-decoration: none; font: 400 16px/1 var(--font); color: var(--ink);
             border-bottom: 3px solid transparent; margin-bottom: -15px; }
.ds-tabs a:hover { border-bottom-color: var(--ln2); }
.ds-tabs a[aria-current="page"] { font-weight: 700; color: var(--nav-on); border-bottom-color: var(--nav-on); }
.ds-tools { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ds-tools > .ds-lab { font-size: 13px; line-height: 1.4; }

/* section eyebrow lockup: an 8px orange bar, then an uppercase 300-weight label */
.ds-eyebrow, .ds-panel-head h2 { display: flex; align-items: center; gap: 12px; margin: 0;
              font: 300 24px/1.2 var(--font); text-transform: uppercase; color: var(--mut); }
.ds-eyebrow::before, .ds-panel-head h2::before { content: ""; flex: none; width: 8px; height: 26px; background: var(--brand); }

/* ── controls ── */
.ds-field { display: flex; flex-direction: column; gap: 6px; }
.ds-field > .ds-lab, .ds-lab { font: 400 12px/1.4 var(--font); color: var(--mut); }
/* body.ds prefix: the shared Desk sheet styles input[type=…] (4px corners, its own colours) and is injected later */
body.ds .ds-input, body.ds .ds-dd-btn, body.ds select.ds-input {
  height: 36px; padding: 0 15px; border-radius: var(--r); border: 1px solid var(--mut); background: var(--bg);
  color: var(--ink); font: 400 14px/1 var(--font); font-feature-settings: "tnum" 1; outline: none; box-shadow: none; }
body.ds .ds-input:hover, body.ds .ds-dd-btn:hover { border-color: var(--ink); }
body.ds .ds-input:focus, body.ds .ds-dd-btn:focus-visible, body.ds .ds-dd.open .ds-dd-btn { border-color: var(--ink) !important; outline: none; box-shadow: inset 0 0 0 1px var(--ink); }
.ds-input::placeholder { color: var(--mut); }
body.ds .ds-input:focus-visible, body.ds .ds-ta:focus-visible { outline: none; }
body.ds .ds-input[type=number] { width: 96px; -moz-appearance: textfield; }
.ds-input[type=number]::-webkit-inner-spin-button, .ds-input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.ds-affix { position: relative; display: inline-flex; align-items: center; }
.ds-affix > i { position: absolute; left: 14px; font-style: normal; color: var(--mut); pointer-events: none; font-size: 13px; line-height: 1; }
.ds-affix > i svg { display: block; width: 15px; height: 15px; }
body.ds .ds-affix > .ds-input { padding-left: 33px; }
.ds-affix > b { position: absolute; right: 14px; font: 400 12px/1 var(--font); color: var(--mut); pointer-events: none; }
.ds-affix > .ds-input:has(+ b) { padding-right: 32px; }
/* search shortcut badge: shown while the box is empty */
body.ds .ds-affix > b.ds-kbd { right: 9px; padding: 3px 6px; border: 1px solid var(--ln2); border-radius: var(--r); font: 500 11px/1 var(--font); letter-spacing: .02em; }
body.ds .ds-affix > .ds-input:has(+ b.ds-kbd) { padding-right: 58px; }
.ds-affix > .ds-input:not(:placeholder-shown) + b.ds-kbd { display: none; }
.ds-search { width: 240px; text-transform: uppercase; }
.ds-search::placeholder { text-transform: none; }

/* buttons: black pills */
.ds-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 6px 17px;
          border-radius: var(--r); border: 1px solid var(--ink); background: transparent; color: var(--ink);
          font: 400 16px/1 var(--font); cursor: pointer; white-space: nowrap; }
.ds-btn:hover { background: var(--sf2); }
.ds-btn:active { transform: translateY(1px); }
.ds-btn.primary, .ds-btn[aria-pressed="true"] { background: var(--pill); border-color: var(--pill); color: var(--on-pill); }
.ds-btn.primary:hover, .ds-btn[aria-pressed="true"]:hover { opacity: .85; }
.ds-btn.ghost { border-color: transparent; color: var(--ink2); font-size: 14px; }
.ds-btn.ghost:hover { color: var(--ink); background: var(--sf2); }
.ds-btn:disabled { opacity: .5; cursor: progress; }
.ds-btn svg { width: 16px; height: 16px; flex: none; }

/* segmented control: plain words, the chosen one becomes a black pill */
.ds-seg { display: inline-flex; gap: 2px; }
.ds-seg button { height: 32px; padding: 0 13px; border: 0; border-radius: var(--r); background: transparent; color: var(--ink);
                 font: 400 14px/1 var(--font); cursor: pointer; white-space: nowrap; }
.ds-seg button:hover { background: var(--sf2); }
.ds-seg button[aria-pressed="true"] { background: var(--pill); color: var(--on-pill); font-weight: 700; }
/* timeframes: label over the hit count */
.ds-seg.tf button { height: 44px; min-width: 54px; padding: 0 12px; border-radius: var(--r); display: flex; flex-direction: column;
                    align-items: center; justify-content: center; gap: 3px; font: 700 15px/1 var(--font); }
.ds-seg.tf button small { font: 400 12px/1 var(--font); color: var(--mut); }
.ds-seg.tf button[aria-pressed="true"] small { color: inherit; opacity: .75; }
.ds-seg.tf button small:empty::before { content: "–"; opacity: .5; }
/* chips: several choices */
.ds-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ds-chips button { height: 32px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--ln2); background: transparent;
                   color: var(--ink); font: 400 14px/1 var(--font); cursor: pointer; }
.ds-chips button:hover { border-color: var(--ink); }
.ds-chips button[aria-pressed="true"] { background: var(--pill); border-color: var(--pill); color: var(--on-pill); font-weight: 700; }

/* switch */
.ds-switch { display: inline-flex; align-items: center; gap: 10px; height: 32px; cursor: pointer; color: var(--ink);
             font: 400 14px/1.2 var(--font); white-space: nowrap; user-select: none; }
body.ds .ds-switch input { appearance: none; -webkit-appearance: none; margin: 0; flex: none; width: 34px; height: 20px; vertical-align: middle; box-shadow: none; border: 0; border-radius: var(--r);
                   background: var(--ln2); position: relative; cursor: pointer; }
body.ds .ds-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 2px; background: #fff; transition: transform .15s; }
body.ds .ds-switch input:focus { box-shadow: none; }
body.ds .ds-switch input:checked { background: var(--pill); }
body.ds .ds-switch input:checked::after { transform: translateX(14px); background: var(--on-pill); }

/* dropdowns (DS.enhanceSelect, the History candle list) */
.ds-dd { position: relative; }
.ds-dd-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 120px; width: 100%; cursor: pointer; text-align: left; }
.ds-dd-btn > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-dd-btn::after { content: ""; flex: none; width: 6px; height: 6px; border: solid var(--ink); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translateY(-2px); }
.ds-dd-btn:disabled { opacity: .45; cursor: not-allowed; }
.ds-dd-list { position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; min-width: max(100%, 200px); max-height: 320px; overflow-y: auto;
              padding: 4px 0; background: var(--bg); border: 1px solid var(--ln); box-shadow: var(--drop); }
.ds-dd-opt { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 9px 14px; cursor: pointer;
             white-space: nowrap; font: 400 14px/1.2 var(--font); color: var(--ink); }
.ds-dd-opt:hover, .ds-dd-opt.kb { background: var(--sf2); }
.ds-dd-opt.on { font-weight: 700; box-shadow: inset 3px 0 0 var(--ink); }
.ds-dd-opt .c { font-size: 12px; color: var(--mut); }
.ds-dd-opt.mode { color: var(--mut); }
.ds-dd-opt.mode + .ds-dd-opt:not(.mode), .ds-dd-opt:not(.mode) + .ds-dd-opt.mode { border-top: 1px solid var(--ln); }
.ds-dd-find { position: sticky; top: -4px; margin: -4px 0 4px; padding: 8px; background: var(--bg); border-bottom: 1px solid var(--ln); }
body.ds .ds-dd-find .ds-input { width: 100%; height: 32px; }
.ds-dd-none { padding: 10px 14px; color: var(--mut); font-size: 13px; }

/* ── status strip: one cell per fact, hairlines between, no boxes ── */
.ds-rail { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-bottom: 1px solid var(--ln); }
.ds-cell { padding: 14px 18px 14px; border-left: 1px solid var(--ln); min-width: 0; }
.ds-cell:first-child { border-left: 0; padding-left: 0; }
.ds-cell .ds-lab { display: block; margin-bottom: 6px; }
.ds-cell .v { font: 700 20px/1.2 var(--font); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-cell .v small { font-size: 13px; font-weight: 400; color: var(--mut); margin-left: 5px; }
.ds-cell .sub { margin-top: 3px; font-size: 12px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-cell.bad .v, .ds-cell.bad .sub { color: var(--live); }
.ds-cell .meter { height: 4px; margin-top: 9px; background: var(--ln); overflow: hidden; display: flex; }
.ds-cell .meter i { display: block; height: 100%; }
/* session: the LIVE badge with its pulsing dot */
.ds-state { display: inline-flex; align-items: center; gap: 9px; }
.ds-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ln2); flex: none; }
.ds-state.live { padding: 3px 7px 3px 6px; border: 1.5px solid var(--live); border-radius: 2px; color: var(--live);
                 font: 900 14px/1 var(--font); text-transform: uppercase; }
.ds-state.live .ds-dot { background: var(--live); animation: ds-pulse 1.6s infinite; }
.ds-state.wait .ds-dot { background: var(--mut); }
@keyframes ds-pulse { 50% { opacity: .25; } }
/* problems: breaking bands */
.ds-alerts { display: flex; flex-direction: column; gap: 2px; margin: 0; }
.ds-alerts:empty { display: none; }
.ds-alert { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--live); color: #fff; font: 700 15px/1.35 var(--font); }
.ds-alert::before { content: "Alert"; flex: none; padding: 2px 6px; border: 1.5px solid #fff; border-radius: 2px; font: 900 12px/1 var(--font); text-transform: uppercase; }

/* ── filter bar: flat, closed by a hairline ── */
.ds-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--ln); }
.ds-bar .grow { flex: 1; }
.ds-bar .sep { width: 1px; align-self: stretch; background: var(--ln); }
.ds-bar .ds-field { min-width: 0; max-width: 100%; }
/* History: timeframes on their own line; date + filters left-aligned on the next */
.ds-bar-stack { flex-direction: column; align-items: flex-start; }
.ds-bar-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; max-width: 100%; }
.ds-tf-big .ds-seg button { height: 40px; min-width: 56px; padding: 0 16px; font-size: 16px; }

/* ── notes ── */
.ds-note { margin-top: 14px; padding: 10px 16px; font-size: 14px; color: var(--ink2); background: var(--sf2); border-left: 3px solid var(--ln2); }
.ds-note.err { color: #fff; background: var(--live); border-left-color: var(--live); font-weight: 700; }
.ds-note.warn { color: var(--ink); border-left-color: var(--ink); }
.ds-note code { font-size: 13px; padding: 1px 5px; background: var(--bg); border: 1px solid var(--ln); border-radius: 4px; }
#msg:empty { display: none; }

/* ── result sections ── */
.ds-panel { min-width: 0; margin-top: 26px; }
.ds-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 0 12px; flex-wrap: wrap; }
.ds-count { display: inline-block; padding: 3px 8px; border-radius: var(--r); background: var(--pill); color: var(--on-pill);
            font: 700 12px/1.2 var(--font); text-transform: none; }
.ds-panel-head .note { font-size: 12px; color: var(--mut); }
.ds-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.ds-drawer .ds-panel { margin-top: 0; }

/* ── tables (DS.table): an ink rule on top, hairlines between rows ── */
.ds-tbl-wrap { overflow: auto; border-top: 1px solid var(--rule); }
.ds-tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.ds-tbl th { position: sticky; top: 0; z-index: 2; padding: 10px 12px; background: var(--bg); border-bottom: 1px solid var(--ln);
             text-align: left; white-space: nowrap; font: 400 12px/1.4 var(--font); color: var(--mut); user-select: none; }
.ds-tbl th.sortable { cursor: pointer; }
.ds-tbl th.sortable:hover { color: var(--ink); }
.ds-tbl th[aria-sort] { color: var(--ink); font-weight: 700; }
.ds-tbl th[aria-sort]::after { content: ""; display: inline-block; margin-left: 6px; border: 4px solid transparent; vertical-align: 1px; }
.ds-tbl th[aria-sort="descending"]::after { border-top-color: var(--ink); border-bottom-width: 0; }
.ds-tbl th[aria-sort="ascending"]::after { border-bottom-color: var(--ink); border-top-width: 0; vertical-align: 3px; }
.ds-tbl td { padding: 9px 12px; border-bottom: 1px solid var(--ln); white-space: nowrap; color: var(--ink2); }
.ds-tbl th:first-child, .ds-tbl td:first-child { padding-left: 4px; }
.ds-tbl th:last-child, .ds-tbl td:last-child { padding-right: 4px; }
.ds-tbl .n { text-align: right; }
.ds-tbl .grow { width: 100%; }
.ds-tbl tbody tr:last-child td { border-bottom: 0; }
.ds-tbl tr.click { cursor: pointer; }
.ds-tbl tr.click:hover td { background: var(--sf2); }
.ds-tbl tr.click:focus-visible { outline: none; }
.ds-tbl tr.click:focus-visible td { background: var(--sf2); box-shadow: inset 0 -2px 0 var(--ink); }
.ds-tbl tr.on td { background: var(--sf2); }
.ds-tbl tr.on td:first-child { box-shadow: inset 3px 0 0 var(--ink); }
.ds-tbl td.pos { color: var(--buy); }
.ds-tbl td.neg { color: var(--sell); }
.ds-tbl td.sym { color: var(--ink); font-weight: 700; }
.ds-tbl td.t { color: var(--ink); }
.ds-tbl td .u { margin-left: 2px; font-size: .8em; opacity: .65; }
.ds-tbl td.hit { color: var(--buy); font-weight: 900; }
.ds-tbl td.gap { color: var(--mut); font-style: italic; }
/* Live: one group row per close, like a minute-by-minute timeline (dot on a silver rail) */
.ds-tbl tr.grp td { position: sticky; top: 37px; z-index: 1; padding: 12px 4px 8px; background: var(--bg); border-bottom: 1px solid var(--ink); color: var(--ink); }
.ds-tbl tr.grp .g { display: flex; align-items: baseline; gap: 12px; }
.ds-tbl tr.grp .g::before { content: ""; align-self: center; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--ln2); flex: none; }
.ds-tbl tr.grp b { font: 700 18px/1 var(--font); }
.ds-tbl tr.grp span { font-size: 12px; color: var(--mut); }
.ds-tbl tr.grp .ago { margin-left: auto; }
.ds-tbl tr.grp.latest .g::before { background: var(--live); border-color: var(--live); }
.ds-tbl tr.grp.latest .ago { color: var(--live); font-weight: 900; text-transform: uppercase; }
.ds-tbl tr.grp.new td { animation: ds-fade 4s ease-out; }
@keyframes ds-fade { from { background: color-mix(in srgb, var(--live) 12%, var(--bg)); } }
.ds-more { display: flex; justify-content: center; padding: 10px; border-top: 1px solid var(--ln); }

/* small tags next to the symbol */
.ds-tag { display: inline-block; margin-left: 7px; padding: 2px 4px 1px; border-radius: 2px; vertical-align: 1px;
          font: 700 10.5px/1.2 var(--font); letter-spacing: .02em; color: var(--mut); border: 1px solid var(--ln2); }
.ds-tag.ipo { color: var(--on-pill); background: var(--pill); border-color: var(--pill); font-weight: 900; }
.ds-tag.part { border-style: dashed; }
.ds-ch { display: inline-flex; vertical-align: -3px; margin-left: 6px; color: var(--ink); }
.ds-ch svg { width: 14px; height: 14px; }

/* copy-symbol button: a circular icon button */
.ds-copy { display: inline-flex; vertical-align: -4px; margin-left: 6px; padding: 4px; border: 0; border-radius: var(--r); background: transparent;
           color: var(--mut); cursor: pointer; line-height: 0; }
.ds-copy svg { width: 13px; height: 13px; }
.ds-copy:hover { color: var(--ink); background: var(--sf2); }
.ds-copy.done { color: var(--buy); }
.ds-copy.row { visibility: hidden; }
tr:hover .ds-copy.row, tr:focus-within .ds-copy.row, .ds-copy.row.done { visibility: visible; }

/* empty / loading */
.ds-empty { padding: 44px 20px 50px; text-align: center; color: var(--mut); border-top: 1px solid var(--rule); }
.ds-empty b { display: block; margin-bottom: 4px; font: 700 18px/1.35 var(--font); color: var(--ink); }
.ds-empty svg { display: block; width: 46px; height: 28px; margin: 0 auto 14px; color: var(--ln2); }
.ds-loading { padding: 30px; text-align: center; color: var(--mut); }

/* ── Replay: TradingView marks, summary ── */
.ds-tv { display: inline-flex; gap: 4px; }
.ds-tv button { width: 30px; height: 26px; border: 1px solid var(--ln2); border-radius: var(--r); background: transparent; color: var(--mut);
                cursor: pointer; font: 700 13px/1 var(--font); }
.ds-tv button:hover { color: var(--ink); border-color: var(--ink); }
.ds-tv button.on[data-v=match] { background: var(--buy); border-color: var(--buy); color: #fff; }
.ds-tv button.on[data-v=differs] { background: var(--sell); border-color: var(--sell); color: #fff; }
.ds-mtx { border-collapse: collapse; font-size: 14px; }
.ds-mtx th, .ds-mtx td { padding: 8px 16px; text-align: right; border-bottom: 1px solid var(--ln); white-space: nowrap; }
.ds-mtx th { font: 400 12px/1.4 var(--font); color: var(--mut); }
.ds-mtx th:first-child, .ds-mtx td:first-child { text-align: left; padding-left: 0; color: var(--ink); }
.ds-mtx td { color: var(--ink); font-weight: 700; }
.ds-mtx td.z { color: var(--mut); font-weight: 400; }
.ds-sum { display: grid; grid-template-columns: auto 1fr; gap: 20px 48px; padding: 14px 0 4px; align-items: start; border-top: 1px solid var(--rule); }
.ds-sum h3 { margin: 0 0 10px; font: 700 14px/1.3 var(--font); color: var(--ink); }
.ds-syms { display: flex; flex-wrap: wrap; gap: 6px; }
.ds-syms span { padding: 3px 7px; border: 1px solid var(--ln2); border-radius: 2px; font: 700 12px/1.2 var(--font); color: var(--ink); }
.ds-ta { width: 440px; max-width: 100%; min-height: 64px; height: 64px; padding: 9px 15px; border-radius: var(--r); resize: vertical;
         border: 1px solid var(--mut); background: var(--bg); color: var(--ink); font: 400 14px/1.45 var(--font); text-transform: uppercase; }
body.ds .ds-ta:focus { border-color: var(--ink) !important; outline: none; box-shadow: inset 0 0 0 1px var(--ink); }
.ds-ta::placeholder { text-transform: none; color: var(--mut); }

/* ── drawer: one stock's chart and candles ── */
.ds-scrim { position: fixed; inset: 0; z-index: 1090; background: var(--scrim); opacity: 0; transition: opacity .18s; }
.ds-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 1100; width: min(820px, 100vw); display: flex; flex-direction: column;
             background: var(--bg); box-shadow: var(--drop); transform: translateX(100%); transition: transform .22s cubic-bezier(.2, .7, .2, 1); }
.ds-drawer.open { transform: none; }
.ds-scrim.open { opacity: 1; }
/* centred in the whole dimmed area left of the drawer: the wheel anywhere here (or anywhere in the drawer but the chart)
   scrolls the drawer, a click closes it. Theme-aware card so it reads on both the light and dark scrim. */
.ds-scrim-hint { position: absolute; top: 0; bottom: 0; left: 0; right: min(820px, 100vw); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.ds-scrim-hint > div { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 22px 16px; max-width: 15em;
                       background: var(--bg); color: var(--ink); border: 1px solid var(--ln); border-radius: var(--r); box-shadow: var(--drop);
                       font: 500 11px/1.6 var(--font); letter-spacing: .14em; text-transform: uppercase; text-align: center;
                       opacity: 0; animation: ds-hint-in .3s .25s ease-out forwards; }
.ds-scrim-hint small { font: 400 11px/1.5 var(--font); letter-spacing: .04em; text-transform: none; color: var(--mut); }
.ds-scrim-hint svg { width: 26px; height: 40px; }
.ds-scrim-hint .wheel { animation: ds-wheel 1.6s ease-in-out infinite; }
.ds-scrim-hint .chev { animation: ds-chev 1.6s ease-in-out infinite; }
@keyframes ds-hint-in { from { opacity: 0; transform: translateY(6px); } to { opacity: .95; transform: none; } }
@keyframes ds-wheel { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 70% { transform: translateY(8px); opacity: 0; } 100% { transform: translateY(8px); opacity: 0; } }
@keyframes ds-chev { 0%, 30% { transform: translateY(0); opacity: .25; } 60% { transform: translateY(3px); opacity: 1; } 100% { transform: translateY(0); opacity: .25; } }
@media (max-width: 1080px) { .ds-scrim-hint { display: none; } }   /* dimmed strip too narrow for the card */
@media (prefers-reduced-motion: reduce) { .ds-scrim-hint .wheel, .ds-scrim-hint .chev { animation: none; } .ds-scrim-hint > div { animation: none; opacity: .95; } }
.ds-drawer-head { display: flex; align-items: flex-start; gap: 14px; padding: 20px 24px 16px; border-bottom: 1px solid var(--rule); }
.ds-drawer-head h2 { margin: 0; font: 700 32px/1.25 var(--font); color: var(--ink); }
.ds-drawer-head h2 .ds-copy { vertical-align: 4px; }
.ds-drawer-head .sub { margin-top: 2px; font-size: 14px; color: var(--mut); }
.ds-drawer-head .ds-btn { margin-left: auto; }
.ds-drawer-body { flex: 1; overflow-y: auto; padding: 18px 24px 28px; }
.ds-drawer-body h3 { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; font: 300 20px/1.2 var(--font); text-transform: uppercase; color: var(--mut); }
.ds-drawer-body h3::before { content: ""; width: 8px; height: 22px; background: var(--brand); flex: none; }
.ds-drawer-body h3 span { font-size: 12px; text-transform: none; font-weight: 400; }
.ds-drawer-body .caption { font-size: 13px; color: var(--mut); margin-bottom: 12px; }

#chart { position: relative; height: 400px; border-bottom: 1px solid var(--ln); background: var(--bg); overflow: hidden; }
.chart-legend { position: absolute; top: 9px; left: 4px; z-index: 3; pointer-events: none; font: 400 12px/1.65 var(--font); color: var(--ink); }
.chart-legend span { margin-right: 6px; } .chart-legend .mut { color: var(--mut); margin-right: 3px; }
.chart-legend b { margin-right: 6px; font-weight: 700; }
.ds-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin-top: 8px; font-size: 12px; color: var(--mut); }
.ds-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ds-legend i { display: inline-block; width: 10px; height: 10px; }

/* Volume / Delta / Min Δ strip right under the chart (delta.js drawFlow): cells are placed at the chart's candle
   x positions, so they pan / zoom with it; --pane = the chart's plot width, row names sit under the price axis */
.ds-flow { border-bottom: 1px solid var(--ln); user-select: none; cursor: grab; touch-action: pan-y; }
.ds-flow.drag { cursor: grabbing; }
.ds-flow-row { position: relative; height: 26px; }
.ds-flow-row + .ds-flow-row { border-top: 1px solid var(--bg); }
.ds-flow .cells { position: absolute; left: 0; top: 0; bottom: 0; width: var(--pane, 100%); overflow: hidden; }
.ds-flow .c { position: absolute; top: 1px; bottom: 1px; display: flex; align-items: center; justify-content: center; overflow: hidden;
              white-space: nowrap; font: 400 11px/1 var(--font); font-feature-settings: "tnum" 1; color: var(--ink); }
.ds-flow .c.on { box-shadow: inset 0 0 0 1.5px var(--ink); font-weight: 700; }
.ds-flow .c.hv { box-shadow: inset 0 0 0 1px var(--mut); }
.ds-flow .lab { position: absolute; left: calc(var(--pane, 100%) + 8px); top: 0; bottom: 0; display: flex; align-items: center;
                font-size: 11px; color: var(--mut); white-space: nowrap; }

/* tick / cross icons and the "Your marks" count badges (Replay) */
.ds-ico { display: block; width: 13px; height: 13px; flex: none; }
.ds-tv button .ds-ico { width: 12px; height: 12px; margin: auto; }
.ds-marks { display: flex; gap: 8px; }
.ds-mk { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px 0 9px; border-radius: var(--r);
         font: 700 15px/1 var(--font); font-feature-settings: "tnum" 1; color: #fff; }
.ds-mk .ds-ico { width: 14px; height: 14px; }
.ds-mk.ok { background: var(--buy); }
.ds-mk.bad { background: var(--sell); }

/* ── History: calendar ── */
.ds-cal { position: relative; }
.ds-cal-btn { min-width: 168px; justify-content: flex-start; gap: 9px; }
.ds-cal-btn svg { color: var(--ink); flex: none; width: 15px; height: 15px; }
.ds-cal-btn > span { flex: 1; }
.ds-cal-btn .dim { color: var(--mut); }
.ds-cal-pop { position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; width: 284px; padding: 14px; background: var(--bg);
              border: 1px solid var(--ln); box-shadow: var(--drop); color: var(--ink); }
.ds-cal-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ds-cal-hd b { font: 700 16px/1 var(--font); }
.ds-cal-nav { width: 32px; height: 32px; border: 0; border-radius: var(--r); background: transparent; color: var(--ink); cursor: pointer; font-size: 18px; }
.ds-cal-nav:hover:not(:disabled) { background: var(--sf2); }
.ds-cal-nav:disabled { opacity: .3; cursor: default; }
.ds-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.ds-cal-grid .wd { padding: 4px 0 6px; text-align: center; font: 400 12px/1 var(--font); color: var(--mut); }
.ds-cal-d { height: 34px; border: 0; border-radius: var(--r); background: transparent; color: var(--ink); font: 400 14px/1 var(--font); cursor: pointer; }
.ds-cal-d:hover:not(:disabled) { background: var(--sf2); }
.ds-cal-d:disabled { color: var(--mut); opacity: .35; cursor: default; }
.ds-cal-d.today { box-shadow: inset 0 0 0 1px var(--ln2); }
.ds-cal-d.in { background: var(--sf2); border-radius: 0; }
.ds-cal-d.sel { background: var(--pill); color: var(--on-pill); font-weight: 700; border-radius: var(--r); }
.ds-cal-ft { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--ln);
             font-size: 12px; color: var(--mut); }
.ds-cal-ft button { height: 28px; padding: 0 12px; border: 0; border-radius: var(--r); background: var(--pill); color: var(--on-pill); font: 400 13px/1 var(--font); cursor: pointer; }

/* ── History: sector picker (a modal) ── */
.ds-sec-btn { width: 180px; }
.sec-modal { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 3vw; background: var(--scrim); }
.sec-box { width: min(1280px, 100%); max-height: 90vh; display: flex; flex-direction: column; overflow: hidden;
           background: var(--bg); border-radius: 10px; box-shadow: var(--drop); }
.sec-hd { display: flex; align-items: center; gap: 14px; padding: 18px 24px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.sec-hd h3 { display: flex; align-items: center; gap: 12px; margin: 0; font: 300 24px/1.2 var(--font); text-transform: uppercase; color: var(--mut); }
.sec-hd h3::before { content: ""; width: 8px; height: 26px; background: var(--brand); }
.sec-hd .sub { color: var(--mut); font-size: 13px; }
.sec-hd .spacer { flex: 1; }
.sec-hd .ds-input { width: 220px; }
.sec-x { width: 36px; height: 36px; border: 1px solid var(--ink); border-radius: var(--r); background: transparent; color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; }
.sec-x:hover { background: var(--sf2); }
.sec-grid { overflow-y: auto; padding: 0 24px 24px; display: grid; column-gap: 32px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); align-content: start; }
.sec-card { display: flex; flex-direction: column; gap: 12px; padding: 16px 0 14px; text-align: left; font: inherit; color: var(--ink);
            background: transparent; border: 0; border-bottom: 1px solid var(--ln); cursor: pointer; }
.sec-card:hover .sec-name { text-decoration: underline; }
.sec-card:focus-visible { outline-offset: -2px; }
.sec-card.on { box-shadow: inset 0 -3px 0 var(--ink); }
.sec-card.on .sec-name { font-weight: 900; }
.sec-card.zero { opacity: .45; }
.sec-top { display: flex; align-items: center; gap: 12px; flex: 1 0 auto; }
.sec-ico { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--sf2); color: var(--ink) !important; }
.sec-ico i { display: block; width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.sec-t { flex: 1; min-width: 0; }
.sec-name { font: 700 16px/1.3 var(--font); }
.sec-of { margin-top: 2px; font-size: 12px; color: var(--mut); }
.sec-pill { flex: none; font: 300 30px/1 var(--font); color: var(--mut); }
.sec-card:not(.zero) .sec-pill { color: var(--ink); }
.sec-caps { display: grid; grid-template-columns: repeat(4, 1fr); }
.sec-caps div { display: flex; flex-direction: column; gap: 4px; }
.sec-caps .k { font-size: 12px; color: var(--mut); }
.sec-caps .v { font: 700 15px/1 var(--font); color: var(--ink); }
.sec-caps .v.z { color: var(--mut); font-weight: 400; }
.sec-none { grid-column: 1 / -1; padding: 40px; text-align: center; color: var(--mut); }


/* ── small screens ── */
@media (max-width: 1100px) {
  .ds-cols { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 860px) {
  .ds-page { padding: 0 14px 48px; }
  html body.ds #iqd-bar { height: 60px; padding: 0 14px; }
  html body.ds #iqd-bar img.iqd-logo { height: 26px; }
  .ds-mark > span { font-size: 36px; }
  .ds-head { gap: 12px 18px; }
  .ds-tabs a { margin-bottom: 0; padding: 8px 10px; }
  .ds-tools { padding-top: 6px; }
  .ds-tools { margin-left: 0; width: 100%; }
  .ds-tools .ds-field, .ds-tools .ds-affix, .ds-search { flex: 1; min-width: 0; width: auto; }
  .ds-rail { grid-template-columns: repeat(2, 1fr); }
  .ds-cell { border-left: 0; border-top: 1px solid var(--ln); padding-left: 0; }
  .ds-cell:nth-child(-n+2) { border-top: 0; }
  .ds-cell:nth-child(even) { border-left: 1px solid var(--ln); padding-left: 16px; }
  .ds-bar .grow, .ds-bar .sep { display: none; }
  .ds-seg.tf { max-width: 100%; overflow-x: auto; }
  .ds-sum { grid-template-columns: 1fr; }
  .ds-drawer-head h2 { font-size: 24px; }
  #chart { height: 320px; }
}

@media (prefers-reduced-motion: reduce) {
  body.ds *, body.ds *::before, body.ds *::after { animation: none !important; transition: none !important; }
}
