:root {
  color-scheme: light;
  --bg: #fcfcfb; --surface: #fcfcfb; --line: #e4e3df; --grid: #eeede9; --axis: #a9a8a2;
  --ink: #0b0b0b; --ink-2: #52514e; --ink-3: #6f6e69;
  --series-1: #2a78d6; --series-2: #eb6834;
  --critical: #d03b3b; --warning: #fab219; --good: #0ca30c;
  --fill: #f0efec; --ink-inv: #fcfcfb;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1a1a19; --surface: #1a1a19; --line: #33332f; --grid: #2a2a27; --axis: #6b6a64;
    --ink: #f0efec; --ink-2: #c3c2b7; --ink-3: #a3a297;
    --series-1: #3987e5; --series-2: #d95926; --fill: #2a2a27; --ink-inv: #1a1a19;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1a1a19; --surface: #1a1a19; --line: #33332f; --grid: #2a2a27; --axis: #6b6a64;
  --ink: #f0efec; --ink-2: #c3c2b7; --ink-3: #a3a297;
  --series-1: #3987e5; --series-2: #d95926; --fill: #2a2a27; --ink-inv: #1a1a19;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-variant-numeric: tabular-nums; }
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; }
.page { max-width: 1240px; margin: 0 auto; padding: 16px 16px 48px; }
.state { padding: 48px 0; color: var(--ink-2); }
.top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--ink); }
.top h1 { font-size: 15px; font-weight: 600; letter-spacing: .01em; }
.top time { color: var(--ink-2); font-size: 13px; }

.hero { padding: 24px 0 20px; }
.hero .label { color: var(--ink-2); font-size: 14px; }
.hero .big { font-size: clamp(44px, 12.5vw, 88px); line-height: 1.02; font-weight: 600; letter-spacing: -.03em; margin: 2px 0 8px; white-space: nowrap; }
.hero .parts { color: var(--ink-2); font-size: 14px; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.stat { padding: 12px 12px 14px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.stat:nth-child(even) { padding-left: 12px; border-left: 1px solid var(--line); padding-right: 0; }
.stat .k { color: var(--ink-2); font-size: 13px; }
.stat .v { font-size: 24px; font-weight: 600; letter-spacing: -.015em; line-height: 1.2; margin-top: 2px; overflow-wrap: anywhere; }
.stat .n { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.flag { display: inline-flex; align-items: center; gap: 5px; }
.flag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--critical); }
.flag.warn::before { background: var(--warning); }

.cols { display: grid; gap: 0 48px; grid-template-columns: minmax(0, 1fr); }
section { padding-top: 28px; min-width: 0; }
section > h2 { font-size: 17px; font-weight: 600; letter-spacing: -.005em; padding-bottom: 8px; border-bottom: 1px solid var(--ink); display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
section > h2 small { font-size: 13px; font-weight: 400; color: var(--ink-2); white-space: nowrap; }
.note { color: var(--ink-3); font-size: 12.5px; padding-top: 8px; }

.rows li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rows .t { min-width: 0; overflow-wrap: anywhere; }
.rows .s { display: block; color: var(--ink-3); font-size: 12.5px; margin-top: 1px; }
.rows .a { white-space: nowrap; font-weight: 500; }
.grp { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-2); font-size: 13px; font-weight: 600; padding: 14px 0 4px; }
.date { color: var(--ink-2); display: inline-block; min-width: 3.4em; }

.todo li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: start; }
.todo button { width: 22px; height: 22px; margin-top: 0; padding: 0; background: none; border: 1.5px solid var(--axis); border-radius: 5px; cursor: pointer; position: relative; }
.todo button::after { content: ""; position: absolute; inset: -11px; }
.todo button:hover { border-color: var(--ink); }
.todo button:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; }
.todo .late { color: var(--critical); }
.todo .when { display: block; color: var(--ink-3); font-size: 12.5px; }
.todo li.done { opacity: .45; text-decoration: line-through; }

.chart { position: relative; padding-top: 12px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.chart text { font-size: 11.5px; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .zero { stroke: var(--axis); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .mark { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.chart .cross { stroke: var(--ink-3); stroke-width: 1; }
.chart .goal { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .b1 { fill: var(--series-1); } .chart .b2 { fill: var(--series-2); }
.chart .hit { fill: transparent; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; padding-top: 10px; color: var(--ink-2); font-size: 13px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
details { padding-top: 10px; font-size: 13.5px; }
summary { cursor: pointer; color: var(--ink-2); padding: 4px 0; }
.tip { position: fixed; z-index: 10; pointer-events: none; max-width: 240px; padding: 7px 10px; font-size: 12.5px; line-height: 1.35; color: var(--ink-inv); background: var(--ink); border-radius: 6px; }
.tip b { font-weight: 600; }

.legend .k1 { background: var(--series-1); } .legend .k2 { background: var(--series-2); }
.rows li.lim { display: block; }
.limhead { display: flex; justify-content: space-between; gap: 12px; }
.bar { height: 6px; background: var(--fill); border-radius: 3px; overflow: hidden; margin-top: 5px; }
.bar i { display: block; height: 100%; background: var(--series-1); border-radius: 3px; }
.bar.over i { background: var(--critical); }
.stage { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }

@media (min-width: 720px) {
  .page { padding: 20px 28px 64px; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat, .stat:nth-child(even) { padding: 12px 16px 14px; border-left: 1px solid var(--line); }
  .stat:first-child { padding-left: 0; border-left: 0; }
  .stat .v { font-size: 28px; }
}
@media (min-width: 1060px) {
  .cols { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
}
