/* QuantMind terminal styles — dense, dark-first, responsive, no build step.
   Tokens drive both themes; [data-theme] on <html> is switched by app.js. */
:root {
  --bg: #080d16; --bg-2: #0d1421; --panel: #101a2b; --panel-2: #14213450; --line: #1d2b41;
  --ink: #dbe6f6; --ink-2: #93a5c0; --ink-3: #64789a;
  --up: #22c55e; --down: #ef4444; --flat: #94a3b8;
  --acc: #38bdf8; --acc-2: #a78bfa; --warn: #f59e0b; --danger: #f43f5e;
  --demo: #f59e0b; --radius: 10px; --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gap: 12px; --row-h: 26px; --shadow: 0 10px 30px #0006;
}
[data-theme="light"] {
  --bg: #f4f6fb; --bg-2: #ffffff; --panel: #ffffff; --panel-2: #f7f9fd; --line: #dde3ee;
  --ink: #16233a; --ink-2: #4a5c78; --ink-3: #7b8aa5; --shadow: 0 8px 24px #1c2a4422;
}
* { box-sizing: border-box }
/* `hidden` must beat a class. An attribute selector and a class selector weigh the same, and author CSS outranks
   the UA sheet, so any rule that names a display value puts a hidden element back on screen — which is how an
   empty modal layer came to dim the whole site and swallow every click on every page. */
[hidden] { display: none !important }
html, body { margin: 0; padding: 0 }
body { background: var(--bg); color: var(--ink); font: 13px/1.45 var(--sans); -webkit-font-smoothing: antialiased }
a { color: var(--acc); text-decoration: none }
a:hover { text-decoration: underline }
h1, h2, h3, h4 { margin: 0 0 .4rem; font-weight: 650; letter-spacing: -.01em }
h1 { font-size: 20px } h2 { font-size: 16px } h3 { font-size: 14px } h4 { font-size: 13px; color: var(--ink-2) }
code, .mono, table.num td, table.num th { font-family: var(--mono); font-variant-numeric: tabular-nums }
.skip { position: absolute; left: -9999px } .skip:focus { left: 8px; top: 8px; z-index: 99; background: var(--panel); padding: 6px 10px }
.warn { color: var(--warn) } .up { color: var(--up) } .down { color: var(--down) } .flat { color: var(--flat) }
.muted { color: var(--ink-2) } .tiny { font-size: 11px } .nowrap { white-space: nowrap }
.center { text-align: center } .right { text-align: right }

/* ---------- chrome ---------- */
.topbar { display: flex; align-items: center; gap: 14px; padding: 8px 14px; background: var(--bg-2);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40 }
.topbar__brand { display: flex; align-items: center; gap: 9px }
.logo { display: flex; align-items: center; gap: 7px; color: var(--ink); font-weight: 700; letter-spacing: -.02em }
.logo svg { width: 22px; height: 22px; color: var(--up) }
.logo em { font-style: normal; color: var(--acc) }
.topbar__search { flex: 1; max-width: 460px; position: relative }
.topbar__search input { width: 100%; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink) }
.topbar__search input:focus { outline: 2px solid var(--acc); outline-offset: 0 }
.search__results { position: absolute; top: 110%; left: 0; right: 0; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; z-index: 50 }
.search__results a { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; color: var(--ink) }
.search__results a:hover { background: var(--panel-2); text-decoration: none }
.topbar__actions { display: flex; align-items: center; gap: 7px; margin-left: auto }
.icon-btn { background: transparent; border: 1px solid var(--line); color: var(--ink); width: 30px; height: 28px;
  border-radius: 7px; cursor: pointer }
.icon-btn:hover { border-color: var(--acc) }
.pill { font-size: 10.5px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2);
  text-transform: uppercase; letter-spacing: .06em; display: inline-flex; gap: 5px; align-items: center }
