/* OS Invest Terminal — same design system as the landing page (apps/web/landing):
   constant-chroma navy surfaces, white-alpha hairlines for depth, one blue accent,
   Schibsted Grotesk for headings, Geist for UI, Geist Mono for every number.
   Variable names are kept from the previous theme because the page modules use them inline. */
@font-face { font-family: "Schibsted Grotesk"; src: url("fonts/schibsted.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Geist"; src: url("fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/geist-mono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Fallback"; src: local("Arial"); ascent-override: 100.5%; descent-override: 29.5%; line-gap-override: 0%; size-adjust: 102%; }
:root {
  --bg: #090d16;
  --bg-2: #0f141d;
  --panel: #0f141d;
  --panel-solid: #0f141d;
  --panel-2: #171c25;
  --panel-3: #1f242e;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .13);
  --line-soft: rgba(255, 255, 255, .06);
  --text: #f2f5fa;
  --body: #c4ccd9;
  --muted: #9aa4b5;
  --faint: #7d879a;
  --accent: #0b6fd6;
  --accent-2: #0a63c0;
  --accent-text: #70b8ff;
  --accent-soft: rgba(11, 111, 214, .16);
  --glow: none;
  --gold: #f5b53d;
  --up: #3dd68c;
  --up-bg: rgba(48, 164, 108, .16);
  --down: #ff9592;
  --down-bg: rgba(229, 72, 77, .16);
  --flat: #9aa4b5;
  --display: "Schibsted Grotesk", "Geist Fallback", "Helvetica Neue", Arial, sans-serif;
  --sans: "Geist", "Geist Fallback", "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, Consolas, monospace;
  --side-w: 236px;
  --r: 10px;
  --r-sm: 6px;
  --dots: none;
  --ease: cubic-bezier(.23, 1, .32, 1);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--body); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
h1, h2, h3 { margin: 0; font-family: var(--display); color: var(--text); letter-spacing: -.02em; }
h1 { font-size: 24px; font-weight: 700; }
/* Section labels are h2 (page title is the h1, so headings stay sequential for screen readers
   and the audit). A real title inside a card/modal opts back in with .title. */
h2.title { font-size: 16px; font-weight: 600; }
h2:not(.title), h3 { font-family: var(--sans); font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
p { margin: 0; }
.num, td.r, th.r, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.mono.code, kbd, .tiny.mono { font-family: var(--mono); }
.up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--flat); }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.small { font-size: 12.5px; } .tiny { font-size: 11px; }
[hidden] { display: none !important; }
::selection { background: rgba(11, 111, 214, .4); }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: #262d3a; border-radius: 10px; border: 2px solid var(--bg); } ::-webkit-scrollbar-track { background: transparent; }

/* ── Layout ── */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.side {
  background: var(--bg-2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: none;
}
.side::-webkit-scrollbar { display: none; }
.logo { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo-mark { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; background: var(--accent); }
.logo-text { font-family: var(--display); font-weight: 700; font-size: 17px; line-height: 1.05; letter-spacing: -.01em; }
.logo-text em { font-style: normal; color: var(--accent-text); }
.logo-text small { display: block; font-family: var(--sans); font-size: 10px; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; font-weight: 500; margin-top: 2px; }
.nav { display: flex; flex-direction: column; padding: 4px 10px; gap: 1px; }
.nav-group { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding: 14px 10px 5px; font-weight: 600; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm);
  color: var(--body); font-weight: 500; font-size: 13.5px; transition: background .15s var(--ease), color .15s var(--ease);
}
.nav a i { font-style: normal; width: 18px; text-align: center; color: var(--faint); font-size: 12px; }
.nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--text); }
.nav a.on i { color: var(--accent-text); }
.side-foot { margin-top: auto; padding: 14px 18px 18px; font-size: 11px; color: var(--faint); line-height: 1.45; }
.plan-pill {
  display: inline-block; margin-bottom: 8px; padding: 4px 10px; border-radius: var(--r-sm);
  border: 1px solid rgba(245, 181, 61, .45); color: var(--gold); font-weight: 600; font-size: 11px; letter-spacing: .04em;
}
.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  display: flex; align-items: center; gap: 14px; padding: 10px 20px;
  background: var(--top-bg, rgba(9, 13, 22, .92)); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.burger { display: none; background: none; border: 1px solid var(--line-2); border-radius: var(--r-sm); width: 36px; height: 36px; color: var(--text); font-size: 16px; cursor: pointer; }
