:root {
  --bg: #fbfbf9;
  --surface: #ffffff;
  --text: #1c1d1f;
  --muted: #5d6168;
  --line: #e2e2dd;
  --accent: #1f5fbf;
  --accent-soft: #e8f0fb;
  --c1: #3a6fc4;
  --c2: #d08a2e;
  --grid: #e7e7e2;
  --pend: #9aa0a8;
  --real-bg: #e7f4ea; --real-fg: #1d6b34;
  --sim-bg: #fdf1e1; --sim-fg: #8a4b0b;
  --mix-bg: #eef0fb; --mix-fg: #3a3f8f;
  --coming-bg: #eef0f3; --coming-fg: #4a5058;
  --live-bg: #dff3e4; --live-fg: #17602d;
  --code-bg: #f2f2ee;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131416;
    --surface: #1b1d20;
    --text: #e7e8ea;
    --muted: #a1a6ad;
    --line: #2e3136;
    --accent: #79a8f2;
    --accent-soft: #1d2a3d;
    --c1: #6b9be6;
    --c2: #e3a54f;
    --grid: #2b2e33;
    --pend: #6d737b;
    --real-bg: #15301d; --real-fg: #8fd6a2;
    --sim-bg: #33240f; --sim-fg: #f1bd7a;
    --mix-bg: #20234a; --mix-fg: #b2b8f5;
    --coming-bg: #262a30; --coming-fg: #b9bfc7;
    --live-bg: #16351f; --live-fg: #8fdca4;
    --code-bg: #202226;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131416; --surface: #1b1d20; --text: #e7e8ea; --muted: #a1a6ad; --line: #2e3136;
  --accent: #79a8f2; --accent-soft: #1d2a3d; --c1: #6b9be6; --c2: #e3a54f; --grid: #2b2e33; --pend: #6d737b;
  --real-bg: #15301d; --real-fg: #8fd6a2; --sim-bg: #33240f; --sim-fg: #f1bd7a; --mix-bg: #20234a; --mix-fg: #b2b8f5;
  --coming-bg: #262a30; --coming-fg: #b9bfc7; --live-bg: #16351f; --live-fg: #8fdca4; --code-bg: #202226;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  overflow-wrap: break-word;
}
a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
code, pre { font-family: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace; font-size: 0.88em; }
code { background: var(--code-bg); padding: 0.05em 0.3em; border-radius: 4px; }
.wrap { max-width: 880px; margin: 0 auto; padding: 24px 16px 8px; }
h1 { font-size: 2rem; line-height: 1.2; margin: 0.2em 0 0.3em; letter-spacing: -0.01em; }
h2 { font-size: 1.3rem; margin: 2em 0 0.6em; padding-top: 0.6em; border-top: 1px solid var(--line); }
h3 { font-size: 1.05rem; margin: 1.4em 0 0.5em; }
p { margin: 0.5em 0; }
ul { padding-left: 1.2em; }
li { margin: 0.3em 0; }
.small { font-size: 0.88rem; color: var(--muted); }
.lede { font-size: 1.1rem; color: var(--muted); max-width: 46em; }
.hero { padding: 16px 0 4px; }

/* cards */
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 0; }
.card h3 { margin: 0.35em 0 0.25em; font-size: 1.1rem; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { color: var(--accent); text-decoration: underline; }
.card.teaser { background: transparent; border-style: dashed; padding: 12px 16px; }
.card.teaser h3 { margin: 0.3em 0 0.1em; color: var(--muted); }
.for { font-weight: 400; color: var(--muted); font-size: 0.85em; white-space: nowrap; }
.prob { margin: 0.2em 0; }
.head { background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 8px 10px; border-radius: 0 6px 6px 0; margin: 0.6em 0; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 0.85rem; color: var(--muted); }
.days { font-weight: 600; color: var(--text); }
.badge { margin-left: auto; padding: 2px 9px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.badge.coming { background: var(--coming-bg); color: var(--coming-fg); }
.badge.live { background: var(--live-bg); color: var(--live-fg); }
.links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 0.92rem; margin-top: 0.4em; }
.links:empty { display: none; }
.tag { font-size: 0.78rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }

/* build pages */
.crumb { font-size: 0.9rem; margin-bottom: 8px; }
.bhead h1 { font-size: 1.75rem; }
.hook { font-size: 1.12rem; }
.label { padding: 8px 10px; border-radius: 6px; font-size: 0.92rem; }
.lab-real { background: var(--real-bg); color: var(--real-fg); }
.lab-sim { background: var(--sim-bg); color: var(--sim-fg); }
.lab-mixed { background: var(--mix-bg); color: var(--mix-fg); }
.fig { margin: 1em 0; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.fig.png img { display: block; width: 100%; height: auto; background: #fff; border-radius: 6px; }
.figtitle { font-weight: 600; margin: 0 0 8px; }
figcaption { font-size: 0.88rem; color: var(--muted); margin-top: 8px; }
figcaption .src { display: block; margin-top: 2px; }
.chart { display: block; max-width: min(100%, 600px); height: auto; overflow: visible; }
.chart text { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.chart .gl { font-size: 15px; fill: var(--text); }
.chart .gl.hi { font-weight: 700; }
.chart .v { font-size: 13px; fill: var(--muted); }
.chart .ax { font-size: 12px; fill: var(--muted); }
.chart .lg { font-size: 14px; fill: var(--text); }
.chart .pt { font-size: 12px; fill: var(--muted); font-style: italic; }
.chart .s1 { fill: var(--c1); }
.chart .s2 { fill: var(--c2); }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .ref { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 3; }
.chart .pend { fill: none; stroke: var(--pend); stroke-width: 1; stroke-dasharray: 5 4; }

.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
th, td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { background: var(--code-bg); font-weight: 600; white-space: nowrap; }
tbody th { font-weight: 400; min-width: 11em; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
td { white-space: nowrap; font-variant-numeric: tabular-nums; }
td.pending { color: var(--pend); font-style: italic; }
.note { font-size: 0.86rem; color: var(--muted); }
.limits li::marker { color: var(--sim-fg); }
pre { background: var(--code-bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; white-space: pre; line-height: 1.45; }
pre code { background: none; padding: 0; font-size: 0.85rem; }
.srcline { margin-top: 2em; }
.about .prov { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }

.foot { max-width: 880px; margin: 32px auto 0; padding: 16px 16px 32px; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--muted); }
.foot p { margin: 0.3em 0; }

@media (max-width: 520px) {
  h1 { font-size: 1.6rem; }
  .bhead h1 { font-size: 1.45rem; }
  .badge { margin-left: 0; }
  th, td { padding: 5px 8px; }
}
