/* VECTOR Command Center - "quiet terminal": a dark, institutional research desk. Research / monitoring only.
   No inline styles are used anywhere (the page is served with a strict CSP that also blocks web fonts, so only system fonts are named), nothing comes from another origin,
   and every status is carried by text as well as colour. A light variant remains available via <html data-theme="light">. */
:root {
  color-scheme: dark;
  /* surfaces: graphite layers, hairline borders */
  --bg: #0a0d12; --bg-2: #0d1117; --surface: #11161e; --surface-2: #161c26; --surface-3: #1c2331; --border: #222a37; --border-2: #2d3747;
  /* text: warm off-white, never pure white */
  --text: #e7e3da; --muted: #9aa3b2; --faint: #6f7989;
  /* one restrained accent (brass) for focus and selection only */
  --accent: #c9a96a; --accent-2: #e2c48a; --accent-soft: rgba(201, 169, 106, .12); --accent-line: rgba(201, 169, 106, .40);
  /* muted status colours, always paired with text */
  --ok: #5fbf8f; --ok-bg: rgba(95, 191, 143, .10); --ok-line: rgba(95, 191, 143, .30);
  --warn: #e0a957; --warn-bg: rgba(224, 169, 87, .11); --warn-line: rgba(224, 169, 87, .30);
  --bad: #ec7d72; --bad-bg: rgba(236, 125, 114, .11); --bad-line: rgba(236, 125, 114, .32);
  --info: #94acdb; --info-bg: rgba(148, 172, 219, .10); --info-line: rgba(148, 172, 219, .28);
  --bull: #5fbf8f; --bear: #ec7d72; --neutral: #9aa3b2;
  --navy: #080b10; --navy-2: #0c1016;
  /* chart series: fixed categorical order, validated for colour-vision deficiency against the card surface; never cycled, never re-ordered by rank */
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181;
  --grid: rgba(255, 255, 255, .055); --axis: #6f7989;
  --shadow: 0 1px 0 rgba(255, 255, 255, .025) inset, 0 10px 28px rgba(0, 0, 0, .30);
  --radius: 6px; --radius-sm: 4px;
  --font: system-ui, "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f2ee; --bg-2: #ecebe6; --surface: #ffffff; --surface-2: #f7f6f2; --surface-3: #efede7; --border: #dedbd2; --border-2: #cfcbc0;
  --text: #17191d; --muted: #5d6470; --faint: #858b95; --accent: #8a6a2c; --accent-2: #6e5321; --accent-soft: rgba(138, 106, 44, .10); --accent-line: rgba(138, 106, 44, .42);
  --ok: #1f7a50; --ok-bg: #e5f2ea; --ok-line: #b9dcc8; --warn: #8f5d12; --warn-bg: #f8eedb; --warn-line: #e8cf9f; --bad: #a8332a; --bad-bg: #f8e4e1; --bad-line: #ebbdb7;
  --info: #34508a; --info-bg: #e7ecf6; --info-line: #c3cfe6; --bull: #1f7a50; --bear: #a8332a; --neutral: #5d6470; --navy: #16191e; --navy-2: #1d2128; --shadow: 0 1px 2px rgba(0, 0, 0, .06);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --grid: rgba(0, 0, 0, .07); --axis: #858b95;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.5; font-weight: 400;
  font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: var(--accent-soft); color: var(--text); }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; font-weight: 600; letter-spacing: -.005em; }
h1 { font-size: 1.5rem; letter-spacing: -.018em; font-weight: 620; }
h2 { font-size: .86rem; font-weight: 600; color: var(--muted); font-variant-caps: all-small-caps; letter-spacing: .14em; margin-bottom: 12px; display: flex; align-items: center; gap: 12px; }
h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-2), transparent); }
h3 { font-size: .95rem; } h4 { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .13em; font-weight: 600; }
p { margin: .3em 0 .8em; }
a { color: var(--accent); text-decoration: none; } a:hover { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm); }
code, .mono { font-family: var(--mono); font-size: .82em; letter-spacing: 0; }
.boot { padding: 4rem 1rem; text-align: center; color: var(--muted); letter-spacing: .12em; font-variant-caps: all-small-caps; font-size: .9rem; }

