:root {
  --bg: #f5f2ea; --surface: #fffdf8; --ink: #1d2621; --muted: #5f6b63; --line: #ddd6c6;
  --accent: #1f6b45; --accent-ink: #fff; --accent-soft: #e2efe6; --clay: #b0502a; --clay-soft: #f6e6dc;
  --warn: #8a5a00; --warn-soft: #fbf0d3; --bad: #a12c2c; --bad-soft: #f8e1df; --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #141a17; --surface: #1c2420; --ink: #e8ece8; --muted: #9aa69e; --line: #313c36;
    --accent: #5fbf8b; --accent-ink: #0d1a13; --accent-soft: #20362a; --clay: #e08a5f; --clay-soft: #3a2a21;
    --warn: #e5b955; --warn-soft: #3a3118; --bad: #f08a84; --bad-soft: #402422; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1 { font-size: 26px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: 17px; margin: 0 0 4px; }
h3 { font-size: 13px; margin: 0 0 8px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
p { margin: 0 0 12px; }
.lede { color: var(--muted); max-width: 62ch; margin-bottom: 20px; }
.hint { color: var(--muted); font-size: 13px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 700; font-size: 17px; text-decoration: none; }
.brand span { color: var(--ink); }
.top-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.banner { background: var(--accent-soft); color: var(--ink); padding: 10px 20px; text-align: center; }

.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; }
.steps { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 72px; align-self: start; }
.steps button { display: flex; align-items: center; gap: 10px; text-align: left; border: 0; background: none; color: var(--muted); padding: 9px 10px; border-radius: 8px; font: inherit; cursor: pointer; }
.steps button:hover { background: var(--accent-soft); color: var(--ink); }
.steps button[aria-current="step"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
.steps .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; border: 1.5px solid currentColor; flex: none; }
.steps button.done .n { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.steps .count { margin-left: auto; font-size: 12px; font-variant-numeric: tabular-nums; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card.tight { padding: 12px 14px; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 160px; min-width: 0; }

label.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); min-width: 0; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; width: 100%; min-width: 0; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { resize: vertical; min-height: 120px; line-height: 1.45; }
input[type="checkbox"] { width: auto; accent-color: var(--accent); }
label.check { display: flex; gap: 8px; align-items: flex-start; color: var(--ink); font-size: 14px; cursor: pointer; }
label.check input { margin-top: 3px; flex: none; }
label.check small { display: block; color: var(--muted); }

.btn { font: inherit; font-weight: 600; border-radius: 8px; padding: 7px 13px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.big { padding: 11px 20px; font-size: 16px; }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); font-weight: 500; }
.btn.ghost:hover { color: var(--ink); background: var(--accent-soft); }
.btn.donate { background: var(--clay-soft); border-color: transparent; color: var(--clay); }
.btn.add { border-style: dashed; color: var(--accent); background: none; }
.btn:disabled { opacity: .55; cursor: default; }
.x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 4px 8px; border-radius: 6px; }
.x:hover { color: var(--bad); background: var(--bad-soft); }
.link { border: 0; background: none; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { font: inherit; font-size: 13px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: baseline; }
.next { display: flex; justify-content: space-between; margin-top: 20px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.tile b { display: block; font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: 13px; }
.tile.bad b { color: var(--bad); }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checks li { display: flex; gap: 8px; align-items: baseline; }
.checks .mark { font-weight: 700; width: 16px; flex: none; }
.checks .ok .mark { color: var(--accent); }
.checks .no .mark { color: var(--warn); }
.checks small { color: var(--muted); }
.note { border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.bad { background: var(--bad-soft); color: var(--bad); }
.note ul { margin: 4px 0 0; padding-left: 18px; }
.error { color: var(--bad); font-size: 14px; }

.progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin: 14px 0 6px; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .5s linear; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 18px 0 12px; }
.tabs button { font: inherit; border: 0; background: none; padding: 8px 12px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.filters select { width: auto; }
.week { margin-bottom: 18px; }
.week > h3 { position: sticky; top: 52px; background: var(--bg); padding: 6px 0; margin: 0; z-index: 2; }
.day { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.day .date { font-weight: 600; }
.day .date small { display: block; color: var(--muted); font-weight: 400; }
.game { display: grid; grid-template-columns: 78px minmax(0, 1.5fr) minmax(0, 1fr); gap: 8px; padding: 2px 0; align-items: baseline; }
.game .t { font-variant-numeric: tabular-nums; color: var(--muted); }
.game .where { color: var(--muted); font-size: 13px; }
.game.dim { opacity: .3; }
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.seq { font-family: ui-monospace, Menlo, monospace; font-size: 12px; letter-spacing: 1px; color: var(--muted); }
.short { color: var(--bad); font-weight: 600; }

.support { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--clay-soft); border-color: transparent; }
.support p { margin: 0; max-width: 60ch; }
.foot { max-width: 1180px; margin: 0 auto; padding: 0 20px 30px; color: var(--muted); font-size: 13px; display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--surface); color: var(--ink); max-width: min(440px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(10, 16, 12, .5); }
.donate-box { padding: 22px; }
.amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.amounts button { font: inherit; font-weight: 600; font-size: 17px; padding: 12px 0; border-radius: 9px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; }
.amounts button[aria-pressed="true"] { border-color: var(--clay); background: var(--clay-soft); color: var(--clay); }
.custom { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.money { display: flex; align-items: center; gap: 4px; flex: 1; }
.fine { color: var(--muted); font-size: 12px; margin: 12px 0 0; text-align: center; }

@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 14px 16px 50px; }
  .steps { flex-direction: row; overflow-x: auto; position: static; padding-bottom: 4px; }
  .steps button { flex: none; }
  .steps .count { display: none; }
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top { padding: 8px 16px; }
  .top-actions .btn.ghost { padding: 6px 8px; font-size: 13px; }
  .game { grid-template-columns: 70px minmax(0, 1fr); }
  .game .where { grid-column: 2; }
  .week > h3 { top: 0; position: static; }
}
@media (max-width: 520px) {
  .g2 { grid-template-columns: minmax(0, 1fr); }
  .day { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .brand span { display: none; }
}
@media print {
  .top, .steps, .foot, .noprint, .tabs, .filters, .support, .next { display: none !important; }
  .shell { display: block; padding: 0; }
  body { background: #fff; color: #000; font-size: 12px; }
  .week > h3 { position: static; background: none; }
  .day { break-inside: avoid; }
}
