/* AMCC V74 design system. Mobile first at 390 px, RTL, dark. Type and row sizes follow the visual reference sheet
   (reports/audit/D-visual-reference.md section 2): body 14 px, numbers 13-14 px tabular, captions 11-12 px and
   nothing below 11 px; every interactive target is at least 44 px. Colour is never the only carrier of meaning:
   every coloured state also has a word, an arrow or an icon in the markup. */

@font-face {
  font-family: Vazirmatn;
  src: url('/vendor/Vazirmatn-wght-33.003.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #07101b;
  --panel: #0f1c2d;
  --raised: #16263a;
  --line: #263a50;
  --text: #f4f8ff;
  --muted: #9fb1c7;
  --up: #71dfb2;
  --down: #ff8c9c;
  --amber: #ffd17d;
  --cyan: #58ddc8;
  --strip-h: 44px;
  --nav-h: 56px;
  --gutter: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: auto; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Vazirmatn, -apple-system, "Segoe UI", Tahoma, sans-serif;
  font-size: 14px;
  line-height: 1.7;
  overflow-x: hidden;
}

h1, h2, h3, p, ul { margin: 0; }
h1 { font-size: 18px; font-weight: 700; line-height: 1.5; }
h2 { font-size: 15px; font-weight: 700; line-height: 1.6; }
h3 { font-size: 14px; font-weight: 600; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 50; background: var(--cyan); color: #04121a; padding: 10px 14px; border-radius: 8px; min-height: 44px; }
.skip:focus { top: 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.noscript { padding: 16px; }

/* Numbers: one LTR isolate, tabular figures, so signs and units never reorder and columns line up. */
.num, .sym, .latin, .code, .ver-text { unicode-bidi: isolate; direction: ltr; font-variant-numeric: tabular-nums; }
.num { font-size: 13.5px; line-height: 1.3; white-space: nowrap; }
.sym { font-weight: 700; letter-spacing: .2px; }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }
.money { white-space: nowrap; }
.unit { color: var(--muted); font-size: 12px; }
.na { color: var(--muted); }

/* A change: arrow + sign + value in the markup; the colour is the fourth cue. */
.chg { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; direction: ltr; }
.chg .arrow { font-size: 11px; }
.chg.up { color: var(--up); }
.chg.down { color: var(--down); }
.chg.flat { color: var(--muted); }

.brand { margin: 0; padding: 4px var(--gutter) 0; font-size: 11px; line-height: 1.5; letter-spacing: .6px; color: var(--muted); text-align: right; }

/* ---- status strip ---- */
.strip { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line); }
.strip-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: var(--strip-h); padding: 0 var(--gutter); background: none; border: 0; cursor: pointer; text-align: start; }
.strip-title { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 0; }
.chip { flex: none; font-size: 11px; line-height: 1.6; padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.strip-age { flex: 0 1 auto; min-width: 0; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip-age .num { font-size: 11px; }
.strip-ver { flex: none; margin-inline-start: auto; font-size: 11px; color: var(--muted); white-space: nowrap; }
.ver-unknown { color: var(--amber); }

/* ---- macro ticker ---- */
.tkbar { height: 44px; border-bottom: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.tk-loading { margin: 0; padding: 0 var(--gutter); line-height: 44px; font-size: 12px; color: var(--muted); }
.tkbar-inner { display: flex; direction: ltr; height: 44px; }
.tk-pause { flex: none; width: 44px; height: 44px; background: var(--panel); border: 0; border-right: 1px solid var(--line); color: var(--muted); font-size: 12px; cursor: pointer; }
.tk-pause[disabled] { opacity: .4; cursor: default; }
.tk-view { flex: 1; min-width: 0; overflow: hidden; }
/* Two identical sets; the track slides from -50 % to 0, so items enter at the left and leave at the right. */
.tk-track { display: flex; width: max-content; animation: tk-ltr var(--tk-duration, 60s) linear infinite; will-change: transform; }
.tk-set { display: flex; flex-direction: row-reverse; flex: none; }
@keyframes tk-ltr { from { transform: translateX(-50%); } to { transform: translateX(0); } }
.tk-view:hover .tk-track, .tk-view:focus-within .tk-track, .tkbar[data-touch] .tk-track, .tkbar-inner[data-paused] .tk-track { animation-play-state: paused; }
/* Nothing live to show, or the feed is down: one static list, read from the right, scrolled by hand. */
.tkbar-inner[data-moving="false"] .tk-track { animation: none; }
.tkbar-inner[data-moving="false"] .tk-view { direction: rtl; overflow-x: auto; scrollbar-width: none; }
.tkbar-inner[data-moving="false"] .tk-set { flex-direction: row; }
.tk { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; background: none; border: 0; border-inline-end: 1px solid var(--line); white-space: nowrap; font-size: 13px; cursor: pointer; }
.tk-name { color: var(--muted); font-size: 12px; }
.tk-price .num { font-weight: 600; }
.tk-time .num, .tk-time .when, .tk-note, .tk-src, .tk-word { font-size: 11px; color: var(--muted); }
.tk.stale .tk-name, .tk.stale .tk-price { opacity: .6; }
.tk.unavailable, .tk.not-configured { color: var(--muted); }
.stale-tag { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; line-height: 1.6; padding: 0 6px; border: 1px solid var(--amber); border-radius: 6px; color: var(--amber); white-space: nowrap; }
.stale-tag .num { font-size: 11px; }

/* ---- page ---- */
main { display: block; padding: 12px var(--gutter) calc(var(--nav-h) + var(--safe-bottom) + 24px); min-height: 60vh; outline: none; }
.screen { display: grid; gap: 12px; }
.screen > * { min-width: 0; }
.screen-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pad { padding: 4px 0; }
.stack { display: grid; gap: 8px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 8px; min-width: 0; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.back, .link { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; color: var(--cyan); }
.link { text-decoration: underline; padding: 0 2px; }
.back { font-size: 13px; justify-self: start; padding-inline-end: 12px; }
.plain { list-style: none; padding: 0; display: grid; gap: 4px; }
.tag { display: inline-block; font-size: 11px; line-height: 1.7; padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); white-space: nowrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 16px; border: 1px solid var(--cyan); border-radius: 10px; background: none; color: var(--cyan); font-weight: 600; cursor: pointer; justify-self: start; }
.btn.small { padding: 0 12px; font-size: 13px; }
.btn.ghost { border-color: var(--line); color: var(--text); }
.btn[disabled] { opacity: .45; cursor: default; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.segs { display: flex; gap: 6px; flex-wrap: wrap; }
.seg { min-height: 44px; min-width: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: none; color: var(--muted); font-size: 13px; cursor: pointer; }
/* The pressed state is a filled chip with a check mark, not only a colour. */
.seg[aria-pressed="true"] { background: var(--raised); color: var(--text); border-color: var(--cyan); font-weight: 700; }
.seg[aria-pressed="true"]::before { content: '✓ '; }

/* ---- states ---- */
.state { font-size: 14px; color: var(--muted); }
.state.empty { padding: 8px 0; }
.state.warn { color: var(--amber); }
.state.warn.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.when { white-space: nowrap; font-variant-numeric: tabular-nums; }
.state.ok { color: var(--up); }
.state.error { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--amber); border-radius: 12px; color: var(--text); background: var(--panel); }
.state.empty-block { display: grid; gap: 8px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; }
.skel { display: grid; gap: 8px; }
.skel-row { height: 52px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
details.tech { border-top: 1px solid var(--line); }
details.tech > summary { min-height: 44px; display: flex; align-items: center; color: var(--muted); font-size: 12px; cursor: pointer; }
.tech-body { display: grid; gap: 4px; padding-bottom: 8px; direction: ltr; text-align: left; }

/* ---- evidence line and placeholders ---- */
.edge { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 4px; background: var(--panel); }
.edge.warn { border-color: var(--amber); }
.edge-main { font-weight: 600; }
.edge.warn .edge-main { color: var(--amber); }
.edge-sub { font-size: 12px; color: var(--muted); }
.edge .link { justify-self: start; }
.placeholder p { color: var(--muted); }
.placeholder h2 { color: var(--text); }

/* ---- action words: label + icon first, stripe colour third ---- */
.act { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; white-space: nowrap; }
.act.buy { color: var(--up); }
.act.sell { color: var(--down); }
.act.reduce { color: #ffb3bd; }
.act.watch { color: var(--text); }
.act.avoid, .act.none { color: var(--muted); }
.act.shadow { color: var(--text); font-weight: 600; }

/* ---- count gauge ---- */
.gauge { display: grid; gap: 6px; }
.gauge-cells { display: flex; flex-direction: row-reverse; direction: ltr; gap: 3px; }
.gauge-cell { display: grid; gap: 2px; flex: 1 1 0; min-width: 52px; text-align: center; }
.gauge-count { font-weight: 700; white-space: nowrap; }
.gauge-bar { height: 6px; border-radius: 3px; background: var(--line); }
.gauge-cell.buy .gauge-bar { background: var(--up); }
.gauge-cell.sell .gauge-bar { background: var(--down); }
.gauge-cell.reduce .gauge-bar { background: #ffb3bd; }
.gauge-cell.watch .gauge-bar { background: var(--text); }
.gauge-cell.avoid .gauge-bar { background: var(--muted); }
.gauge-word { font-size: 11px; color: var(--muted); }
.gauge-note { font-size: 12px; color: var(--muted); }

/* ---- decision card ---- */
.decision { background: var(--panel); border: 1px solid var(--line); border-inline-start: 4px solid var(--muted); border-radius: 12px; padding: 12px; display: grid; gap: 8px; }
.decision.buy { border-inline-start-color: var(--up); }
.decision.sell { border-inline-start-color: var(--down); }
.decision.reduce { border-inline-start-color: #ffb3bd; }
.decision.watch { border-inline-start-color: var(--text); }
.decision-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.decision-action { display: grid; gap: 4px; justify-items: start; }
.decision-action .act { font-size: 18px; }
.decision-meta, .decision-prov { font-size: 12px; color: var(--muted); }
.decision-validation { font-size: 12px; color: var(--amber); }
.levels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; border-block: 1px solid var(--line); padding: 8px 0; }
.level { display: grid; gap: 2px; min-width: 0; }
.level-label { font-size: 11px; color: var(--muted); }
.level-value .num { font-size: 15px; }
.decision-why { display: grid; gap: 4px; }
.coin-name { font-size: 11px; color: var(--muted); }

/* ---- market ---- */
.context-main { font-weight: 700; font-size: 15px; }
.majors { display: flex; gap: 8px; flex-wrap: wrap; }
.major { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; }
.heat-map { position: relative; height: 300px; border-radius: 8px; overflow: hidden; background: var(--bg); }
.heat-cell { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 1px solid var(--bg); overflow: hidden; color: var(--text); font-size: 11px; line-height: 1.3; background: var(--raised); }
.heat-cell .sym { font-size: 12px; }
.heat-cell .chg { color: var(--text); }
.heat-cell .num { font-size: 11.5px; }
.heat-value { white-space: nowrap; font-size: 11px; }
.heat-0, .heat-na { background: var(--raised); }
.heat-p1 { background: rgba(113, 223, 178, .14); }
.heat-p2 { background: rgba(113, 223, 178, .26); }
.heat-p3 { background: rgba(113, 223, 178, .40); }
.heat-n1 { background: rgba(255, 140, 156, .14); }
.heat-n2 { background: rgba(255, 140, 156, .26); }
.heat-n3 { background: rgba(255, 140, 156, .40); }
.grp-buy { background: rgba(113, 223, 178, .26); }
.grp-watch { background: rgba(244, 248, 255, .14); }
.grp-avoid, .grp-none, .grp-neutral { background: var(--raised); color: var(--muted); }
.legend-scale { display: flex; gap: 2px; }
.scale-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 36px; padding: 2px; border-radius: 4px; font-size: 11px; color: var(--text); }
.scale-label { font-size: 11px; white-space: nowrap; }
.legend-groups { list-style: none; padding: 0; display: grid; gap: 4px; font-size: 12px; }
.swatch { display: inline-flex; width: 24px; height: 20px; align-items: center; justify-content: center; border-radius: 4px; border: 1px solid var(--line); }
.mtable { display: grid; margin-inline: -4px; }
.mhead, .mrow { display: grid; grid-template-columns: minmax(84px, 1.2fr) 1fr 1fr 1.1fr; align-items: center; gap: 4px; padding: 0 4px; }
.mhead { position: sticky; top: var(--strip-h); z-index: 5; background: var(--panel); border-bottom: 1px solid var(--line); }
.th { min-height: 44px; background: none; border: 0; padding: 0; font-size: 12px; color: var(--muted); text-align: right; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th:first-child { text-align: start; }
.th[aria-sort="ascending"], .th[aria-sort="descending"] { color: var(--text); font-weight: 700; }
.mrow { min-height: 52px; border-bottom: 1px solid var(--line); }
.mrow:last-child { border-bottom: 0; }
.coin-id { display: grid; line-height: 1.4; min-width: 0; }
.coin-id .coin-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Numeric cells: LTR with physical right alignment, so digits line up on one edge. */
.cell-num { direction: ltr; text-align: right; min-width: 0; white-space: nowrap; overflow: hidden; }
.cell-num .act { font-size: 11.5px; font-weight: 600; direction: rtl; }
.coin-row { display: grid; grid-template-columns: minmax(84px, 1.2fr) 1fr 1fr 1.1fr; align-items: center; gap: 4px; min-height: 56px; border-bottom: 1px solid var(--line); }
.stale .num { opacity: .6; }

/* ---- coin ---- */
.hero { display: grid; gap: 2px; }
.hero-price .num { font-size: 26px; font-weight: 700; }
.hero-price .unit { font-size: 14px; }
.hero-change { font-size: 12px; }
.readout { display: grid; grid-template-columns: repeat(4, auto); gap: 4px 10px; justify-content: start; min-height: 28px; font-size: 12px; }
.ro-cell { white-space: nowrap; }
.ro-label { color: var(--muted); font-size: 11px; }
.ro-value { unicode-bidi: isolate; direction: ltr; display: inline-block; font-variant-numeric: tabular-nums; }
.chart-host { height: 270px; width: 100%; position: relative; }
.chart-empty { min-height: 120px; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 8px; }
.chart-caption { font-size: 12px; color: var(--muted); }
.kv { display: flex; justify-content: space-between; gap: 8px; min-height: 32px; align-items: center; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv-label { color: var(--muted); font-size: 13px; }

/* ---- more ---- */
.menu { display: grid; }
.menu-row { display: grid; grid-template-columns: 1fr auto; align-items: center; min-height: 60px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.menu-title { font-weight: 600; }
.menu-note { grid-column: 1; font-size: 12px; color: var(--muted); }
.chev { grid-row: 1 / span 2; grid-column: 2; color: var(--muted); font-size: 18px; }
.news-list, .alert-list { display: grid; gap: 8px; }
.news-card { display: grid; gap: 4px; min-height: 56px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.news-title { font-size: 14px; overflow-wrap: anywhere; }
.news-title.original { text-align: left; line-height: 1.5; }
.news-meta { font-size: 11px; color: var(--muted); }
.news-meta .num { font-size: 11px; }
.alert-card { display: grid; gap: 4px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-inline-start: 4px solid var(--muted); border-radius: 12px; }
.alert-card.sev-warning { border-inline-start-color: var(--amber); }
.alert-card.sev-critical { border-inline-start-color: var(--down); }
.alert-line { font-size: 13px; overflow-wrap: anywhere; }
.checks { list-style: none; padding: 0; display: grid; }
.check { display: grid; grid-template-columns: 20px 1fr; gap: 0 6px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.check.ok .check-mark { color: var(--up); }
.check.off .check-mark { color: var(--amber); }
.check.wait .check-mark { color: var(--muted); }
.check-note { grid-column: 2; font-size: 12px; color: var(--muted); }
.notice { direction: ltr; text-align: left; font-size: 12.5px; line-height: 1.6; padding: 8px; border: 1px solid var(--line); border-radius: 8px; overflow-wrap: anywhere; }
.field { font-size: 12px; color: var(--muted); }
.input { width: 100%; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-size: 16px; }

/* ---- my positions ---- */
.holdings { display: grid; gap: 8px; }
.holding { background: var(--panel); border: 1px solid var(--line); border-inline-start: 4px solid var(--muted); border-radius: 12px; padding: 12px; display: grid; gap: 2px; }
.holding.reduce { border-inline-start-color: #ffb3bd; }
.holding.sell { border-inline-start-color: var(--down); }
.holding-head { display: flex; justify-content: space-between; align-items: center; }
.holding-sym { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; font-size: 16px; }
.holding-action { padding: 6px 0; }
.trade-list { display: grid; }
.trade-row { display: grid; gap: 2px; width: 100%; min-height: 56px; padding: 8px 0; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: start; cursor: pointer; }
.trade-row:last-child { border-bottom: 0; }
.trade-main { font-size: 13px; }
.trade-sub { font-size: 11px; color: var(--muted); }
.form-field { display: grid; gap: 2px; }
.ticket-text { margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-family: inherit; font-size: 13px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }

/* ---- scorecard ---- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { display: grid; gap: 2px; align-content: start; padding: 8px; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.tile-label { font-size: 11px; color: var(--muted); }
.tile-value .num { font-size: 20px; font-weight: 700; }
.tile-evidence { font-size: 11px; color: var(--muted); line-height: 1.6; }
.tile-evidence .num { font-size: 11px; }
.score-model { font-size: 13px; overflow-wrap: anywhere; }
.rel { display: grid; gap: 2px; max-width: 280px; }
.rel-plot { position: relative; aspect-ratio: 1; border: 1px solid var(--line); background: var(--bg); overflow: hidden; }
.rel-diagonal { position: absolute; inset: 0; background: linear-gradient(to top left, transparent calc(50% - 0.5px), var(--muted) calc(50% - 0.5px), var(--muted) calc(50% + 0.5px), transparent calc(50% + 0.5px)); opacity: .6; }
.rel-point { position: absolute; border-radius: 50%; background: var(--cyan); border: 2px solid var(--cyan); transform: translate(-50%, 50%); }
.rel-point.thin { background: transparent; }
.rel-hist { display: flex; align-items: flex-end; gap: 1px; height: 28px; }
.rel-bar { flex: 1; min-height: 1px; background: var(--muted); opacity: .6; }
.rel-axis { font-size: 11px; color: var(--muted); }
.rel-axis .num { font-size: 11px; }
.cal-table { display: grid; padding-bottom: 8px; }
.cal-row { display: grid; grid-template-columns: repeat(3, 1fr); min-height: 28px; align-items: center; border-bottom: 1px solid var(--line); }
.cal-head { font-size: 11px; color: var(--muted); }
.out-list { display: grid; }
.out-row { display: grid; grid-template-columns: 24px 1fr; gap: 0 6px; padding: 6px 0; border-bottom: 1px solid var(--line); align-items: center; }
.out-row:last-child { border-bottom: 0; }
.out-mark { grid-row: 1 / span 2; font-size: 15px; }
.out-row.win .out-mark { color: var(--up); }
.out-row.loss .out-mark { color: var(--down); }
.out-main { font-size: 13px; }
.out-sym { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
.out-result { grid-column: 2; font-size: 12px; }

.act.shadow-buy, .act.primed, .act.neutral, .act.hold { color: var(--text); }
.act.exit { color: var(--down); }

/* ---- action board ---- */
.edge-table { display: grid; font-size: 12px; }
.edge-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 4px; min-height: 28px; align-items: center; border-bottom: 1px solid var(--line); }
.edge-row:last-child { border-bottom: 0; }
.edge-head { font-size: 11px; color: var(--muted); }
.edge-head span:not(:first-child) { text-align: left; }
.gauge-wrap { display: grid; gap: 6px; }
.gauge-headline { font-weight: 700; }
button.gauge-cell { min-height: 56px; min-width: 44px; padding: 4px 0; background: none; border: 0; cursor: pointer; align-content: center; }
.gauge-cell.seg-buy .gauge-bar { background: var(--up); }
.gauge-cell.seg-exit .gauge-bar { background: var(--down); }
.gauge-cell.seg-reduce .gauge-bar { background: #ffb3bd; }
.gauge-cell.seg-shadow_buy .gauge-bar, .gauge-cell.seg-primed .gauge-bar { background: var(--text); }
.gauge-cell.seg-avoid .gauge-bar, .gauge-cell.seg-neutral .gauge-bar { background: var(--muted); }
.gauge-cell .gauge-word { white-space: normal; line-height: 1.3; }
.market-warning { padding: 8px 10px; border: 1px solid var(--amber); border-radius: 10px; color: var(--amber); font-size: 13px; }
.board-group { display: grid; gap: 8px; scroll-margin-top: calc(var(--strip-h) + 8px); }
.group-head { display: flex; align-items: center; gap: 4px; min-height: 44px; font-size: 15px; font-weight: 700; }
details.board-group > summary { cursor: pointer; }
.group-rows { display: grid; gap: 8px; }
.group-empty { color: var(--muted); padding: 0 0 8px; }
.board-row { background: var(--panel); border: 1px solid var(--line); border-inline-start: 4px solid var(--muted); border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; min-width: 0; }
.board-row.buy { border-inline-start-color: var(--up); }
.board-row.exit { border-inline-start-color: var(--down); }
.board-row.reduce { border-inline-start-color: #ffb3bd; }
.board-row.shadow-buy, .board-row.primed { border-inline-start-color: var(--text); }
.row-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.row-sym { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 44px; font-size: 16px; }
.row-rank { color: var(--muted); font-size: 12px; }
.row-price { font-size: 13px; white-space: nowrap; }
.row-action .act { font-size: 16px; white-space: normal; }
.row-meta { font-size: 12px; }
.row-size, .record { font-size: 13px; }
.levels.three { grid-template-columns: 1.4fr 1fr 1fr; }
.level-note { font-size: 11px; color: var(--muted); }
.level-note .num { font-size: 11px; }
.tag.wrap { white-space: normal; border-radius: 8px; }
.tag.proven { border-color: var(--up); color: var(--up); }
.code-line { overflow-wrap: anywhere; }
.code-label { unicode-bidi: isolate; font-size: 12px; color: var(--muted); }
.owner-prompt.compact { display: grid; gap: 6px; justify-items: start; }

/* ---- grade badge ---- */
.grades { display: flex; gap: 8px; flex-wrap: wrap; }
.grades.full { display: grid; }
.grade { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.grade-box { display: inline-flex; align-items: center; justify-content: center; gap: 2px; min-width: 40px; min-height: 24px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--raised); }
.grade-box .grade-num { font-weight: 700; font-size: 14px; }
.grade-dir { font-size: 11px; }
.grade-title { color: var(--muted); }
.grade.full { display: flex; gap: 10px; align-items: flex-start; }
.grade.full .grade-box { min-width: 56px; min-height: 44px; }
.grade.full .grade-box .grade-num { font-size: 20px; }
.grade-words { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.grade-bar { flex-basis: 100%; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; display: block; }
.grade-fill { display: block; height: 100%; background: var(--muted); }
.grade-flip { flex-basis: 100%; color: var(--muted); }
/* band colours only for a grade that is no longer experimental */
.grade.strong .grade-box { border-color: var(--up); }
.grade.strong .grade-fill { background: var(--up); }
.grade.weak .grade-box { border-color: var(--down); }
.grade.weak .grade-fill { background: var(--down); }

/* ---- readiness ---- */
.ready-summary { font-weight: 700; font-size: 15px; }
.risk-item { display: grid; gap: 2px; padding-top: 6px; border-top: 1px solid var(--line); }
.notice { display: grid; gap: 4px; }
.check-note .btn { margin-top: 4px; }
.beats { display: grid; font-size: 13px; }
.beats-row { display: grid; grid-template-columns: 1.2fr .8fr 1.6fr; gap: 4px; min-height: 32px; align-items: center; border-bottom: 1px solid var(--line); }
.beats-head { font-size: 11px; color: var(--muted); }
.yes { color: var(--up); }
.no { color: var(--amber); }
.marker-legend { color: var(--muted); }
.decision-blockers ul { margin-top: 2px; }
.decision.shadow-buy, .decision.primed, .decision.neutral { border-inline-start-color: var(--text); }
.decision.exit { border-inline-start-color: var(--down); }

/* ---- bottom bar ---- */
.nav { position: fixed; inset-inline: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--nav-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom); background: var(--panel); border-top: 1px solid var(--line); }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--nav-h); font-size: 11px; color: var(--muted); border-top: 3px solid transparent; }
.nav-icon { font-size: 16px; line-height: 1; }
/* The current destination: a bar on top and bold text, not only a colour. */
.nav a[aria-current="page"] { color: var(--cyan); font-weight: 700; border-top-color: var(--cyan); }

/* ---- bottom sheet ---- */
.sheet { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); border: 0; }
.sheet-panel { position: relative; width: 100%; max-height: 80vh; overflow-y: auto; background: var(--raised); border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; padding: 12px var(--gutter) calc(16px + var(--safe-bottom)); display: grid; gap: 8px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

@media (min-width: 720px) {
  main, .strip-btn { max-width: 720px; margin-inline: auto; }
}

/* Reduced motion: the ticker is a static list scrolled by hand; nothing else in the product animates. */
@media (prefers-reduced-motion: reduce) {
  .tk-track { animation: none !important; }
  .tk-view { direction: rtl; overflow-x: auto; scrollbar-width: none; }
  .tk-set { flex-direction: row; }
  .tk-set[aria-hidden="true"] { display: none; }
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* ---- audit center (V74.1) ---- */
.audit-mark.green { color: var(--up); }
.audit-mark.yellow { color: var(--amber); }
.audit-mark.red { color: var(--down); }
.audit-red { font-size: 20px; font-weight: 700; }
.audit-red.none { color: var(--muted); font-weight: 600; }
.audit-check.red .audit-explain { color: var(--text); }
.audit-verdict, .audit-group-red { margin-inline-start: 6px; }
.audit-raw { margin: 4px 0 0; max-height: 240px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; direction: ltr; text-align: left; }

/* ---- paper ledgers (V74.1) ---- */
.ledger-line { font-size: 15px; }
.ledger-b { border-style: dashed; }
.ledger .edge-row { grid-template-columns: 1.3fr 1fr; }

/* V74.2 pinned reference coins on the action board: three compact tiles in the existing tile style */
.pinned { display: grid; gap: 6px; min-width: 0; }
.pinned-head { font-size: 13px; color: var(--muted); }
.tiles.pinned-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.pinned-tile { text-decoration: none; color: inherit; padding: 8px 6px; }
.pinned-tile .tile-value .num { font-size: 15px; }
.pinned-tile .pinned-change { font-size: 12px; }
.pinned-tile .act { font-size: 12px; }
.pinned-tile .coin-name { font-size: 11px; }

/* ---- V74.3: market-move explanations, model gates, data freshness (cards inside existing screens) ---- */
.layer-tag { font-size: 11px; }
.expl { border-inline-start: 3px solid var(--muted); padding-inline-start: 10px; margin: 8px 0; min-width: 0; }
.expl-down { border-inline-start-color: var(--down); }
.expl-up { border-inline-start-color: var(--up); }
.expl-head { font-size: 16px; margin: 4px 0; }
.expl-verdict { font-weight: 600; }
.expl-section h4 { font-size: 13px; color: var(--muted); margin: 8px 0 4px; }
.expl-facts li, .expl-hyp p { overflow-wrap: anywhere; }
.expl-hyp { margin: 6px 0; }
.expl-hyp.hyp-supported p::before { content: '◆ '; color: var(--amber); }
.expl-hyp.hyp-weak p, .expl-hyp.hyp-context p { color: var(--muted); }
.expl-news-list { margin: 2px 0 0; padding-inline-start: 12px; font-size: 12px; }
.expl-news .news-link { overflow-wrap: anywhere; }
.expl-line-wrap { display: grid; gap: 4px; margin: 6px 0; }
.expl-line { display: flex; align-items: center; min-height: 44px; text-decoration: none; color: inherit; font-size: 13px; overflow-wrap: anywhere; }
.gate-row { grid-template-columns: 1.6fr 1fr 0.8fr; }
.gate-row.fail span:first-child { color: var(--down); }
.gate-row.pass span:first-child { color: var(--up); }
.freshness-card .edge-row { grid-template-columns: 1.6fr 1fr 0.7fr; }
.fresh-stale span:last-child { color: var(--amber); }
.fresh-dead span:last-child, .fresh-missing span:last-child { color: var(--down); }
.ew-card.ew-high { border-color: var(--down); }
.ew-card.ew-elevated { border-color: var(--amber); }
.ew-cond.active { color: var(--text); font-weight: 600; }
.ew-cond.quiet, .ew-cond.unavailable { color: var(--muted); }
.reeval { border: 1px dashed var(--amber); border-radius: 10px; padding: 8px 10px; margin: 8px 0; min-width: 0; }
.ew-record-card .edge-row { grid-template-columns: 0.9fr 1fr 1fr 1fr; }

/* V75 sections (v75-ui.js): simulated values are boxed and tinted apart from real holdings */
.v75 h2 { font-size: 15px; margin: 0; }
.v75 h3 { font-size: 13px; margin: 6px 0 0; color: var(--muted); }
.v75 p { margin: 0; overflow-wrap: anywhere; }
.v75-honest { color: var(--amber); font-size: 13px; }
.v75-sim { border: 1px dashed var(--cyan); border-radius: 10px; padding: 8px; display: grid; gap: 4px; background: var(--raised); }
/* V75.3: the account line is one wrapped line, not a grid of stacked fragments (M9) */
.v75-sim.v75-inline { display: block; line-height: 1.9; }
.v75-shortlabel { display: inline-block; max-width: 100%; white-space: normal; height: auto; }
/* V75.3 signal table: asset and direction stay in view while the table scrolls sideways */
.v75-table { font-size: 12px; }
.v75-table th, .v75-table td { white-space: nowrap; }
.v75-table .sticky { position: sticky; background: var(--raised); z-index: 1; }
.v75-table .sticky.s0 { right: 0; width: 56px; min-width: 56px; max-width: 56px; box-sizing: border-box; }
.v75-table .sticky.s1 { right: 56px; }
.v75-table tr.v75-detail td { white-space: normal; padding-top: 0; }
.v75-dir-short { color: var(--down); border-color: var(--down); }
.v75-dir-long { color: var(--up); border-color: var(--up); }
.v75-attr-table td { white-space: normal; }
.v75-attr-table tr.f-contradicting td:nth-child(2) { color: var(--down); }
.v75-attr-table tr.f-confirming td:nth-child(2) { color: var(--up); }
.v75-attr-table tr.f-unavailable td:nth-child(2), .v75-attr-table tr.f-stale td:nth-child(2) { color: var(--amber); }
.v75-signal.v75-short { border-color: var(--down); }
.v75-title { font-weight: 600; }
.v75-unproven { color: var(--amber); border-color: var(--amber); }
.v75-shortlabel { color: var(--down); border-color: var(--down); }
.v75-paperchip { color: var(--cyan); border-color: var(--cyan); }
.v75-advisory { border: 1px solid var(--amber); border-radius: 10px; padding: 8px; display: grid; gap: 4px; }
.v75-explain { white-space: pre-wrap; font-family: inherit; font-size: 13px; margin: 6px 0; }
.v75 .muted { color: var(--muted); font-size: 12px; }
.v75 details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.v75-links { display: flex; flex-wrap: wrap; gap: 8px; }
.v75-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; }
/* V75: tap targets of the move-explanation card (pre-existing 38 px links and a 24 px summary) */
.expl-news .news-link { display: inline-flex; align-items: center; min-height: 44px; }
.expl-more > summary { min-height: 44px; display: flex; align-items: center; }

/* V75.1 Trade Room «اتاق ترید» (v75-ui.js): summary tiles, scrollable trade tables, P&L row tint */
.trade-room { display: grid; gap: 8px; min-width: 0; }
.v75 pre { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }
.tr-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.tr-stat { display: grid; gap: 2px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); min-width: 0; }
.tr-stat-label { font-size: 12px; color: var(--muted); }
.tr-stat-value { font-weight: 700; overflow-wrap: anywhere; }
.tr-recon.ok { color: var(--up); font-size: 13px; }
.tr-recon.warn { color: var(--amber); font-size: 13px; font-weight: 700; }
.tr-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; max-width: 100%; border: 1px solid var(--line); border-radius: 10px; }
.tr-scroll:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.tr-table { border-collapse: collapse; width: max-content; min-width: 100%; font-size: 13px; }
.tr-table th, .tr-table td { padding: 8px 10px; text-align: right; vertical-align: top; white-space: nowrap; border-bottom: 1px solid var(--line); }
.tr-table thead th { position: sticky; top: 0; background: var(--raised); color: var(--muted); font-weight: 600; font-size: 12px; }
.tr-table tbody th { position: sticky; right: 0; background: var(--panel); z-index: 1; }
/* subtle tint by net P&L; the sign and arrow carry the same meaning without colour */
.tr-row.pnl-pos { background: rgba(113, 223, 178, 0.10); }
.tr-row.pnl-neg { background: rgba(255, 140, 156, 0.10); }
.tr-row.pnl-pos > th { background: #19303a; }
.tr-row.pnl-neg > th { background: #272738; }
.tr-row.pnl-pos .tr-pnl { color: var(--up); }
.tr-row.pnl-neg .tr-pnl { color: var(--down); }
.tr-side.long { color: var(--up); font-weight: 600; }
.tr-side.short { color: var(--down); font-weight: 600; }
.tr-src { display: block; }
.tr-stale .chip.warn, .chip.warn { color: var(--amber); border-color: var(--amber); }
.tr-more > summary { min-height: 44px; min-width: 44px; display: flex; align-items: center; color: var(--cyan); }
.tr-more[open] { white-space: normal; min-width: 180px; }
.tr-history { display: grid; gap: 8px; min-width: 0; }
.tr-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { .tr-scroll { scroll-behavior: auto; } }
/* V75.3 risk-decision chips in the signal table */
.chip.ok { color: var(--up); border-color: var(--up); }
.chip.muted { color: var(--muted); }
/* V75.3 market state: quote tiles, the four separate dimensions, breadth meter */
.v75-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 6px; }
.v75-tile { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: var(--raised); min-width: 0; }
.v75-tile-label { font-size: 11px; color: var(--muted); }
.v75-meter { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.v75-meter-fill { height: 100%; background: var(--cyan); }
.v75-move .v75-link { min-height: 44px; }
/* V75.3 (browser check at 390/320 px): a V75 card is one column that never grows wider than the screen; without this the
   auto-sized grid track took the min-content width of the tile grid and of the technical JSON and the page scrolled sideways */
.card.v75 { grid-template-columns: minmax(0, 1fr); }
.card.v75 > *, .v75-state > *, .v75 .tech-body > * { min-width: 0; }
.v75 .tech-body { grid-template-columns: minmax(0, 1fr); }
.v75 pre.latin { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-all; }
.v75-sim { grid-template-columns: minmax(0, 1fr); }
.v75-sim > * { min-width: 0; }
