/* EPOCH elevation pass ("Bitcoin Bloomberg meets 2027"), after the GPT-6 Astra review + CEO rulings (notes/UI-REVIEW.md).
   Loaded last: re-tokens the palette, adds the Inter + JetBrains Mono type system, neutral panel chrome, the DESK grid,
   tablet + phone layouts. Fonts: Inter (c) 2016 The Inter Project Authors; JetBrains Mono (c) 2020 The JetBrains Mono
   Project Authors; both under the SIL Open Font License 1.1 (full text in HELP > Licences). */
@font-face { font-family: 'Inter'; src: url('../fonts/Inter-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/Inter-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --bg: #000;
  --panel: #080A0C;
  --raised: #11151A;
  --hover: #19212A;
  --rule: #252B33;
  --rule-2: #171D24;
  --text: #E8EDF2;
  --dim: #A4ADB8;
  --faint: #7E8996;
  --orange: #F7931A;
  --amber: #FFC857;
  --warn: #FFC857;
  --up: #2EE6A6;
  --down: #FF646D;
  --focus: #75CFFF;
  --cyan: #75CFFF;
  --violet: #B8A0FF;
  --orange-bg: rgba(247, 147, 26, .10);
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --top-h: 40px; --tape-h: 40px; --title-h: 28px; --foot-h: 24px;
  --gutter: 8px; --pad: 12px;
}

/* ---------- type system: sans for language, mono for numbers / ids / dates / keys ---------- */
body { font: 400 13px/18px var(--sans); font-variant-numeric: tabular-nums; color: var(--text); background: var(--bg); }
.num, td.r, .kv-v, .ldr-px, .ldr-dist, .ldr-id, .tp-v, .stat-v, .hero-v, .hero-of, #utc, kbd, code, .asof-d, .news-age,
.eco-d, .eco-t, .lg-v, .chip, .layer-v, .pk-asof, #foot-asof, .cmd-kind, .rm-k, .tb-ic, .hcp-asof, .spark-l {
  font-family: var(--mono); font-variant-numeric: tabular-nums slashed-zero;
}
.label, .stat-k, .tp-k, th { font: 600 11px/16px var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
.note, .na, .empty-s, .ser-src, .news-t, .help-r p, .cnd-lbl, .ldr-lbl { font-family: var(--sans); }
.note { font-size: 12px; line-height: 17px; color: var(--dim); }
.dim { color: var(--dim); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
a, button, .seg-b, .btn, .rm-i, .tb, .fk { transition: color .1s ease-out, background-color .1s ease-out, border-color .1s ease-out; }

/* ---------- shell ---------- */
body { grid-template-rows: var(--top-h) var(--tape-h) auto 1fr var(--foot-h); }
#top { height: var(--top-h); background: var(--bg); border-bottom: 1px solid var(--rule); }
#brand { border-right: 1px solid var(--rule); padding: 0 16px; }
#brand-name { font: 600 15px/var(--top-h) var(--sans); letter-spacing: .14em; color: var(--orange); }
#brand-tag { font: 400 12px/var(--top-h) var(--sans); letter-spacing: 0; text-transform: none; color: var(--faint); }
.fk { font: 600 12px/16px var(--sans); letter-spacing: .02em; color: var(--dim); border-right: 0; padding: 0 10px; position: relative; background: none; }
.fk .fk-k { display: none; }
.fk:hover { color: var(--text); background: none; }
.fk[aria-current="page"] { background: none; color: var(--orange); }
.fk[aria-current="page"]::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; background: var(--orange); }
#cmd-input { height: 28px; background: var(--panel); border: 1px solid var(--rule); border-radius: 2px; font: 400 13px var(--sans); color: var(--text); }
#cmd-input:focus { border-color: var(--focus); }
#cmd-results { background: var(--raised); border: 1px solid var(--rule); border-radius: 2px; box-shadow: 0 16px 48px #00000099; font-family: var(--sans); }
li.cmd-o { grid-template-columns: 72px 1fr auto; padding: 6px 10px; font-size: 13px; }
li.cmd-o.is-active, li.cmd-o:hover { background: var(--hover); color: var(--text); }
li.cmd-o.is-active .dim, li.cmd-o:hover .dim { color: var(--dim); opacity: 1; }
.cmd-kind { font-size: 10px; color: var(--faint); }
.cmd-k { background: var(--hover); color: var(--dim); }

/* scoped feed status (only the BTC quote is ever "live") */
.feed { display: inline-flex; align-items: center; gap: 6px; margin: 0 12px; font: 600 12px/16px var(--sans); white-space: nowrap; color: var(--dim); }
.feed::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.feed-live { color: var(--text); }
.feed-live::before { background: var(--up); box-shadow: 0 0 0 3px rgba(46, 230, 166, .18); }
.feed-conn::before { background: var(--amber); }
.feed-down { color: var(--down); }
.feed-down::before { background: var(--down); }
#health-btn { font: 600 12px/16px var(--sans); letter-spacing: 0; border-left: 1px solid var(--rule); color: var(--dim); }
#health-btn .dot { border-radius: 50%; }
#health-btn.h-part .dot, #health-btn.h-stale .dot { background: var(--amber); }
#health-btn.h-ok .dot { background: var(--up); }
#health-btn.h-off .dot { background: var(--down); }
#utc { font-size: 12px; color: var(--dim); border-left: 1px solid var(--rule); }

/* route menu button: replaces the ten labels at 1200px and below */
#route-btn { display: none; align-items: center; gap: 6px; height: 28px; margin: 0 8px; padding: 0 10px; background: var(--panel);
  border: 1px solid var(--rule); border-radius: 2px; color: var(--orange); font: 600 12px var(--sans); cursor: pointer; }
#route-menu { position: fixed; top: calc(var(--top-h) + 4px); left: 8px; z-index: 80; min-width: 240px; padding: 4px; background: var(--raised);
  border: 1px solid var(--rule); border-radius: 2px; box-shadow: 0 16px 48px #00000099; display: flex; flex-direction: column;
  animation: rise .18s cubic-bezier(.2, .8, .2, 1); }
#route-menu[hidden] { display: none; }
.rm-i { display: grid; grid-template-columns: 28px 1fr; align-items: center; min-height: 36px; padding: 0 10px; background: none; border: 0;
  color: var(--text); font: 400 13px var(--sans); text-align: left; cursor: pointer; border-radius: 2px; }