/* ------------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; background: var(--navy); }
.side { background: var(--navy); color: var(--muted); padding: 22px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 24px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.brand-mark { width: 32px; height: 32px; border-radius: 5px; display: grid; place-items: center; font-weight: 750; font-size: .95rem; color: #15120b; flex: none;
  background: linear-gradient(145deg, var(--accent-2), var(--accent) 58%, #8a6f40); box-shadow: 0 0 0 1px rgba(255, 255, 255, .08) inset, 0 6px 18px rgba(201, 169, 106, .18); }
.brand b { display: block; font-size: .98rem; letter-spacing: .34em; color: var(--text); font-weight: 650; }
.brand small { display: block; color: var(--faint); font-size: .74rem; letter-spacing: .05em; font-variant-caps: all-small-caps; margin-top: 2px; white-space: nowrap; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a { display: flex; gap: 10px; align-items: center; padding: 7px 10px 7px 12px; border-radius: var(--radius-sm); color: var(--muted); font-size: .86rem; border-left: 2px solid transparent; }
.nav a:hover { background: rgba(255, 255, 255, .03); color: var(--text); text-decoration: none; }
.nav a.on { background: linear-gradient(90deg, var(--accent-soft), transparent); color: var(--text); font-weight: 600; border-left-color: var(--accent); }
.nav .grp { color: var(--faint); font-size: .6rem; text-transform: uppercase; letter-spacing: .2em; padding: 20px 12px 6px; }
.side .foot { margin-top: 24px; padding: 12px 13px; font-size: .72rem; line-height: 1.6; color: var(--faint); border: 1px solid var(--border); border-left: 2px solid var(--accent-line); border-radius: var(--radius-sm); background: var(--bg-2); }
.side .foot a { color: var(--muted); letter-spacing: .04em; } .side .foot a:hover { color: var(--accent); }
.main { min-width: 0; border-left: 1px solid var(--border); background: radial-gradient(1100px 420px at 75% -140px, rgba(201, 169, 106, .06), transparent 70%), var(--bg); }

/* status strips: the safety statement and the data-mode banner are always visible */
.banner { background: var(--bg-2); color: var(--muted); font-size: .72rem; letter-spacing: .04em; padding: 8px 28px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  justify-content: space-between; border-bottom: 1px solid var(--border); }
.banner b { color: var(--text); letter-spacing: .16em; font-weight: 650; }
.banner .tag { border: 1px solid var(--border-2); color: var(--muted); padding: 1px 9px; border-radius: 99px; font-family: var(--mono); font-size: .68rem; letter-spacing: 0; }
.banner.mode-live, .banner.mode-stale, .banner.mode-historical_local { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: space-between; color: var(--text); position: relative; padding-left: 44px; }
.banner.mode-live::before, .banner.mode-stale::before, .banner.mode-historical_local::before { content: ""; position: absolute; left: 26px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; }
.banner.mode-live { background: var(--ok-bg); border-bottom-color: var(--ok-line); } .banner.mode-live::before { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.banner.mode-stale { background: var(--bad-bg); border-bottom-color: var(--bad-line); } .banner.mode-stale::before { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
.banner.mode-historical_local { background: var(--warn-bg); border-bottom-color: var(--warn-line); } .banner.mode-historical_local::before { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.banner.mode-live b, .banner.mode-stale b, .banner.mode-historical_local b { color: var(--text); letter-spacing: .1em; }
.banner .small { color: var(--muted); }
.content { padding: 28px 30px 68px; max-width: 1440px; }

.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.head h1 { margin-bottom: 5px; } .head p { color: var(--muted); margin: 0; max-width: 820px; font-size: .9rem; }
.tools { display: flex; gap: 8px; align-items: center; }

/* ------------------------------------------------------------------ controls */
button, .btn { font: inherit; font-size: .82rem; cursor: pointer; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); padding: 6px 14px; border-radius: var(--radius-sm);
  letter-spacing: .02em; transition: border-color .15s ease, background-color .15s ease, color .15s ease; }
button:hover { border-color: var(--accent-line); background: var(--surface-2); }
button.primary { background: var(--accent); color: #15120b; border-color: var(--accent); font-weight: 650; padding: 9px 14px; } button.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
button.tab { padding: 5px 13px; color: var(--muted); background: transparent; }
button.tab.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); font-weight: 600; }
input { font: inherit; padding: 10px 12px; border: 1px solid var(--border-2); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); width: 100%; }
input::placeholder { color: var(--faint); } input:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ------------------------------------------------------------------ cards + grids */
.grid { display: grid; gap: 14px; } .g2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); } .g3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); } .g4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.card { background: linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px 18px; box-shadow: var(--shadow); min-width: 0; }
.card.flat { box-shadow: none; background: var(--surface-2); }
.card h3 { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: .86rem; font-variant-caps: all-small-caps; letter-spacing: .12em; color: var(--muted); font-weight: 600;
  padding-bottom: 11px; margin: 0 0 13px; border-bottom: 1px solid var(--border); }
