/* Terminal look: black background, amber/orange text, monospaced type. No external fonts or libraries. */
:root {
  --bg: #000;
  --panel: #070707;
  --line: #2b2108;
  --line-2: #3d2f0c;
  --orange: #fb8b1e;
  --amber: #ffb52e;
  --text: #f2e3c4;
  --dim: #8c7a55;
  --white: #e9e9e9;
  --up: #23d160;
  --down: #ff4d4d;
  --cyan: #3cc8f0;
  --sel: #3a2600;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 12px/1.45 var(--mono); }
body { display: flex; flex-direction: column; min-height: 100vh; }
a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }
b { color: var(--orange); font-weight: 700; }
.dim { color: var(--dim); }
.up { color: var(--up); }
.down { color: var(--down); }
.amber { color: var(--amber); }
.orange { color: var(--orange); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* top bar */
.top { display: flex; align-items: center; gap: 12px; padding: 6px 10px; border-bottom: 1px solid var(--line-2);
  background: #0b0700; }
.brand { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.logo { background: var(--orange); color: #000; font-weight: 700; padding: 1px 6px; letter-spacing: 1px; }
.brand-name { color: var(--amber); letter-spacing: 2px; }
.cmd { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 560px;
  border: 1px solid var(--line-2); background: #000; padding: 2px 4px; }
.cmd-sec { color: #000; background: var(--amber); padding: 0 6px; font-weight: 700; white-space: nowrap; }
.cmd input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--amber); font: inherit;
  text-transform: uppercase; outline: none; }
.cmd input::placeholder { color: var(--dim); text-transform: none; }
.go { background: #1f8a3a; color: #fff; border: 0; font: inherit; font-weight: 700; padding: 1px 10px; cursor: pointer; }
.top-right { display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.clock { color: var(--amber); }
.pill { padding: 0 6px; border: 1px solid currentColor; }
.pill.ok { color: var(--up); }
.pill.warn { color: var(--orange); }

/* function tabs */
.tabs { display: flex; gap: 2px; padding: 4px 10px 0; border-bottom: 1px solid var(--line-2); overflow-x: auto;
  scrollbar-width: none; }
.tabs button { background: #120d02; color: var(--text); border: 1px solid var(--line-2); border-bottom: 0;
  font: inherit; padding: 3px 12px; cursor: pointer; white-space: nowrap; }
.tabs button b { color: var(--dim); margin-right: 4px; }
.tabs button.on { background: var(--orange); color: #000; }
.tabs button.on b, .tabs button.on .dim { color: #3a2200; }

/* three columns */
.layout { flex: 1; display: grid; grid-template-columns: 230px minmax(0, 1fr) 320px; gap: 6px; padding: 6px;
  min-height: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0;
  min-width: 0; }
.panel-h { display: flex; justify-content: space-between; gap: 8px; padding: 3px 8px; background: #140e02;
  border-bottom: 1px solid var(--line-2); color: var(--orange); letter-spacing: 1px; text-transform: uppercase; }
.view { padding: 8px 10px; overflow: auto; flex: 1; }

/* watchlist */
.watch-list { overflow: auto; }
.wl-group { color: var(--dim); padding: 6px 8px 2px; border-top: 1px solid var(--line); letter-spacing: 1px; }
.wl-row { display: grid; grid-template-columns: 14px 1fr auto auto; gap: 6px; padding: 2px 8px; cursor: pointer;
  align-items: baseline; }
.wl-row:hover { background: #160f02; }
.wl-row.sel { background: var(--sel); }
.wl-row .mark { color: var(--orange); }
.wl-row .tk { color: var(--amber); }
.wl-row .px { color: var(--white); }
.wl-row .stale { color: var(--orange); font-size: 10px; }
.watch-note { padding: 8px; border-top: 1px solid var(--line); font-size: 11px; margin-top: auto; }

/* filings */
.filing-list { overflow: auto; }
.filing { display: grid; grid-template-columns: 74px 46px 34px 1fr; gap: 6px; padding: 3px 8px;
  border-bottom: 1px solid #120d02; align-items: baseline; }
.filing:hover { background: #160f02; }
.filing .fd { color: var(--dim); }
.filing .ft { color: var(--amber); }
.filing .fc { color: var(--orange); }
.filing .fs { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filing.hl .ft { background: var(--sel); }

/* tables */
table.t { width: 100%; border-collapse: collapse; }
.t th { color: var(--orange); text-align: left; font-weight: 400; border-bottom: 1px solid var(--line-2);
  padding: 3px 6px; white-space: nowrap; }
.t th.num { text-align: right; }
.t td { padding: 3px 6px; border-bottom: 1px solid #140f04; }
.t tr:hover td { background: #120c02; }
.t td.lbl { color: var(--amber); white-space: nowrap; }
.sec-h { color: var(--orange); margin: 14px 0 6px; letter-spacing: 1px; display: flex; justify-content: space-between;
  gap: 8px; border-bottom: 1px solid var(--line-2); padding-bottom: 2px; }
.sec-h:first-child { margin-top: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 16px 28px; }
.grid2 > div { min-width: 0; overflow-x: auto; }
.t td.trend, .t th.trend { width: 68px; max-width: 68px; overflow: hidden; padding-right: 0; }
.note { color: var(--dim); font-size: 11px; margin-top: 6px; }
.spark { display: block; }

/* brief teaser */
.teaser { border: 1px solid var(--line-2); padding: 6px 8px; margin-bottom: 12px; cursor: pointer; background: #0d0900; }
.teaser:hover { border-color: var(--orange); }
.teaser .k { color: #000; background: var(--orange); padding: 0 5px; margin-right: 8px; }

/* price chart */
.quote { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: baseline; margin-bottom: 6px; }
.quote .big { font-size: 26px; color: var(--white); }
.quote .kv span { display: block; color: var(--dim); font-size: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0; }
.legend i { display: inline-block; width: 14px; height: 2px; vertical-align: middle; margin-right: 4px; }
.ranges { display: flex; gap: 4px; margin-left: auto; }
.ranges button, .seg button { background: #120d02; color: var(--text); border: 1px solid var(--line-2); font: inherit;
  padding: 0 8px; cursor: pointer; }
.ranges button.on, .seg button.on { background: var(--amber); color: #000; }
.seg { display: inline-flex; gap: 4px; }
canvas { display: block; width: 100%; }
.chart-wrap { position: relative; }
.tip { position: absolute; pointer-events: none; background: #000; border: 1px solid var(--orange); padding: 2px 6px;
  color: var(--white); font-size: 11px; display: none; white-space: nowrap; }

/* heatmap */
.heat td.c { text-align: center; color: #000; min-width: 52px; }
.heat th { text-align: center; }

/* brief */
.headline { color: var(--white); font-size: 16px; margin: 4px 0 10px; }
ol.points, ul.risks { margin: 0; padding-left: 22px; }
ol.points li, ul.risks li { margin: 4px 0; }
ol.points li::marker { color: var(--orange); }
ul.risks li::marker { color: var(--down); }
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 14px; margin-top: 14px;
  border-top: 1px solid var(--line-2); padding-top: 8px; }
.meta div span { display: block; color: var(--dim); font-size: 10px; }
.badge { padding: 0 5px; border: 1px solid currentColor; font-size: 11px; }
.badge.live { color: var(--up); }
.badge.stale { color: var(--orange); }
.badge.missing { color: var(--down); }
.issues { margin: 0; padding-left: 16px; color: var(--dim); }
.issues li.error { color: var(--down); }

/* bottom line */
.status-line { padding: 3px 10px; border-top: 1px solid var(--line-2); background: #0b0700; color: var(--dim);
  display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 11px; }
.status-line b { color: var(--amber); font-weight: 400; }

/* phones and narrow windows */
@media (max-width: 980px) {
  html, body { height: auto; }
  body { overflow-x: hidden; }
  .layout { grid-template-columns: minmax(0, 1fr); flex: none; }
  .watch, .filings { min-height: auto; }
  .watch { order: 1; }
  .main { order: 2; min-height: 70vh; }
  .filings { order: 3; max-height: 50vh; }
  .watch-list { display: flex; overflow-x: auto; }
  .wl-group { display: none; }
  .wl-row { grid-template-columns: auto auto; border-right: 1px solid var(--line); padding: 4px 10px; white-space: nowrap; }
  .wl-row .mark, .wl-row .px { display: none; }
  .watch-note { display: none; }
  .top { flex-wrap: wrap; }
  .cmd { order: 3; flex-basis: 100%; max-width: none; }
  .brand-name { display: none; }
}
@media (max-width: 520px) {
  .filing { grid-template-columns: 70px 44px 1fr; }
  .filing .fc { display: none; }
  .top-right #asof { display: none; }
  .quote .big { font-size: 22px; }
  .t .trend { display: none; }
  .t td.lbl { white-space: normal; }
}
.t tr.sel td { background: var(--sel); }
.t td.dim { white-space: nowrap; }

/* alerts strip */
.alertbar { display: flex; gap: 8px; align-items: center; padding: 3px 10px; border-bottom: 1px solid var(--line-2);
  background: #0d0800; overflow-x: auto; white-space: nowrap; scrollbar-width: none; cursor: pointer; }
.alertbar:empty { display: none; }
.alertbar .lab { color: #000; background: var(--down); padding: 0 6px; font-weight: 700; }
.alertbar .a { color: var(--text); }
.alertbar .a.warn b { color: var(--down); }
.alertbar .a.info b { color: var(--cyan); }
.alertbar .sep { color: var(--dim); }
.alert-list li { margin: 3px 0; }
.alert-list b { display: inline-block; min-width: 52px; }
.alert-list .warn b { color: var(--down); }
.alert-list .info b { color: var(--cyan); }

/* ask */
.qa { border: 1px solid var(--line-2); padding: 8px 10px; margin-bottom: 10px; background: #0b0700; }
.qa .q { color: var(--amber); margin-bottom: 4px; }
.qa .q::before { content: "Q> "; color: var(--orange); }
.qa .a { color: var(--white); }
.qa .cites { margin-top: 6px; font-size: 11px; color: var(--dim); }
.qa .cites span { border: 1px solid var(--line-2); padding: 0 5px; margin-right: 4px; display: inline-block; margin-top: 3px; color: var(--amber); }
.askform { display: flex; gap: 6px; margin-bottom: 12px; }
.askform input { flex: 1; min-width: 0; background: #000; border: 1px solid var(--orange); color: var(--amber); font: inherit; padding: 4px 6px; }
.askform button { background: var(--orange); color: #000; border: 0; font: inherit; font-weight: 700; padding: 0 12px; cursor: pointer; }

/* news */
.ed { display: grid; grid-template-columns: 90px 1fr auto; gap: 8px; padding: 4px 0; border-bottom: 1px solid #140f04; }
.newsframe { width: 100%; height: 70vh; border: 1px solid var(--line-2); background: #fff; margin-top: 10px; }
