/* Bloomberg-terminal styling.
   Pure black ground, amber chrome, monospaced numerals, dense rows and visible
   panel dividers. Information density is the point: nothing is padded for
   comfort, and colour is reserved for direction and urgency. */

:root {
  --bg: #000000;
  --panel: #0A0A0C;
  --panel-hi: #121217;
  --row-alt: #08080A;
  --line: #1E1E24;
  --line-hi: #2E2E38;

  --amber: #FFA028;
  --amber-dim: #8A5A16;
  --cyan: #4FC3F7;
  --text: #E4E4E8;
  --bright: #FFFFFF;
  --muted: #A2A2B0;
  --faint: #7C7C8A;

  --up: #00D95F;
  --down: #FF3B30;
  --warn: #FFD23F;

  --mono: "IBM Plex Mono", "SF Mono", Menlo, Consolas, "Courier New", monospace;
  /* Prose gets a sans face. Monospace is right for columns of numbers
     and wrong for three lines of description, where the even advance
     width slows reading badly at small sizes. */
  --sans: "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, sans-serif;

  --rail: 320px;
  --nav: 186px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* The HTML `hidden` attribute is applied by the UA stylesheet as
   `[hidden] { display: none }`, which ANY author-level display rule outranks.
   `.auth-gate` is `display: flex` and `.ctl-row` is `display: flex`, so both
   stayed fully visible while their `hidden` property read true - the login
   overlay sat on top of an app the user was already signed into, and four
   successful logins in a row looked like four failures.

   One !important rule at the top makes `el.hidden = true` mean what every
   caller assumes it means. */
[hidden] { display: none !important; }



body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.num { font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.amber { color: var(--amber); }

/* ------------------------------------------------------------ index strip */
.ticker-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.idx {
  border-right: 1px solid var(--line);
  padding: 8px 12px 6px;
  display: flex; gap: 12px; align-items: center; min-width: 0;
}
.idx:last-child { border-right: none; }
.idx-info { min-width: 0; flex: 1; }
.idx-name {
  font-size: 11px; color: var(--amber); letter-spacing: .09em;
  text-transform: uppercase; font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.idx-last { font-family: var(--mono); font-size: 20px; font-weight: 600; color: var(--bright); margin-top: 1px; }
.idx-chg { font-family: var(--mono); font-size: 12.5px; margin-top: 1px; }
.idx-meta { font-size: 10.5px; color: var(--faint); margin-top: 2px; white-space: nowrap; }
.idx-spark { width: 84px; height: 38px; flex: 0 0 84px; }
.gate-flag {
  display: inline-block; font-size: 8.5px; padding: 0 4px;
  border: 1px solid currentColor; letter-spacing: .06em; margin-left: 4px;
  vertical-align: 1px;
}

/* ------------------------------------------------------------------ shell */
.term {
  display: grid;
  grid-template-columns: var(--nav) minmax(0, 1fr) var(--rail);
  min-height: calc(100vh - 66px);
}

.nav { border-right: 1px solid var(--line); background: var(--panel); }
.nav-head {
  font-size: 9.5px; color: var(--amber); letter-spacing: .12em;
  padding: 7px 11px 5px; border-bottom: 1px solid var(--line);
  text-transform: uppercase; font-weight: 600;
}
.nav-item {
  padding: 8px 11px; cursor: pointer; color: var(--muted);
  border-left: 2px solid transparent; font-size: 12.5px;
  display: flex; align-items: center; gap: 7px; user-select: none;
  white-space: nowrap; overflow: hidden;
}
.nav-item:hover { background: var(--panel-hi); color: var(--text); }
.nav-item.active {
  background: var(--panel-hi); color: var(--amber);
  border-left-color: var(--amber);
}
.nav-key {
  font-size: 9px; color: var(--faint); border: 1px solid var(--line-hi);
  padding: 0 3px; min-width: 17px; text-align: center;
}
.nav-item.active .nav-key { color: var(--amber); border-color: var(--amber-dim); }
.nav-badge {
  margin-left: auto; font-size: 9px; background: var(--amber);
  color: #000; padding: 0 4px; font-weight: 700;
}

.work { min-width: 0; border-right: 1px solid var(--line); }

/* ------------------------------------------------------------------ panel */
.panel { border-bottom: 1px solid var(--line); }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 6px 11px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.panel-title {
  font-size: 11.5px; color: var(--amber); letter-spacing: .11em;
  text-transform: uppercase; font-weight: 600;
}
.panel-note { font-size: 11.5px; color: var(--muted); }
.panel-body { padding: 9px 11px; }
.panel-body.flush { padding: 0; }

/* ------------------------------------------------------------------ scans */
.scan-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(228px, 100%), 1fr));
}
.scan-item {
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 7px 10px; cursor: pointer; min-width: 0;
}
.scan-item:hover { background: var(--panel-hi); }
.scan-item.active { background: var(--panel-hi); box-shadow: inset 2px 0 0 var(--amber); }
.scan-name {
  font-family: var(--sans); font-size: 13px; color: var(--bright); font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.scan-item.active .scan-name { color: var(--amber); }
.scan-desc {
  font-family: var(--sans); font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.scan-item.active .scan-desc { -webkit-line-clamp: 14; }

/* ----------------------------------------------------------------- tables */
.tbl-wrap { overflow-x: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px;
        font-family: var(--mono); }
thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--panel); color: var(--amber);
  font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  font-weight: 600; text-align: right; padding: 6px 9px;
  border-bottom: 1px solid var(--line-hi); white-space: nowrap;
  cursor: pointer; user-select: none;
}
thead th:first-child, tbody td:first-child { text-align: left; }
thead th:hover { color: var(--bright); }
tbody td {
  padding: 6px 9px; text-align: right; white-space: nowrap;
  border-bottom: 1px solid #0E0E12; font-variant-numeric: tabular-nums;
}
tbody tr { cursor: pointer; }
tbody tr:nth-child(even) { background: var(--row-alt); }
tbody tr:hover { background: #16161C; }
.sym { color: var(--bright); font-weight: 600; }
.sym-name { font-family: var(--sans); font-size: 10.5px; color: var(--muted); }

.tag {
  display: inline-block; padding: 1px 5px; font-size: 10.5px;
  border: 1px solid var(--line-hi); color: var(--muted); letter-spacing: .03em;
}
.tag.up { color: var(--up); border-color: #0A3D22; background: #04160C; }
.tag.down { color: var(--down); border-color: #4A1512; background: #1A0605; }
.tag.hot { color: var(--warn); border-color: #4A3C0A; background: #161203; }
.tag.amber { color: var(--amber); border-color: var(--amber-dim); background: #150D02; }
.tag + .tag { margin-left: 3px; }

.bar { display: inline-flex; align-items: center; gap: 5px; justify-content: flex-end; }
.bar-track { width: 34px; height: 3px; background: #1A1A20; }
.bar-fill { height: 100%; background: var(--amber); }

/* ------------------------------------------------------------- right rail */
.rail { background: var(--panel); display: flex; flex-direction: column; min-width: 0; }
.rail-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px; border-bottom: 1px solid var(--line);
}
.rail-title {
  font-size: 10px; color: var(--amber); letter-spacing: .11em;
  text-transform: uppercase; font-weight: 600;
}
.rail-body { overflow-y: auto; flex: 1; max-height: calc(100vh - 110px); }
.ann {
  padding: 6px 10px; border-bottom: 1px solid #0E0E12;
  border-left: 2px solid transparent; cursor: pointer;
}
.ann:hover { background: var(--panel-hi); }
.ann.pos { border-left-color: var(--up); }
.ann.neg { border-left-color: var(--down); }
.ann.hot { border-left-color: var(--warn); }
.ann-top { display: flex; align-items: baseline; gap: 6px; }
.ann-sym { font-size: 12.5px; color: var(--bright); font-weight: 600; }
.ann-time { margin-left: auto; font-size: 11px; color: var(--faint); }
.ann-head {
  font-family: var(--sans); font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ----------------------------------------------------------------- inputs */
.ctl-row { display: flex; flex-wrap: wrap; gap: 7px; align-items: flex-end; }
.ctl label {
  display: block; font-size: 10px; color: var(--muted);
  letter-spacing: .07em; text-transform: uppercase; margin-bottom: 2px;
}
.ctl input, .ctl select {
  background: #06060A; border: 1px solid var(--line-hi); color: var(--text);
  padding: 4px 7px; font-family: var(--mono); font-size: 13px;
  outline: none; min-width: 84px;
}
.ctl input:focus, .ctl select:focus { border-color: var(--amber); color: var(--bright); }

.btn {
  background: #0E0E12; border: 1px solid var(--line-hi); color: var(--text);
  padding: 5px 12px; font-family: var(--mono); font-size: 12px;
  cursor: pointer; letter-spacing: .04em; text-transform: uppercase;
}
.btn:hover { border-color: var(--amber); color: var(--amber); }
.btn.go { background: var(--amber); color: #000; border-color: var(--amber); font-weight: 700; }
.btn.go:hover { filter: brightness(1.12); color: #000; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.chk {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  font-size: 12px; color: var(--muted); border: 1px solid var(--line);
  padding: 4px 9px; user-select: none;
}
.chk:hover { border-color: var(--line-hi); color: var(--text); }
.chk.on { color: var(--amber); border-color: var(--amber-dim); background: #120B02; }
.chk::before { content: "\25A1"; font-size: 11px; }
.chk.on::before { content: "\25A3"; }

/* -------------------------------------------------------------- stat cells */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr));
  border-bottom: 1px solid var(--line);
}
.stat { padding: 6px 11px; border-right: 1px solid var(--line); min-width: 0; }
.stat:last-child { border-right: none; }
.stat-k { font-size: 10.5px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.stat-v { font-family: var(--mono); font-size: 19px; color: var(--bright); font-weight: 600; margin-top: 1px; }

/* ----------------------------------------------------------------- drawer */
.scrim {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .72); z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 96vw);
  background: var(--bg); border-left: 1px solid var(--amber-dim); z-index: 61;
  transform: translateX(100%); transition: transform .18s ease-out;
  overflow-y: auto;
}
.drawer.open { transform: translateX(0); }
.drawer-close {
  position: absolute; top: 7px; right: 10px; background: transparent;
  border: 1px solid var(--line-hi); color: var(--muted); width: 22px; height: 22px;
  cursor: pointer; font-family: var(--mono); line-height: 1;
}
.drawer-close:hover { color: var(--amber); border-color: var(--amber); }

.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(96px, 100%), 1fr));
  border-top: 1px solid var(--line);
}
.kv { padding: 5px 9px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.kv-k { font-size: 10px; color: var(--muted); letter-spacing: .07em; text-transform: uppercase; }
.kv-v { font-size: 15px; color: var(--bright); font-weight: 600; margin-top: 1px; }

.evt { display: flex; gap: 8px; padding: 5px 11px; border-bottom: 1px solid #0E0E12; }
.evt-bar { width: 2px; flex: 0 0 2px; background: var(--faint); }
.evt-bar.up { background: var(--up); }
.evt-bar.down { background: var(--down); }
.evt-body { min-width: 0; flex: 1; }
.evt-top { display: flex; gap: 7px; align-items: baseline; }
.evt-label { font-family: var(--sans); font-size: 12.5px; color: var(--bright); }
.evt-date { margin-left: auto; font-size: 11px; color: var(--faint); }
.evt-detail { font-family: var(--sans); font-size: 11.5px; color: var(--muted); margin-top: 1px; }

.quote {
  font-family: var(--sans); font-size: 12.5px; color: var(--text); line-height: 1.5;
  border-left: 2px solid var(--amber-dim); padding: 2px 0 2px 8px; margin-bottom: 5px;
}

.note {
  font-family: var(--sans); font-size: 12px; color: var(--warn); border: 1px solid #4A3C0A;
  background: #12100A; padding: 6px 9px; margin-bottom: 8px;
}
.note.info { color: var(--cyan); border-color: #123A4A; background: #06121A; }

.empty { padding: 30px 14px; text-align: center; color: var(--muted); font-size: 12.5px; }

.spin {
  display: inline-block; width: 9px; height: 9px;
  border: 1px solid var(--line-hi); border-top-color: var(--amber);
  border-radius: 50%; animation: sp .6s linear infinite;
}
@keyframes sp { to { transform: rotate(360deg); } }

.toasts { position: fixed; bottom: 10px; right: 10px; z-index: 90; display: flex; flex-direction: column; gap: 5px; }
.toast {
  background: var(--panel); border: 1px solid var(--line-hi);
  border-left: 2px solid var(--amber); padding: 9px 12px; font-size: 12.5px;
  max-width: 330px;
}
.toast.err { border-left-color: var(--down); }
.toast.ok { border-left-color: var(--up); }

.status-bar {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  padding: 5px 11px; border-top: 1px solid var(--line);
  background: var(--panel); font-size: 11px; color: var(--muted);
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); display: inline-block; }
.dot.ok { background: var(--up); }
.dot.bad { background: var(--down); }

.sector-row {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) 52px 40px;
  gap: 7px; align-items: center; padding: 3px 11px;
  border-bottom: 1px solid #0E0E12;
}
.sector-rank { font-size: 10px; color: var(--faint); text-align: center; }
.sector-name { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sector-track { height: 3px; background: #1A1A20; margin-top: 2px; }
.sector-fill { height: 100%; background: var(--amber); }

canvas.big { display: block; width: 100%; height: 128px; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  :root { --rail: 0px; --nav: 150px; }
  .term { grid-template-columns: var(--nav) minmax(0, 1fr); }
  /* The rail's filings feed is not lost - the FILINGS view shows the same
     data, and the nav still reaches it. */
  .rail { display: none; }
}

/* ------------------------------------------------------------------ mobile
   The side nav cannot simply be hidden: doing that leaves a phone with no way
   to change view at all. It becomes a fixed bottom tab bar instead, which is
   where a thumb already is, and the work area gets the full width. */
@media (max-width: 760px) {
  :root { --nav: 0px; }

  body { font-size: 13px; }

  .term {
    grid-template-columns: minmax(0, 1fr);
    /* Clear the bottom bar, plus the iOS home indicator. */
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  }
  .work { border-right: none; }

  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    display: flex; border-right: none; border-top: 1px solid var(--line-hi);
    background: #06060A;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  .nav-head { display: none; }
  .nav-item {
    flex: 1 0 auto; flex-direction: column; gap: 2px;
    justify-content: center; padding: 8px 12px; min-height: 52px;
    border-left: none; border-top: 2px solid transparent;
    font-size: 10px; letter-spacing: .04em;
  }
  .nav-item.active { border-left-color: transparent; border-top-color: var(--amber); }
  .nav-key { font-size: 8px; border: none; padding: 0; min-width: 0; }
  .nav-badge { margin-left: 0; position: absolute; top: 4px; right: 8px; }

  /* Index strip scrolls sideways one card at a time rather than squeezing
     three into a phone's width. */
  .ticker-strip {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .ticker-strip::-webkit-scrollbar { display: none; }
  .idx { flex: 0 0 84%; scroll-snap-align: start; }

  /* Touch targets. 32px minimum, which is the smallest a thumb hits reliably. */
  .btn { padding: 8px 14px; font-size: 12px; min-height: 34px; }
  .chk { padding: 7px 11px; font-size: 11.5px; min-height: 32px; }
  .ctl input, .ctl select { padding: 7px 8px; font-size: 15px; min-height: 34px; }
  .scan-item { padding: 10px 12px; }
  .scan-name { font-size: 13px; }
  .scan-desc { font-size: 11px; }
  .nav-item, .scan-item, tbody tr, .ann { -webkit-tap-highlight-color: rgba(255,160,40,.18); }

  /* Tables stay wide and scroll inside their own box, with the symbol column
     pinned so a row never loses its identity mid-swipe. */
  .tbl-wrap { -webkit-overflow-scrolling: touch; }
  tbody td { padding: 8px 8px; }
  thead th { padding: 7px 8px; }
  thead th:first-child, tbody td:first-child {
    position: sticky; left: 0; z-index: 1; background: var(--bg);
  }
  tbody tr:nth-child(even) td:first-child { background: var(--row-alt); }
  thead th:first-child { z-index: 3; background: var(--panel); }

  .drawer { width: 100%; border-left: none; }
  .drawer-close { width: 34px; height: 34px; font-size: 15px; }
  .kv-grid { grid-template-columns: repeat(auto-fit, minmax(min(88px, 45%), 1fr)); }

  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { border-bottom: 1px solid var(--line); }

  .status-bar { font-size: 9px; gap: 9px; padding: 4px 9px; }
  #statGate { margin-left: 0; width: 100%; }

  .toasts { left: 10px; right: 10px; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .toast { max-width: none; }

  .panel-head { flex-wrap: wrap; }
  .rail-body { max-height: none; }
}

/* Very narrow phones: drop the nav labels, keep the keys as icons. */
@media (max-width: 400px) {
  .nav-item span:not(.nav-key):not(.nav-badge) { font-size: 9px; }
  .idx { flex: 0 0 92%; }
}

/* Alert toggle sits inside the scan card; it must not look like the card's
   own click target, which runs the scan. */
.alert-btn {
  font-size: 9.5px; padding: 2px 7px; letter-spacing: .06em;
  flex: 0 0 auto; min-height: 0;
}
.scan-item .scan-name { justify-content: space-between; }

/* ------------------------------------------------- simplified scan cards
   Sixteen scans, each previously showing a full technical paragraph, made the
   page unreadable. A card now leads with one plain sentence and keeps the rule
   set one click away, and the grid is wider so cards breathe. */
.scan-list {
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
}
.scan-item { padding: 12px 14px; display: flex; flex-direction: column; gap: 7px; }
.scan-item.active { background: var(--panel-hi); }
.scan-name { font-size: 14px; letter-spacing: -.01em; }
.scan-sum {
  font-family: var(--sans); font-size: 12.5px; color: var(--text);
  line-height: 1.5; flex: 1;
}
.scan-foot { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.scan-detail {
  font-family: var(--sans); font-size: 11.5px; color: var(--muted);
  line-height: 1.55; border-top: 1px solid var(--line); padding-top: 8px;
}
.run-btn { padding: 5px 16px; }
.alert-btn { font-size: 11px; padding: 5px 11px; }
.alert-btn.armed { border-color: var(--amber); color: var(--amber); background: #150D02; }
.link-btn {
  background: none; border: none; color: var(--cyan); cursor: pointer;
  font-family: var(--sans); font-size: 11.5px; padding: 4px 2px;
  text-decoration: underline; text-underline-offset: 2px; margin-left: auto;
}
.link-btn:hover { color: var(--bright); }

/* Advanced filters stay out of the way until asked for. */
.ctl-row.adv {
  margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line-hi);
}

@media (max-width: 760px) {
  .scan-list { grid-template-columns: minmax(0, 1fr); }
  .scan-item { padding: 14px; }
  .run-btn, .alert-btn { min-height: 36px; }
  .link-btn { font-size: 12.5px; min-height: 36px; }
}

/* ----------------------------------------------------------- auth gate */
.auth-gate {
  position: fixed; inset: 0; z-index: 100; background: #000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.auth-box {
  width: min(380px, 100%); border: 1px solid var(--line-hi);
  background: var(--panel); padding: 26px 24px;
}
.auth-brand {
  font-family: var(--mono); font-size: 17px; font-weight: 700;
  letter-spacing: .08em; color: var(--bright);
}
.auth-sub { font-size: 12.5px; color: var(--muted); margin: 4px 0 18px; }
.auth-box .ctl { margin-bottom: 11px; }
.auth-box .ctl input { width: 100%; min-height: 36px; font-size: 15px; }
.auth-err {
  font-size: 12px; color: var(--down); border: 1px solid #4A1512;
  background: #1A0605; padding: 7px 9px; margin-top: 8px;
}
.auth-switch {
  margin-top: 14px; font-size: 12.5px; color: var(--muted);
  display: flex; gap: 6px; align-items: center;
}
.auth-note {
  margin-top: 12px; font-size: 11.5px; color: var(--cyan);
  border: 1px solid #123A4A; background: #06121A; padding: 8px 10px;
}
.link-code {
  font-family: var(--mono); font-size: 26px; font-weight: 700;
  letter-spacing: .22em; color: var(--amber); background: #150D02;
  border: 1px solid var(--amber-dim); padding: 10px 16px;
  display: inline-block; margin: 8px 0;
}
.step { font-size: 12.5px; color: var(--text); margin: 4px 0; }
.step b { color: var(--amber); }


/* ------------------------------------------------------------- typeahead */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 7px 12px; border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.topbar input { width: 100%; min-height: 30px; }

.ta-wrap { position: relative; flex: 1; }
.ta-box {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 70;
  background: #07070B; border: 1px solid var(--amber-dim);
  max-height: 300px; overflow-y: auto;
}
.ta-item {
  display: grid; grid-template-columns: 96px 1fr auto;
  gap: 9px; align-items: baseline;
  padding: 6px 10px; cursor: pointer;
  border-bottom: 1px solid #0E0E12;
}
.ta-item:hover, .ta-item.on { background: var(--panel-hi); }
.ta-item.on { box-shadow: inset 2px 0 0 var(--amber); }
.ta-sym {
  font-family: var(--mono); font-size: 12.5px;
  color: var(--amber); font-weight: 600;
}
.ta-name {
  font-size: 12.5px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ta-meta { font-size: 10.5px; color: var(--faint); white-space: nowrap; }

@media (max-width: 760px) {
  .topbar { padding: 8px 10px; }
  .ta-item { grid-template-columns: 84px 1fr; padding: 10px; }
  .ta-meta { display: none; }
}


/* ------------------------------------------------- stock panel navigation */
/* The only way out used to be a 22px "x" floating in the corner or the Esc
   key. On a phone neither is discoverable, so the panel felt like a dead end. */
.drawer-bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.drawer-back { padding: 6px 14px; font-weight: 600; }
.drawer-back:hover { border-color: var(--amber); color: var(--amber); }
.drawer-crumb {
  font-size: 11px; color: var(--muted); letter-spacing: .05em;
  text-transform: uppercase; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; flex: 1;
}
.drawer .drawer-close { position: static; margin-left: auto; }

@media (max-width: 760px) {
  .drawer-bar { padding: 10px; }
  .drawer-back { min-height: 38px; padding: 8px 16px; font-size: 13px; }
  .drawer .drawer-close { width: 38px; height: 38px; font-size: 18px; }
}

/* ------------------------------------------------------------ stock chart */
.chart-wrap { border-bottom: 1px solid var(--line); }
canvas.px { display: block; width: 100%; }
.chart-legend {
  display: flex; gap: 12px; flex-wrap: wrap;
  padding: 5px 11px; font-size: 10.5px; color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.chart-legend b { font-weight: 600; }
.lg { display: inline-flex; align-items: center; gap: 4px; }
.lg i { width: 10px; height: 2px; display: inline-block; }
.chart-range { display: flex; gap: 4px; margin-left: auto; }
.chart-range button {
  background: transparent; border: 1px solid var(--line);
  color: var(--muted); font-family: var(--mono); font-size: 10px;
  padding: 1px 7px; cursor: pointer;
}
.chart-range button.on { color: var(--amber); border-color: var(--amber-dim); background: #150D02; }

.more-btn {
  display: block; width: 100%; text-align: center;
  background: transparent; border: none; border-top: 1px solid var(--line);
  color: var(--cyan); font-family: var(--mono); font-size: 11.5px;
  padding: 9px; cursor: pointer;
}
.more-btn:hover { background: var(--panel-hi); color: var(--bright); }

/* ---------------------------------------------- growth catalysts & guidance */
/* The scorecard leads the panel: a list of promises is worth much less than the
   record of whether they were kept, so delivered/missed gets the visual weight
   and the individual bullets sit underneath it. */
.score { margin-bottom: 4px; }
.score-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px; margin-bottom: 6px; flex-wrap: wrap;
}
.score-ratio { font-size: 11px; color: var(--fg); font-weight: 600; }
.score-bar {
  display: flex; height: 7px; border-radius: 4px; overflow: hidden;
  background: var(--line);
}
.score-bar i { display: block; height: 100%; }
.score-key {
  display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 7px;
  font-size: 10px; color: var(--muted);
}
.sc-lbl { display: inline-flex; align-items: center; gap: 5px; }
.sc-lbl i { width: 8px; height: 8px; border-radius: 2px; flex: none; }

.sc-delivered { background: var(--up); }
.sc-ontrack   { background: #2E9BD6; }
.sc-partial   { background: var(--amber); }
.sc-pending   { background: #6B6B7B; }
.sc-missed    { background: var(--down); }

.cat { padding: 8px 0; border-top: 1px solid var(--line); }
.cat:first-child { border-top: 0; padding-top: 2px; }
.cat-top {
  display: flex; align-items: baseline; gap: 8px;
  justify-content: space-between; margin-bottom: 3px;
}
.cat-title { font-size: 11.5px; font-weight: 600; color: var(--fg); line-height: 1.4; }
.cat-body { font-size: 11px; color: var(--muted); line-height: 1.55; }

/* Verdict chips reuse the scorecard colours so the bar and the list read as
   one thing rather than two unrelated colour schemes. */
.tag.st-delivered { color: var(--up);    border-color: var(--up); }
.tag.st-ontrack   { color: #4FC3F7;      border-color: #2E9BD6; }
.tag.st-partial   { color: var(--amber); border-color: var(--amber-dim); }
.tag.st-pending   { color: var(--muted); border-color: var(--line); }
.tag.st-missed    { color: var(--down);  border-color: var(--down); }