.card h3 > span:first-child { color: var(--text); }
.kpi { display: flex; flex-direction: column; gap: 3px; padding: 3px 0 8px; }
.kpi .label { color: var(--faint); font-size: .64rem; text-transform: uppercase; letter-spacing: .15em; }
.kpi .value { font-size: 1.28rem; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: var(--text); }
.kpi .sub { color: var(--muted); font-size: .78rem; }
.stack { display: flex; flex-direction: column; gap: 14px; } .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.section { margin-top: 30px; }
.section > .grid + .card, .section > .card + .card, .section > .card + .grid, .section > .grid + .grid { margin-top: 14px; }
.section + p.small, .card + p.small { margin-top: 12px; } .muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: .8rem; }
.note { border: 1px solid var(--info-line); border-left: 3px solid var(--info); background: var(--info-bg); padding: 12px 16px; border-radius: var(--radius-sm); margin: 12px 0; color: var(--text); }
.note.warn { border-color: var(--warn-line); border-left-color: var(--warn); background: var(--warn-bg); }
.note.bad { border-color: var(--bad-line); border-left-color: var(--bad); background: var(--bad-bg); }
.note.ok { border-color: var(--ok-line); border-left-color: var(--ok); background: var(--ok-bg); }
.note .muted { color: var(--muted); }

/* ------------------------------------------------------------------ status */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--faint); }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); } .dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); } .dot.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px; border-radius: 99px; font-size: .8rem; font-weight: 650; letter-spacing: .06em; font-variant-caps: all-small-caps;
  background: var(--surface-2); border: 1px solid var(--border-2); color: var(--muted); white-space: nowrap; line-height: 1.7; }
.pill .dot { width: 6px; height: 6px; box-shadow: none; }
.pill.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); } .pill.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.pill.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); } .pill.info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.pill.mute { color: var(--muted); }
/* the indicator tiles on the overview: a quiet instrument panel */
.ind { display: flex; align-items: center; gap: 13px; padding: 13px 15px; background: linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--border); border-radius: var(--radius);
  position: relative; overflow: hidden; }
