:root {
  --bg: #0f1115; --panel: #161a21; --panel2: #1b2029; --line: #262c37; --text: #eef0f5; --muted: #9aa3b2;
  --accent: #49d6b9; --accent2: #9294f7; --num: #f5b041; --warn: #ff7a5c; --heat: 73, 214, 185;
  --grad: linear-gradient(135deg, #9294f7, #6db5d8 50%, #49d6b9);
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
:root[data-theme="light"] { --bg: #f4f5f8; --panel: #ffffff; --panel2: #f0f2f6; --line: #dde1e8; --text: #12151b; --muted: #5b6472; --accent: #0c8a72; --accent2: #5557d4; --num: #b06a00; --warn: #c2330f; --heat: 12, 138, 114; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
header, main, footer { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding-top: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .word { display: flex; align-items: center; font-weight: 700; font-size: 26px; letter-spacing: -.02em; line-height: 1; }
.brand .word i { width: 17px; height: 17px; border-radius: 5.5px; margin: 4px 1.5px 0; background: var(--grad); box-shadow: 0 0 14px rgba(73, 214, 185, .35); }
.brand .sub { color: var(--muted); font-size: 14px; font-weight: 600; padding-top: 5px; }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
nav a { color: var(--muted); font-weight: 500; }
nav a:hover { color: var(--text); text-decoration: none; }
nav .cta { color: #0f1115; background: var(--grad); padding: 7px 16px; border-radius: 12px; font-weight: 700; }
nav .cta:hover { color: #0f1115; filter: brightness(1.08); }
#theme { font: 500 12px var(--sans); color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 10px; padding: 5px 10px; cursor: pointer; }
main { padding-top: 28px; padding-bottom: 48px; }
h1 { font: 700 32px/1.2 var(--sans); margin: 0 0 8px; letter-spacing: -.02em; }
h2 { font: 700 22px/1.3 var(--sans); letter-spacing: -.01em; margin: 34px 0 12px; }
h2 small { color: var(--accent); margin-left: 10px; font-size: 14px; font-weight: 600; letter-spacing: 0; }
h3 { font: 700 17px/1.3 var(--sans); margin: 22px 0 4px; }
.lede { color: var(--muted); max-width: 70ch; margin: 0 0 22px; font-size: 17px; }
.muted, .note { color: var(--muted); }
.note { font-size: 13px; margin: 8px 0 0; max-width: 90ch; }
.crumb { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.warnmsg { color: var(--warn); }
.hot { color: var(--num); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 0 0 8px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; min-width: 0; }
.tile span { display: block; font-size: 13px; font-weight: 500; color: var(--muted); }
.tile b { display: block; font: 700 26px/1.25 var(--sans); letter-spacing: -.01em; margin: 4px 0 2px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile:first-child b { color: var(--num); }
.tile em { display: block; font-style: normal; font-size: 13px; color: var(--muted); }
.tile.warn b, .tile.warn em { color: var(--warn); }

.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0 32px; }
@media (max-width: 800px) { .split { grid-template-columns: minmax(0, 1fr); } }
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 24px; }
.sq { position: relative; aspect-ratio: 1; border: 1.5px solid rgba(var(--heat), calc(.18 + var(--h, 0) * .55)); border-radius: 14px; padding: 6px 8px; background: rgba(var(--heat), calc(.04 + var(--h, 0) * .2)); display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; overflow: hidden; }
.sq i { position: absolute; top: 6px; left: 9px; font: normal 11px var(--mono); color: var(--muted); }
.sq b { font: 700 clamp(11px, 2.4vw, 17px) var(--sans); font-variant-numeric: tabular-nums; color: var(--accent); }
.sq em { font: normal clamp(9px, 1.8vw, 12px) var(--sans); color: var(--muted); white-space: nowrap; }
.recent { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.recent a { border: 1px solid var(--line); border-radius: 12px; padding: 7px 4px; text-align: center; color: var(--text); background: var(--panel); }
.recent a:hover { text-decoration: none; border-color: var(--accent); }
.recent a.ml { border-color: var(--num); }
.recent b { display: block; font: 700 17px var(--sans); }
.recent em { font: normal 11px var(--sans); color: var(--muted); }

.chart { margin: 26px 0 0; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 18px; min-width: 0; }
.chart figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 10px; }
.chart figcaption a { font: 700 17px var(--sans); color: var(--text); }
.chart figcaption span { font-size: 13px; color: var(--muted); }
.plot { width: 100%; min-width: 0; overflow: hidden; }
.empty { color: var(--muted); padding: 60px 0; text-align: center; font-size: 14px; }
.u-legend { font: 12px var(--sans); color: var(--muted); text-align: left; }
.u-legend .u-value { color: var(--text); }

.method { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 6px 22px 12px; position: relative; overflow: hidden; }
.method::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--grad); }
.method h2 { margin-top: 16px; }
.method p { max-width: 80ch; margin: 10px 0; }
.toollist { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.toollist a { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; color: var(--text); }
.toollist a:hover { border-color: var(--accent); text-decoration: none; }
.toollist b { display: block; font: 700 16px var(--sans); color: var(--accent); }
.toollist span { font-size: 13px; color: var(--muted); }
.chartlist { display: flex; flex-wrap: wrap; gap: 8px; }
.chartlist a { border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 14px; color: var(--text); background: var(--panel); }
.chartlist a:hover { border-color: var(--accent); text-decoration: none; }

.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 14px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
tr:last-child td { border-bottom: 0; }
.form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 0 0 18px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); flex: 1 1 180px; max-width: 520px; }
.form input { font: 16px var(--sans); color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; width: 100%; }
.form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form button { font: 700 15px var(--sans); color: #0f1115; background: var(--grad); border: 0; border-radius: 14px; padding: 13px 22px; cursor: pointer; }
.item { border-bottom: 1px solid var(--line); padding: 14px 0; }
.item time { font-size: 12px; color: var(--muted); }
.item h3 { margin: 4px 0; }
.item p { margin: 0; max-width: 80ch; }
.post { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 18px; align-items: start; }
.post pre { font: 15px/1.5 var(--sans); white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0 0; }
.post img { width: 100%; border-radius: 14px; border: 1px solid var(--line); }
@media (max-width: 700px) { .post { grid-template-columns: minmax(0, 1fr); } }
.st-sent { color: var(--accent); } .st-failed { color: var(--warn); }
footer { border-top: 1px solid var(--line); padding-top: 18px; padding-bottom: 40px; font-size: 13px; color: var(--muted); }