.pill--demo { border-color: var(--demo); color: var(--demo); background: #f59e0b14 }
.pill--live { border-color: var(--up); color: var(--up); background: #22c55e14 }
.pill--ghost { text-transform: none; letter-spacing: 0 }
.notice { padding: 7px 14px; font-size: 12px; border-bottom: 1px solid var(--line) }
.notice--demo { background: #f59e0b12; color: var(--ink-2) }
.notice--demo strong { color: var(--demo) }
/* Ticker tape. The strip is a viewport around a track painted twice and translated left forever, so the seam
   never shows. Paused on hover/focus so a chip can be clicked, dragged to scrub by hand, and stilled outright
   where the reader asked for reduced motion — then the row is scrollable instead of animated. */
.ticker { position: relative; overflow: hidden; padding: 5px 0; background: var(--bg-2);
  border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 11.5px; white-space: nowrap }
.ticker__track { display: inline-flex; gap: 22px; padding-left: 14px; will-change: transform;
  animation: qm-tape var(--qm-tape-dur, 60s) linear infinite }
.ticker:hover .ticker__track, .ticker:focus-within .ticker__track, .ticker[data-drag="1"] .ticker__track { animation-play-state: paused }
.ticker__copy { display: inline-flex; gap: 22px; padding-right: 14px }
.ticker span { color: var(--ink-2); display: inline-flex; gap: 6px; align-items: baseline }
.ticker a { color: inherit; text-decoration: none }
.ticker a:hover, .ticker a:focus-visible { text-decoration: underline }
.ticker__rec { border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; color: var(--ink-3) }
.ticker__rec b { color: var(--acc) }
.ticker__lead { color: var(--ink-3); letter-spacing: .08em; font-size: 10px; text-transform: uppercase }
@keyframes qm-tape { from { transform: translateX(0) } to { transform: translateX(-50%) } }
/* Readiness page: one bar per score, one chip per gate state. */
.ready__pct { font-family: var(--mono); font-size: 26px; letter-spacing: -0.02em }
.ready__bar { height: 7px; border-radius: 999px; background: var(--bg-3); overflow: hidden; margin: 2px 0 12px }
.ready__bar i { display: block; height: 100%; border-radius: 999px }
.ready__chip { text-transform: uppercase; letter-spacing: .06em; font-size: 10px }
.ready__chip--pass { border-color: var(--up); color: var(--up) }
.ready__chip--partial { border-color: var(--demo); color: var(--demo) }
.ready__chip--pending { border-color: var(--down); color: var(--down) }
.ready__chip--blocked { border-color: var(--line); color: var(--ink-3) }
/* Landing page (signed-out /): a centred column, no tables, nothing that depends on a quote being in storage. */
.landing { max-width: 720px; margin: 6vh auto 0; padding: 0 4px }
.landing__kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--acc); margin: 0 0 10px }
.landing__title { font-size: 34px; line-height: 1.15; margin: 0 0 10px; letter-spacing: -0.02em }
.landing__lede { font-size: 14.5px; line-height: 1.62; color: var(--ink-2); margin: 0 0 22px }
.landing__grid { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) }
.landing__grid li { border: 1px solid var(--line); border-radius: 10px; padding: 12px 13px; background: var(--panel) }
.landing__grid h3 { margin: 0 0 6px; font-size: 13px }
.landing__grid p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--ink-2) }
.landing__cta { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 18px }
.landing__foot { font-size: 11.5px; line-height: 1.6; color: var(--ink-3); border-top: 1px solid var(--line); padding-top: 12px }
.btn--lg { padding: 8px 15px; font-size: 13px }
@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none }
  .ticker { overflow-x: auto; -webkit-overflow-scrolling: touch }
}
.shell { display: grid; grid-template-columns: 168px minmax(0, 1fr); min-height: calc(100vh - 120px) }
.sidenav { border-right: 1px solid var(--line); padding: 10px 8px; display: flex; flex-direction: column; gap: 2px;
  background: var(--bg-2); position: sticky; top: 45px; align-self: start; max-height: calc(100vh - 45px); overflow: auto }
