:root {
  color-scheme: light;
  --page: #f4f4f1; --surface: #fcfcfb; --raised: #ffffff;
  --ink: #0b0b0b; --ink2: #52514e; --muted: #75736d;
  --grid: #e1e0d9; --axis: #c3c2b7; --ring: rgba(11,11,11,.10);
  --history: #eb6834; --money: #1baf7a;
  --up: #006300; --down: #b02a2a; --warn-bg: #fff4d9; --warn-line: #e5b94f;
  --btn: #0b0b0b; --btn-ink: #fff;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --raised: #232322;
    --ink: #f0efec; --ink2: #c3c2b7; --muted: #98968f;
    --grid: #2c2c2a; --axis: #4a4a46; --ring: rgba(255,255,255,.10);
    --history: #d95926; --money: #199e70;
    --up: #2fbf4f; --down: #ef7a7a; --warn-bg: #2d2611; --warn-line: #7a6220;
    --btn: #f0efec; --btn-ink: #0b0b0b;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0; text-wrap: balance; }
h2 { font-size: 17px; }
.muted { color: var(--muted); } .ink2 { color: var(--ink2); } .small { font-size: 13px; } .pad { padding: 24px 0; }
main, footer, .top { max-width: 1120px; margin: 0 auto; padding-inline: 20px; }
.top { display: flex; align-items: center; gap: 12px 28px; padding-block: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; text-decoration: none; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { text-decoration: none; color: var(--ink2); padding: 6px 11px; border-radius: 8px; }
nav a:hover { background: var(--ring); } nav a[aria-current] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--ring); }
footer { padding-block: 28px 40px; color: var(--muted); font-size: 13px; }
:focus-visible { outline: 2px solid var(--ink2); outline-offset: 2px; border-radius: 4px; }

.card { background: var(--surface); border-radius: 14px; box-shadow: 0 0 0 1px var(--ring); padding: 20px; min-width: 0; }
.stack { display: grid; gap: 18px; } .stack > * { min-width: 0; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.cardhead { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.notice { background: var(--warn-bg); box-shadow: inset 0 0 0 1px var(--warn-line); border-radius: 12px; padding: 13px 16px; }
.history { --c: var(--history); } .money { --c: var(--money); }

.chan { display: grid; gap: 18px; align-content: start; border-top: 4px solid var(--c); }
.who { display: flex; gap: 14px; align-items: center; min-width: 0; } .who > div:last-child { min-width: 0; }
.who h1 { font-size: 26px; } .who h2 { font-size: 20px; }
.ava { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; background: var(--c); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 20px; }
.hero { font-size: 52px; line-height: 1; font-weight: 650; letter-spacing: -.02em; }
.herorow { display: flex; align-items: end; gap: 10px 16px; flex-wrap: wrap; }
.delta { font-weight: 550; white-space: nowrap; } .delta.up { color: var(--up); } .delta.down { color: var(--down); } .delta.flat { color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); gap: 18px 22px; }
.tile .l { color: var(--ink2); font-size: 13px; } .tile .v { font-size: 25px; font-weight: 600; line-height: 1.25; } .tile .d { font-size: 13px; color: var(--muted); }
.btn { font: inherit; border: 0; border-radius: 9px; padding: 8px 14px; background: var(--btn); color: var(--btn-ink); cursor: pointer; text-decoration: none; display: inline-block; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--axis); } .btn:disabled { opacity: .5; cursor: default; }
.seg { justify-self: start; display: inline-flex; background: var(--surface); box-shadow: inset 0 0 0 1px var(--ring); border-radius: 10px; padding: 3px; flex-wrap: wrap; }
.seg button { font: inherit; border: 0; background: none; color: var(--ink2); padding: 5px 12px; border-radius: 7px; cursor: pointer; } .seg button[aria-pressed=true] { background: var(--btn); color: var(--btn-ink); }

.plot { position: relative; width: 100%; } .plot svg { display: block; width: 100%; overflow: visible; touch-action: pan-y; }
.plot text { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; } .plot text.end { fill: var(--ink); font-weight: 600; }
.plot .empty { min-height: 150px; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 12px; }
.legend { display: flex; gap: 6px 18px; flex-wrap: wrap; font-size: 13px; color: var(--ink2); } .legend i { display: inline-block; width: 16px; height: 3px; border-radius: 2px; background: var(--c); vertical-align: middle; margin-right: 7px; }
#tip { position: fixed; z-index: 20; pointer-events: none; background: var(--raised); color: var(--ink); border-radius: 9px; box-shadow: 0 0 0 1px var(--ring), 0 6px 22px rgba(0,0,0,.18); padding: 8px 11px; font-size: 13px; max-width: 260px; }
#tip .row { display: flex; align-items: center; gap: 8px; } #tip .row i { width: 14px; height: 3px; border-radius: 2px; background: var(--c); } #tip .row b { font-size: 14px; } #tip .row span { color: var(--ink2); }

.scroll { overflow-x: auto; margin-inline: -20px; padding-inline: 20px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; } th { text-align: right; font-weight: 550; color: var(--ink2); font-size: 13px; white-space: nowrap; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--grid); } td { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; padding-left: 0; } th:last-child, td:last-child { padding-right: 0; }
tbody tr:last-child td { border-bottom: 0; } tr.sum td { font-weight: 600; border-top: 1px solid var(--axis); }
th button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; } th[aria-sort] button { color: var(--ink); }
.vid { display: flex; gap: 12px; align-items: center; min-width: 260px; max-width: 420px; text-align: left; background: none; border: 0; font: inherit; color: inherit; cursor: pointer; padding: 0; white-space: normal; }
.vid img { width: 84px; height: 47px; object-fit: cover; border-radius: 6px; flex: none; background: var(--grid); } .vid .t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; } .vid:hover .t { text-decoration: underline; }
.mile { display: grid; gap: 14px; } .mile .m { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 14px; } .track { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--c) 18%, var(--surface)); overflow: hidden; } .track > i { display: block; height: 100%; background: var(--c); border-radius: 4px; }
.vs { table-layout: fixed; }  .vs thead th i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-right: 7px; }

form { display: grid; gap: 12px; max-width: 460px; } label { display: grid; gap: 4px; font-size: 14px; color: var(--ink2); }
input, select { font: inherit; color: var(--ink); background: var(--raised); border: 1px solid var(--axis); border-radius: 8px; padding: 8px 10px; width: 100%; } .inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.rpm { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; align-items: center; } ol.steps { padding-left: 20px; margin: 0; display: grid; gap: 5px; } .msg:empty { display: none; } .msg.bad { color: var(--down); } .msg.good { color: var(--up); }
dialog { border: 0; border-radius: 14px; padding: 22px; width: min(720px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--ring), 0 20px 60px rgba(0,0,0,.35); } dialog::backdrop { background: rgba(0,0,0,.5); }
@media (max-width: 760px) { .two { grid-template-columns: minmax(0, 1fr); } .hero { font-size: 44px; } main, footer, .top { padding-inline: 16px; } .card { padding: 16px; } .scroll { margin-inline: -16px; padding-inline: 16px; } nav a { padding: 6px 9px; } .vid { min-width: 210px; } }
@media (prefers-reduced-motion: no-preference) { .track > i { transition: width .4s ease; } }
