/* Mobile first. Long values wrap; tables become labelled records below 760px. */
:root {
  color-scheme: dark;
  --bg: #0a1219;
  --panel: #111d25;
  --panel-soft: #14232d;
  --ink: #edf2f3;
  --muted: #a7b9c4;
  --line: #2b3c47;
  --accent: #67d8bc;
  --amber: #f5cb7b;
  --red: #ffb1b5;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
}
* { box-sizing: border-box; min-width: 0; }
html { background: var(--bg); overflow-wrap: anywhere; }
body { margin: 0; color: var(--ink); line-height: 1.65; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
[hidden] { display: none !important; }
.skip-link { position: absolute; top: -100px; padding: 10px 16px; background: var(--ink); color: var(--bg); z-index: 5; }
.skip-link:focus { top: 4px; }
.status-banner { padding: 10px max(16px, calc((100vw - 1240px) / 2)); font-size: .88rem; border-bottom: 1px solid var(--line); }
.status-banner.fresh { background: #132c29; color: #b2e1d4; }
.status-banner.warning, .status-banner.source-warning { background: #382d1a; color: var(--amber); }
.status-banner.stale, .status-banner.unknown { background: #47222a; color: var(--red); }
.masthead { max-width: 1280px; margin: auto; padding: 24px 16px 0; }
.brand-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font-size: 1.05rem; font-weight: 700; letter-spacing: .1em; }
.brand small { display: block; color: var(--muted); font-size: .64rem; font-weight: 500; letter-spacing: .22em; }
.readonly { color: var(--accent); border: 1px solid #355c55; padding: 4px 9px; border-radius: 4px; font-size: .74rem; white-space: nowrap; }
.site-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; margin-top: 24px; border-bottom: 1px solid var(--line); }
.site-nav a { text-align: center; padding: 12px 0; color: var(--muted); font-size: .86rem; border-bottom: 2px solid transparent; }
.site-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.site-nav a:hover { background: #15242d; }
main { max-width: 1280px; margin: auto; padding: 25px 16px 36px; }
.page-heading { margin-bottom: 25px; }
.eyebrow { color: var(--accent); font-size: .72rem; letter-spacing: .18em; margin: 0 0 8px; }
h1 { margin: 0 0 8px; font-size: clamp(1.7rem, 4vw, 2.5rem); line-height: 1.2; font-weight: 600; letter-spacing: -.04em; }
h2 { font-size: 1.03rem; font-weight: 600; margin: 0; }
h3 { font-size: .93rem; font-weight: 600; margin: 14px 0 8px; }
p { margin: 8px 0; }
.page-heading > p:not(.eyebrow), .subtle, time { color: var(--muted); font-size: .84rem; }
#snapshot-meta { font-size: .73rem; }
.fixture-notice { margin: 0 0 18px; padding: 12px 14px; border-left: 3px solid var(--amber); background: #30291c; color: #f6d99e; font-size: .84rem; }
#content { display: grid; gap: 18px; }
.panel { border: 1px solid var(--line); border-radius: 8px; padding: 17px; background: var(--panel); max-width: 100%; }
.section-head { margin-bottom: 16px; }
.section-head p { color: var(--muted); font-size: .8rem; margin-bottom: 0; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0 0; }
.metric { padding: 12px 0; border-top: 1px solid var(--line); }
.metric:last-child { grid-column: 1 / -1; }
.metric dt { color: var(--muted); font-size: .8rem; }
.metric dd { margin: 4px 0 0; font-size: 2rem; line-height: 1.2; color: var(--accent); font-family: "SFMono-Regular", Consolas, monospace; font-variant-numeric: tabular-nums; letter-spacing: -.06em; }
.datum { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.unknown { color: var(--muted); }
.strategy-grid { display: grid; gap: 12px; }
.inset { padding: 14px; background: var(--panel-soft); border-radius: 6px; }
.inset h3 { margin-top: 0; }
.card-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-title h3 { margin: 0; }
.badge { display: inline-block; color: #c1d4dc; background: #263842; border: 1px solid #3c515d; border-radius: 4px; padding: 2px 8px; font-size: .76rem; }
.fixture-tag { display: inline-block; border: 1px solid #7b6440; color: var(--amber); padding: 2px 8px; font-size: .75rem; border-radius: 4px; }
.facts { margin: 12px 0 0; }
.facts > div { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid #273640; font-size: .82rem; }
.facts > div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.event { border-left: 2px solid #547a7b; padding: 0 0 0 13px; margin: 16px 0; }
.event p { font-size: .9rem; }
.callout { border-left: 2px solid var(--amber); padding: 10px 12px; background: #2b291f; color: #e7d7ae; font-size: .85rem; }
.empty { border: 1px dashed #42535e; border-radius: 5px; padding: 16px; color: var(--muted); font-size: .86rem; }
.table-wrap { max-width: 100%; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: .8rem; }
th { color: var(--muted); font-weight: 500; text-align: left; }
th, td { padding: 11px 9px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead { display: none; }
table, tbody, tr, td { display: block; }
tr { border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; margin-bottom: 12px; }
td { display: grid; grid-template-columns: minmax(0, .65fr) minmax(0, 1fr); gap: 12px; padding: 8px 0; }
td:last-child { border-bottom: 0; }
td::before { content: attr(data-label); color: var(--muted); }
details { max-width: 100%; }
summary { cursor: pointer; color: #b0ded1; padding: 10px 0; min-height: 44px; }
details .facts > div { grid-template-columns: minmax(0, 1fr); gap: 3px; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; font-size: .73rem; }
.pagination button { border: 1px solid #4a665f; border-radius: 5px; background: #19332f; color: #c2e6dc; padding: 8px 10px; min-height: 44px; cursor: pointer; }
.pagination button:disabled { color: #90a0aa; background: #1a252d; border-color: #34424a; cursor: default; }
.chart-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.chart-heading strong { color: var(--accent); font-size: 1.8rem; font-family: "SFMono-Regular", Consolas, monospace; }
.chart-heading > span, .chart-credit { color: var(--muted); font-size: .72rem; }
#equity-chart { width: 100%; height: 260px; overflow: hidden; }
#equity-chart table, #equity-chart tbody, #equity-chart tr, #equity-chart td { display: revert; }
#equity-chart table { table-layout: auto; }
#equity-chart tr, #equity-chart td { border: 0; padding: 0; margin: 0; }
#equity-chart td::before { content: none; }
.data-stale #content .datum, .values-muted .datum { color: #9ba6ad !important; }
.data-stale #equity-chart, .values-muted #equity-chart { filter: grayscale(1); }
.rule-card + .rule-card { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 20px; }
.review-card + .review-card { border-top: 1px solid var(--line); }
.review-card > summary { color: var(--ink); padding: 14px 0; font-size: .92rem; }
.review-card > summary .subtle { display: block; padding-left: 16px; font-size: .75rem; }
.review-lines p { font-size: .9rem; white-space: pre-wrap; }
.markdown-text { white-space: pre-wrap; overflow-wrap: anywhere; font: .85rem/1.8 "PingFang SC", "Microsoft YaHei", sans-serif; }
.source-error { color: var(--red); font-size: .84rem; }
.login-form { display: grid; gap: 12px; max-width: 420px; }
.login-form label { color: var(--muted); font-size: .84rem; }
.login-form input[type="password"] { width: 100%; box-sizing: border-box; padding: 12px; font: inherit; font-size: 1rem; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
.login-form input[type="password"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.login-form button, .logout { font: inherit; padding: 10px 18px; color: var(--bg); background: var(--accent); border: 0; border-radius: 6px; cursor: pointer; }
.logout { color: var(--muted); background: transparent; border: 1px solid var(--line); padding: 6px 12px; font-size: .73rem; }
.login-message { min-height: 1.4em; margin: 0; color: var(--amber); font-size: .84rem; }
footer { max-width: 1280px; margin: auto; padding: 0 16px 36px; color: var(--muted); font-size: .73rem; }
@media (min-width: 760px) {
  .masthead { padding: 28px 28px 0; }
  .brand small { display: inline; margin-left: 12px; }
  .site-nav { display: flex; gap: 25px; }
  .site-nav a { padding: 14px 16px; }
  main { padding: 36px 28px 42px; }
  .panel { padding: 24px; }
  .metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .metric:last-child { grid-column: auto; }
  .strategy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  table { display: table; }
  thead { display: table-header-group; }
  tbody { display: table-row-group; }
  tr { display: table-row; border: 0; }
  td { display: table-cell; }
  td:last-child { border-bottom: 1px solid var(--line); }
  td::before { content: none; }
  footer { padding: 0 28px 40px; }
}
@media (prefers-reduced-motion: no-preference) {
  a, button { transition: background-color .15s ease; }
}