.sidenav a { display: block; padding: 5px 8px; border-radius: 7px; color: var(--ink-2); font-size: 12.5px }
.sidenav a:hover { background: var(--panel); color: var(--ink); text-decoration: none }
.sidenav a.active { background: var(--panel); color: var(--ink); box-shadow: inset 2px 0 0 var(--acc) }
.sidenav__foot { margin-top: auto; padding: 8px; font-size: 10.5px; color: var(--ink-3); font-family: var(--mono) }
.main { padding: 14px; min-width: 0 }
.foot { display: flex; justify-content: space-between; gap: 16px; padding: 12px 16px; border-top: 1px solid var(--line);
  color: var(--ink-3); font-size: 11.5px; background: var(--bg-2) }
.foot__links { display: flex; gap: 12px; flex-wrap: wrap }

/* ---------- primitives ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden }
.panel__hd { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line) }
.panel__hd h2, .panel__hd h3 { margin: 0 }
.panel__bd { padding: 12px }
.panel__tools { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap }
.grid { display: grid; gap: var(--gap) }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)) }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)) }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)) }
.grid--sidebar { grid-template-columns: minmax(0, 1fr) 340px }
.grid--terminal { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(240px, auto) }
@media (max-width: 1180px) { .grid--4 { grid-template-columns: repeat(2, minmax(0,1fr)) } .grid--sidebar { grid-template-columns: 1fr } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr } .sidenav { position: static; max-height: none; flex-direction: row; overflow-x: auto }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr } .grid--terminal { grid-template-columns: 1fr }
  .topbar { flex-wrap: wrap } .topbar__search { order: 3; max-width: none; flex-basis: 100% }
}
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); font-size: 12.5px }
.btn:hover { border-color: var(--acc) }
.btn--primary { background: var(--acc); border-color: var(--acc); color: #05202e; font-weight: 600 }
.btn--danger { border-color: var(--danger); color: var(--danger) }
.btn--ghost { background: transparent }
.btn[disabled] { opacity: .45; cursor: not-allowed }
.btn--sm { padding: 2px 7px; font-size: 11.5px }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden }
.seg button { border: 0; background: transparent; color: var(--ink-2); padding: 4px 9px; cursor: pointer; font-size: 12px }
.seg button[aria-pressed="true"] { background: var(--acc); color: #05202e }
.chip { display: inline-flex; gap: 5px; align-items: center; padding: 1px 7px; border-radius: 999px; font-size: 11px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-2) }
.chip--up { color: var(--up); border-color: #22c55e55 } .chip--down { color: var(--down); border-color: #ef444455 }
.chip--warn { color: var(--warn); border-color: #f59e0b55 } .chip--acc { color: var(--acc); border-color: #38bdf855 }
.alert { padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); margin-bottom: 10px }
.alert--warn { border-color: #f59e0b66; background: #f59e0b12 }
.alert--err { border-color: #f43f5e66; background: #f43f5e12 }
.alert--ok { border-color: #22c55e66; background: #22c55e12 }
label { display: block; font-size: 11.5px; color: var(--ink-2); margin-bottom: 3px }
input[type=text], input[type=search], input[type=number], input[type=password], input[type=email], input[type=date],
select, textarea { width: 100%; padding: 6px 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2);
  color: var(--ink); font: inherit }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--acc); outline-offset: -1px }
.field { margin-bottom: 9px }
.field-row { display: flex; gap: 9px; flex-wrap: wrap }
.field-row > * { flex: 1 1 160px }
.check { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2) }
.check input { width: auto }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; max-height: 72vh }
table { width: 100%; border-collapse: collapse; font-size: 12.5px }
thead th { position: sticky; top: 0; background: var(--bg-2); color: var(--ink-2); font-weight: 600; text-align: left;
  padding: 6px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 2 }
thead th a { color: inherit; display: inline-flex; gap: 4px; align-items: center }
tbody td { padding: 5px 9px; border-bottom: 1px solid var(--line); vertical-align: middle }
tbody tr:hover { background: var(--panel-2) }
tbody tr[hidden] { display: none }
table.num td:not(:first-child) { text-align: right; font-family: var(--mono); font-size: 12px }
.score-cell { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end }
.scorebar { width: 46px; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden }
.scorebar i { display: block; height: 100%; background: var(--acc) }
.badge { font-size: 10.5px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); color: var(--ink-2) }
.badge--strong_buy, .badge--high_conviction_long { color: var(--up); border-color: #22c55e66; background: #22c55e14 }
.badge--buy, .badge--accumulate, .badge--constructive { color: #4ade80; border-color: #4ade8055 }
.badge--neutral { color: var(--ink-2) }
.badge--deteriorating, .badge--avoid, .badge--sell { color: var(--warn); border-color: #f59e0b55 }
.badge--short_candidate, .badge--strong_sell { color: var(--danger); border-color: #f43f5e55; background: #f43f5e12 }
.badge--low { color: var(--up) } .badge--medium { color: var(--warn) }
.badge--high, .badge--very_high { color: var(--danger) }
.unavail { color: var(--ink-3); font-style: italic }
.spark { display: block; width: 90px; height: 24px }
.pager { display: flex; gap: 7px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 12px }
.pager .grow { flex: 1 }

/* ---------- metric tiles ---------- */
.metric { padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius) }
.metric__label { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em }
.metric__value { font-size: 21px; font-weight: 650; font-family: var(--mono) }
.metric__sub { font-size: 11.5px; color: var(--ink-2) }
.bars { display: grid; gap: 5px }
.bars__row { display: grid; grid-template-columns: 108px 1fr 52px; gap: 8px; align-items: center; font-size: 12px }
.bars__track { height: 7px; border-radius: 4px; background: var(--line); overflow: hidden }
.bars__track i { display: block; height: 100%; background: var(--acc) }