.rm-i:hover, .rm-i:focus-visible { background: var(--hover); }
.rm-i[aria-current="page"] { color: var(--orange); }
.rm-k { color: var(--faint); font-size: 12px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* tape: market now + compact cycle context */
#tape { height: var(--tape-h); border-bottom: 1px solid var(--rule); background: var(--bg); }
.tp { align-items: center; padding: 0 16px; gap: 8px; border-right: 1px solid var(--rule-2); }
.tp-k { font-size: 11px; }
.tp-v { font-size: 15px; font-weight: 500; color: var(--text); }
.tp:first-child .tp-v { font-size: 22px; line-height: 28px; color: var(--text); }
.tp-m, .tp-m .dim { font: 400 11px var(--mono); color: var(--faint); }

footer#foot { font: 400 11px/16px var(--sans); color: var(--faint); border-top: 1px solid var(--rule); }
footer#foot .disclaimer { color: var(--dim); }
#home-link, .tv-attr-foot { color: var(--dim); }
#home-link:hover { color: var(--orange); }

/* ---------- panels: flat surfaces, neutral headers, 8px gutters ---------- */
#page.grid { gap: var(--gutter); padding: var(--pad); background: var(--bg); }
#page.grid > .pnl { box-shadow: none; border: 1px solid var(--rule-2); border-radius: 2px; background: var(--panel); }
.pnl-h { height: var(--title-h); background: transparent; color: var(--text); border-bottom: 1px solid var(--rule-2); padding: 0 12px; position: relative; }
.pnl-t { font: 600 12px/var(--title-h) var(--sans); letter-spacing: 0; text-transform: none; color: var(--text); }
.pnl:focus-within > .pnl-h::before { content: ''; position: absolute; left: -1px; top: 6px; bottom: 6px; width: 2px; background: var(--orange); }
.pnl-meta { font: 400 11px var(--mono); color: var(--faint); opacity: 1; }
.pnl-h .bdg { background: transparent; }
.pnl-b { padding: 10px 12px; }
.pnl.is-stale .pnl-h { background: transparent; color: var(--text); }
.pnl.is-stale { border-color: rgba(255, 200, 87, .55); }
.pnl.is-stale .pnl-b > * { opacity: 1; } /* never dim essential text */

/* badges: tier (provenance) vs freshness vs delivery get different shapes */
.bdg { height: 18px; padding: 0 6px; border-radius: 2px; font: 600 10.5px/16px var(--sans); letter-spacing: .04em; }
.bdg-exact { color: var(--text); border-color: var(--rule); }
.bdg-approx { color: var(--dim); border-color: var(--rule); border-style: dashed; }
.bdg-external { color: var(--focus); border-color: rgba(117, 207, 255, .45); }
.bdg-stale { color: var(--amber); background: rgba(255, 200, 87, .10); border-color: rgba(255, 200, 87, .6); }
.bdg-provisional { color: var(--amber); border-color: rgba(255, 200, 87, .45); border-style: dashed; }
.bdg-sealed { color: var(--violet); border-color: rgba(184, 160, 255, .45); }
.bdg-live { color: var(--up); border-color: rgba(46, 230, 166, .45); }
.bdg-live::before { animation: none; border-radius: 50%; }
.bdg-offline { color: #000; background: var(--down); border-color: var(--down); }
.bdg-na, .bdg-off { color: var(--faint); border-color: var(--rule); }
.warn { color: var(--amber); border-left: 2px solid var(--amber); background: rgba(255, 200, 87, .07); font: 600 12px/17px var(--sans); }
.btn { height: 28px; border-radius: 2px; border-color: var(--rule); color: var(--dim); background: transparent; font: 600 12px var(--sans); letter-spacing: 0; }
.btn:hover { color: var(--text); border-color: var(--faint); }
.btn:active { background: var(--hover); color: var(--text); }
.seg { border-color: var(--rule); border-radius: 2px; }
.seg-b { height: 28px; padding: 0 10px; font: 600 12px var(--mono); color: var(--dim); border-right-color: var(--rule); }
.seg-b[aria-pressed="true"] { background: var(--hover); color: var(--orange); box-shadow: inset 0 -2px 0 var(--orange); }
.btn-q { height: 22px; font-size: 11px; color: var(--dim); }
.tbl th { background: var(--panel); color: var(--faint); border-bottom-color: var(--rule); }
.tbl td { border-bottom-color: var(--rule-2); height: 28px; }
.tbl tbody tr:hover { background: var(--hover); }
.kv-k, .kv-v, .kv-m { border-bottom-color: var(--rule-2); }
.kv-k { color: var(--dim); font-family: var(--sans); }
.bar { background: var(--rule-2); height: 4px; border-radius: 1px; }
.bar-fill.bar-or { background: var(--dim); }
.chip { border-color: var(--rule); border-radius: 2px; color: var(--dim); height: 22px; font-size: 11px; }
.chip-note { color: var(--amber); }
.na { color: var(--dim); font-size: 12px; }
.na-dash { color: var(--faint); }

/* designed empty / loading */
.empty { display: flex; flex-direction: column; gap: 4px; padding: 16px 4px; border: 1px dashed var(--rule); border-radius: 2px; text-align: center; }
.empty-t { font: 600 13px var(--sans); color: var(--dim); }
.empty-s { font-size: 12px; line-height: 17px; color: var(--faint); max-width: 46ch; margin: 0 auto; }
.is-loading { color: var(--faint); }

/* ---------- HCP hero rail ---------- */
.hcp-asof { font-size: 12px; line-height: 16px; color: var(--dim); border-bottom: 0; padding: 0; margin-bottom: 6px; font-weight: 400; }
.hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; gap: 4px 16px; }
.hero-num { display: flex; align-items: baseline; gap: 4px; }
.hero-v { font-size: 56px; line-height: 56px; font-weight: 500; letter-spacing: -.02em; color: var(--text); }
.hero-of { font-size: 14px; color: var(--faint); }
.hero-meta { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 0; padding-bottom: 4px; }
.zone-chip { font: 600 13px/18px var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--text); border: 1px solid var(--rule); border-radius: 2px; padding: 1px 8px; }
.hero-meta .row { gap: 2px 10px; }
.zone-sub { font-size: 11px; color: var(--faint); }
.band-t { font: 400 12px var(--sans); color: var(--violet); }
.hero-spark { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; padding-bottom: 6px; }
.spark-l { font-size: 10px; color: var(--faint); }
.hero-strip { margin-top: 2px; }
.hero-strip canvas.strip { display: block; width: 100%; }
.strip-key { font-size: 11px; line-height: 15px; color: var(--faint); }
.layers-inline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 6px; }
.layer-c { display: grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: 3px; align-items: baseline; }
.layer-n { font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer-v { font-size: 13px; color: var(--text); }
.layer-c .bar { grid-column: 1 / -1; height: 3px; min-width: 0; }
.hcp-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--dim); }
.hcp-meta .num { font-size: 11px; }
.pg-desk .a-hcp .strip-key, .pg-desk .a-hcp .hero-spark { display: none; }
.pg-desk .a-hcp .hero-v { font-size: 48px; line-height: 48px; }
.pg-desk .a-hcp .hcp-asof { display: none; } /* date/readout shown in the meta line on the DESK */
#p-gauge .hcp-more, #p-gauge .hcp-def, #p-gauge .btn-q, #p-gauge .hcp-asof { display: none; }

