/* 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;
  --foot-h: 24px;
  --radius: 3px;
}

* { box-sizing: border-box; }
html { height: 100%; }
body { min-height: 100%; }   /* a fixed body height stops the sticky header past the first screen */

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);
}

.burger { display: none; width: 34px; height: 34px; margin-left: -8px; flex-direction: column; justify-content: center; gap: 5px; padding: 0 8px; border-radius: var(--radius); }
.burger i { display: block; height: 2px; background: var(--muted); border-radius: 1px; transition: transform .16s, opacity .16s; }
.burger.on i:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.on i:nth-child(2) { opacity: 0; }
.burger.on i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.drawer { display: none; }
.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; white-space: nowrap;
  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; white-space: nowrap; }
/* the four market clocks in the top bar, between the menu and the search */
.nav-clocks { margin-left: auto; margin-right: 14px; padding: 0 4px; border: 1px solid var(--line); border-radius: var(--radius); height: 28px; align-items: center; }
.search { margin-left: 0; }
.clk { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border-left: 1px solid var(--line-soft); line-height: 1; }
.clk:first-child { border-left: none; }
.clk i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); flex: none; }
.clk.open i { background: var(--up); box-shadow: 0 0 6px var(--up); }
.clk b { font-family: var(--display); font-weight: 700; font-size: 9.5px; letter-spacing: .1em; color: var(--faint); }
.clk-t { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
.clk.open .clk-t { color: var(--text); }
.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(--surface-2); border-bottom: 1px solid var(--line); overflow: hidden; }
.tape-item { border-right-color: var(--line); }
.tape-item:hover { background: var(--surface); }
.tape-empty { color: var(--muted); }
.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; }
/* the name page drops the tape: the rail already carries the watchlist, and the screen needs the height */
body.no-tape { --tape-h: 0px; }
body.no-tape .tape { display: none; }
.tape-track.still { animation: none; }
.tape-set { display: inline-flex; align-items: center; height: 100%; }
.tape-gap { flex: none; height: 100%; }
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tape-item { display: inline-flex; align-items: baseline; gap: 8px; padding: 0 18px; height: var(--tape-h); line-height: var(--tape-h); 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); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------------------------------------------------------------- shell */

.shell { display: block; min-height: calc(100vh - var(--top-h) - var(--tape-h) - var(--foot-h)); }
.foot { height: var(--foot-h); box-sizing: border-box; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 16px; border-top: 1px solid var(--line); background: var(--surface); font-family: var(--mono); font-size: 10px; letter-spacing: .04em; color: var(--faint); white-space: nowrap; overflow: hidden; }
.foot-sep { width: 1px; height: 10px; background: var(--line); }


.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; }


/* ---------------------------------------------------------------- watchlist rail */