/* ---------- heatmap ---------- */
.heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 4px }
.heat__cell { border-radius: 6px; padding: 7px 6px; text-align: center; color: #04121a; font-family: var(--mono);
  border: 1px solid #0004; cursor: pointer; transition: transform .08s }
.heat__cell:hover { transform: scale(1.06); z-index: 3 }
.heat__cell b { display: block; font-size: 11.5px } .heat__cell span { font-size: 11px; opacity: .85 }
.heat__group { margin-bottom: 12px }
.heat__legend { display: flex; gap: 5px; align-items: center; font-size: 11px; color: var(--ink-2) }
.heat__legend i { width: 20px; height: 10px; border-radius: 3px; display: block }

/* ---------- charts ---------- */
.chart { position: relative; width: 100% }
.chart canvas { display: block; width: 100%; touch-action: none; cursor: crosshair }
.chart__hud { position: absolute; top: 6px; left: 8px; font-family: var(--mono); font-size: 11px; color: var(--ink-2);
  background: #0b122099; padding: 3px 7px; border-radius: 6px; pointer-events: none }
[data-theme="light"] .chart__hud { background: #ffffffcc }
.chart__tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 7px 10px; border-bottom: 1px solid var(--line) }
.legend { display: flex; gap: 10px; font-size: 11px; color: var(--ink-2); flex-wrap: wrap }
.legend i { width: 9px; height: 3px; display: inline-block; margin-right: 4px; vertical-align: middle }

/* ---------- score / AI ---------- */
.gauge { display: flex; align-items: center; gap: 12px }
.gauge__num { font-size: 34px; font-weight: 700; font-family: var(--mono); line-height: 1 }
.gauge__ring { --p: 0; width: 62px; height: 62px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--acc) calc(var(--p) * 1%), var(--line) 0) }
.gauge__ring::after { content: ""; display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--panel);
  margin: 8px; width: 46px; height: 46px }
.comp { display: grid; gap: 7px }
.comp__row { display: grid; grid-template-columns: 118px 1fr 46px 1fr; gap: 9px; align-items: center; font-size: 12px;
  padding: 5px 0; border-bottom: 1px dashed var(--line) }