.search { position: relative; flex: 1; max-width: 520px; display: flex; align-items: center; }
.search-ico { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search-kbd { position: absolute; right: 10px; font-family: var(--mono); font-size: 11px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; pointer-events: none; }
.search input#q, .search input[type=search] {
  width: 100%; padding: 8px 40px 8px 36px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--text); font: inherit; outline: none; transition: border-color .15s var(--ease);
}
.search input:focus { border-color: var(--line-2); }
.search-drop {
  position: absolute; top: 100%; left: 0; right: 0; margin-top: 6px; background: var(--panel-solid); border: 1px solid var(--line-2);
  border-radius: var(--r); box-shadow: 0 18px 50px rgba(0, 0, 0, .55); overflow: hidden; z-index: 30; max-height: 380px; overflow-y: auto;
}
.search-drop a { display: grid; grid-template-columns: 78px 1fr auto; gap: 10px; padding: 9px 14px; color: var(--text); align-items: center; }
.search-drop a:hover, .search-drop a.on { background: var(--panel-2); text-decoration: none; }
.search-drop .sym { font-family: var(--display); font-weight: 700; }
.search-drop .co { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clock { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.clock b { color: var(--text); font-weight: 500; }
.clock .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); margin-right: 7px; vertical-align: 1px; }
.clock .dot.open { background: var(--up); }
.who { font-size: 13px; color: var(--muted); white-space: nowrap; }
.theme-btn { background: transparent; border: 1px solid var(--line-2); color: var(--muted); border-radius: var(--r-sm); width: 34px; height: 34px; cursor: pointer; font-size: 15px; margin-right: 8px; }
.theme-btn:hover { color: var(--text); }
.who a { display: inline-block; color: #fff; background: var(--accent); padding: 7px 14px; border-radius: var(--r-sm); font-weight: 600; font-family: var(--display); }
.who a:hover { text-decoration: none; background: var(--accent-2); }

/* ── Index ticker tape ── */
.tape { overflow: hidden; border-bottom: 1px solid var(--line); background: var(--bg-2); height: 34px; }
.tape-track { display: flex; width: max-content; animation: tape 70s linear infinite; }
.tape:hover .tape-track { animation-play-state: paused; }
@keyframes tape { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tk { display: flex; align-items: center; gap: 8px; padding: 0 18px; height: 34px; font-family: var(--mono); font-size: 12px; border-right: 1px solid var(--line); color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tk:hover { text-decoration: none; background: var(--panel-2); }
.tk b { font-weight: 500; color: var(--muted); }

/* ── View ── */
.view { padding: 18px 20px 48px; display: flex; flex-direction: column; gap: 16px; animation: fade .25s var(--ease); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 4px 2px 0; }
.head p { color: var(--muted); margin-top: 4px; font-size: 13.5px; }
.card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; min-width: 0; }
.card > h3, .card > h2:not(.title) { margin-bottom: 12px; }
.card.pad0 { padding: 0; overflow: hidden; }
.card.pad0 > h3, .card.pad0 > h2:not(.title), .card.pad0 > .bar { padding: 14px 16px 0; }
.card.compact td .co { display: none; }
.card.compact th, .card.compact td { padding: 8px 10px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.g-3-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.g-side { grid-template-columns: 360px minmax(0, 1fr); }
/* Sectors: list | detail. A class, not an inline style, so the phone breakpoint below can stack it. */
.g-5-6 { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
/* Side lists are narrow: keep the company line short so the number columns stay on screen. */
.g-side > .card:first-child td .co { max-width: 150px; }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g-side { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .g2, .g3, .g4, .g-2-1, .g-1-2, .g-3-2, .g-5-6 { grid-template-columns: 1fr; } }

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 10px; }
.tile { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; min-width: 0; }
.tile span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; font-weight: 500; }
.tile b { font-family: var(--mono); font-weight: 500; font-size: 15px; white-space: nowrap; color: var(--text); font-variant-numeric: tabular-nums; }
.tile b.up { color: var(--up); } .tile b.down { color: var(--down); } .tile b.faint { color: var(--faint); }
.tile.big b { font-size: 22px; }
.kpi { display: flex; flex-direction: column; gap: 2px; }
.kpi span { font-size: 11px; color: var(--muted); }
.kpi b { font-family: var(--mono); font-size: 24px; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.kpi small { font-family: var(--mono); font-size: 12px; }

/* tables */
.tablewrap { overflow: auto; max-height: 70vh; }
.tablewrap.tall { max-height: none; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { position: sticky; top: 0; z-index: 2; background: var(--panel-2); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line-2); }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th.sorted { color: var(--text); }
th.sorted::after { content: " ▾"; color: var(--accent-text); } th.sorted.asc::after { content: " ▴"; }
td.r, th.r { text-align: right; }
td { color: var(--body); }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover { background: var(--panel-2); }
tbody tr.on { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent-text); }
td .sym { font-family: var(--display); font-weight: 700; color: var(--text); font-size: 14px; }
td .co { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.chg { display: inline-block; min-width: 68px; padding: 2px 8px; border-radius: 4px; text-align: center; font-family: var(--mono); font-weight: 500; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.chg.up { background: var(--up-bg); } .chg.down { background: var(--down-bg); } .chg.flat { background: rgba(154, 164, 181, .14); }
.tfoot { padding: 8px 14px; font-size: 11.5px; color: var(--faint); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.tfoot .sp { flex: 1; }
.empty { padding: 30px 16px; text-align: center; color: var(--muted); }
/* Skeletons: same height as the content that replaces them (see ui.skeleton). */
.skel { padding: 6px 12px 10px; }
.skel-row { height: 30px; margin: 8px 0; border-radius: 6px; background: linear-gradient(90deg, var(--panel-2) 25%, var(--bg-3) 50%, var(--panel-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.skel-tile { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.skel-tile span { display: block; height: 14px; width: 60%; border-radius: 4px; background: var(--panel-2); }
.skel-tile b { display: block; height: 22px; width: 45%; margin: 6px 0 4px; border-radius: 4px; background: var(--panel-2); }
.skel-tile small { display: block; height: 13px; width: 35%; border-radius: 4px; background: var(--panel-2); }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel-row { animation: none; } }
.loading { padding: 26px; color: var(--faint); text-align: center; font-family: var(--mono); font-size: 12px; }
.loading::after { content: "…"; animation: blink 1s steps(3) infinite; }
@keyframes blink { to { opacity: .2; } }

/* controls */
.bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.bar .sp { flex: 1; }
input, select, textarea, button { font: inherit; color: var(--text); }
input:not([type=checkbox]):not([type=radio]):not(#q), select, textarea {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 12px; outline: none; min-width: 0; transition: border-color .15s var(--ease);
}
input:focus, select:focus, textarea:focus { border-color: var(--line-2); }
input::placeholder { color: var(--faint); }
select { appearance: none; padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
select option { background: var(--panel-solid); color: var(--text); }
input.sm, select.sm { padding: 6px 10px; font-size: 12.5px; }
select.sm { padding-right: 28px; }
input[type=date] { color-scheme: dark; }
/* Light theme — same roles, chosen for contrast on white. Toggled by the ☀/☾ button (localStorage "osinvest.theme"). */
:root[data-theme="light"] {
  --bg: #f3f5f8;
  --bg-2: #ffffff;
  --panel: #ffffff;
  --panel-solid: #ffffff;
  --panel-2: #eef2f7;
  --panel-3: #e3e9f1;
  --line: rgba(16, 24, 40, .08);
  --line-2: rgba(16, 24, 40, .14);
  --line-soft: rgba(16, 24, 40, .06);
  --text: #101828;
  --body: #344054;
  --muted: #5b6b82;
  --faint: #77849a;
  --accent: #0b6fd6;
  --accent-2: #0a63c0;
  --accent-text: #0a5cba;
  --accent-soft: rgba(11, 111, 214, .12);
  --gold: #a86400;
  --up: #128a57;
  --up-bg: rgba(18, 138, 87, .12);
  --down: #c4352b;
  --down-bg: rgba(196, 53, 43, .12);
  --flat: #5b6b82;
  --top-bg: rgba(255, 255, 255, .92);
}
:root[data-theme="light"] input[type=date] { color-scheme: light; }
:root[data-theme="light"] ::-webkit-scrollbar-thumb { background: #c9d2de; }

label.f { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
label.f > span { font-size: 11px; font-weight: 500; }
.btn {
  background: var(--accent); border: 1px solid transparent; border-radius: var(--r-sm); padding: 8px 16px; cursor: pointer; font-weight: 600; font-family: var(--display); color: #fff; white-space: nowrap;
  transition: background .15s var(--ease), transform .1s var(--ease);
}
.btn:hover { background: var(--accent-2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.ghost { background: var(--panel-2); border-color: var(--line-2); color: var(--text); }
.btn.ghost:hover { background: var(--panel-3); }
.btn.sm { padding: 5px 11px; font-size: 12.5px; }
.btn.danger { background: transparent; border-color: rgba(229, 72, 77, .5); color: var(--down); }
.btn.danger:hover { background: var(--down-bg); }
.btn.gold { background: var(--gold); color: #1a1405; }
.btn.gold:hover { background: #e2a52f; }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 2px; gap: 2px; flex-wrap: wrap; }
.seg button { background: transparent; border: 0; border-radius: 4px; padding: 5px 11px; font-size: 12.5px; color: var(--muted); cursor: pointer; font-weight: 500; }
.seg button.on { background: var(--panel-3); color: var(--text); }
.seg button:hover { color: var(--text); }
.chip { display: inline-block; font-size: 11px; padding: 3px 8px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--body); font-family: var(--sans); font-weight: 500; background: var(--panel-2); }
.chip.shariah { border-color: rgba(61, 214, 140, .4); color: var(--up); background: var(--up-bg); }
.chip.acc { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 12px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 12px; color: var(--muted); cursor: pointer; font-weight: 500; white-space: nowrap; font-size: 13.5px; margin-bottom: -1px; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent-text); }
.err { color: var(--down); font-size: 12.5px; }
.note { font-size: 12.5px; color: var(--muted); border: 1px solid var(--line); border-left: 3px solid var(--accent-text); padding: 9px 14px; background: var(--panel-2); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.note.warn { border-left-color: var(--gold); }
.badge { font-size: 10.5px; padding: 2px 7px; border-radius: 4px; background: var(--panel-2); color: var(--muted); font-family: var(--sans); font-weight: 600; border: 1px solid var(--line); }
.badge.buy { color: var(--up); background: var(--up-bg); border-color: rgba(61, 214, 140, .3); } .badge.sell { color: var(--down); background: var(--down-bg); border-color: rgba(255, 149, 146, .3); } .badge.neutral { color: var(--flat); }
.bars { display: flex; flex-direction: column; gap: 7px; }
.brow { display: grid; grid-template-columns: 90px 1fr 80px; gap: 10px; align-items: center; font-size: 12.5px; }
.brow .track { height: 8px; background: var(--panel-3); border-radius: 4px; overflow: hidden; position: relative; }
.brow .fill { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.range52 { position: relative; height: 6px; background: linear-gradient(90deg, var(--down), var(--flat), var(--up)); border-radius: 3px; margin: 8px 0 2px; opacity: .9; }
.range52 i { position: absolute; top: -4px; width: 3px; height: 14px; background: #fff; border-radius: 2px; margin-left: -1px; box-shadow: 0 0 0 2px var(--panel-solid); }
.gauge { display: flex; align-items: center; gap: 14px; }
.gauge .dial { width: 100px; height: 50px; border-radius: 100px 100px 0 0; background: conic-gradient(from 270deg at 50% 100%, var(--down) 0 60deg, var(--flat) 60deg 120deg, var(--up) 120deg 180deg, transparent 180deg); position: relative; overflow: hidden; }
.gauge .dial::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: 0; height: 34px; border-radius: 68px 68px 0 0; background: var(--panel-solid); }
.gauge .needle { position: absolute; left: 50%; bottom: 0; width: 2px; height: 46px; background: #fff; transform-origin: bottom; border-radius: 2px; }
.donut { width: 140px; height: 140px; border-radius: 50%; position: relative; flex: none; }
.donut::after { content: ""; position: absolute; inset: 34px; border-radius: 50%; background: var(--panel-solid); }
.legend { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
.list { display: flex; flex-direction: column; }
.list .row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.list .row:last-child { border-bottom: 0; }
.list .when { font-family: var(--mono); font-size: 11px; color: var(--faint); white-space: nowrap; min-width: 92px; padding-top: 2px; }
.list .ttl { flex: 1; min-width: 0; color: var(--body); }
.list .ttl a.sym { font-family: var(--display); font-weight: 700; margin-right: 8px; }
.ipo { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.newsgrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.news { display: flex; flex-direction: column; gap: 8px; cursor: pointer; transition: border-color .15s var(--ease); }
.news:hover { border-color: var(--line-2); text-decoration: none; }
.news img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: var(--r-sm); background: var(--panel-2); }
.news .src { font-size: 11px; color: var(--accent-text); font-weight: 600; }
.news h2.title { font-size: 15px; line-height: 1.35; }
.reader { max-width: 760px; line-height: 1.75; font-size: 16px; color: var(--body); }
.reader p { margin: 0 0 14px; }

/* map / treemap */
.tmap { position: relative; width: 100%; height: 72vh; min-height: 420px; border-radius: var(--r-sm); overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); }
.tmap .sec { position: absolute; border: 1px solid var(--bg); overflow: hidden; }
.tmap .sec > b { position: absolute; left: 0; right: 0; top: 0; height: 18px; font-family: var(--sans); font-size: 10.5px; letter-spacing: .02em; color: var(--text); background: var(--panel-3); padding: 2px 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 2; font-weight: 600; }
.tmap .tile { position: absolute; border: 1px solid rgba(9, 13, 22, .95); border-radius: 0; padding: 3px 4px; overflow: hidden; color: #fff; cursor: pointer; transition: filter .12s; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; line-height: 1.1; }
.tmap .tile:hover { filter: brightness(1.3); z-index: 3; outline: 1px solid #fff; }
.tmap .tile b { font-family: var(--display); font-weight: 700; }
.tmap .tile small { font-family: var(--mono); font-size: 10px; opacity: .9; }
.tip { position: fixed; z-index: 50; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 9px 12px; font-size: 12.5px; pointer-events: none; box-shadow: 0 14px 40px rgba(0, 0, 0, .6); max-width: 260px; }
.tip b { font-family: var(--display); }
.scale { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.scale i { display: inline-block; width: 22px; height: 10px; border-radius: 3px; }

/* charts */
.chart { position: relative; width: 100%; }
.chart-main { height: 380px; }
.chart-sub { height: 110px; border-top: 1px solid var(--line); }
.chart .lgd { position: absolute; top: 8px; left: 12px; z-index: 3; font-family: var(--mono); font-size: 11px; color: var(--muted); display: flex; gap: 12px; pointer-events: none; flex-wrap: wrap; }
.chart .lgd b { font-weight: 500; color: var(--text); }
canvas.spark { width: 100%; height: 48px; display: block; }
.mini-chart { height: 180px; }
/* Compact table inside a dialog (basket preview). */
table.mini { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.mini td { padding: 3px 6px; border-bottom: 1px solid var(--line); }

/* modal + toasts */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(4, 7, 12, .72); display: grid; place-items: center; padding: 20px; }
.modal .box { background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: var(--r); width: min(560px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 40px 100px rgba(0, 0, 0, .7); animation: pop .18s var(--ease); }
.modal .box.wide { width: min(860px, 100%); }
@keyframes pop { from { transform: scale(.98); opacity: 0; } }
.modal .mh { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal .mh button { background: none; border: 0; color: var(--muted); font-size: 20px; cursor: pointer; }
.modal .mb { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.modal .mf { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 70; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--panel-solid); border: 1px solid var(--line-2); border-left: 3px solid var(--accent-text); padding: 11px 16px; border-radius: var(--r-sm); font-size: 13.5px; box-shadow: 0 14px 40px rgba(0, 0, 0, .6); animation: pop .18s var(--ease); max-width: 360px; color: var(--text); }
.toast.err { border-left-color: var(--down); } .toast.ok { border-left-color: var(--up); }

/* stock header */
.stockhead { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.stockhead .logo-img { width: 54px; height: 54px; border-radius: var(--r); background: var(--panel-2); display: grid; place-items: center; font-weight: 700; font-family: var(--display); overflow: hidden; border: 1px solid var(--line); }
.stockhead .logo-img img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.stockhead .price { font-family: var(--mono); font-size: 32px; font-weight: 500; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.stockhead .chg { font-size: 14px; }
.stockhead .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 7px 16px; font-size: 13px; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; font-family: var(--mono); text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.plans { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.plan { display: flex; flex-direction: column; gap: 12px; }
.plan.pro { border-color: rgba(245, 181, 61, .5); }
.plan ul { margin: 0; padding-left: 18px; color: var(--body); font-size: 13.5px; line-height: 1.8; }
.plan .price { font-family: var(--display); font-size: 28px; font-weight: 700; color: var(--text); letter-spacing: -.02em; }
.auth { max-width: 420px; margin: 6vh auto; display: flex; flex-direction: column; gap: 14px; }
.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.hero-idx { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.hero-idx a { display: block; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); color: var(--text); position: relative; overflow: hidden; transition: border-color .15s var(--ease); }
.hero-idx a::after { content: "→"; position: absolute; right: 12px; top: 10px; color: var(--accent-text); font-size: 14px; }
.hero-idx a:hover { border-color: var(--line-2); text-decoration: none; }
.hero-idx a span { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.hero-idx a b { display: block; font-family: var(--mono); font-size: 20px; font-weight: 500; margin: 3px 0; font-variant-numeric: tabular-nums; }
.hero-idx a small { font-family: var(--mono); font-size: 12.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.hero-idx canvas { position: absolute; right: 0; bottom: 0; width: 48%; height: 42px; opacity: .6; }
.breadth { display: flex; height: 6px; border-radius: 3px; overflow: hidden; margin: 10px 0 6px; }
.breadth i { display: block; }
.dropzone { border: 1px dashed var(--line-2); border-radius: var(--r); padding: 18px; text-align: center; color: var(--muted); font-size: 12.5px; background: var(--panel-2); }
.dropzone.over { border-color: var(--accent-text); background: var(--accent-soft); }
kbd { font-family: var(--mono); font-size: 11px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; }
.filters { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); }
.filters .pair { display: flex; gap: 4px; }
.filters .pair input { width: 50%; }
.saved { display: flex; gap: 6px; flex-wrap: wrap; }
.cal-day { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cal-day .d { font-family: var(--sans); font-size: 12px; color: var(--muted); }
.cal-day .d b { display: block; color: var(--text); font-family: var(--display); font-size: 20px; font-weight: 700; }
.ev { display: flex; gap: 8px; align-items: baseline; padding: 3px 0; font-size: 13px; }
.ev .badge { min-width: 88px; text-align: center; }
.sec-chip { cursor: pointer; }
.sec-chip.on { background: var(--accent-soft); color: var(--text); border-color: var(--accent); }

@media (prefers-reduced-motion: reduce) { .tape-track { animation: none; } .view, .modal .box, .toast { animation: none; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: 250px; transform: translateX(-100%); transition: transform .2s var(--ease); }
  .side.open { transform: none; box-shadow: 0 0 0 100vw rgba(0, 0, 0, .55); }
  .burger { display: block; }
  .clock { display: none; }
  .top { padding: 8px 12px; }
  .view { padding: 14px 12px 40px; }
  .tmap { height: 60vh; }
  .chart-main { height: 280px; }
}