/* ---------- trigger ladder: human label first, internal id as alias ---------- */
.ldr-r, .pg-desk .ldr-r, .pg-levels .ldr-r {
  grid-template-columns: minmax(0, 1fr) 84px 64px 44px; grid-template-areas: "lbl px dist st" "id px dist st";
  height: auto; min-height: 40px; padding: 4px 8px; row-gap: 0; font-size: 13px; border-bottom-color: var(--rule-2);
}
.ldr-r > .ldr-lbl, .pg-desk .ldr-r > .ldr-lbl, .pg-levels .ldr-r > .ldr-lbl { grid-area: lbl; white-space: normal; overflow: visible; color: var(--text); font-size: 13px; line-height: 17px; }
.ldr-r > .ldr-id, .pg-desk .ldr-r > .ldr-id, .pg-levels .ldr-r > .ldr-id { grid-area: id; font-size: 11px; color: var(--faint); font-weight: 400; }
.ldr-r > .ldr-px, .pg-desk .ldr-r > .ldr-px, .pg-levels .ldr-r > .ldr-px { grid-area: px; justify-self: end; align-self: center; }
.ldr-r > .ldr-dist, .pg-desk .ldr-r > .ldr-dist, .pg-levels .ldr-r > .ldr-dist { grid-area: dist; align-self: center; }
.ldr-r > .ldr-st, .pg-desk .ldr-r > .ldr-st, .pg-levels .ldr-r > .ldr-st { grid-area: st; align-self: center; }
.ldr-now, .pg-desk .ldr-now { background: var(--orange-bg); color: var(--text); font-weight: 600; box-shadow: inset 2px 0 0 var(--orange); }
.ldr-now .ldr-id, .ldr-now .ldr-dist, .ldr-now .ldr-px, .ldr-now > .ldr-lbl, .pg-desk .ldr-now > .ldr-lbl { color: var(--text); }
.ldr-now .ldr-id { color: var(--orange); }
.ldr-macro { border-left-color: var(--focus); }
.ldr-r.is-on, .cnd.is-on { background: rgba(255, 255, 255, .03); }
.lv-head { display: grid; grid-template-columns: minmax(0, 1fr) 84px 64px 44px; padding: 0 8px 4px; font: 600 11px var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
.lv-head span:nth-child(n+2) { text-align: right; }
.cnd { font-size: 13px; min-height: 30px; border-bottom-color: var(--rule-2); }
.cnd-lbl { white-space: normal; }

/* ---------- headlines: two lines, publication age ---------- */
a.news-i { grid-template-columns: 44px minmax(0, 1fr); grid-template-areas: "age src" "age t"; row-gap: 2px; padding: 6px 0; border-bottom-color: var(--rule-2); }
.news-age { grid-area: age; font-size: 12px; color: var(--faint); }
.news-src { grid-area: src; font: 600 11px var(--sans); letter-spacing: .04em; color: var(--dim); }
.news-t, .pg-desk .news-t { grid-area: t; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 13px; line-height: 18px; color: var(--text); }
.news-i:hover .news-t { color: var(--orange); }

/* ---------- TV: poster until click ---------- */
.tv-wrap { margin-top: 6px; }
.tv-frame, .pg-desk .a-tv .tv-frame { aspect-ratio: 16 / 9; flex: none; background: #050607; border: 1px solid var(--rule-2); border-radius: 2px; min-height: 0; }
.pg-desk .a-tv .tv-wrap { display: block; flex: none; }
.pg-desk .a-tv .pnl-b { display: block; }
.tv-play { color: var(--text); font: 600 13px var(--sans); }
.tv-play .tv-ic { color: var(--orange); font-size: 26px; }
.tv-play:hover { background: rgba(255, 255, 255, .03); }

/* main chart chrome */
.pnl-chart .toolbar { padding: 6px 10px; gap: 8px; border-bottom-color: var(--rule-2); }
.legend { background: rgba(8, 10, 12, .85); border-radius: 2px; font-size: 12px; }
.lg-t { color: var(--text); }
.chart-src { font-size: 11px; }
.tv-attr { color: var(--faint); font-family: var(--sans); }

/* ---------- DESK grid (Astra/CEO): chart + right rail (HCP, TV); triggers | changes | headlines ---------- */
@media (min-width: 1201px) {
  #page.pg-desk { display: grid; height: auto; min-height: 0; align-content: start;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) 424px; grid-template-rows: 232px auto 264px; }
  #page.pg-desk > .a-chart { grid-column: 1 / 3; grid-row: 1 / 3; min-height: 480px; }
  #page.pg-desk > .a-hcp { grid-column: 3; grid-row: 1; }
  #page.pg-desk > .a-tv { grid-column: 3; grid-row: 2; }
  #page.pg-desk > .a-lv { grid-column: 1; grid-row: 3; }
  #page.pg-desk > .a-chg { grid-column: 2; grid-row: 3; }
  #page.pg-desk > .a-news { grid-column: 3; grid-row: 3; }
}
@media (min-width: 1201px) and (max-width: 1365px) { #page.pg-desk { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) 360px; } }
@media (min-width: 1900px) { #page.pg-desk { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) 568px; grid-template-rows: 232px auto 348px; } }
@media (min-width: 3000px) { body { font-size: 14px; } }

/* tablet 761–1200: route menu replaces the labels; DESK = chart + 340px rail */
@media (max-width: 1200px) {
  #fkeys { display: none; }
  #route-btn { display: inline-flex; }
  #tabbar { display: none; }
  body { padding-bottom: 0; }
}
@media (min-width: 900px) and (max-width: 1200px) {
  #page.pg-desk { display: grid; height: auto; min-height: 0; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 340px; grid-template-rows: auto auto auto; }
  #page.pg-desk > .a-chart { grid-column: 1 / 3; grid-row: 1 / 3; min-height: 440px; }
  #page.pg-desk > .a-hcp { grid-column: 3; grid-row: 1; }
  #page.pg-desk > .a-tv { grid-column: 3; grid-row: 2; }
  #page.pg-desk > .a-lv { grid-column: 1; grid-row: 3; max-height: none; }
  #page.pg-desk > .a-chg { grid-column: 2; grid-row: 3; }
  #page.pg-desk > .a-news { grid-column: 3; grid-row: 3; max-height: 420px; }
}
@media (min-width: 761px) and (max-width: 899px) {
  #page.pg-desk { display: grid; height: auto; min-height: 0; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto; }
  #page.pg-desk > .a-hcp { grid-column: 1; grid-row: 1; }
  #page.pg-desk > .a-tv { grid-column: 2; grid-row: 1; }
  #page.pg-desk > .a-chart { grid-column: 1 / 3; grid-row: 2; min-height: 380px; }
  #page.pg-desk > .a-lv { grid-column: 1; grid-row: 3; }
  #page.pg-desk > .a-chg { grid-column: 2; grid-row: 3; }
  #page.pg-desk > .a-news { grid-column: 1 / 3; grid-row: 4; max-height: 420px; }
  #page.pg-desk .a-hcp .hero-v { font-size: 40px; line-height: 44px; }
  #page.grid > .a-ser { grid-column: span 6; }
}
/* other screens on tablet */
@media (min-width: 761px) and (max-width: 1200px) {
  #page.grid:not(.pg-desk) > .pnl:not(.a-ser) { grid-column: 1 / -1; grid-row: auto; }
}

/* ---------- phone: native-feeling single column, 5-item bottom nav ---------- */
@media (max-width: 760px) {
  body { grid-template-rows: auto auto auto 1fr auto; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); font-size: 14px; line-height: 20px; }
  #route-btn { display: none; }
  #top { min-height: 44px; }
  #brand-name { line-height: 44px; }
  .feed { margin: 0 8px; font-size: 11px; }
  #tape { height: 48px; }
  .tp:first-child .tp-v { font-size: 22px; }
  #page.grid { padding: 8px; gap: 8px; }
  #page.pg-desk > .a-hcp { order: 0; } #page.pg-desk > .a-chart { order: 1; } #page.pg-desk > .a-tv { order: 2; }
  #page.pg-desk > .a-lv { order: 3; } #page.pg-desk > .a-chg { order: 4; } #page.pg-desk > .a-news { order: 5; }
  #page.pg-desk > .a-chart .chart-box { height: 260px; min-height: 260px; }
  .hero-v, .pg-desk .a-hcp .hero-v { font-size: 40px; line-height: 44px; }
  .layers-inline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seg-b, .btn { min-height: 44px; }
  .tbl td { height: 40px; }
  #tabbar { display: flex; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); background: rgba(8, 10, 12, .96);
    border-top: 1px solid var(--rule); overflow: visible; scroll-snap-type: none; }
  .tb { flex: 1 1 20%; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    background: none; border: 0; color: var(--faint); font: 600 11px var(--sans); }
  .tb-ic { font-size: 14px; color: inherit; }
  .tb[aria-current="page"], .tb-more[aria-current] { color: var(--orange); }
  #route-menu { top: auto; left: 8px; right: 8px; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px); }
  .rm-i { min-height: 44px; }
}

/* ---------- motion: purposeful, removed under reduced motion ---------- */
#page > .pnl { animation: rise .18s cubic-bezier(.2, .8, .2, 1) both; }
.fl-up { animation: flUp .45s ease-out; }
.fl-dn { animation: flDn .45s ease-out; }
@keyframes flUp { from { background-color: rgba(46, 230, 166, .28); } to { background-color: transparent; } }
@keyframes flDn { from { background-color: rgba(255, 100, 109, .28); } to { background-color: transparent; } }
@media (prefers-reduced-motion: reduce) {
  #page > .pnl, #route-menu { animation: none; }
}
.legend { max-width: calc(100% - 96px); overflow: hidden; }
.lg-row { flex-wrap: wrap; row-gap: 0; }
@media (max-width: 760px) { .legend { max-width: calc(100% - 72px); font-size: 11px; } }
.news-f { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.news-f .seg-b { font-family: var(--sans); height: 24px; font-size: 11px; }
.news-n { font-size: 11px; }
.pg-desk .news-f .seg-b:nth-child(n+2) { display: none; } /* DESK cell: show the default scope only */
.ladder .ldr-r:not(.ldr-now) { cursor: pointer; }
.ladder .ldr-r:not(.ldr-now):hover { background: var(--hover); }
.pg-levels > .pnl, .pg-cycle > .a-pl, .pg-cycle > .a-gauge { align-self: start; }
@media (min-width: 1201px) {
  .pg-cycle > .a-hcp { grid-column: 1 / 5; grid-row: 1; }
  .pg-cycle > .a-gauge { grid-column: 1 / 5; grid-row: 2; }
  .pg-cycle > .a-clock { grid-column: 5 / 13; grid-row: 1; }
  .pg-cycle > .a-bottom { grid-column: 5 / 13; grid-row: 2; }
}
.eco-i { grid-template-columns: 76px 64px 40px minmax(0, 1fr); }
.eco-imp { letter-spacing: 0; }
.pnl-series .row { flex-wrap: wrap; min-width: 0; }
.pnl-h { overflow: hidden; min-width: 0; }
.pnl-t { min-width: 0; flex: 0 1 auto; }
.pnl-meta, .pnl-badges { flex: none; }
@media (max-width: 1200px) { #utc { display: none; } #cmd { min-width: 120px; } #brand-tag { display: none; } }
@media (max-width: 900px) { .feed { max-width: 30vw; overflow: hidden; text-overflow: ellipsis; } }
.mini { min-width: 0; overflow: hidden; }
@media (max-width: 760px) { #page.grid > .pnl { width: 100%; max-width: 100%; } .pnl-b { min-width: 0; } }
#cmd-input::placeholder { color: var(--dim); }
@media (max-width: 760px) {
  #health-btn { max-width: 38vw; overflow: hidden; white-space: nowrap; }
  #health-btn .health-txt { overflow: hidden; text-overflow: ellipsis; }
  .feed { max-width: 40vw; overflow: hidden; }
}

/* ---- CEO eyes-on 19:50: HCP fits its content; rail legible; layer cells are buttons; inspector sheet ---- */
@media (min-width: 1201px) {
  #page.pg-desk { grid-template-rows: auto auto 264px; }
}
@media (min-width: 1900px) { #page.pg-desk { grid-template-rows: auto auto 348px; } }
#page.pg-desk > .a-hcp .pnl-b { overflow: visible; }
.hero-strip canvas.strip { height: 74px; }
.layers-inline { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
button.layer-c { all: unset; box-sizing: border-box; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 6px; row-gap: 3px;
  align-items: baseline; padding: 4px 6px; border: 1px solid var(--rule-2); border-radius: 2px; cursor: pointer; min-width: 0; }
button.layer-c:hover { background: var(--hover); }
button.layer-c:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.layer-n { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; font-size: 12px; line-height: 15px; }
.hcp-meta { flex-wrap: wrap; row-gap: 4px; margin-top: 6px; }
.tv-live { font: 400 11px var(--sans); }
.cnd { cursor: pointer; }
.cnd:hover { background: var(--hover); }
.inspector { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); z-index: 90; background: var(--raised);
  border-left: 1px solid var(--rule); box-shadow: 0 16px 48px #00000099; display: flex; flex-direction: column;
  animation: insIn .18s cubic-bezier(.2, .8, .2, 1); }
@keyframes insIn { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }
.ins-h { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px 10px; border-bottom: 1px solid var(--rule); }
.ins-ht { flex: 1; min-width: 0; }
.ins-k { font: 400 11px var(--mono); color: var(--faint); }
.ins-t { margin: 2px 0 0; font: 600 15px/20px var(--sans); color: var(--text); }
.ins-x { flex: none; width: 32px; height: 32px; background: transparent; border: 1px solid var(--rule); border-radius: 2px; color: var(--dim); font: 400 18px var(--sans); cursor: pointer; }
.ins-x:hover { color: var(--text); }
.ins-b { flex: 1; overflow: auto; padding: 12px 16px 24px; display: flex; flex-direction: column; gap: 10px; }
.ins-tbl th { position: static; text-align: left; vertical-align: top; width: 40%; font: 400 12px var(--sans); text-transform: none; letter-spacing: 0; color: var(--dim); background: transparent; }
.ins-tbl td { white-space: normal; height: auto; padding: 5px 6px; }
.inspector .tbl td, .inspector .tbl th { white-space: normal; }
@media (max-width: 760px) { .inspector { width: 100vw; border-left: 0; } }
@media (prefers-reduced-motion: reduce) { .inspector { animation: none; } }

/* ---- SHIP GATE (Astra round 2 + CEO 20:10) ---- */
:root { --dim: #A6B0BC; --rule: #252C34; --panel: #0D1116; --cyan: #75CBEF; --violet: #B29AFF; }
#page.grid { background: #080A0C; }
.pnl-t { font-size: 13px; line-height: 18px; }
.pnl-meta { font-size: 12px; }
body { font-size: 13px; line-height: 19px; }
/* DESK: intrinsic rows, 420px rail, bottom row 5:3:4 */
@media (min-width: 1201px) {
  #page.pg-desk { grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) 420px; grid-template-rows: auto auto auto; }
  #page.pg-desk > .a-chart { grid-column: 1 / 3; grid-row: 1 / 3; min-height: 520px; }
  #page.pg-desk > .a-lv { grid-column: 1; grid-row: 3; align-self: start; }
  #page.pg-desk > .a-chg { grid-column: 2; grid-row: 3; align-self: start; }
  #page.pg-desk > .a-news { grid-column: 3; grid-row: 3; align-self: start; max-height: 420px; }
}
@media (min-width: 1201px) and (max-width: 1365px) { #page.pg-desk { grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) 380px; } }
@media (min-width: 1900px) { #page.pg-desk { grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) 568px; grid-template-rows: auto auto auto; } }
#page.pg-desk > .a-hcp { min-height: 280px; }
#page > .a-hcp .pnl-b { overflow: visible; }
.pg-desk .a-hcp .hero-v, .hero-v { font-size: 40px; line-height: 44px; }
.zone-chip { border: 0; padding: 0; text-transform: none; letter-spacing: 0; font: 600 14px/20px var(--sans); color: var(--text); }
.band-t { font: 600 13px/18px var(--sans); color: var(--violet); }
.hero { grid-template-columns: auto minmax(0, 1fr); }
.strip-key { font-size: 12px; color: var(--dim); }
.hcp-meta { font-size: 13px; color: var(--dim); }
.layers-inline { grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); }
/* changes: compact when empty */
.pnl.is-empty .pnl-b { padding: 8px 12px; }
.empty-compact { padding: 10px 12px; font: 400 13px/18px var(--sans); color: var(--dim); text-align: left; }
/* conditions table */
.lvt td { height: auto; padding: 6px 6px; vertical-align: top; white-space: normal; }
.lvt-r { cursor: pointer; }
.lvt-r:hover { background: var(--hover); }
.lvt-c { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lvt-lbl { font: 400 13px/18px var(--sans); color: var(--text); }
.lvt-side { font: 400 11px var(--mono); color: var(--faint); }
.side-bull .lvt-c { box-shadow: inset 2px 0 0 var(--up); padding-left: 6px; }
.side-bear .lvt-c { box-shadow: inset 2px 0 0 var(--down); padding-left: 6px; }
.side-macro .lvt-c { box-shadow: inset 2px 0 0 var(--cyan); padding-left: 6px; }
.side-top .lvt-c { box-shadow: inset 2px 0 0 var(--violet); padding-left: 6px; }
.lvt-d { color: #B8C1CC; white-space: nowrap; }
.lvt-s { font: 600 12px var(--sans); color: var(--dim); white-space: nowrap; }
.lvt-s.met { color: var(--text); }
.lvt-spot-r td { font: 600 12px var(--mono); color: var(--orange); background: var(--orange-bg); padding: 3px 6px; }
.lvt-spot { font: 400 13px var(--sans); color: var(--dim); margin-bottom: 6px; }
.lvt-spot .num { color: var(--text); font-weight: 600; }
.readout-note { margin-top: 8px; font-size: 12px; }
/* derivs coverage */
.coverage { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 6px 8px; margin-bottom: 8px; border-left: 2px solid var(--rule); font-size: 13px; }
.cov-part { border-left-color: #E5B45A; }
.cov-part .cov-k { color: #E5B45A; font-weight: 600; }
.cov-x { color: var(--dim); }
/* macro: value + 12px metadata row */
.mac { display: flex; flex-direction: column; }
.mac-r { padding: 6px 0; border-bottom: 1px solid var(--rule-2); }
.mac-top { display: flex; align-items: baseline; gap: 12px; }
.mac-k { flex: 1; color: var(--dim); font-size: 13px; }
.mac-v { font-size: 15px; color: var(--text); }
.mac-m { font: 400 12px/16px var(--mono); color: var(--faint); }
.mac-s { font-size: 12px; color: var(--text); margin-top: 2px; }
.mac-w { font: 600 12px var(--sans); color: var(--amber); margin-top: 2px; }
#p-clock .stat-k { text-transform: none; letter-spacing: 0; font-size: 12px; max-width: 26ch; white-space: normal; }
/* phone: order quote -> score -> chart -> next conditions -> TV -> changes -> headlines; header fits 360 */
@media (max-width: 760px) {
  #page.pg-desk > .a-hcp { order: 0; } #page.pg-desk > .a-chart { order: 1; } #page.pg-desk > .a-lv { order: 2; }
  #page.pg-desk > .a-tv { order: 3; } #page.pg-desk > .a-chg { order: 4; } #page.pg-desk > .a-news { order: 5; }
  #page.pg-desk > .a-chart .chart-box { height: 280px; min-height: 280px; }
  #top { flex-wrap: wrap; height: auto; }
  #brand { border-right: 0; padding: 0 10px; }
  #health-btn { max-width: 44vw; border-left: 0; padding: 0 8px; }
  .feed { max-width: 46vw; margin: 0 6px; }
  .lvt td { padding: 8px 6px; }
}
@media (max-width: 400px) { #brand-name { letter-spacing: .08em; } .feed { font-size: 11px; } }
/* Headers never truncate: title + meta wrap onto two lines when the panel is narrow. */
.pnl-h { height: auto; min-height: var(--title-h); flex-wrap: wrap; row-gap: 0; padding-top: 4px; padding-bottom: 4px; }
.pnl-t { white-space: normal; overflow: visible; text-overflow: clip; line-height: 20px; }
.pnl-meta { white-space: normal; line-height: 20px; }
.mac-s { display: flex; flex-wrap: wrap; gap: 0 4px; }
.eco-n { white-space: normal; overflow: visible; text-overflow: clip; }
@media (max-width: 760px) { #health-btn .hl-k { display: none; } #health-btn .health-txt { overflow: visible; } }
/* Astra round 3: the band caption is part of the score on every page and device */
.pg-desk .a-hcp .strip-key { display: block; }
.lvt-pre { font: 400 12px/16px var(--sans); color: var(--amber); }
#p-powerlaw .stat-k { text-transform: none; letter-spacing: 0; font-size: 12px; max-width: 22ch; white-space: normal; }
.pl-explain { margin-top: 6px; }
.band-d { font-size: 12px; color: var(--violet); }
.cov-badge { padding: 0 10px; border-left: 1px solid var(--rule); font: 600 12px var(--sans); color: var(--dim); white-space: nowrap; }
.cov-badge.cov-part { color: #E5B45A; }
@media (max-width: 1200px) { .cov-badge { display: none; } }

/* ---- After-gate (3): LEVELS 40/60, stacked right column, no void ---- */
@media (min-width: 1201px) {
  #page.pg-levels { grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: auto; align-items: start; }
  #page.pg-levels > .a-lv { grid-column: 1 / 6; grid-row: 1 / span 3; }
  #page.pg-levels > .a-pl { grid-column: 6 / 13; grid-row: 1; }
  #page.pg-levels > .a-plh { grid-column: 6 / 13; grid-row: 2; }
  #page.pg-levels > .a-clock { grid-column: 6 / 13; grid-row: 3; }
}
.mini-tall { height: 300px; }
.pl-key { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 6px; font-size: 12px; color: var(--dim); }
.pl-k { display: inline-flex; align-items: center; gap: 6px; }
.pl-sw { width: 14px; height: 0; border-top: 2px solid var(--orange); }
.pl-sw.dashed { border-top-style: dashed; }
#p-powerlaw .plstrip { margin-top: 4px; }
#p-derivs .tbl .bdg { text-transform: none; letter-spacing: 0; font-weight: 400; height: auto; white-space: normal; }
@media (min-width: 1201px) {
  /* the tall conditions table spans a trailing flexible row so its extra height never inflates the right column's rows */
  #page.pg-levels { grid-template-rows: auto auto auto minmax(0, 1fr); }
  #page.pg-levels > .a-lv { grid-row: 1 / 5; }
}

/* ---- After-gate (4): CYCLE score card with Rail | Gauge toggle; content-height bottom watch ---- */
.hcp-view { margin-left: 8px; }
.hcp-view .seg-b { height: 22px; font-family: var(--sans); font-size: 11px; }
.hcp-gauge { display: none; }
.pnl.view-gauge .hcp-gauge { display: block; }
.pnl.view-gauge .hero-strip { display: none; }
.hcp-gauge .pnl { border: 0 !important; background: transparent !important; animation: none; }
.hcp-gauge .pnl-h { display: none; }
.hcp-gauge .pnl-b { padding: 0; }
.hcp-gauge .hcp-asof, .hcp-gauge .row, .hcp-gauge .warn { display: none; }
@media (min-width: 1201px) {
  #page.pg-cycle > .a-hcp { grid-column: 1 / 5; grid-row: 1 / span 2; align-self: start; }
  #page.pg-cycle > .a-clock { grid-column: 5 / 13; grid-row: 1; }
  #page.pg-cycle > .a-bottom { grid-column: 5 / 13; grid-row: 2; align-self: start; }
  #page.pg-cycle > .a-pl { grid-column: 1 / 5; grid-row: 3; align-self: start; }
  #page.pg-cycle > .a-inputs { grid-column: 5 / 13; grid-row: 3; }
}
.board { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

/* ---- After-gate (5): phone CYCLE collapsed sections ---- */
.pnl-tog { margin-left: auto; height: 32px; padding: 0 12px; background: transparent; border: 1px solid var(--rule); border-radius: 2px; color: var(--dim); font: 600 12px var(--sans); cursor: pointer; }
.pnl.is-collapsed > .pnl-b { display: none; }
.pnl.is-collapsed { min-height: 0 !important; }

/* Bottom watch: content-height cards; condition detail wraps instead of clipping (audit finding) */
.cond-det { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; font-size: 12px; }

/* QA D-01: feed offline (> 2 h without a push) -> stale treatment on every panel not fed by the live quote */
.pnl.is-feed-stale { box-shadow: inset 0 2px 0 var(--down); }
.feed-stale { margin-left: 8px; }

/* QA D-02: top-bar overflow goes into a measured "More" menu */
.fk[hidden], .rm-i[hidden] { display: none !important; }
#fk-more { flex: 0 0 auto; height: 100%; display: inline-flex; align-items: center; border: 0; cursor: pointer; }
#fk-more.is-cur { color: var(--orange); }
@media (max-width: 1200px) { #fk-more { display: none !important; } }

/* QA D-04: AA contrast. Stale/failed rows are marked, never faded: opacity compositing pushed badges and the
   missing-value dash below 4.5:1. Status badge tokens re-set to measured >= 4.5:1 on the panel and raised surfaces. */
.tbl tr.is-stale td { opacity: 1; color: var(--dim); }
.tbl tr.is-stale td:first-child { box-shadow: inset 2px 0 0 var(--amber); }
.pnl.is-stale .pnl-b > *:not(.warn):not(.hcp-asof) { opacity: 1; }
.bdg-na, .bdg-off { color: var(--dim); border-color: var(--faint); background: transparent; }
.bdg-stale { color: var(--amber); background: transparent; border-color: rgba(255, 200, 87, .6); }
.bdg-offline { color: #000; background: var(--down); border-color: var(--down); }
.pnl-meta { opacity: 1; }
/* Phone tab bar: the current tab was orange text on an orange fill (1.00:1). Orange text + top indicator instead. */
@media (max-width: 760px) {
  .tb[aria-current="page"], .tb-more[aria-current] { background: transparent; color: var(--orange); box-shadow: inset 0 2px 0 var(--orange); }
}
/* DERIVS excluded venues: short badge + wrapping reason under the venue name (audit: reason overlapped the next cell) */
.venue-why { white-space: normal; font: 400 12px/16px var(--sans); color: var(--dim); margin-top: 2px; max-width: 28ch; }
td.venue-down { white-space: normal; }

/* Phone header (Astra/CEO regression: search bar overlapped the quote tape). Explicit stacked rows instead of a
   wrapped flex line whose height was resolved circularly: row 1 brand · feed · status (44px), row 2 search (own row),
   then the tape below in the body grid. Nothing overlaps; e2e checks pairwise header/tape boxes at 360–414px. */
@media (max-width: 760px) {
  #top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: 44px auto;
    grid-template-areas: "brand feed health" "cmd cmd cmd"; height: auto; min-height: 0; align-items: center; }
  #brand { grid-area: brand; height: 44px; }
  #live-badge { grid-area: feed; min-width: 0; max-width: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #health-btn { grid-area: health; height: 44px; max-width: 44vw; }
  #cmd { grid-area: cmd; order: 0; margin: 0; padding: 0 8px 8px; max-width: none; min-width: 0; }
  #cmd-input { height: 36px; width: 100%; }
  #fkeys, #fk-more, #route-btn, #utc, #cov-badge { display: none !important; }
}
/* CYCLE Bottom watch: fewer, wider cards (auto-fit, >= 300px: 2x2 on desktop, 1 column on phone); details wrap only
   between words, never inside "threshold" or "$71,374". */
.board { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.cond-det, .cond-lbl { overflow-wrap: normal; word-break: normal; hyphens: none; }

/* DERIVS (Astra launch gate): venue table left, both funding charts stacked right, so ticks AND last-value labels
   ("+0.0051% / 8h") are inside one uncropped 1440x900 capture. */
@media (min-width: 1201px) {
  #page.pg-derivs { grid-template-rows: auto auto; align-content: start; }
  #page.pg-derivs > .a-derivs { grid-column: 1 / 8; grid-row: 1 / span 2; align-self: start; }
  #page.pg-derivs > .a-ser { grid-column: 8 / 13; }
}

/* ---- After-gate (6): readable type. 12px floor for every visible label, metadata, badge, axis and table cell on
   desktop; 14px for explanatory prose on phone. Measured by tests/web/e2e (typeAudit), not eyeballed. ---- */
:root { --fs-xs: 12px; --fs-s: 12px; }
.tp-k, .tp-m, .tp-m .dim, #tape, #tape span, .news-src, .news-n, .bdg, .lvt-side, .ser-src, .tb-l, kbd, .pk-tag, th, .tbl th,
.tv-attr, .tv-attr-foot, .feed, .cmd-k, .seg-b, small, .label, .chip-t, .chip-x, .disclaimer, #foot, #foot *, #home-link,
.stat-m, .stat-k, .lg-k, .lg-v, .kv-m, .cond-lbl, .btn-q, .win-passed, .win-inside, .spark-l, .lv-sub, .lv-k, .pnl-meta,
.tbl, .tbl td, .lvt td, .lvt th, .lvt-d, .td-in, #p-help, #p-help .help-r, #p-help td, #p-clock .strong, #p-clock .num,
#p-derivs td, #p-derivs .num, #p-inputs td, #p-inputs .dim, .help-r small, .rm-k, .fk { font-size: 12px; }
.bdg { line-height: 16px; }
@media (max-width: 760px) {
  .note, .hcp-cap, .na, .empty-s, .ins-p, .help-r p, .desc, .pl-desc, .mac-note, .cap { font-size: 14px; line-height: 20px; }
}
.pnl .seg .seg-b, #p-news .seg-b, #p-hcp .seg-b, .hcp-view .seg-b, .lg-t, .lg .lg-t { font-size: 12px; }

/* ---- After-gate (7): chart chrome = 32px title + 36px toolbar; study chips collapse behind "Studies · n" ---- */
.pnl-chart > .pnl-h { height: 32px; min-height: 32px; }
.pnl-chart .toolbar { min-height: 36px; padding: 4px 10px; align-items: center; }
@media (min-width: 761px) { .pnl-chart .toolbar { height: 36px; flex-wrap: nowrap; } .pnl-chart .chart-src { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; } }
.pnl-chart .chips .chip:not(.chip-note) { display: none; }      /* listed, added and removed in the Studies picker */
.pnl-chart .chips:not(:has(.chip-note)) { display: none; }       /* only data notes ("…: no data", "loading…") stay visible */
.btn-studies { font: 600 12px var(--sans); }
.chart-more { position: relative; display: inline-flex; }
.btn-more { min-width: 32px; font: 600 14px var(--sans); }
.chart-menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 60; min-width: 200px; padding: 4px; background: var(--raised);
  border: 1px solid var(--rule); border-radius: 2px; box-shadow: 0 16px 48px #00000099; display: flex; flex-direction: column; gap: 2px; }
.chart-menu[hidden] { display: none; }
.chart-menu .mi { justify-content: flex-start; text-align: left; height: 32px; padding: 0 10px; border: 0; background: none; color: var(--text); font: 400 13px var(--sans); }
.chart-menu .mi:hover, .chart-menu .mi:focus-visible { background: var(--hover); }

/* ---- After-gate (8): WIRE = 60% headlines (left, primary) / 40% TV + calendar (right); one column below 1201px ---- */
@media (min-width: 1201px) {
  #page.pg-wire { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); grid-template-rows: auto minmax(0, 1fr); align-content: start; }
  #page.pg-wire > .a-news { grid-column: 1; grid-row: 1 / span 2; }
  #page.pg-wire > .a-tv { grid-column: 2; grid-row: 1; }
  #page.pg-wire > .a-eco { grid-column: 2; grid-row: 2; }
}
#page.pg-wire > .a-tv, #page.pg-wire > .a-eco { align-self: start; }  /* content height: no stretched void beside a long feed */

/* Astra R7: phone quote strip cut the 24H change. Price + 24H fit at 360–414; the rest of the strip scrolls
   sideways (snap) with an edge fade so the overflow is discoverable. */
@media (max-width: 760px) {
  #tape { position: relative; overflow: hidden; }
  #tape .tape-in { overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scrollbar-width: none; height: 100%; }
  #tape .tape-in::-webkit-scrollbar { display: none; }
  #tape .tp { padding: 0 8px; gap: 6px; scroll-snap-align: start; flex: 0 0 auto; }
  #tape .tp:first-child .tp-v { font-size: 20px; }
  #tape::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 24px; pointer-events: none;
    background: linear-gradient(to right, rgba(0, 0, 0, 0), var(--bg)); }
}
@media (max-width: 760px) {
  #tape .tp:first-child { display: grid; grid-template-columns: auto auto; column-gap: 6px; row-gap: 0; align-content: center; align-items: baseline; }
  #tape .tp:first-child .tp-v { line-height: 24px; }
  #tape .tp:first-child .tp-m { grid-column: 1 / -1; margin: 0; line-height: 16px; }
}

/* ---- After-gate (9): ON-CHAIN shared date range ---- */
.page-tools { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 6px 12px; background: var(--panel); border: 1px solid var(--rule-2); }
.page-tools .seg-b { min-width: 40px; height: 28px; }
.page-tools .seg-b[aria-pressed="true"] { color: var(--orange); border-color: var(--orange); }
@media (max-width: 760px) { .page-tools .seg-b { height: 40px; } }
/* Axis caption for interval rates (funding): sits above the price axis, inside the chart box */
.mini { position: relative; }
.axis-cap { position: absolute; top: 2px; right: 4px; z-index: 3; padding: 0 4px; font: 600 12px/16px var(--sans); color: var(--dim); background: rgba(8, 10, 12, .85); pointer-events: none; }
/* Chart tone (founder 05:48): overlays on charts use the panel surface, not the darker page black */
.legend, .axis-cap { background: color-mix(in srgb, var(--panel) 88%, transparent); }
/* v1.4 tier: reconstructed (hindsight replay) = model styling (violet), its own word */
.bdg-reconstructed { color: var(--violet); border-color: rgba(178, 154, 255, .6); border-style: dashed; }

/* ---- Persistent TV dock (founder 05:54): one iframe outside the routed page; over the DESK/WIRE slot or docked mini ---- */
.tv-dock { position: fixed; z-index: 45; background: #000; display: flex; flex-direction: column; }
.tv-dock[hidden] { display: none; }
.tv-dock .tvd-frame { flex: 1 1 auto; min-height: 0; }
.tv-dock .tv-if { display: block; width: 100%; height: 100%; border: 0; }
.tv-dock.in-slot .tvd-bar { display: none; }
.tv-dock.in-slot.is-offscreen { visibility: hidden; }
.tv-dock.tvd-mini { width: 320px; bottom: calc(var(--foot-h) + 8px); right: 12px; border: 1px solid var(--rule); border-radius: 2px; box-shadow: 0 16px 48px #000000b3; }
.tv-dock.tvd-mini.dock-left { right: auto; left: 12px; }
.tv-dock.tvd-mini .tvd-frame { aspect-ratio: 16 / 9; flex: none; }
.tv-dock.is-hidden { visibility: hidden; }
.tvd-bar { display: flex; align-items: center; gap: 2px; min-height: 32px; padding: 0 4px 0 8px; background: var(--raised); font: 400 12px/16px var(--sans); color: var(--text); }
.tvd-t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tvd-b { height: 28px; min-width: 28px; padding: 0 6px; background: none; border: 1px solid transparent; border-radius: 2px; color: var(--text); font: 600 12px var(--sans); cursor: pointer; }
.tvd-b:hover, .tvd-b:focus-visible { border-color: var(--rule); background: var(--hover); }
.tv-slot { position: relative; }
@media (max-width: 760px) {
  .tv-dock.tvd-mini, .tv-dock.tvd-mini.dock-left { left: auto; right: 8px; width: min(320px, calc(100vw - 16px));
    bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px); }
  .tvd-b { min-width: 36px; height: 36px; }
}
.tv-dock .tvd-frame { position: relative; }

/* ---- DESK fit-to-viewport (founder 06:04): at >= 1200x700 the shell is exactly one screen, no document scrollbar.
   Chart takes the leftover height; score card keeps its intrinsic height; TV keeps 16:9; long lists scroll inside. ---- */
body.fit-desk { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; grid-template-rows: auto auto auto minmax(0, 1fr) auto; }
body.fit-desk main#main { overflow: hidden; }
/* Fit grid: chart (cols 1-3) over levels | changes | TV; rail = score card, then headlines filling the rest. */
body.fit-desk #page.pg-desk { height: 100%; min-height: 0; align-content: stretch;
  grid-template-columns: minmax(0, 3.6fr) minmax(0, 2.6fr) minmax(0, 3.4fr) var(--rail-w, 420px); grid-template-rows: auto minmax(0, 1fr) auto; }
@media (min-width: 1900px) { body.fit-desk #page.pg-desk { --rail-w: 568px; } }
body.fit-desk #page.pg-desk > .a-chart { grid-column: 1 / 4; grid-row: 1 / 3; min-height: 0; }
body.fit-desk #page.pg-desk > .a-hcp { grid-column: 4; grid-row: 1; }
body.fit-desk #page.pg-desk > .a-news { grid-column: 4; grid-row: 2 / 4; }
body.fit-desk #page.pg-desk > .a-lv { grid-column: 1; grid-row: 3; }
body.fit-desk #page.pg-desk > .a-chg { grid-column: 2; grid-row: 3; }
body.fit-desk #page.pg-desk > .a-tv { grid-column: 3; grid-row: 3; align-self: start; }
/* Long panels contribute no intrinsic height (the TV row sets it) and scroll inside, with a fade at the cut edge. */
body.fit-desk #page.pg-desk > .a-lv, body.fit-desk #page.pg-desk > .a-news, body.fit-desk #page.pg-desk > .a-chg { contain: size; max-height: none; }
body.fit-desk #page.pg-desk > .a-lv > .pnl-b, body.fit-desk #page.pg-desk > .a-news > .pnl-b, body.fit-desk #page.pg-desk > .a-chg > .pnl-b {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--rule) transparent;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent); padding-bottom: 24px; }
body.fit-desk #page.pg-desk .a-chart .chart-box { min-height: 0; height: auto; flex: 1 1 auto; }
body.fit-desk #page.pg-desk > .a-lv, body.fit-desk #page.pg-desk > .a-news, body.fit-desk #page.pg-desk > .a-chg { align-self: stretch; height: auto; }
/* WIRE fit (natural there): headlines and the calendar scroll inside; the page itself does not scroll */
body.fit-wire { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; grid-template-rows: auto auto auto minmax(0, 1fr) auto; }
body.fit-wire main#main { overflow: hidden; }
body.fit-wire #page.pg-wire { height: 100%; min-height: 0; grid-template-rows: auto minmax(0, 1fr); align-content: stretch; }
body.fit-wire #page.pg-wire > .a-news, body.fit-wire #page.pg-wire > .a-eco { contain: size; align-self: stretch; height: auto; }
body.fit-wire #page.pg-wire > .a-news > .pnl-b, body.fit-wire #page.pg-wire > .a-eco > .pnl-b { flex: 1 1 auto; min-height: 0; overflow-y: auto;
  overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--rule) transparent; }
/* overflow: clip (not hidden): focus / scrollIntoView must never scroll the fitted shell itself, only the inner lists */
body.fit-desk, body.fit-wire, body.fit-desk main#main, body.fit-wire main#main { overflow: clip; }

/* ---- Chart luminance (founder 07:00 "low light") ---- */
:root { --chart-grid: rgba(255, 255, 255, 0.09); }
#health-btn.h-conn .dot { background: var(--faint); }
.chart-hint { position: absolute; left: 8px; bottom: 30px; z-index: 3; padding: 2px 6px; font: 600 12px/16px var(--sans); color: var(--text);
  background: color-mix(in srgb, var(--panel) 88%, transparent); border: 1px solid var(--rule); border-radius: 2px; pointer-events: none; }
.chart-hint[hidden] { display: none; }
/* .chart-host is already absolutely positioned (panels.css): the hint anchors to it */

/* ---- DESK trigger rows, two lines (CEO 1440x900: the 4-column table was too narrow in the bottom row) ---- */
.lvc { display: flex; flex-direction: column; }
.lvc-r { display: flex; flex-direction: column; gap: 3px; padding: 6px 6px 6px 8px; border-bottom: 1px solid var(--rule-2); cursor: pointer; }
.lvc-r:hover, .lvc-r:focus-visible { background: var(--hover); }
.lvc-r.side-bull { box-shadow: inset 2px 0 0 var(--up); } .lvc-r.side-bear { box-shadow: inset 2px 0 0 var(--down); }
.lvc-r.side-macro { box-shadow: inset 2px 0 0 var(--cyan); } .lvc-r.side-top { box-shadow: inset 2px 0 0 var(--violet); }
.lvc-lbl { font: 400 13px/18px var(--sans); color: var(--text); overflow-wrap: anywhere; }
.lvc-m { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.lvc-chip { font: 600 12px/18px var(--mono); padding: 0 6px; border: 1px solid var(--rule); border-radius: 2px; color: var(--text); white-space: nowrap; }
.lvc-d { color: #B8C1CC; font-weight: 400; }
.lvc-s { font-family: var(--sans); color: var(--dim); }
.lvc-s.met { color: #000; background: var(--orange); border-color: var(--orange); }
.lvc-side { font: 400 12px var(--mono); color: var(--faint); }
.lvc-spot { font: 600 12px/20px var(--mono); color: var(--orange); background: var(--orange-bg); padding: 0 8px; }

/* ---- DESK Dense (founder density ask): context panels in #page-dense, compact variants ---- */
#page-dense[hidden] { display: none; }
#page-dense { display: grid; gap: 1px; background: var(--rule); margin-top: 1px; min-width: 0;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: stretch; }
#page-dense > .pnl { min-width: 0; max-height: 400px; }
#page-dense > .pnl > .pnl-b { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--rule) transparent; }
/* Below 1920x1080 the Focus screen stays exactly one screen; the dense row follows it inside #main, which scrolls. */
body.fit-desk.dense-scroll main#main { overflow-x: clip; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--rule) transparent; }
body.fit-desk.dense-scroll #page.pg-desk { height: 100%; }
/* >= 1920x1080: one screen; the dense row takes a fixed band under the Focus grid. */
body.fit-desk.dense-fit main#main { display: flex; flex-direction: column; }
body.fit-desk.dense-fit #page.pg-desk { flex: 1 1 auto; height: auto; min-height: 0; }
body.fit-desk.dense-fit #page-dense { flex: none; height: 220px; grid-template-columns: repeat(7, minmax(0, 1fr)); }
body.fit-desk.dense-fit #page-dense > .pnl { contain: size; max-height: none; height: 100%; }
body.fit-desk.dense-fit #page-dense > .pnl > .pnl-b { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 20px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 20px), transparent); padding-bottom: 20px; }
#page-dense .is-compact .kv-r { min-height: 0; }
#page-dense .plstrip { min-height: 72px; }
/* Header toggle */
.dn-seg { flex: none; align-self: center; margin: 0 8px; }
@media (max-width: 1200px) { .dn-seg { display: none; } } /* the Focus|Dense layouts are desktop layouts; key d still works */
/* ---- Table audit fixes (PM 2026-11-14: the extended audit flags tables wider than their box) ---- */
#p-inputs .tbl td, #p-inputs .tbl th { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  /* DERIVS venues on a phone: one card per venue (labels from CSS), never a sideways-scrolling table */
  #p-derivs .tbl thead { display: none; }
  #p-derivs .tbl, #p-derivs .tbl tbody { display: block; width: 100%; }
  #p-derivs .tbl tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 8px; padding: 8px 0; border-bottom: 1px solid var(--rule-2); }
  #p-derivs .tbl td { display: block; height: auto; padding: 0; text-align: left; white-space: normal; border: 0; }
  #p-derivs .tbl td:first-child { grid-column: 1 / -1; font-weight: 600; }
  #p-derivs .tbl td:nth-child(n+2)::before { display: block; font: 600 12px/16px var(--sans); color: var(--dim); }
  #p-derivs .tbl td:nth-child(2)::before { content: 'Mark'; }
  #p-derivs .tbl td:nth-child(3)::before { content: 'Funding / 8h'; }
  #p-derivs .tbl td:nth-child(4)::before { content: 'APR'; }
  #p-derivs .tbl td:nth-child(5)::before { content: 'OI USD'; }
  #p-derivs .tbl td:nth-child(6)::before { content: 'OI BTC'; }
  #p-derivs .tbl td:nth-child(7)::before { content: 'Share'; }
}

/* Score rail: past tops/bottoms are hcp_replay_pit values (labelled; DESK only, CYCLE says it in the strip key) */
.strip-marks { font: 400 12px/16px var(--sans); color: var(--dim); margin-top: 2px; }
.strip-marks[hidden], .pg-cycle .strip-marks, #p-gauge .strip-marks { display: none; }

/* ---- CYCLE: Cycle score through history (v1.4 replay) ---- */
#page.pg-cycle > .a-hist { grid-column: 1 / -1; }
@media (min-width: 1201px) {
  #page.pg-cycle > .a-hist { grid-row: 3; }
  #page.pg-cycle > .a-pl { grid-row: 4; }
  #page.pg-cycle > .a-inputs { grid-row: 4; }
}
.hist-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin-bottom: 6px; }
.hist-item { display: inline-flex; align-items: center; gap: 6px; font: 400 12px/18px var(--sans); color: var(--text); }
.sw { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--amber); flex: none; }
.sw-pit { border-top-color: #FFB000; }
.sw-all { border-top: 2px dashed #B48CFF; }
.sw-band { height: 10px; border: 1px solid rgba(180,140,255,0.45); background: rgba(180,140,255,0.16); }
.sw-pub { width: 8px; height: 8px; border: 0; border-radius: 50%; background: #FFFFFF; }
.sw-price { border-top-color: var(--orange); }
.hist-asof { color: var(--dim); }
.hist-desc { margin: 2px 0; }
.hist-warn { margin: 4px 0; color: var(--amber); }
.hist-read { font: 400 12px/18px var(--mono); color: var(--text); margin: 4px 0; overflow-wrap: anywhere; }
.hist-host { position: relative; height: 480px; min-width: 0; }
@media (max-width: 760px) { .hist-host { height: 380px; } }
/* ---- Economic calendar v2 (eco.json v1.4: units, periods, first print) ---- */
.ec-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.ec-count { font: 400 12px/16px var(--sans); color: var(--dim); }
.ec-day { font: 600 12px/18px var(--mono); letter-spacing: .04em; color: var(--orange); border-bottom: 1px solid var(--rule); padding: 6px 0 2px; }
.ec-day.is-past, .ec-r.is-past { opacity: 0.72; }
.ec-r { display: grid; grid-template-columns: 64px 34px minmax(0, 1fr); grid-template-areas: "t imp n" ". . v"; column-gap: 8px; row-gap: 1px;
  padding: 4px 0; border-bottom: 1px solid var(--rule-2); align-items: baseline; }
.ec-t { grid-area: t; font: 400 12px/18px var(--mono); color: var(--dim); white-space: nowrap; }
.ec-imp { grid-area: imp; font: 400 12px/18px var(--mono); color: var(--amber); white-space: nowrap; letter-spacing: 0; }
.ec-n { grid-area: n; font: 400 13px/18px var(--sans); color: var(--text); overflow-wrap: anywhere; }
.imp-3 .ec-n { font-weight: 600; }
.ec-v { grid-area: v; font: 400 12px/16px var(--mono); color: #B8C1CC; overflow-wrap: anywhere; }
.ec-foot { margin-top: 6px; }
.is-compact .ec-r { grid-template-columns: 58px 30px minmax(0, 1fr); column-gap: 6px; }

/* ON-CHAIN: own-node index status beside the date range */
.page-tools .brk-note { margin-left: auto; font: 400 12px/16px var(--sans); color: var(--dim); }
.page-tools .brk-note.is-live { color: var(--up); }
@media (max-width: 760px) { .page-tools .brk-note { font-size: 14px; line-height: 20px; margin-left: 0; flex-basis: 100%; } }
/* v1.5 carried-forward card blocks: amber "as of <card day> · update due", never an error */
.pending-note { font: 400 12px/16px var(--sans); color: var(--amber); border-left: 2px solid var(--amber); padding: 2px 0 2px 8px; margin: 0 0 6px; overflow-wrap: anywhere; }
@media (max-width: 760px) { .pending-note { font-size: 14px; line-height: 20px; } }

.zone-chip.is-arriving { color: var(--amber); border-color: var(--amber); }
/* Headlines auto-refresh (founder 2026-11-15): new arrivals highlighted, "n new" chip, stale feed line */
.news-i.is-new { background: var(--orange-bg); box-shadow: inset 2px 0 0 var(--orange); }
@media (prefers-reduced-motion: no-preference) { .news-i.is-new { transition: background-color .6s; } }
.news-new { margin-left: auto; color: #000; background: var(--orange); border-color: var(--orange); font-weight: 600; }
.feed-late { margin-bottom: 6px; }
.hl-feed { color: var(--amber); }