.comp__name { color: var(--ink-2) }
.comp__wt { color: var(--ink-3); font-size: 11px; text-align: right }
.factors { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 12px }
.factors li { margin-bottom: 2px }
.disc { font-size: 11.5px; color: var(--ink-3); border-left: 2px solid var(--warn); padding-left: 9px; margin-top: 10px }
.fan { display: grid; gap: 6px }
.fan__row { display: grid; grid-template-columns: 46px 1fr; gap: 9px; align-items: center }
.fan__bar { position: relative; height: 22px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px }
.fan__bear, .fan__bull { position: absolute; top: 0; bottom: 0; border-radius: 5px }
.fan__bear { background: #ef444433; right: 50% } .fan__bull { background: #22c55e33; left: 50% }
.fan__base { position: absolute; top: 3px; bottom: 3px; background: var(--acc); opacity: .55; border-radius: 4px }
.fan__ref { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--ink) }
.scenarios { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap) }
@media (max-width: 860px) { .scenarios { grid-template-columns: 1fr } }
.scenario { padding: 10px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel) }
.scenario--bull { border-color: #22c55e55 } .scenario--bear { border-color: #ef444455 } .scenario--base { border-color: #38bdf855 }
.scenario h4 { margin-bottom: 4px }

/* ---------- misc ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; overflow-x: auto }
.tabs a, .tabs button { padding: 6px 11px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer;
  border-bottom: 2px solid transparent; font-size: 12.5px; white-space: nowrap }
.tabs [aria-current="true"], .tabs .is-active { color: var(--ink); border-bottom-color: var(--acc) }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 12.5px }
.kv dt { color: var(--ink-3) } .kv dd { margin: 0; font-family: var(--mono) }
.stack { display: grid; gap: var(--gap) }
.flex { display: flex; gap: 9px; align-items: center; flex-wrap: wrap }
.scroll-y { max-height: 60vh; overflow: auto }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--flat) }
.dot--up { background: var(--up) } .dot--down { background: var(--down) } .dot--warn { background: var(--warn) }
.dot--bad { background: var(--danger) }
.toast-stack { position: fixed; right: 14px; bottom: 14px; display: grid; gap: 8px; z-index: 90 }
.toast { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--acc); border-radius: 8px;
  padding: 9px 12px; box-shadow: var(--shadow); font-size: 12.5px; max-width: 340px }
.toast--err { border-left-color: var(--danger) } .toast--ok { border-left-color: var(--up) }
/* The layer is inert until the attribute says otherwise: a fixed full-viewport box that declares its own display
   would beat `hidden` — same specificity, and an author rule outranks the UA sheet — which is how an empty modal
   backdrop once covered every page. The grid is therefore part of the not([hidden]) state, not of the class. */
.modal-root { position: fixed; inset: 0; background: #040a12cc; z-index: 80; padding: 16px }
.modal-root:not([hidden]) { display: grid; place-items: center }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; width: min(760px, 100%);
  max-height: 88vh; overflow: auto; box-shadow: var(--shadow) }
.modal__hd { display: flex; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line) }
.modal__bd { padding: 14px }
.cmdk { width: min(560px, 100%); align-self: start; margin-top: 8vh }
.cmdk input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 12px }
.cmdk__list { max-height: 50vh; overflow: auto }
.cmdk__list button { display: flex; justify-content: space-between; width: 100%; text-align: left; padding: 8px 12px;
  background: transparent; border: 0; color: var(--ink); cursor: pointer; font-size: 12.5px }
.cmdk__list button:hover, .cmdk__list button[aria-selected=true] { background: var(--panel-2) }
.progress { height: 5px; background: var(--line); border-radius: 3px; overflow: hidden }
.progress i { display: block; height: 100%; background: var(--acc); width: 0; transition: width .3s }
.term-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: var(--gap) }
.term-grid .panel { display: flex; flex-direction: column; min-height: 260px }
.term-grid .panel__bd { flex: 1; overflow: auto }
.feed { display: grid; gap: 9px }
.feed__item { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding-bottom: 9px; border-bottom: 1px solid var(--line) }
.feed__title { font-weight: 600; color: var(--ink) }
.feed__meta { font-size: 11px; color: var(--ink-3) }
.emoji { font-size: 15px }
table.calendar td { vertical-align: top }
.impact { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px }
.impact--high { background: var(--danger) } .impact--medium { background: var(--warn) } .impact--low { background: var(--ink-3) }
.chain { font-family: var(--mono); font-size: 11.5px }
.chain td, .chain th { padding: 3px 6px }
.chain .calls { background: #22c55e0a } .chain .puts { background: #ef44440a }
.chain .itm { font-weight: 650 } .chain tr.atm td { border-top: 1px solid var(--acc); border-bottom: 1px solid var(--acc) }
.strike { text-align: center !important; background: var(--panel-2); font-weight: 600 }
.pos-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden }
.pos-bar i { display: block; height: 100% }
.skeleton { background: linear-gradient(90deg, var(--panel-2) 25%, var(--line) 37%, var(--panel-2) 63%);
  background-size: 400% 100%; animation: sk 1.4s infinite; border-radius: 6px; height: 14px }