/* pinned under the tape strip down the right edge; the main column makes room for it */
.rail {
  position: fixed; top: calc(var(--top-h) + var(--tape-h)); right: 0; bottom: var(--foot-h); z-index: 20;
  width: 348px; box-sizing: border-box;
  display: flex; min-width: 0; background: var(--surface); border-left: 1px solid var(--line);
}
.rail.off { width: 48px; }
.rail[hidden] { display: none; }
@media (min-width: 861px) {
  body:has(#ov-rail:not([hidden])) .main { padding-right: calc(348px + 22px); }
  body:has(#ov-rail.off:not([hidden])) .main { padding-right: calc(48px + 22px); }
}
.rail-panel { width: 300px; display: flex; flex-direction: column; min-width: 0; }
.rail.off .rail-panel { display: none; }
.rail-h { padding: 10px 12px; border-bottom: 1px solid var(--line); font-family: var(--display); font-weight: 700; font-size: 13px; }
.rail-h a:hover { text-decoration: underline; }
.rail-b { flex: 1; min-height: 0; overflow: auto; padding: 6px 8px; }
.rail-b .t.compact td { padding: 6px 4px; }
.rail-b .rail-lock { position: static; inset: auto; height: 100%; background: none; z-index: auto; }
.rail-bar { width: 48px; padding-top: 6px; border-left: 1px solid var(--line); }
.rail-tab {
  display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin: 0 auto;
  border: 0; border-radius: 6px; background: var(--surface-2); color: var(--muted); cursor: pointer;
}
.rail-tab svg { width: 20px; height: 20px; }
.rail-tab:hover { color: var(--text); background: var(--line); }
.rail:not(.off) .rail-tab { color: var(--text); background: var(--line); }

/* ---------------------------------------------------------------- news filter */

.nf { position: relative; align-self: center; margin-left: -4px; }
.nf-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--muted); }
.nf-btn svg { width: 18px; height: 18px; }
.nf-btn:hover, .nf-btn[aria-expanded="true"] { color: var(--text); border-color: var(--faint); }
.nf-btn.on { color: var(--yellow); border-color: var(--yellow); }
.nf-menu { position: absolute; left: 0; top: calc(100% + 6px); z-index: 40; width: 280px; max-height: min(70vh, 560px); overflow: auto; padding: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.nf-h { padding: 6px 6px 4px; font-family: var(--display); font-weight: 700; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.nf-sort { margin: 0 6px 8px; }
.nf-row { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 2px; font-size: 12.5px; cursor: pointer; }
.nf-row:hover { background: var(--surface); }
.nf-row input { width: 13px; height: 13px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.nf-row small { color: var(--faint); font-size: 11px; margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nf-all { font-weight: 600; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.nf-group > .nf-row { padding-right: 2px; }
.nf-group > .nf-row > label { display: flex; align-items: center; gap: 8px; flex: 1; cursor: pointer; }
.nf-open { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 2px; color: var(--muted); }
.nf-open:hover { color: var(--text); background: var(--surface); }
.nf-open .caret { transition: transform .12s; }
.nf-open[aria-expanded="true"] .caret { transform: rotate(180deg); }
.nf-names { padding: 0 0 4px 22px; }
.nf-names .nf-row { padding: 4px 6px; }

/* the screen is a terminal, not a document: dragging across it selects nothing, except where
   text is worth copying */
.main, .rail, .tape { user-select: none; -webkit-user-select: none; }
.main :is(input, textarea, .n-body, .n-row, .panel-note, .view-sub, .pr-out, .tree-wrap, .auth-form, .kv, .an-row, .metrics) { user-select: text; -webkit-user-select: text; }

/* ---------------------------------------------------------------- fixed terminal
   the window is the screen: the main area is the height left under the tape, rows share it,
   and anything that does not fit scrolls inside its box */

@media (min-width: 861px) {
  body.fixed { overflow: hidden; }
  body.fixed .main { height: calc(100vh - var(--top-h) - var(--tape-h) - var(--foot-h)); box-sizing: border-box; padding-bottom: 12px; overflow: hidden; }
  body.fixed .view:not([hidden]) { display: flex; flex-direction: column; height: 100%; }
  body.fixed .view-head { flex: none; }
  body.fixed .view:not(.scrolls) .grid { flex: 1; min-height: 0; grid-auto-rows: minmax(0, 1fr); }
  body.fixed .view:not(.scrolls) .grid > .panel { min-height: 0; height: auto !important; }
  /* the name view: boxes keep their size and the block of them scrolls under the page tabs */
  body.fixed .view.scrolls .grid-scroll { flex: 1; min-height: 0; overflow: auto; padding-bottom: 10px; }
  body.fixed .view.scrolls .pager { flex: none; }
  body.fixed .panel-b { overflow: auto; min-height: 0; }
  body.fixed .panel-b:has(> .tbl:first-child) { padding-top: 0; }   /* the table header sticks to the very top */
  body.fixed .panel-b .t thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); padding-top: 10px; }
  body.fixed .news-scroll { flex: 1; min-height: 0; overflow: auto; padding-bottom: 10px; }
}
/* thin scrollbars inside boxes, shown on hover */
.panel-b, .rail-b, .news-scroll, .grid-scroll { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.panel-b:hover, .rail-b:hover, .news-scroll:hover, .grid-scroll:hover { scrollbar-color: var(--line) transparent; }
.panel-b::-webkit-scrollbar, .rail-b::-webkit-scrollbar, .news-scroll::-webkit-scrollbar, .grid-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.panel-b::-webkit-scrollbar-thumb, .rail-b::-webkit-scrollbar-thumb, .news-scroll::-webkit-scrollbar-thumb, .grid-scroll::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; }
.panel-b:hover::-webkit-scrollbar-thumb, .rail-b:hover::-webkit-scrollbar-thumb, .news-scroll:hover::-webkit-scrollbar-thumb, .grid-scroll:hover::-webkit-scrollbar-thumb { background: var(--line); }

/* ---------------------------------------------------------------- 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);
  /* dark bar, the orange kept for the title: the data gets the eye, not the chrome */
  background: var(--surface-2); color: var(--accent);
  font-family: var(--display); font-weight: 700; font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
}
.panel-h a:hover { text-decoration: underline; }
.panel-h .seg { border-color: var(--line); background: var(--line); }
.panel-h .seg button { background: var(--surface-2); color: var(--faint); }
.panel-h .seg button:hover { color: var(--text); }
.panel-h .seg button.on { background: var(--surface); 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: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 2px 7px 2px 6px; }
.dd-btn:hover { color: var(--text); border-color: var(--faint); }
.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 */

/* the name, the price under it, the last trade time under that; the exchange small on the right */
.head { padding: 4px 0 6px; }
.hero-id { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.hero-id h1 { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -0.015em; line-height: 1.15; margin: 0; color: var(--text); min-width: 0; }
.hero-id h1 .h-code { color: var(--muted); font-weight: 600; }
.hero-meta { font-family: var(--mono); font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); white-space: nowrap; margin-left: auto; }
.hero-meta:empty { display: none; }
.hero-px { display: flex; align-items: baseline; gap: 12px; margin-top: 6px; }
.big-px { font-family: var(--mono); font-size: 30px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; color: var(--yellow); }
.big-chg { font-family: var(--mono); font-size: 16px; font-variant-numeric: tabular-nums; color: var(--muted); }
.big-chg.up { color: var(--up); } .big-chg.down { color: var(--down); }
.hero-sub { font-family: var(--mono); font-size: 11.5px; color: var(--faint); margin-top: 3px; min-height: 14px; }

.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; }

/* the summary page's figures: three columns of plain rows under the chart, no box around them */
.kv-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 36px; }
.kv-3 > div { display: contents; }
.facts { grid-column: 1 / -1; padding: 2px 0 6px; }
.facts[hidden] { display: none; }