.ind::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--border-2); }
.ind:has(.dot.ok)::after { background: var(--ok); } .ind:has(.dot.warn)::after { background: var(--warn); } .ind:has(.dot.bad)::after { background: var(--bad); }
.ind .t { font-size: .62rem; color: var(--faint); text-transform: uppercase; letter-spacing: .16em; } .ind .v { font-weight: 550; font-size: .86rem; color: var(--text); font-family: var(--mono); letter-spacing: 0; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-2); }
table { border-collapse: collapse; width: 100%; font-size: .83rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 9px 13px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-2); color: var(--faint); font-size: .62rem; font-weight: 600; text-transform: uppercase; letter-spacing: .15em; position: sticky; top: 0; white-space: nowrap; }
tbody tr:hover td { background: rgba(255, 255, 255, .016); }
tr:last-child td { border-bottom: 0; } tbody tr.click { cursor: pointer; } tbody tr.click:hover td { background: var(--accent-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: .78rem; }
td.muted { color: var(--faint); font-style: italic; }

/* ------------------------------------------------------------------ stance + horizons */
.stance { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: .76rem; letter-spacing: .03em; }
.stance.up { color: var(--bull); } .stance.down { color: var(--bear); } .stance.flat { color: var(--neutral); } .stance.na { color: var(--faint); font-weight: 500; }
.lanes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.lane { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--bg); min-width: 0; }
.lane .lt { font-size: .6rem; text-transform: uppercase; letter-spacing: .15em; color: var(--faint); display: flex; justify-content: space-between; gap: 4px; }
.lane .m { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; margin-top: 5px; font-size: .8rem; }
.chip { display: inline-flex; gap: 4px; align-items: center; border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: 1px 6px; background: var(--surface); font-size: .72rem; font-family: var(--mono); }
.chip.advisory { opacity: .6; border-style: dashed; } .chip.unavail { opacity: .45; text-decoration: line-through; }
.badge { display: inline-block; padding: 2px 8px; border-radius: var(--radius-sm); font-size: .62rem; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; border: 1px solid transparent; }
.badge.CALIBRATION_VALIDATION, .badge.CALIBRATION, .badge.VALIDATION { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.badge.POST_OOS_DIAGNOSTIC { background: var(--warn-bg); color: var(--warn); border: 1px dashed var(--warn); }
.badge.SEALED_OOS { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); } .badge.LEGACY_POOLED { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border-2); }
/* progress toward OOS release: a sealed-vault meter, never an outcome */
progress { width: 100%; height: 8px; accent-color: var(--accent); appearance: none; -webkit-appearance: none; border: 0; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--surface-3); border-radius: 99px; } progress::-webkit-progress-value { background: linear-gradient(90deg, #8a6f40, var(--accent)); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 99px; }

/* ------------------------------------------------------------------ decision trace */
.qa { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.qa .q { background: linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 16px; }
.qa .q h4 { margin-bottom: 8px; } .qa ul, .list { margin: 4px 0 0; padding-left: 18px; } .qa li, .list li { margin: 3px 0; } .list li::marker { color: var(--faint); }
.steps { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0 20px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-2); }
.step { padding: 4px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-2); background: var(--surface); font-size: .72rem; letter-spacing: .03em; }
.step.block { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); font-weight: 650; } .step.pass { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.step.na { opacity: .55; } .arrow { color: var(--faint); font-size: .78rem; }
details { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 0; margin: 8px 0; }
details > summary { cursor: pointer; padding: 11px 15px; font-weight: 600; font-size: .85rem; list-style: none; display: flex; justify-content: space-between; gap: 8px; }
details > summary:hover { color: var(--accent-2); }
details > summary::-webkit-details-marker { display: none; } details > summary::after { content: "+"; color: var(--faint); font-family: var(--mono); } details[open] > summary::after { content: "−"; }
details[open] > summary { border-bottom: 1px solid var(--border); }
details > .body { padding: 10px 15px 15px; }
pre { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; overflow: auto; max-height: 340px; font-size: .72rem; font-family: var(--mono); color: var(--muted); }
.claim { border-left: 2px solid var(--border-2); padding: 4px 11px; margin: 7px 0; } .claim.bull { border-color: var(--bull); } .claim.bear { border-color: var(--bear); } .claim.con { border-color: var(--warn); }

/* ------------------------------------------------------------------ sign-in */
.login { max-width: 430px; margin: 0 auto; padding: 14vh 16px 0; min-height: 100vh; }
.login .card { padding: 30px 28px 26px; border-top: 2px solid var(--accent); }
.login .card > p { color: var(--muted); font-size: .85rem; line-height: 1.55; }
.login .brand { padding: 0 0 18px; }
.err { color: var(--bad); font-size: .84rem; min-height: 1.3em; }
body:has(.login) { background: radial-gradient(900px 500px at 50% -10%, rgba(201, 169, 106, .08), transparent 70%), var(--bg); }

/* ------------------------------------------------------------------ market cards */
.asset .ah { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 12px; } .asset .sym { font-size: 1.1rem; font-family: var(--mono); letter-spacing: .05em; }
.asset .right { text-align: right; font-variant-numeric: tabular-nums; } .asset .af { margin-top: 12px; display: flex; flex-direction: column; gap: 3px; }
.lanes.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ------------------------------------------------------------------ charts (SVG; every mark is a stored value, hover titles carry the exact numbers) */
.grid.term { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; }
.grid.term > :nth-child(3) { grid-column: 1 / -1; }
.card.chart { display: flex; flex-direction: column; gap: 10px; }
.card.chart > h3 { margin-bottom: 2px; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: auto; padding-top: 9px; border-top: 1px dashed var(--border); font-size: .68rem; color: var(--faint); font-family: var(--mono); letter-spacing: 0; }
.meta b { color: var(--muted); font-weight: 600; font-family: var(--font); font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; margin-right: 4px; }
svg.plot { display: block; width: 100%; height: auto; overflow: visible; }
svg.plot.square { max-width: 340px; margin: 0 auto; }
svg .grid { stroke: var(--grid); stroke-width: 1; } svg .base { stroke: var(--border-2); stroke-width: 1; }
svg text { font-family: var(--mono); fill: var(--axis); } svg .axis { font-size: 10px; } svg .axis.lane { font-size: 9.5px; fill: var(--muted); }
svg .dl { font-size: 10.5px; fill: var(--text); }
svg .hit { fill: transparent; } svg .hit:hover { fill: rgba(255, 255, 255, .035); }
svg .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.s1 { --c: var(--s1); } .s2 { --c: var(--s2); } .s3 { --c: var(--s3); } .s4 { --c: var(--s4); } .s5 { --c: var(--s5); }
svg .ln.s1, svg .ln.s2, svg .ln.s3, svg .ln.s4, svg .ln.s5, svg g.s1 .ln, svg g.s2 .ln, svg g.s3 .ln { stroke: var(--c); }
svg g.s1 .pt, svg g.s2 .pt, svg g.s3 .pt { fill: var(--c); fill-opacity: .85; stroke: var(--surface); stroke-width: 2; }
svg g.s2 .ln { stroke-dasharray: 5 3; } svg g.s3 .ln { stroke-dasharray: 1.5 3; }
svg .diag { stroke: var(--faint); stroke-dasharray: 3 4; stroke-width: 1; }
/* candles: up = hollow, down = filled, so colour is never the only cue */
svg .cdl .wick { stroke-width: 1; } svg .cdl.up .wick { stroke: var(--bull); } svg .cdl.down .wick { stroke: var(--bear); }
svg .cdl.up .body { fill: var(--bg); stroke: var(--bull); stroke-width: 1; } svg .cdl.down .body { fill: var(--bear); }
svg .cdl .vol { fill: var(--border-2); } svg .cdl.up .vol { fill: rgba(95, 191, 143, .35); } svg .cdl.down .vol { fill: rgba(236, 125, 114, .35); }
svg .cdl:hover .body { stroke-width: 2; }
/* sparklines and change arrows */
svg.spark { width: 112px; height: 28px; display: block; } svg.spark polyline { fill: none; stroke-width: 1.5; stroke-linejoin: round; }
svg.spark.up polyline { stroke: var(--bull); } svg.spark.up circle { fill: var(--bull); }
svg.spark.down polyline { stroke: var(--bear); } svg.spark.down circle { fill: var(--bear); } svg.spark.flat polyline { stroke: var(--neutral); } svg.spark.flat circle { fill: var(--neutral); }
.spark-na { color: var(--faint); font-size: .7rem; font-family: var(--mono); white-space: nowrap; }
.chg { font-family: var(--mono); font-size: .76rem; white-space: nowrap; } .chg.up { color: var(--bull); } .chg.down { color: var(--bear); } .chg.flat, .chg.na { color: var(--faint); }
b.sel { color: var(--accent); }
/* legends: identity is written, the swatch only repeats it */
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .72rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 3px; border-radius: 2px; display: inline-block; background: var(--c, var(--faint)); }
.sw.diag { background: none; border-top: 1px dashed var(--faint); height: 0; }
.sw.ok, .sw.up { background: var(--ok); height: 8px; width: 8px; } .sw.bad, .sw.down { background: var(--bad); height: 8px; width: 8px; } .sw.skip, .sw.flat { background: var(--faint); height: 8px; width: 8px; }
.sw.bad.x { background: none; border: 2px solid var(--bad); height: 8px; width: 8px; border-radius: 1px; }
.sw.emb { background: var(--bg); border: 1px dashed var(--border-2); height: 9px; width: 9px; } .sw.usable { background: var(--surface-3); height: 9px; width: 9px; } .sw.got { background: var(--accent); height: 9px; width: 9px; }
/* horizontal bars */
.bars { display: flex; flex-direction: column; gap: 7px; }
.brow { display: grid; grid-template-columns: minmax(90px, 34%) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: .78rem; }
.bars.compact .brow { gap: 8px; font-size: .74rem; } .bars.compact { gap: 5px; }
.brow .bl { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brow .bv { font-family: var(--mono); font-size: .72rem; color: var(--text); white-space: nowrap; text-align: right; }
svg.bsv { width: 100%; height: 10px; display: block; }
svg .track { fill: var(--surface-3); } svg .fill { fill: var(--s1); } svg .fill.ok { fill: var(--ok); } svg .fill.warn { fill: var(--warn); } svg .fill.bad { fill: var(--bad); } svg .fill.mute { fill: var(--border-2); }
svg .fill.part { fill: var(--accent); } svg .ref { stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 2 1.5; vector-effect: non-scaling-stroke; }
.reflab { display: flex; align-items: center; gap: 7px; } .refmark { width: 0; height: 12px; border-left: 2px dashed var(--text); display: inline-block; }
.rg + .rg { margin-top: 12px; } .rg h4 { margin-bottom: 6px; }
/* 100% stacks */
svg.stack { width: 100%; height: 14px; display: block; border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
svg.stack rect { fill: var(--border-2); }
svg.stack .ok, svg.stack .up, svg.stack .st-pass, svg.stack .st-active, svg.stack .st-potential_entry { fill: var(--ok); }
svg.stack .bad, svg.stack .down, svg.stack .st-block, svg.stack .st-no_trade, svg.stack .st-avoid, svg.stack .st-unavailable { fill: var(--bad); }
svg.stack .st-watch, svg.stack .st-caution, svg.stack .st-pass_with_warnings, svg.stack .st-advisory { fill: var(--warn); } svg.stack .skip, svg.stack .flat { fill: var(--faint); }
.sw.st-pass, .sw.st-active, .sw.st-potential_entry { background: var(--ok); height: 8px; width: 8px; } .sw.st-block, .sw.st-no_trade, .sw.st-avoid, .sw.st-unavailable { background: var(--bad); height: 8px; width: 8px; }
.sw.st-watch, .sw.st-caution, .sw.st-pass_with_warnings, .sw.st-advisory { background: var(--warn); height: 8px; width: 8px; }
/* bullet gauges */
.gauges { gap: 12px 20px; margin-top: 4px; } .bullet { display: flex; flex-direction: column; gap: 5px; }
.bullet .bh { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--muted); } .bullet .bh b { color: var(--text); font-family: var(--mono); margin-left: auto; }
svg.bsvg { width: 100%; height: 16px; display: block; } svg.bsvg .zone { fill: var(--ok-bg); stroke: var(--ok-line); stroke-width: 1; }
svg .mark.ok { fill: var(--ok); } svg .mark.bad { fill: var(--bad); }
/* job timeline ticks: OK = bar, skipped = faint bar, failed = cross */
svg .tk.ok { fill: var(--ok); } svg .tk.skip { fill: var(--faint); opacity: .7; } svg .tk.bad { stroke: var(--bad); stroke-width: 2; fill: none; }
/* forward OOS cells: counts only */
svg.track-cells { width: 100%; height: auto; display: block; }
svg.track-cells .cell { fill: var(--surface-3); } svg.track-cells .cell.emb { fill: var(--bg); stroke: var(--border-2); stroke-dasharray: 2 1.5; stroke-width: 1; } svg.track-cells .cell.got { fill: var(--accent); stroke: none; }
/* empty state: a grid with no marks, and the reason in words */
.empty { position: relative; border: 1px dashed var(--border-2); border-radius: var(--radius-sm); background: var(--bg); min-height: 150px; display: grid; place-items: center; overflow: hidden; }
.empty svg.ghost { position: absolute; inset: 0; width: 100%; height: 100%; } .empty svg.ghost line { stroke: var(--grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
.empty .et { position: relative; display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; padding: 18px 20px; max-width: 460px; }
.empty .et b { font-size: .84rem; color: var(--text); font-weight: 600; } .empty .et span { font-size: .76rem; color: var(--muted); }
.empty .et .need { color: var(--faint); font-family: var(--mono); font-size: .68rem; margin-top: 4px; }

/* ------------------------------------------------------------------ loading */
.skeleton { min-height: 120px; border-radius: var(--radius); margin: 28px; border: 1px solid var(--border);
  background: linear-gradient(90deg, var(--surface), var(--surface-3), var(--surface)); background-size: 200% 100%; animation: sk 1.4s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* ------------------------------------------------------------------ responsive, motion, print */
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; border-bottom: 1px solid var(--border); padding: 14px 12px; } .main { border-left: 0; }
  .brand { border-bottom: 0; padding-bottom: 10px; } .nav { flex-direction: row; flex-wrap: wrap; } .nav .grp { display: none; }
  .nav a { border-left: 0; border-bottom: 2px solid transparent; border-radius: 0; } .nav a.on { border-bottom-color: var(--accent); background: none; }
  .side .foot { margin-top: 12px; } .lanes { grid-template-columns: repeat(2, minmax(0, 1fr)); } .content { padding: 18px 14px 50px; }
  .banner { padding-left: 14px; padding-right: 14px; }
  .grid.g3:has(> .ind) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .ind { padding: 10px 11px; gap: 9px; } .banner.mode-live, .banner.mode-stale, .banner.mode-historical_local { padding-left: 30px; }
  .banner.mode-live::before, .banner.mode-stale::before, .banner.mode-historical_local::before { left: 14px; }
  .grid.term { grid-template-columns: minmax(0, 1fr); } .brow { grid-template-columns: minmax(80px, 38%) minmax(0, 1fr) auto; }
}
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } * { transition: none !important; } }
@media print { .side, .tools { display: none; } .shell { grid-template-columns: 1fr; } }
/* dense terminal tables inside chart panels */
th.num { font-family: var(--font); font-size: .62rem; }
.card.chart td { white-space: nowrap; padding: 6px 10px; vertical-align: middle; } .card.chart th { padding: 7px 10px; }
.sec { display: inline-block; max-width: 92px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; color: var(--muted); }
.card.chart svg.spark { width: 84px; }