@keyframes sk { 0% { background-position: 100% 50% } 100% { background-position: 0 50% } }
@media print { .topbar, .sidenav, .ticker, .foot, .notice { display: none !important } .shell { display: block }
  body { background: #fff; color: #000 } .panel { border-color: #ccc } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .001s !important; transition-duration: .001s !important } }

/* ------------------------------------------------------------------ view kit
   Shared atoms used by app/Views/partials and pages/*: metric grids, score
   readouts, factor bars, tag lists, generic data tables and panel footers.
   Everything is presentational: no rule here encodes a market value. */
.row { display: flex; align-items: center }
.row.gap { gap: 8px; flex-wrap: wrap }
.inline { display: inline-flex; align-items: center; gap: 6px }
.wrap { flex-wrap: wrap }
.gap { gap: 8px }
.sub { color: var(--muted); font-size: 12px; margin-top: 2px }
.tiny { font-size: 11.5px }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, monospace }
.right { text-align: right }
.panel__ft { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; border-top: 1px solid var(--line); background: var(--panel-2); flex-wrap: wrap }
table.data { width: 100%; border-collapse: collapse; font-size: 13px }
table.data th, table.data td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle }
table.data thead th { position: sticky; top: 0; background: var(--panel-2); z-index: 1; font-weight: 600; white-space: nowrap }
table.data thead th a { color: var(--muted); text-decoration: none }
table.data thead th a:hover { color: var(--txt) }
table.data tbody tr:hover { background: #ffffff08 }
table.data td.right, table.data th.right { text-align: right }
.cols-2, .cols-3 { display: grid; gap: 12px }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) }
/* scorecard: total, component bars, evidence */
.scorecard { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel) }
.scorecard__top { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap }
.scorecard__num { font-size: 34px; font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums }
.scorecard__bars { display: grid; gap: 7px }
.scorecard__tags { display: flex; gap: 6px; flex-wrap: wrap }
.scorecard__why { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); font-size: 12.5px }
.scorecard__why ul { margin: 4px 0 0; padding-left: 18px }
.bar-row { display: grid; grid-template-columns: 132px 1fr 52px; align-items: center; gap: 8px; font-size: 12.5px }
.bar-row__lb { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.bar-row__track { height: 8px; border-radius: 4px; background: var(--panel-2); overflow: hidden; border: 1px solid var(--line) }
.bar-row__fill { display: block; height: 100% }
.bar-row__v { text-align: right; font-variant-numeric: tabular-nums }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel-2); font-size: 11.5px; color: var(--muted) }
.tag--high, .tag--very_high { color: var(--danger); border-color: #ef444455 }
.tag--medium, .tag--normal { color: var(--warn); border-color: #f59e0b55 }
.tag--low { color: var(--up); border-color: #22c55e55 }
.badge { display: inline-block; padding: 2px 7px; border-radius: 6px; font-size: 11.5px; background: var(--panel-2);
  border: 1px solid var(--line); color: var(--muted); text-transform: capitalize; white-space: nowrap }
.badge--bull, .badge--accumulate, .badge--constructive, .badge--long, .badge--buy, .badge--armed,
.badge--filled, .badge--active, .badge--published, .badge--done, .badge--ok { color: var(--up); border-color: #22c55e55 }
.badge--bear, .badge--deteriorating, .badge--short_candidate, .badge--sell, .badge--disabled,
.badge--rejected, .badge--failed, .badge--error, .badge--expired { color: var(--danger); border-color: #ef444455 }
.badge--paused, .badge--pending, .badge--draft, .badge--partial, .badge--shadow, .badge--working, .badge--skipped { color: var(--warn); border-color: #f59e0b55 }
.badge--proposed { color: var(--acc); border-color: #60a5fa55 }
.is-hi { color: var(--up) } .is-lo { color: var(--danger) } .is-mid { color: var(--warn) } .is-na { color: var(--muted) }
.chg { font-variant-numeric: tabular-nums; font-style: normal }
.bandfig { overflow-x: auto }
.bandsvg { width: 100%; min-width: 620px; height: auto; background: var(--panel-2); border-radius: var(--r); border: 1px solid var(--line) }
.band-ref { stroke: var(--muted); stroke-dasharray: 3 3 }
.band-r { opacity: .55 } .band-r--bull { fill: var(--up) } .band-r--base { fill: var(--acc) } .band-r--bear { fill: var(--danger) }
.band-whisk { stroke: var(--muted) } .band-tick { stroke: var(--txt) } .band-med { stroke: var(--acc); stroke-width: 3 }
.band-iqr { fill: #60a5fa22 } .band-lb, .band-tag { fill: var(--muted); font-size: 11px } .band-tag { fill: var(--txt) }
.predict .tabs button[aria-selected="true"] { background: var(--acc); color: #04110a; border-color: transparent }
.prob { font-variant-numeric: tabular-nums }
.ticks { display: flex; gap: 4px }
.case { font-size: 12.5px; color: var(--muted); border-left: 2px solid var(--line); padding-left: 8px }
.case--bull { border-color: var(--up) } .case--base { border-color: var(--acc) } .case--bear { border-color: var(--danger) }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px }
.kv dt { color: var(--muted) } .kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums }
.empty { padding: 18px; color: var(--muted); font-size: 13px; border: 1px dashed var(--line); border-radius: var(--r); background: var(--panel-2) }
.empty b { color: var(--txt) }
.page-head { display: grid; gap: 10px; margin: 0 0 16px }
.page-head h1 { font-size: 22px; margin: 0; letter-spacing: -.3px }
.crumbs { display: flex; gap: 7px; align-items: center; font-size: 12px; color: var(--muted) }
.crumbs a { color: var(--muted); text-decoration: none } .crumbs a:hover { color: var(--txt) }
.crumbs b { color: var(--txt); font-weight: 600 }
.prov { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: 0 0 14px }
.seg { display: inline-flex; gap: 4px; flex-wrap: wrap; align-items: center }
.tabs a[aria-current="page"], .tabs a.active { color: var(--txt); border-color: var(--acc) }
.chart__host { padding: 4px }
.panel__tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 8px 12px; border-bottom: 1px solid var(--line) }
.feed__item a { color: var(--txt) }
.authwrap { display: grid; place-items: start center; padding: 10px 0 40px }
.authcard { width: min(560px, 100%) }
.authcard .panel__bd { padding: 16px }

/* vertical stack of panels inside a grid column */
.stack { display: grid; gap: 14px; align-content: start }
.field-row.is-active > div > a { color: var(--acc) }
.feed__item.is-new { border-left: 2px solid var(--acc); padding-left: 8px }

/* trend scale on the regime page: −100 … 0 … +100 with a marker for the stored score */
.bandfig__track { position: relative; display: block; height: 8px; border-radius: 6px;
  background: linear-gradient(90deg, rgba(244,63,94,.4), rgba(148,163,184,.22) 50%, rgba(34,197,94,.4)) }
.bandfig__track .bandfig__mid { position: absolute; left: 50%; top: -3px; width: 1px; height: 14px; background: rgba(148,163,184,.55) }
.bandfig__track i { position: absolute; top: -4px; width: 3px; height: 16px; border-radius: 2px; background: var(--acc); transform: translateX(-1.5px) }


/* ── reference bubbles, the go-live wizard, the assistant and the patch apply row ──
   The bubble is anchored to the viewport by app.js, because a tile inside a scrolling .table-wrap would clip an
   absolutely-positioned child. It carries no arrow on purpose: the note is about the number above it, and the
   ring on the host is what ties the two together. */
[data-help] { cursor: help }
[data-help]:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px }
.metric[data-help] .metric__label::after, th[data-help] a::after {
  content: '?'; display: inline-block; margin-left: 5px; font-size: 9px; line-height: 13px; width: 13px; height: 13px;
  text-align: center; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: var(--bg-2)
}
.metric.is-helped, th.is-helped { box-shadow: 0 0 0 2px var(--acc); border-radius: 8px }
.bub { position: absolute; z-index: 60; background: var(--bg-2); color: var(--txt); border: 1px solid var(--acc);
  border-radius: 10px; padding: 10px 12px; font-size: 12.5px; line-height: 1.55; box-shadow: 0 12px 34px rgba(3,7,18,.55) }
.bub b { display: block; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--acc); margin-bottom: 5px }
.bub p { margin: 0 }
.bub--still { animation: none }
@media (prefers-reduced-motion: no-preference) {
  .bub { animation: qm-bub-in .13s ease-out }
  @keyframes qm-bub-in { from { opacity: 0; transform: translateY(-3px) } to { opacity: 1; transform: none } }
}
.bub--above { border-color: var(--line) }

/* one button, one table of consequences */
.btn--danger { background: var(--down); border-color: var(--down); color: #fff }
.btn--danger:hover { filter: brightness(1.08) }
.modal--wide { width: min(860px, 96vw) }
.wiz table.data { margin: 10px 0 0; font-size: 12px }
.wiz__counts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px }
.ready__row { display: grid; gap: 14px }
.ready__card--wide { grid-column: 1 / -1 }
.gate__fix { color: var(--muted); font-size: 11.5px }
.chip--go { border-color: var(--acc); color: var(--acc) }

/* the assistant: a question, an answer with its sources, and the panel that edits what it can say */
.ask__box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg-2); margin-top: 10px }
.ask__box.is-open { border-color: var(--acc) }
.ask__box p:first-child { margin-top: 0 }
.ask__try { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px }
.ask__try button { font: inherit; font-size: 12px; color: var(--txt); background: transparent; border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 10px; cursor: pointer }
.ask__try button:hover { border-color: var(--acc); color: var(--acc) }
.ref__list { display: grid; gap: 6px; margin-top: 8px }
.ref__row { display: grid; grid-template-columns: minmax(120px, .8fr) minmax(0, 2fr) auto; gap: 10px; align-items: center;
  border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; background: var(--bg-2) }
.ref__row b { font-size: 12.5px }
.ref__row .tiny { color: var(--muted) }
.penny__tier { display: grid; gap: 10px; margin-bottom: 14px }
.penny__tier .metric__sub em { font-style: normal; color: var(--acc) }
/* Go live is neither a primary action nor a danger: it is the amber of "this changes what this install is". */
.btn--warn { background: var(--demo); border-color: var(--demo); color: #1a1300; font-weight: 600 }
.btn--warn:hover { filter: brightness(1.07) }
.notice--info { border-left: 3px solid var(--acc); background: color-mix(in srgb, var(--acc) 8%, transparent) }
.wiz__detail table.data { margin-top: 8px }
.wiz__detail .chip { margin-right: 4px }
@media (max-width: 720px) { .ref__row { grid-template-columns: 1fr; gap: 4px } }

/* The Deploy menu in the topbar: a details element, so it opens without JavaScript and closes on Escape by itself.
   The panel is positioned against the header rather than the page, because the topbar is sticky. */
.topmenu { position: relative; }
.topmenu > summary { list-style: none; cursor: pointer; }
.topmenu > summary::-webkit-details-marker { display: none; }
.topmenu > summary::after { content: " \25BE"; opacity: .6; }
.topmenu__in { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 19rem;
  display: grid; gap: 2px; padding: 6px; border: 1px solid var(--line, #2a2f39); border-radius: 10px;
  background: var(--panel, #14181f); box-shadow: 0 14px 34px rgba(0, 0, 0, .34); }
.topmenu__in a { display: grid; gap: 1px; padding: 7px 9px; border-radius: 7px; text-decoration: none; }
.topmenu__in a:hover, .topmenu__in a:focus-visible { background: var(--hover, rgba(255, 255, 255, .06)); }
.topmenu__in b { font-size: .88rem; color: var(--text, #e8ecf3); }
.topmenu__in span { font-size: .76rem; color: var(--muted, #9aa6b8); }
