/* Tape. Black screen, solid orange header bars, yellow tickers, white numbers, blue
   charts, green and red for direction: the terminal palette. Panels with a labelled
   header bar, dense tables, every number in mono with tabular figures so the columns
   sit on the decimal. Headings Figtree, body IBM Plex Sans, numbers IBM Plex Mono. */

:root {
  --bg:        #000000;
  --surface:   #0e0e0e;
  --surface-2: #181818;
  --line:      #2e2e2e;
  --line-soft: #222222;
  --text:      #e6e6e6;
  --muted:     #a3a3a3;
  --faint:     #6f6f6f;
  --accent:    #f58220;
  --yellow:    #ffd23f;
  --red-bar:   #b3121f;
  --up:        #2fd15a;
  --down:      #ff4d3d;
  --blue:      #3d7bff;
  --violet:    #b58ae6;

  --display: "Figtree", "Helvetica Neue", Arial, sans-serif;
  --sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", Menlo, monospace;

  --top-h: 48px;
  --tape-h: 30px;
  --radius: 3px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
.none { color: var(--faint); }

/* ---------------------------------------------------------------- header */

.top {
  position: sticky; top: 0; z-index: 30;
  height: var(--top-h);
  display: flex; align-items: center; gap: 18px;
  padding: 0 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.mark { display: flex; align-items: center; padding-right: 6px; }
.mark img { height: 15px; width: auto; display: block; }

.nav { display: flex; gap: 2px; }
.nav a {
  font-family: var(--display); font-weight: 600; font-size: 12.5px; letter-spacing: .01em;
  color: var(--muted); padding: 6px 10px; border-radius: var(--radius);
  transition: color .12s, background .12s;
}
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a.on { color: var(--text); background: var(--surface-2); }
.nav-item { position: relative; }
.nav-item > a { display: inline-flex; align-items: center; gap: 5px; }
.caret { display: inline-block; width: 0; height: 0; border-left: 3.5px solid transparent; border-right: 3.5px solid transparent; border-top: 4px solid currentColor; opacity: .7; }
.mega {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 45;
  display: none; grid-template-columns: 150px 300px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 16px 44px rgba(0,0,0,.6);
}
.mega::before { content: ""; position: absolute; top: -8px; left: 0; right: 0; height: 8px; }   /* keeps the menu open while the mouse crosses the gap */
.nav-item:hover .mega, .nav-item:focus-within .mega { display: grid; }
.mega ul { list-style: none; margin: 0; padding: 6px; }
.mega-groups { border-right: 1px solid var(--line); }
.mega-groups a { display: block; padding: 7px 10px; border-radius: 2px; color: var(--muted); font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: 0; }
.mega-groups a:hover, .mega-groups a.hot { color: var(--yellow); background: var(--surface); }
.mega-list a { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 5px 10px; border-radius: 2px; font-weight: 400; }
.mega-list a:hover { background: var(--surface); }
.mm-code { font-family: var(--display); font-weight: 700; font-size: 12.5px; color: var(--yellow); letter-spacing: 0; }
.mm-name { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-all a { display: block; margin-top: 4px; padding: 6px 10px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; color: var(--muted); }
.mm-all a:hover { color: var(--text); }

.search { position: relative; width: 210px; margin-left: auto; color: var(--faint); }
.search input {
  width: 100%; font: inherit; font-size: 12.5px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 5px 10px 5px 28px; outline: none; -webkit-appearance: none;
  transition: border-color .12s, background .12s;
}
.search input::placeholder { color: var(--faint); }
.search input:focus { border-color: var(--faint); background: var(--surface-2); }

.search-ico { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40; min-width: 380px;
  list-style: none; margin: 0; padding: 4px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 14px 40px rgba(0,0,0,.55); max-height: 380px; overflow: auto;
}
.results li { display: grid; grid-template-columns: 90px minmax(0,1fr) auto; align-items: baseline; gap: 10px; padding: 7px 9px; border-radius: var(--radius); cursor: pointer; }
.results li:hover, .results li.active { background: var(--surface); }
.results .r-sym { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--yellow); }
.results .r-name { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.results .r-meta { font-family: var(--mono); font-size: 10px; color: var(--faint); letter-spacing: .04em; }
.results .r-none { padding: 9px; color: var(--faint); font-size: 12.5px; }

.clocks { display: flex; gap: 14px; font-family: var(--mono); font-size: 11px; color: var(--faint); white-space: nowrap; }
.clocks b { color: var(--muted); font-weight: 500; margin-right: 5px; }
.clocks .open { color: var(--up); }
.updated { font-family: var(--mono); font-size: 10.5px; color: var(--faint); white-space: nowrap; }

/* ---------------------------------------------------------------- favourites tape */

.tape { position: sticky; top: var(--top-h); z-index: 29; height: var(--tape-h); background: var(--red-bar); border-bottom: 1px solid var(--line); overflow: hidden; }
.tape-item .t-px { color: #fff; }
.tape-item { border-right-color: rgba(0,0,0,.35); }
.tape-item:hover { background: rgba(0,0,0,.25); }
.tape-empty { color: rgba(255,255,255,.75); }
.tape-track { display: inline-flex; align-items: center; height: 100%; white-space: nowrap; animation: slide var(--dur, 40s) linear infinite; will-change: transform; }
.tape:hover .tape-track { animation-play-state: paused; }
.tape-track.still { animation: none; }
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tape-item { display: inline-flex; align-items: baseline; gap: 8px; padding: 0 18px; height: 100%; border-right: 1px solid var(--line-soft); font-family: var(--mono); font-size: 11.5px; font-variant-numeric: tabular-nums; cursor: pointer; }
.tape-item:hover { background: var(--surface-2); }
.tape-item .t-sym { font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: .03em; color: var(--yellow); }
.tape-item .t-px { color: var(--text); }
.tape-empty { padding: 0 18px; font-size: 12px; color: var(--faint); line-height: var(--tape-h); }

/* ---------------------------------------------------------------- shell */

.shell { display: block; min-height: calc(100vh - var(--top-h) - var(--tape-h)); }


.main { padding: 16px 22px 80px; min-width: 0; max-width: 1720px; margin: 0 auto; }

/* ---------------------------------------------------------------- view head */

.view-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.view-head h1 { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: -0.02em; line-height: 1.05; margin: 0; }
.view-sub { margin: 0; color: var(--faint); font-size: 12.5px; }


/* ---------------------------------------------------------------- panel grid */

/* 48 tracks so a dragged edge lands every 2% of the width; the span classes are the defaults in twelfths */
.grid { display: grid; grid-template-columns: repeat(48, minmax(0, 1fr)); gap: 10px; }
.grid > .panel { grid-column: span var(--cols, 16); }
.span-3 { --cols: 12; } .span-4 { --cols: 16; } .span-5 { --cols: 20; }
.span-6 { --cols: 24; } .span-7 { --cols: 28; } .span-8 { --cols: 32; } .span-12 { --cols: 48; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; display: flex; flex-direction: column; }
.panel-h {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 26px;
  padding: 4px 8px; border-bottom: 1px solid var(--line);
  background: var(--accent); color: #000;
  font-family: var(--display); font-weight: 700; font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
}
.panel-h a:hover { text-decoration: underline; }
.panel-k { font-family: var(--mono); font-weight: 500; font-size: 10px; letter-spacing: .02em; text-transform: none; color: #3a2000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-h .seg { border-color: rgba(0,0,0,.35); background: rgba(0,0,0,.35); }
.panel-h .seg button { background: rgba(0,0,0,.15); color: #2a1600; }
.panel-h .seg button:hover { color: #000; }
.panel-h .seg button.on { background: #000; color: var(--yellow); }
.panel-b { padding: 10px; flex: 1; min-width: 0; }
.panel-note { margin: 0 0 8px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.panel-note b { color: var(--text); font-family: var(--mono); font-weight: 500; }
.panel-note:last-child { margin-bottom: 0; }

.seg { display: inline-flex; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg button { font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; color: var(--faint); padding: 3px 8px; background: var(--surface); transition: color .12s, background .12s; text-transform: none; }
.seg button:hover { color: var(--text); }
.seg button.on { color: var(--bg); background: var(--accent); }

/* chart type picker in the box header */
.dd { position: relative; display: inline-flex; margin-right: auto; margin-left: 10px; }
.dd-btn { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; color: #2a1600; background: rgba(0,0,0,.15); border: 1px solid rgba(0,0,0,.35); border-radius: var(--radius); padding: 2px 7px 2px 6px; }
.dd-btn:hover { color: #000; background: rgba(0,0,0,.25); }
.dd-ic, .dd-ic svg { display: inline-block; width: 16px; height: 13px; }
.dd-car { width: 9px; height: 6px; }
.dd-menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 40; min-width: 150px; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .7); }
.dd-menu li { display: flex; align-items: center; gap: 10px; padding: 7px 9px; font-family: var(--sans); font-size: 12.5px; color: var(--text); cursor: pointer; border-radius: 2px; }
.dd-menu li svg { width: 18px; height: 14px; color: var(--muted); }
.dd-menu li:hover { background: var(--surface-2); }
.dd-menu li.on { color: var(--yellow); }
.dd-menu li.on svg { color: var(--yellow); }
.dd-menu li.on::after { content: ""; margin-left: auto; width: 5px; height: 9px; border: solid var(--up); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* ---------------------------------------------------------------- tables */

.tbl { width: 100%; }
.tbl table, table.t { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.t th { font-family: var(--display); font-weight: 600; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 5px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; white-space: nowrap; }
.t tr:last-child td { border-bottom: none; }
.t .r, .t th.r { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.t tbody tr.row { cursor: pointer; }
.t tbody tr.row:hover td { background: var(--surface-2); }
.t .sym { font-family: var(--display); font-weight: 700; font-size: 12.5px; color: var(--yellow); }
.t .nm { color: var(--muted); font-size: 12px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.t .spark { width: 72px; height: 22px; display: block; }
.t td.c { text-align: center; }
.t .hi td { color: var(--text); font-weight: 500; }
.t td.dim { color: var(--faint); }
.t .logo { width: 20px; height: 20px; border-radius: 4px; background: #fff; object-fit: contain; padding: 2px; display: block; }
.t .tile { width: 20px; height: 20px; border-radius: 4px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); font-family: var(--display); font-weight: 800; font-size: 8px; color: var(--accent); }
.t td.w0 { width: 28px; padding-right: 0; }
.t a.ttl { color: var(--text); }
.t a.ttl:hover { color: var(--accent); }
.t td.wrap { white-space: normal; }
.tbl-empty { color: var(--faint); font-size: 12.5px; padding: 6px 0; }

/* compact table on the overview */
.t.compact td { padding: 4px 6px; }
.t.compact th { padding: 3px 6px; }

/* ---------------------------------------------------------------- key value grid */

.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.kv .row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.kv .row .k { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kv .row .v { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kv .row .v.none { color: var(--faint); }
.kv-empty { color: var(--faint); font-size: 12.5px; }

/* ---------------------------------------------------------------- detail hero and strip */

.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-bottom: 10px; }
.hero-id { min-width: 0; }
.hero-sym { display: flex; align-items: center; gap: 8px; }
.hero-id h1 { font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: -0.02em; line-height: 1.05; margin: 0; color: var(--yellow); }
.hero-id p { font-size: 14px; color: var(--muted); margin: 2px 0 6px; }
.hero-px { display: flex; align-items: baseline; gap: 12px; flex: none; }
.big-px { font-family: var(--mono); font-size: 28px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.big-chg { font-family: var(--mono); font-size: 14px; font-variant-numeric: tabular-nums; color: var(--muted); }
.big-chg.up { color: var(--up); } .big-chg.down { color: var(--down); }

.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { font-size: 10.5px; letter-spacing: .03em; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 2px 8px; }

.strip {
  display: flex; flex-wrap: nowrap; justify-content: space-between; gap: 18px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 5px 4px; margin-bottom: 8px; overflow: hidden;
}
.strip .cell { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; flex: 0 1 auto; line-height: 1; }
.strip .cell .k { font-family: var(--display); font-weight: 700; font-size: 12.5px; color: var(--accent); letter-spacing: .01em; white-space: nowrap; }
.strip .cell .v { font-family: var(--mono); font-size: 12.5px; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.strip { align-items: baseline; }
.strip .cell .v .none { color: var(--faint); }
.strip .cell.wide { flex: 1 1 160px; max-width: 300px; }
.strip .cell.wide .rb { flex: 1; margin: 0; }
.strip .cell .spark { width: 84px; height: 20px; display: block; }
.strip .cell.at .v { color: var(--muted); }
@media (max-width: 1180px) { .strip { flex-wrap: wrap; justify-content: flex-start; } }

.rb { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; font-variant-numeric: tabular-nums; margin-top: 3px; }
.rb-track { position: relative; flex: 1; height: 3px; background: var(--line); border-radius: 2px; }
.rb-pin { position: absolute; top: -4px; width: 2px; height: 11px; background: var(--accent); transform: translateX(-1px); }
.rb-lo { color: var(--down); } .rb-hi { color: var(--up); }

/* ---------------------------------------------------------------- charts */

.chart-wrap { position: relative; }
.chart { display: block; width: 100%; height: 300px; }
.mini { display: block; width: 100%; height: 130px; }
.mini.tall { height: 200px; }
.heat { display: block; width: 100%; }
.bars { display: block; width: 100%; }
.surf { display: block; width: 100%; height: 360px; cursor: grab; }
.surf:active { cursor: grabbing; }

svg .grid-line { stroke: var(--line); stroke-width: 1; }
svg .zero-line { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 3 3; }
svg .axis-text { fill: var(--faint); font-family: var(--mono); font-size: 10px; }
svg .hm-lab { font-size: 10px; fill: var(--muted); }
svg .hm-val { font-family: var(--mono); font-size: 9.5px; }
svg .hm-cell:hover rect { stroke: var(--text); stroke-width: 1; }
svg .series { fill: none; stroke-linejoin: round; stroke-linecap: round; }
svg .cross { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 3 3; }
svg .dot { stroke: var(--bg); stroke-width: 1.5; }

.fig { margin: 8px 0 0; }
.fig figcaption, .fig-cap { font-family: var(--mono); font-size: 10px; color: var(--faint); letter-spacing: .03em; margin: 4px 0 0; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin: 6px 0 0; }
.legend i { display: inline-block; width: 14px; height: 2px; vertical-align: middle; margin-right: 5px; }

.tip {
  position: absolute; pointer-events: none; z-index: 5;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 6px 9px; font-family: var(--mono); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0,0,0,.45);
}
.tip .tip-date { color: var(--faint); font-size: 10px; display: block; margin-bottom: 2px; }

/* ---------------------------------------------------------------- cards (the alternative layout) */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.card {
  --k: 0%;
  position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 24px; align-items: center; gap: 10px;
  padding: 9px 8px 9px 10px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line);
  cursor: pointer; transition: border-color .16s;
}
.card.rise { border-color: color-mix(in srgb, var(--up) var(--k), var(--line)); }
.card.fall { border-color: color-mix(in srgb, var(--down) var(--k), var(--line)); }
.card:hover { border-color: var(--faint); }
.card .logo { width: 34px; height: 34px; border-radius: 6px; background: #fff; object-fit: contain; padding: 5px; display: block; }
.card .tile { width: 34px; height: 34px; border-radius: 6px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); font-family: var(--display); font-weight: 800; font-size: 10px; letter-spacing: .04em; color: var(--accent); }
.card .c-id { min-width: 0; }
.card .c-sym { font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: -0.01em; line-height: 1.15; color: var(--yellow); }
.card .c-name { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .c-px { font-family: var(--mono); font-size: 14px; font-variant-numeric: tabular-nums; text-align: right; line-height: 1.2; }
.card .c-chg { font-family: var(--mono); font-size: 11.5px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.card .star { position: static; }
.bubbles-empty { color: var(--faint); font-size: 12.5px; padding: 20px 0; text-align: center; }

/* ---------------------------------------------------------------- star */

.star { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: var(--faint); transition: color .12s, background .12s; }
.star svg path { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.star:hover { color: var(--accent); background: rgba(240,168,50,.08); }
.star.on { color: var(--accent); }
.star.on svg path { fill: currentColor; }

/* ---------------------------------------------------------------- session score badge and arrows */

.zb { display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 2px; font-family: var(--mono); font-size: 10px; letter-spacing: .03em; border: 1px solid currentColor; vertical-align: 1px; }
.zb.up { color: var(--up); background: color-mix(in srgb, var(--up) 10%, transparent); }
.zb.down { color: var(--down); background: color-mix(in srgb, var(--down) 10%, transparent); }
.zb.big { font-weight: 600; }
.arr { display: inline-block; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; vertical-align: 1px; margin-right: 3px; }
.arr.up { border-bottom: 6px solid var(--up); }
.arr.down { border-top: 6px solid var(--down); }

/* ---------------------------------------------------------------- realised vol table */

.vol-table { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, 1fr); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; background: var(--line-soft); gap: 1px; }
.vol-table > div { background: var(--surface); padding: 5px 9px; font-size: 12px; }
.vol-table .vh { color: var(--faint); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; font-family: var(--display); font-weight: 600; }
.vol-table .vh.n, .vol-table .vv { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.vol-table .vk { color: var(--muted); cursor: pointer; text-decoration: underline dotted transparent; text-underline-offset: 3px; transition: color .12s, text-decoration-color .12s; }
.vol-table .vk:hover { color: var(--yellow); text-decoration-color: var(--yellow); }
.vol-table .vv.none { color: var(--faint); }
.vol-table .hi { color: var(--text); font-weight: 500; }
.vol-empty { color: var(--faint); font-size: 12.5px; }

/* ---------------------------------------------------------------- news */

.news { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; align-items: start; }
.n-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .15s; }
.n-card:hover { border-color: var(--faint); }
.n-thumb { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface-2); }
.n-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 5px; }
.n-meta { display: flex; gap: 8px; align-items: baseline; font-family: var(--mono); font-size: 10px; color: var(--faint); letter-spacing: .03em; }
.n-meta .n-sym { color: var(--yellow); font-weight: 600; }
.n-title { font-family: var(--display); font-weight: 600; font-size: 14px; line-height: 1.3; }
.n-sum { font-size: 12px; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-empty { color: var(--faint); font-size: 12.5px; padding: 12px 0; }

/* the dense list variant inside panels */
.news-list { display: flex; flex-direction: column; }
.n-row { display: grid; grid-template-columns: 52px 62px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 5px 0; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.n-row:last-child { border-bottom: none; }
.n-row:hover .n-t { color: var(--accent); }
.n-row .n-when { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.n-row .n-s { font-family: var(--display); font-weight: 700; font-size: 11.5px; color: var(--yellow); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.n-row .n-t { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.n-row .n-p { font-family: var(--mono); font-size: 10px; color: var(--faint); white-space: nowrap; }

/* ---------------------------------------------------------------- information */

/* hover card next to a name on the overview: a month of closes and what the company does */
.peek { position: fixed; z-index: 60; width: 380px; box-sizing: border-box; padding: 10px 12px 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .7); pointer-events: none; opacity: 0; transform: translateX(-6px); transition: opacity .18s ease-out, transform .18s ease-out; }
.peek.on { opacity: 1; transform: none; }
.peek-h { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.peek-h .sym { font-weight: 700; color: var(--yellow); }
.peek-h .nm { color: var(--muted); font-size: 12px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.peek-px { font-family: var(--mono); font-size: 13px; color: var(--text); white-space: nowrap; }
.peek-px b { font-weight: 500; }
.peek-chart { display: block; width: 100%; height: 110px; }
.peek-k { font-family: var(--mono); font-size: 10px; color: var(--faint); margin: 2px 0 8px; }
.peek-txt { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

/* ---------------------------------------------------------------- modal */

.modal-bg { position: fixed; inset: 0; z-index: 60; background: rgba(8,6,5,.66); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal { position: relative; width: min(640px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px 24px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.modal-x { position: absolute; top: 12px; right: 14px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 4px 8px; border-radius: var(--radius); border: 1px solid transparent; }
.modal-x:hover { color: var(--text); border-color: var(--line); }
.modal-kicker { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.modal h3 { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -0.02em; margin: 0 0 4px; line-height: 1.1; }
.modal .m-sub { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.modal .m-now { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; margin: 0 0 16px; }
.modal .m-now div { background: var(--surface); padding: 8px 11px; }
.modal .m-now .k { display: block; font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin-bottom: 2px; }
.modal .m-now .v { font-family: var(--mono); font-size: 15px; font-variant-numeric: tabular-nums; }
.modal h4 { font-family: var(--display); font-weight: 700; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 16px 0 5px; }
.modal p { margin: 0 0 8px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.modal p b { color: var(--text); font-weight: 500; }
.formula { font-family: var(--mono); font-size: 12px; line-height: 1.7; color: var(--text); background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 10px 12px; margin: 6px 0 4px; white-space: pre; overflow-x: auto; }
.formula .c { color: var(--faint); }

/* ---------------------------------------------------------------- narrow */

@media (max-width: 1180px) {
  .grid > .panel:not(.span-12) { grid-column: span 24; }
}

@media (max-width: 860px) {
  .top { gap: 10px; padding: 0 12px; }
  .nav, .updated, .clocks { display: none; }
  .search { max-width: none; }
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; display: flex; gap: 4px; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--line); padding: 8px 10px; }
  .side-h { display: none; }
  .side-item { white-space: nowrap; border-left: none; border-bottom: 2px solid transparent; border-radius: var(--radius) var(--radius) 0 0; }
  .side-item.on { border-bottom-color: var(--accent); }
  .main { padding: 14px 12px 60px; }
  .view-head h1 { font-size: 20px; }
  .grid > .panel { grid-column: span 48; }
  .kv { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- compare */

.pill { font-family: var(--mono); font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: var(--radius); padding: 3px 8px; margin-left: 4px; }
.pill:hover { color: var(--accent); border-color: var(--accent); }
.cmp-syms { display: flex; flex-wrap: wrap; gap: 6px; text-transform: none; letter-spacing: 0; }
.cmp-chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--display); font-weight: 700; font-size: 12px; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 2px 6px 2px 8px; }
.cmp-chip i { display: inline-block; width: 10px; height: 3px; border-radius: 1px; }
.cmp-chip button { font-family: var(--mono); font-size: 11px; color: var(--faint); padding: 0 2px; }
.cmp-chip button:hover { color: var(--down); }
.cmp-tools { display: flex; align-items: center; gap: 8px; }
.mini-input { font: inherit; font-family: var(--mono); font-size: 11px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 3px 8px; width: 120px; outline: none; text-transform: none; letter-spacing: 0; }
.mini-input:focus { border-color: var(--faint); }
.mini-input::placeholder { color: var(--faint); }
.cmp-empty { color: var(--faint); font-size: 12.5px; padding: 30px 0; text-align: center; }

.row-tools { display: flex; justify-content: flex-end; margin-bottom: 6px; }

/* ---------------------------------------------------------------- news tone */

/* two columns while the box is wide enough for both, stacked when it is not: the box's own width,
   not the window's, since a box can be dragged to any width */
.panel-b { container-type: inline-size; }
.sent-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; }
.sent-grid > * { min-width: 0; overflow-x: auto; }
@container (max-width: 1000px) { .sent-grid { grid-template-columns: 1fr; } }
.lab { display: inline-block; font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; padding: 1px 5px; border-radius: 2px; border: 1px solid currentColor; }
.lab.bullish { color: var(--up); } .lab.bearish { color: var(--down); } .lab.neutral { color: var(--faint); }
.terms { font-family: var(--mono); font-size: 10px; color: var(--faint); }
.terms .p { color: var(--up); } .terms .n { color: var(--down); }
.n-row .n-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--line); margin-right: 6px; vertical-align: 1px; }
.n-row .n-dot.bullish { background: var(--up); } .n-row .n-dot.bearish { background: var(--down); }

/* ---------------------------------------------------------------- surface panel */

.surf-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); gap: 12px; }
.surf-grid > * { min-width: 0; }
@container (max-width: 700px) { .surf-grid { grid-template-columns: 1fr; } }
.surf { height: 400px; }
.surf-side-h { font-family: var(--display); font-weight: 600; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 4px 0 4px; display: flex; justify-content: space-between; align-items: baseline; }
.surf-tag { font-family: var(--mono); font-size: 10px; letter-spacing: .03em; text-transform: none; }
.surf-tag.blue { color: #3d7bff; } .surf-tag.green { color: #39d353; }

/* ---------------------------------------------------------------- panel tools */

.panel { position: relative; }
.panel-tools { display: inline-flex; gap: 2px; margin-left: 6px; flex: none; }
.panel-tools button { width: 18px; height: 18px; display: grid; place-items: center; color: #2a1600; border-radius: 2px; padding: 0; }
.panel-tools button svg { width: 11px; height: 11px; }
.panel-tools button:hover { background: #000; color: var(--yellow); }
.panel-h { cursor: grab; user-select: none; -webkit-user-select: none; }
.panel.dragging { opacity: .35; outline: 1px dashed var(--yellow); }
.panel.drop-target { outline: 2px solid var(--yellow); outline-offset: -2px; }
.drop-gap { position: absolute; z-index: 55; box-sizing: border-box; border: 2px dashed var(--yellow); opacity: .35; pointer-events: none; }
.drop-gap.on { opacity: 1; background: rgba(255, 210, 63, .07); }
.drag-ghost { position: fixed; z-index: 999; pointer-events: none; opacity: .95; box-shadow: 0 8px 30px rgba(0, 0, 0, .6); overflow: hidden; }
body.dragging-panel { user-select: none; cursor: grabbing; }
body.dragging-panel .panel-h { cursor: grabbing; }
.panel.user-hidden { display: none; }
.panel.sized .panel-b { overflow: auto; }
.rz-e { position: absolute; top: 0; right: -3px; width: 7px; height: 100%; cursor: ew-resize; z-index: 3; }
.rz-s { position: absolute; left: 0; bottom: -3px; height: 7px; width: 100%; cursor: ns-resize; z-index: 3; }
.rz-e:hover, .rz-s:hover, .panel.resizing .rz-e, .panel.resizing .rz-s { background: color-mix(in srgb, var(--yellow) 45%, transparent); }
.panel.resizing { user-select: none; }
.add-panel { position: relative; margin-left: auto; }
.add-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; list-style: none; margin: 0; padding: 4px; min-width: 200px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.add-list li { padding: 6px 9px; font-size: 12.5px; cursor: pointer; border-radius: 2px; }
.add-list li:hover { background: var(--surface); color: var(--yellow); }
.add-list li.none { color: var(--faint); cursor: default; }
.add-list li[data-reset] { border-top: 1px solid var(--line); margin-top: 4px; color: var(--muted); }

/* ---------------------------------------------------------------- trade recap */

.quote-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 8px; }
.quote-row div { background: var(--surface); padding: 4px 8px; }
.quote-row .k { display: block; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--yellow); opacity: .85; }
.quote-row .v { font-family: var(--mono); font-size: 12.5px; }
.recap { max-height: 320px; overflow-y: auto; }
.recap .t td { padding: 2px 8px; }
.recap .t th { position: sticky; top: 0; background: var(--surface); }
.recap td.tick-up { color: var(--up); } .recap td.tick-down { color: var(--down); }
.panel-h > span:first-child, .panel-h > a:first-child { white-space: nowrap; }
.add-panel-row { display: flex; justify-content: flex-end; margin: 0 0 8px; }

/* ---------------------------------------------------------------- folded tables and the analyst box */

.fold-more { display: block; width: 100%; text-align: left; font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; color: var(--yellow); padding: 6px 8px 2px; }
.fold-more:hover { color: var(--text); }
.an-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.an-row .k { color: var(--muted); }
.an-row .v { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.an-bar { position: relative; height: 4px; background: var(--line); margin: 22px 48px 24px; border-radius: 2px; }
.an-bar .pin { position: absolute; top: -4px; width: 2px; height: 12px; background: var(--yellow); transform: translateX(-1px); }
.an-bar .pin::after { content: attr(data-lab); position: absolute; top: 13px; left: 50%; transform: translateX(-50%); font-family: var(--mono); font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.an-bar .pin.px { background: #fff; } .an-bar .pin.px::after { color: #fff; top: -14px; }
.an-empty { color: var(--faint); font-size: 12.5px; }
@media (max-width: 860px) { .mega { grid-template-columns: 1fr; } .mega-names { display: none; } }

/* ---------------------------------------------------------------- loading */

.loader { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.loader .ring { position: relative; width: 44px; height: 44px; animation: spin 1.1s linear infinite; }
.loader .ring i { position: absolute; top: 0; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--accent); transform-origin: 3px 22px; }
.loader .ring i:nth-child(1) { transform: rotate(0deg); opacity: 1; }
.loader .ring i:nth-child(2) { transform: rotate(45deg); opacity: .875; }
.loader .ring i:nth-child(3) { transform: rotate(90deg); opacity: .75; }
.loader .ring i:nth-child(4) { transform: rotate(135deg); opacity: .625; }
.loader .ring i:nth-child(5) { transform: rotate(180deg); opacity: .5; }
.loader .ring i:nth-child(6) { transform: rotate(225deg); opacity: .375; }
.loader .ring i:nth-child(7) { transform: rotate(270deg); opacity: .25; }
.loader .ring i:nth-child(8) { transform: rotate(315deg); opacity: .125; }
@keyframes spin { to { transform: rotate(360deg); } }