/* ------------------------------------------------------------------ language: English | عربي */
.lang { display: inline-flex; border: 1px solid var(--border-2); border-radius: 99px; overflow: hidden; flex: none; background: var(--bg); }
.langbtn { border: 0; border-radius: 0; padding: 2px 12px; font-size: .74rem; line-height: 1.6; background: transparent; color: var(--muted); letter-spacing: 0; }
.langbtn:hover { background: var(--surface-2); color: var(--text); }
.langbtn.on { background: var(--accent-soft); color: var(--text); font-weight: 650; }
.langbtn + .langbtn { border-left: 1px solid var(--border-2); }
.langbtn:focus-visible { outline-offset: -2px; }
.bright { display: inline-flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.login .card > .lang { align-self: flex-end; }
/* Arabic: a font with Arabic glyphs, and no letter-spacing (it would break the joined letters) */
:root[lang="ar"] { --font: "Segoe UI", Tahoma, "Noto Sans Arabic", "Noto Naskh Arabic", "Geeza Pro", Arial, system-ui, sans-serif; }
:root[lang="ar"] body, :root[lang="ar"] body * { letter-spacing: 0 !important; }
/* Arabic text runs right to left inside its own box; cards, tables, charts and numbers keep their places */
:root[lang="ar"] :is(p, li, h1, h2, h4, summary, .note, .kpi, .ind > div, .banner > span:first-child, .meta, .empty .et, .bl, .lane .lt, .err, .qa .q, .claim, .head > div, .brand > div, .side .foot, .reflab, .bullet .bh > span:first-child) { direction: rtl; }
:root[lang="ar"] .card h3 > span:first-child { direction: rtl; unicode-bidi: plaintext; }
:root[lang="ar"] :is(th, td) { direction: rtl; text-align: right; }
:root[lang="ar"] :is(.list, .qa ul) { padding-left: 0; padding-right: 18px; }
:root[lang="ar"] input { direction: rtl; }
:root[lang="ar"] :is(.mono, code, pre, svg) { direction: ltr; }
:root[lang="ar"] svg text { font-family: var(--mono), var(--font); }
:root[lang="ar"] .side { direction: rtl; }
/* the one intended layout change: the sidebar moves to the right */
@media (min-width: 961px) {
  :root[lang="ar"] .shell { grid-template-columns: 1fr 240px; }
  :root[lang="ar"] .side { order: 2; }
  :root[lang="ar"] .main { order: 1; border-left: 0; border-right: 1px solid var(--border); }
  :root[lang="ar"] .nav a { border-left: 0; border-right: 2px solid transparent; padding: 7px 12px 7px 10px; }
  :root[lang="ar"] .nav a.on { border-right-color: var(--accent); background: linear-gradient(270deg, var(--accent-soft), transparent); }
  :root[lang="ar"] .side .foot { border-left: 1px solid var(--border); border-right: 2px solid var(--accent-line); }
}
/* Arabic words are set in the text font, not the monospace one (which has no Arabic and would space the letters apart); number-only cells keep their tabular figures */
:root[lang="ar"] :is(.ind .v, .meta, .chip, .brow .bv, .chg, .spark-na, .empty .et .need, .banner .tag, .bullet .bh b, .step) { font-family: var(--font); }
:root[lang="ar"] .legend span { direction: rtl; unicode-bidi: isolate; }  /* legend items keep their order; each label reads right to left */
svg .pt.s1, svg .pt.s2, svg .pt.s3 { fill: var(--c); stroke: var(--surface); stroke-width: 1.5; }
:root[lang="ar"] p.notice { direction: ltr; text-align: left; font-family: var(--font); }
.list.feed li { margin: 6px 0; } .list.feed a { color: var(--text); } .list.feed a:hover { color: var(--accent-2); }

/* new-data notice (app.js checkNewData): a quiet bar under the data-mode banner, never a modal */
.banner.newdata { justify-content: space-between; color: var(--text); }
.banner.newdata button { font: inherit; }
.row.kpis { gap: 6px 24px; align-items: flex-start; } .row.kpis > .kpi { min-width: 0; flex: 1 1 140px; }
:root[lang="ar"] .kpi .value { unicode-bidi: plaintext; text-align: right; }  /* numbers keep their own order: "-1.392", "-3.03 … 0.20" (not "1.392-") */