.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); }

/* ---------------------------------------------------------------- pages */

/* the name screen is four pages deep; the menu runs down the left, the page scrolls beside it */
#view-detail:not([hidden]) { display: flex; flex-direction: row; gap: 22px; }
#view-detail .grid-scroll { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#view-detail .pager { display: none; }
.side { flex: none; width: 140px; display: flex; flex-direction: column; }
.pages { display: flex; flex-direction: column; gap: 2px; padding-top: 8px; }
/* the market clocks sit under the page menu on a name page, so the rail strip stands down there */
.pages button { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-left: 2px solid transparent; text-align: left; font-family: var(--display); font-weight: 600; font-size: 13.5px; color: var(--muted); }
.pages button b { order: 2; font-family: var(--mono); font-weight: 500; font-size: 9.5px; color: var(--faint); padding: 0 4px; border: 1px solid var(--line); border-radius: 2px; }
.pages button:hover { color: var(--text); }
.pages button.on { color: var(--yellow); background: var(--surface); border-left-color: var(--yellow); }
.pages button.on b { color: var(--yellow); border-color: var(--yellow); }
#view-detail .chart { height: 380px; }

.pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 18px; font-family: var(--mono); font-size: 11px; color: var(--faint); }
.pager button { min-width: 30px; height: 28px; padding: 0 9px; border: 1px solid var(--line); border-radius: var(--radius); font-family: var(--mono); font-size: 12px; color: var(--muted); background: var(--surface); }
.pager button:hover { color: var(--text); border-color: var(--faint); }
.pager button.on { background: var(--accent); color: #000; border-color: var(--accent); }
.pager button[disabled] { opacity: .35; cursor: default; }
.pager .pager-n { min-width: 30px; text-align: center; font-size: 12px; color: var(--text); }
.panel.off-page { display: none; }

/* ---------------------------------------------------------------- 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: 100%; min-height: 270px; 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 { width: fit-content; 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); }

/* ---------------------------------------------------------------- relationship map */
.map-body { display: flex; flex-direction: column; }
.map { display: block; width: 100%; height: auto; cursor: grab; }
.map:active { cursor: grabbing; }
.map .trunk { stroke: var(--line); stroke-width: 1.4; }
.map .twig { stroke: var(--line-soft); stroke-width: 1; }
.map .twig.exec, .map .twig.board { stroke: rgba(240, 180, 41, .35); }
.map .twig.holders, .map .twig.funds { stroke: rgba(61, 123, 255, .4); }
.map .twig.peers { stroke: rgba(57, 211, 83, .4); }
.map .mn circle { fill: var(--surface-2); stroke: var(--line); stroke-width: 1.2; }
.map .mn.exec circle, .map .mn.board circle { stroke: rgba(240, 180, 41, .65); }
.map .mn.holders circle, .map .mn.funds circle { stroke: rgba(61, 123, 255, .75); }
.map .mn.peers circle { stroke: rgba(57, 211, 83, .65); }
.map .mn-a { font-family: var(--display); font-weight: 600; fill: var(--text); }
.map .mn-b { font-family: var(--mono); fill: var(--muted); }
.map .hub circle { fill: var(--surface); stroke-width: 1.6; }
.map .hub .mn-a { letter-spacing: .1em; fill: var(--muted); }
.map .hub.exec .mn-a, .map .hub.board .mn-a { fill: var(--yellow); }
.map .hub.holders .mn-a, .map .hub.funds .mn-a { fill: #3d7bff; }
.map .hub.peers .mn-a { fill: #39d353; }
.map .centre circle { fill: var(--surface); stroke: var(--yellow); stroke-width: 1.8; }
.map .centre .mn-a { font-weight: 800; fill: var(--yellow); }
.map .centre .mn-b { font-family: var(--display); }
.map .hub-ring { will-change: transform, opacity; }
.map .hub-n { fill: var(--faint); }
.map .link { cursor: pointer; }
.map .hub.link:hover circle { stroke-width: 2.2; }
.map .peers.link:hover circle { fill: var(--surface); stroke: #39d353; }

/* the expand button in a box header, and the box over the whole window */
.map-zoom { display: inline-flex; margin-left: auto; gap: 2px; }
.map-zoom button { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 4px; font-family: var(--mono); font-size: 12px; text-transform: none; letter-spacing: 0; color: var(--muted); background: var(--surface); border: 1px solid var(--line); }
.map-zoom button:hover { color: var(--text); border-color: var(--faint); }
.panel-h .expand { margin-left: 0; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); }
.panel-h .expand:hover { color: var(--text); border-color: var(--faint); }
.panel-h .expand svg { width: 13px; height: 13px; }
.panel-h .expand .ico-close, .panel.full .panel-h .expand .ico-open { display: none; }
.panel.full .panel-h .expand .ico-close { display: block; }
.panel.full { position: fixed; inset: 0; z-index: 70; border-radius: 0; border: 0; height: auto !important; }
.panel.full .panel-b { overflow: hidden; }
.panel.full .map { flex: 1; min-height: 0; }
body.has-full { overflow: hidden; }

/* ---------------------------------------------------------------- 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%; flex: none; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface-2); }
.n-tile { display: grid; place-items: center; background: #fff; font-family: var(--display); font-weight: 800; font-size: clamp(34px, 5cqw, 64px); letter-spacing: .06em; color: var(--accent); }
.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 */

/* ---------------------------------------------------------------- pricer */

.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); }
.mega-pricer { grid-template-columns: 190px; }
.mega-pricer a, .mega-pricer .soon { display: block; padding: 7px 10px; border-radius: 2px; font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: 0; color: var(--muted); }
.mega-pricer a:hover { color: var(--yellow); background: var(--surface); }
.mega-pricer .soon { color: var(--faint); cursor: default; }
.mega-pricer .soon em { font-style: normal; font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; margin-left: 6px; }
.pr-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pr-form label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pr-form label span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.pr-form label span small { font-size: 9.5px; letter-spacing: .02em; text-transform: none; margin-left: 4px; }
.pr-form input {
  font: inherit; font-family: var(--mono); font-size: 13.5px; color: var(--text); width: 100%; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 7px 9px; outline: none;
  font-variant-numeric: tabular-nums; -moz-appearance: textfield;
}
.pr-form input::-webkit-outer-spin-button, .pr-form input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pr-form input:focus { border-color: var(--faint); background: var(--surface-2); }
.pr-form input.bad { border-color: var(--down); }
.pr-form .form-err, .pr-form .pr-go, .pr-form .pr-btns { grid-column: 1 / -1; }
.pr-form .pr-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pr-form .pr-btns .btn-main { margin-top: 4px; }
.btn-alt { margin-top: 4px; padding: 9px 12px; border-radius: var(--radius); background: var(--surface); color: var(--text); border: 1px solid var(--line); font-family: var(--display); font-weight: 700; font-size: 13px; }
.btn-alt:hover { border-color: var(--faint); }
.pr-form .pr-seg { align-self: start; margin-top: 2px; }
.pr-form .pr-seg button { padding: 6px 10px; font-size: 11px; }
.pr-form .pr-seg button.on { background: var(--surface-2); color: var(--yellow); }
.tree-wrap { width: 100%; overflow-x: auto; }
.tree-wrap svg { display: block; width: 100%; height: auto; }
.tree-wrap .edge { stroke: var(--line); stroke-width: 1; }
.tree-wrap .node { fill: var(--surface-2); stroke: var(--line); }
.tree-wrap .node.ex { stroke: var(--accent); stroke-width: 1.5; }
.tree-wrap .s { fill: var(--text); font-family: var(--mono); font-size: 11px; text-anchor: middle; }
.tree-wrap .v { fill: var(--yellow); font-family: var(--mono); font-size: 11px; text-anchor: middle; }
.tree-wrap .lvl { fill: var(--faint); font-family: var(--mono); font-size: 10px; text-anchor: middle; }
.tree-note { color: var(--faint); font-size: 12.5px; padding: 6px 0; }
.tree-wrap .tbl-empty { color: var(--text); }
.pr-t td.k { color: var(--muted); }
.pr-t td.r { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.pr-t .pr-px { color: var(--yellow); font-weight: 600; font-size: 14px; }
.pr-t .pr-unit { color: var(--faint); font-family: var(--mono); font-size: 10.5px; text-align: left; padding-left: 18px; white-space: nowrap; }

.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 */

/* the canvas takes the box height so a taller box means a bigger surface */
.surf-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); grid-template-rows: minmax(0, 1fr); gap: 12px; min-height: 0; }
.surf-grid > * { min-width: 0; }
@container (max-width: 700px) { .surf-grid { grid-template-columns: 1fr; } }
.surf-side .mini { height: 112px; }
.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: var(--faint); border-radius: 2px; padding: 0; }
.panel-tools button svg { width: 11px; height: 11px; }
.panel-tools button:hover { background: var(--surface); color: var(--yellow); }
.panel-h { cursor: default; user-select: none; -webkit-user-select: none; }
[data-static] .panel-h { cursor: default; }
.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 .panel-b { pointer-events: none; }   /* the chart under the drag must not pop its tooltip */
.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 */

.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; }

/* ---------------------------------------------------------------- loading */

.box-spin { display: flex; justify-content: center; padding: 28px 0; }
.box-spin .ring { width: 28px; height: 28px; }
.box-spin .ring i { transform-origin: 3px 14px; }
.loader { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.ring { position: relative; width: 44px; height: 44px; animation: spin 1.1s linear infinite; }
.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; }
.ring i:nth-child(1) { transform: rotate(0deg); opacity: 1; }
.ring i:nth-child(2) { transform: rotate(45deg); opacity: .875; }
.ring i:nth-child(3) { transform: rotate(90deg); opacity: .75; }
.ring i:nth-child(4) { transform: rotate(135deg); opacity: .625; }
.ring i:nth-child(5) { transform: rotate(180deg); opacity: .5; }
.ring i:nth-child(6) { transform: rotate(225deg); opacity: .375; }
.ring i:nth-child(7) { transform: rotate(270deg); opacity: .25; }
.ring i:nth-child(8) { transform: rotate(315deg); opacity: .125; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- accounts */

.auth { margin-left: 4px; }
.auth > a { white-space: nowrap;
  font-family: var(--display); font-weight: 600; font-size: 12.5px; color: var(--muted);
  padding: 6px 10px; border-radius: var(--radius); transition: color .12s, background .12s;
}
.auth > a:hover, .auth > a.on { color: var(--text); background: var(--surface); }
.auth > a.user { color: var(--yellow); }
.mega-auth { left: auto; right: 0; display: none; grid-template-columns: 170px; }
.auth:hover .mega-auth, .auth:focus-within .mega-auth { display: grid; }
.mega-auth a, .mega-auth button {
  display: block; width: 100%; text-align: left; padding: 7px 10px; border-radius: 2px;
  color: var(--muted); font-family: var(--display); font-weight: 600; font-size: 13px;
}
.mega-auth a:hover, .mega-auth button:hover { color: var(--yellow); background: var(--surface); }
.mega-auth .who { padding: 7px 10px 4px; font-family: var(--mono); font-size: 10.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* sign in and create account: one card in the middle of a quiet screen, the wordmark above the form */
body:has(.view-auth:not([hidden])) .main { padding-bottom: 0; }
.view-auth { display: flex; justify-content: center; align-items: flex-start; box-sizing: border-box; padding: 6vh 16px 24px; min-height: calc(100vh - var(--top-h) - var(--foot-h) - 16px); background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(245, 130, 32, .08), transparent 70%); }
.auth-card { width: min(420px, 100%); padding: 28px 28px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .55); }
.auth-brand { display: flex; align-items: baseline; gap: 10px; margin-bottom: 22px; }
.auth-mark { font-family: var(--display); font-weight: 800; font-size: 15px; letter-spacing: .32em; color: var(--yellow); }
.auth-tag { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form h1 { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -0.02em; margin: 0; }
.auth-form .view-sub { margin: -6px 0 4px; }
.auth-card .auth-form input { background: var(--bg); }
.auth-card .auth-form input:focus { background: var(--surface-2); border-color: var(--faint); }
.auth-form input::placeholder { color: var(--faint); opacity: .7; text-transform: none; letter-spacing: 0; }
.auth-form .btn-main { margin-top: 4px; }
.auth-form .form-alt { text-align: center; }
.auth-form label { display: flex; flex-direction: column; gap: 5px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.auth-form input {
  font: inherit; font-family: var(--sans); font-size: 13.5px; color: var(--text); letter-spacing: 0; text-transform: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; outline: none;
}
.auth-form input:focus { border-color: var(--faint); background: var(--surface-2); }
.auth-form input.bad { border-color: var(--down); }
.auth-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-form label, .auth-form input { min-width: 0; width: 100%; }
.btn-main {
  margin-top: 4px; padding: 9px 12px; border-radius: var(--radius);
  background: var(--accent); color: #000; font-family: var(--display); font-weight: 700; font-size: 13px;
}
.btn-main:hover { filter: brightness(1.08); }
.btn-main[disabled] { opacity: .6; cursor: default; }
.form-err { margin: 0; color: var(--down); font-size: 12.5px; }
.form-alt { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.form-alt a { color: var(--yellow); }

/* a locked box: the body blurs behind a message and a link to the login page */
.panel { position: relative; }
.panel.locked .panel-b { filter: blur(5px); pointer-events: none; user-select: none; min-height: 120px; }
.lock {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 16px;
  background: rgba(0,0,0,.28);
}
.lock b { font-family: var(--display); font-weight: 700; font-size: 13.5px; color: var(--text); }
.lock span { color: var(--muted); font-size: 12px; }
.lock a { display: inline-block; margin-top: 4px; padding: 5px 12px; border-radius: var(--radius); background: var(--accent); color: #000; font-family: var(--display); font-weight: 700; font-size: 12px; }

.toast {
  position: fixed; left: 50%; top: 26vh; transform: translateX(-50%); z-index: 90;
  padding: 9px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text); font-size: 12.5px; box-shadow: 0 12px 36px rgba(0,0,0,.6);
}
.toast a { color: var(--yellow); margin-left: 8px; }
.toast.red { color: var(--down); border-color: var(--down); font-weight: 600; }

/* the phone group picker sits under the heading of the overview and the group page; desktop has the menu */
.phone-groups { display: none; }

/* ---------------------------------------------------------------- narrow screens, last so they win */

@media (max-width: 1180px) {
  .nav-clocks { display: none; }
  .grid > .panel:not(.span-12) { grid-column: span 24; }
  .updated { display: none; }
  .clk { padding: 0 7px; }
}

/* phones: the burger opens the menu, the moving strip goes, the boxes stack, tables scroll inside
   their box, and nothing depends on a mouse being over something */
@media (max-width: 860px) {
  body { overflow-x: hidden; }
  .top { gap: 8px; padding: 0 12px; }
  .burger { display: flex; }
  .nav, .updated, .top .clocks, #auth-nav { display: none; }
  .search { flex: 0 1 180px; width: auto; margin-left: auto; min-width: 0; }
  .search input { font-size: 16px; padding: 3px 8px 3px 28px; }   /* 16px so iOS does not zoom the page on focus */
  .results { min-width: 0; }
  .results li { grid-template-columns: 70px minmax(0, 1fr); }
  .results .r-meta { display: none; }
  .tape { display: none; }
  .shell { min-height: calc(100vh - var(--top-h) - var(--foot-h)); }
  .foot { font-size: 9px; }
  .foot span:last-child, .foot-sep { display: none; }
  .main { padding: 12px 12px calc(60px + env(safe-area-inset-bottom)); }
  .view-head h1 { font-size: 20px; }
  .grid { gap: 8px; }
  .grid > .panel, .grid > .panel:not(.span-12) { grid-column: 1 / -1; height: auto !important; }
  .panel-h { flex-wrap: wrap; row-gap: 4px; }
  .panel-b { overflow-x: auto; }
  .panel-tools, .rz-e, .rz-s, .add-panel { display: none; }
  .panel-h { cursor: default; }
  .kv { grid-template-columns: 1fr; }
  .hero { gap: 10px; }
  .hero-id h1 { font-size: 22px; }
  .big-px { font-size: 24px; }
  .chart { height: 240px; }
  .surf { height: 260px; }
  .mini.tall { height: 170px; }
  /* the pocket version: one short screen per view. Boxes that only work with width stay on the
     desktop, the name page has no pages, the group tables become a picker */
  [data-phone="off"] { display: none !important; }
  .rail { display: none; }   /* the phone keeps the watchlist page behind the menu instead */
  .side, .pager { display: none; }
  .phone-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: -4px 0 12px; }
  .phone-groups a { padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-family: var(--display); font-weight: 600; font-size: 13px; color: var(--muted); text-align: center; }
  .phone-groups a.on { color: var(--yellow); border-color: var(--faint); }
  #ov-movers { order: -1; }
  .modal-bg { padding: 10px; }
  .modal { padding: 16px 14px 18px; max-height: calc(100vh - 20px); }
  .auth-form input, .pr-form input { font-size: 16px; }
  .auth-form .two { gap: 8px; }
  .sent-grid { grid-template-columns: 1fr; }
  .surf-grid { grid-template-columns: 1fr; }
  .n-row { grid-template-columns: 40px 52px minmax(0, 1fr); }
  .n-row .n-p { display: none; }
  .toast { width: calc(100% - 24px); text-align: center; }

  .drawer:not([hidden]) { display: block; }
  .drawer {
    position: fixed; top: var(--top-h); left: 0; right: 0; bottom: 0; z-index: 28;
    background: var(--bg); overflow-y: auto; padding: 6px 14px calc(30px + env(safe-area-inset-bottom));
  }
  .drawer > a { display: block; padding: 13px 4px; border-bottom: 1px solid var(--line-soft); font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--text); }
  .drawer > a.on { color: var(--yellow); }
  .drawer-h { padding: 14px 4px 6px; font-family: var(--display); font-weight: 700; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
  .drawer-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
  .drawer-groups a { padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-family: var(--display); font-weight: 600; font-size: 13px; color: var(--muted); }
  .drawer-groups a.on { color: var(--yellow); border-color: var(--faint); }
  .drawer-clocks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .drawer-clocks .clk { flex-direction: column; align-items: flex-start; gap: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
  .drawer-clocks .clk-t { font-size: 15px; }
  .drawer-auth { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
  .drawer-auth a, .drawer-auth button { display: block; width: 100%; padding: 10px 12px; text-align: center; border-radius: var(--radius); font-family: var(--display); font-weight: 700; font-size: 13px; border: 1px solid var(--line); color: var(--text); }
  .drawer-auth .main-act { background: var(--accent); color: #000; border-color: var(--accent); }
  .drawer-auth .who { text-align: center; font-family: var(--mono); font-size: 11px; color: var(--faint); }
  body.menu-open { overflow: hidden; }
}

/* anything without a mouse: no hover windows, no hover menus */
@media (hover: none) {
  .peek { display: none !important; }
  .nav-item:hover .mega { display: none; }
  .nav-item:focus-within .mega { display: grid; }
}
