/* TOM — clean, forms-and-tables UI with a print stylesheet.
   All colors come from theme tokens (SPEC §2): light values on :root, dark
   overrides on :root[data-theme="dark"]. base.html sets data-theme from the
   saved preference (falling back to the OS scheme) before styles apply.
   Print always renders with the light tokens. */

:root {
  --bg: #f5f7f9;
  --card: #ffffff;
  --ink: #1a2330;
  --muted: #5a6675;
  --line: #d7dde5;
  --accent: #14532d;        /* solid fills: topbar, buttons */
  --accent-ink: #ffffff;    /* text on accent fills */
  --link: #14532d;
  --accent-soft: #e7f3ec;
  --warn: #92400e;
  --warn-soft: #fef3c7;
  --danger: #991b1b;
  --tab-bg: rgba(255, 255, 255, 0.12);
  --tab-bg-hover: rgba(255, 255, 255, 0.3);
  --tab-border: rgba(255, 255, 255, 0.35);
  --print-line: #999999;
}

:root[data-theme="dark"] {
  --bg: #12161d;
  --card: #1c232d;
  --ink: #e5ebf2;
  --muted: #9aa7b5;
  --line: #323d4a;
  --accent: #1d6b3d;
  --accent-ink: #ffffff;
  --link: #7fd8a4;
  --accent-soft: #16301f;
  --warn: #e8a75c;
  --warn-soft: #3a2e12;
  --danger: #b33636;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.5 system-ui, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
/* left-aligned rather than centered: at the scoring table the director wants
   the content near the edge, not a wide gutter on both sides */
main { max-width: 100rem; margin: 0; padding: 1rem 1.25rem 4rem; }
h1 { font-size: 1.5rem; margin: 1rem 0 0.25rem; }
h2 { font-size: 1.1rem; margin: 0 0 0.75rem; }
.meta { color: var(--muted); margin-top: 0; }
.crumb { color: var(--muted); margin: 0.75rem 0 -0.75rem; font-size: 0.85rem;
         text-transform: uppercase; letter-spacing: 0.05em; }
a { color: var(--link); }

.topbar {
  display: flex; align-items: flex-end; gap: 1rem;
  background: var(--accent); color: var(--accent-ink); padding: 0.6rem 1.25rem 0;
  position: sticky; top: 0; z-index: 10;
}
.topbar a { color: var(--accent-ink); text-decoration: none; }
.topbar .brand {
  font-weight: 700; letter-spacing: 0.06em; padding-bottom: 0.5rem;
  font-size: 1.6rem; line-height: 1;
}
.topbar .tname { font-weight: 600; padding-bottom: 0.6rem; }

/* Division/view tabs: bordered, hoverable, active tab joins the page */
.topbar nav.tabs { display: flex; gap: 0.3rem; margin-left: 0.5rem; }
.topbar nav.tabs .tab {
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--tab-border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: var(--tab-bg);
  font-weight: 500;
  cursor: pointer;
}
.topbar nav.tabs .tab:hover { background: var(--tab-bg-hover); }
.topbar nav.tabs .tab.active {
  background: var(--bg);
  color: var(--ink);
  border-color: var(--bg);
  font-weight: 700;
}

.theme-toggle {
  margin-left: auto; margin-bottom: 0.4rem;
  background: var(--tab-bg); border: 1px solid var(--tab-border);
  border-radius: 6px; padding: 0.25rem 0.55rem; font-size: 1rem;
  color: var(--accent-ink); cursor: pointer;
}
.theme-toggle:hover { background: var(--tab-bg-hover); }

/* Quick-access menu: prizes, settings, and other setup pages one click away
   without crowding the division tabs */
.quick-menu {
  margin-bottom: 0.4rem; position: relative;
}
.quick-menu summary {
  background: var(--tab-bg); border: 1px solid var(--tab-border);
  border-radius: 6px; padding: 0.25rem 0.6rem; font-size: 1rem;
  color: var(--accent-ink); cursor: pointer; list-style: none;
}
.quick-menu summary::-webkit-details-marker { display: none; }
.quick-menu summary:hover { background: var(--tab-bg-hover); }
.quick-menu-panel {
  position: absolute; top: 100%; left: 0; margin-top: 0.4rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  display: flex; flex-direction: column; min-width: 12rem;
  padding: 0.4rem; z-index: 20;
}
.quick-menu-panel a {
  color: var(--ink); text-decoration: none; padding: 0.5rem 0.6rem;
  border-radius: 6px; white-space: nowrap;
}
.quick-menu-panel a:hover { background: var(--accent-soft); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 1rem 1.25rem; margin: 1rem 0;
}
.notice { background: var(--accent-soft); padding: 0.5rem 0.75rem; border-radius: 6px; }
.error { background: var(--warn-soft); color: var(--warn); padding: 0.75rem 1rem; border-radius: 6px; }

table { border-collapse: collapse; width: 100%; margin-bottom: 0.75rem; }
th, td { text-align: left; padding: 0.35rem 0.6rem; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }
tr.withdrawn td { color: var(--muted); text-decoration: line-through; }
tr.unpaid td { background: var(--warn-soft); }
a.cancel { margin-left: 0.75rem; }
a.back { display: inline-block; margin-top: 0.75rem; font-weight: 600; text-decoration: none; }
a.back:hover { text-decoration: underline; }

/* Seed prefix in the shared player-name component: noticeably smaller than
   the name, on screen and in print alike */
.player .seed { font-size: 0.8em; }

/* Cross-tables enrichment on the roster */
.player-photo { height: 28px; width: 28px; object-fit: cover;
                border-radius: 4px; vertical-align: middle; margin-right: 0.3rem; }
/* topbar per-division status: outstanding count, or a tick when all in */
.tab-count, .tab-done {
  display: inline-block; margin-left: 0.25rem; padding: 0 0.35rem;
  border-radius: 999px; font-size: 0.8em; font-weight: 700;
  background: var(--tab-bg-hover);
}
.tab-done { font-weight: 400; }

/* live monitoring strip at the top of the round page */
.round-monitor:not(:empty) {
  margin: 0.5rem 0; padding: 0.5rem 0.75rem;
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 4px; background: var(--card);
}
.round-monitor p { margin: 0.15rem 0; }

/* "what to do now" panel — only rendered when there is an action to take */
.next-steps .toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0; }
a.button {
  display: inline-block; padding: 0.4rem 0.75rem; border-radius: 4px;
  background: var(--accent); color: var(--accent-ink); text-decoration: none;
  font-size: 0.95rem;
}
a.button:hover { filter: brightness(1.15); }

/* setup content folded away once play starts */
details.collapsible > summary {
  cursor: pointer; font-size: 1.1rem; font-weight: 600;
}
details.collapsible > summary .meta { font-weight: 400; font-size: 0.85rem; }
details.collapsible > summary + * { margin-top: 0.75rem; }
details.collapsible h2 { margin-top: 0.5rem; }

/* pairing config: advanced columns hidden until asked for */
.hide-advanced .adv { display: none; }
.config-tools { margin: 0 0 0.5rem; }
#set-all-note { margin-left: 0.5rem; }

/* dashboard readiness checklist */
table.readiness .checks { display: flex; flex-wrap: wrap; gap: 0.4rem; }
a.check { text-decoration: none; font-size: 0.9rem; padding: 0.05rem 0.4rem;
          border: 1px solid var(--line); border-radius: 999px; }
a.check.ok { color: var(--muted); }
a.check.todo { color: var(--warn); background: var(--warn-soft);
               border-color: var(--warn); }
.ready { color: var(--accent); font-weight: 600; }
.notready { color: var(--warn); font-weight: 600; }

/* live coverage */
.coverage-title { margin-bottom: 0; }
.coverage-nav { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0.5rem 0; }
.nav-group { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.coverage-nav .chip.current { background: var(--accent); color: var(--accent-ink);
                              border-color: var(--accent); }
.coverage-tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0.5rem 0; }
.coverage-tabs .tab { background: var(--card); color: var(--ink);
                      border: 1px solid var(--line); border-radius: 4px 4px 0 0;
                      padding: 0.35rem 0.75rem; text-decoration: none; }
.coverage-tabs .tab.active { background: var(--accent); color: var(--accent-ink);
                             border-color: var(--accent); }
.coverage-boards tr.done { color: var(--muted); }
.coverage-boards .winner { font-weight: 700; color: var(--ink); }
.coverage-boards .score { text-align: right; font-variant-numeric: tabular-nums; }
.rec { color: var(--muted); font-size: 0.85em; }
.clinch { background: var(--accent-soft); padding: 0.4rem 0.6rem; border-radius: 4px; }
.coverage-standings .up { color: var(--accent); font-size: 0.85em; }
.coverage-standings .down { color: var(--danger); font-size: 0.85em; }
button.star { background: none; border: 0; cursor: pointer; font-size: 1.1rem;
              color: var(--muted); padding: 0; }
button.star.on { color: var(--warn); }
.facts { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-bottom: 0.75rem; }
.stat-cards { display: grid; gap: 0.75rem;
              grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.stat-card { border: 1px solid var(--line); border-radius: 4px; padding: 0.5rem 0.75rem; }
.stat-card h3 { font-size: 0.95rem; margin: 0 0 0.35rem; }
.stat-card ol { margin: 0; padding-left: 1.2rem; }
.stat-card li { margin: 0.15rem 0; }
.stat-value { font-weight: 700; margin-right: 0.35rem; }

/* --- player self-service entry: phone-first, big touch targets --- */
body.play { background: var(--bg); }
.play-main { max-width: 32rem; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.play-event { color: var(--muted); text-transform: uppercase;
              letter-spacing: 0.06em; font-size: 0.8rem; margin: 0 0 0.5rem; }
.play-main h1 { font-size: 1.6rem; margin: 0 0 0.5rem; }
/* once a soft keypad is up the viewport is short; shrink the chrome, never
   the inputs or the button */
@media (max-height: 620px) {
  .play-main { padding-top: 0.5rem; }
  .play-main h1 { font-size: 1.2rem; margin-bottom: 0.25rem; }
  .play-event, .play-tabs { display: none; }
  .play-matchup { font-size: 0.95rem; margin: 0.25rem 0; }
}
.play-matchup { font-size: 1.05rem; }
.play-tabs { display: flex; gap: 0.25rem; margin: 0 0 1rem; }
.play-tabs a { flex: 1; text-align: center; padding: 0.6rem 0.3rem;
               border: 1px solid var(--line); border-radius: 8px;
               text-decoration: none; color: var(--ink); background: var(--card); }
.play-tabs a.on { background: var(--accent); color: var(--accent-ink);
                  border-color: var(--accent); font-weight: 600; }
.handover.done { background: var(--accent-soft); }
.card-games td, .standings td, .standings th { padding: 0.3rem 0.4rem; }
.play-scores tr.me { background: var(--accent-soft); font-weight: 700; }
.board-link { margin-top: 1.25rem; text-align: center; }
.board-link .meta { display: block; margin-top: 0.4rem; }
button.link-button { display: block; width: 100%; margin-top: 1rem;
                     background: none; border: 0; color: var(--link);
                     text-decoration: underline; cursor: pointer;
                     font-size: 1rem; padding: 0.5rem; }
.play-form label { display: block; margin: 0.85rem 0; font-weight: 600; }
.play-form input { display: block; width: 100%; font-size: 1.6rem;
                   padding: 0.6rem 0.7rem; margin-top: 0.3rem;
                   border: 1px solid var(--line); border-radius: 8px; }

/* Score entry: name left, box right, and tight enough that the keypad does
   not push the Submit button off screen. */
.scoreform .score-row {
  display: flex; align-items: center; gap: 0.75rem; margin: 0.5rem 0;
}
.scoreform .score-row .who {
  flex: 1 1 auto; min-width: 0; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.scoreform .score-row input {
  flex: 0 0 5.5rem; width: 5.5rem; margin-top: 0; text-align: center;
  font-size: 1.5rem; padding: 0.45rem 0.4rem;
}
.scoreform .big { margin-top: 0.75rem; padding: 0.75rem 1rem; }
.meta.compact { margin: 0.4rem 0 0; font-size: 0.85rem; }
button.big, .big-link {
  display: block; width: 100%; text-align: center; font-size: 1.15rem;
  padding: 0.9rem 1rem; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); text-decoration: none;
  margin-top: 0.5rem;
}
button.big.danger { background: var(--danger); }
.handover { text-align: center; background: var(--accent-soft);
            border-radius: 10px; padding: 1rem; margin-bottom: 1rem; }
.handover-to { margin: 0; color: var(--muted); }
.handover h1 { margin: 0.2rem 0 0; }
.play-scores { width: 100%; font-size: 1.2rem; }
.play-scores .num { text-align: right; font-weight: 700; }
.warn-box { background: var(--warn-soft); color: var(--warn);
            padding: 0.75rem; border-radius: 8px; }
.dispute { margin-top: 1.5rem; }
.dispute > summary { cursor: pointer; color: var(--muted); }
.play-signout { margin-top: 2rem; }

/* wall chart: wide grid, player column pinned while scrolling sideways */
.wall-scroll { overflow-x: auto; }
table.wall-chart { border-collapse: collapse; font-size: 0.85rem; }
table.wall-chart th, table.wall-chart td {
  border: 1px solid var(--line); padding: 0.2rem 0.35rem; white-space: nowrap;
}
table.wall-chart .sticky { position: sticky; background: var(--card); z-index: 1; }
table.wall-chart .sticky:first-child { left: 0; }
table.wall-chart .name { left: 2.2rem; }
.wall-cell { text-align: center; }
.wall-score { display: block; }
.wall-opp { color: var(--muted); }
.wall-run { display: block; color: var(--muted); font-size: 0.9em; }
.wall-final { white-space: nowrap; }
.prize-editor input, .prize-editor select { max-width: 12rem; }
.flag { color: var(--warn); font-weight: 600; }

/* player scorecards */
a.player { color: inherit; text-decoration: none; }
a.player:hover { text-decoration: underline; }
.scorecard-head { display: flex; align-items: center; gap: 0.5rem; }
.player-photo.large { height: 56px; width: 56px; }
.scorecard-summary { display: flex; flex-wrap: wrap; gap: 1.25rem; margin: 0; }
.rating-estimate { margin: 0.75rem 0 0.25rem; }
.new-peak { color: var(--accent); font-weight: 700; margin-left: 0.35rem; }
.caveats > summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; }
table.scorecard td, table.scorecard th { white-space: nowrap; }
table.scorecard tr.unplayed { color: var(--muted); }
.res-W { color: var(--accent); }
.res-L { color: var(--danger); }

.roster-stats .flag { color: var(--warn); }
.roster-tools { margin: 0.75rem 0 0.25rem; }
.roster-tools input { margin-left: 0.25rem; }
#roster-filter-count { margin-left: 0.5rem; }

.xt-choice { display: block; margin: 0.15rem 0; }
/* number inputs size themselves off the spinner, not the `size` attribute —
   keep the small per-round pairing knobs narrow */
.pairing-config input[type="number"] { width: 4.5rem; }
.pairing-config input.narrow { width: 3.25rem; }
details.bulk-add > summary, details.bulk-score > summary {
    cursor: pointer; margin: 0.4rem 0; }
details.bulk-add textarea, details.bulk-score textarea {
    display: block; margin: 0.3rem 0; font-family: monospace; }
.expiry-warning {
  background: var(--warn-soft); color: var(--warn); font-weight: 700;
  padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.75rem;
}

td.actions details { position: relative; }
td.actions form { margin: 0.25rem 0; }

.stack { display: grid; gap: 0.5rem; max-width: 26rem; }
.stack label { display: grid; gap: 0.15rem; font-size: 0.9rem; color: var(--muted); }
.stack .row { display: flex; gap: 0.75rem; }
.stack .row label { flex: 1; }
.inline-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: end; }
.inline-form label { display: grid; gap: 0.15rem; font-size: 0.85rem; color: var(--muted); }
input, select {
  padding: 0.4rem 0.5rem; border: 1px solid var(--line); border-radius: 6px;
  font: inherit; color: var(--ink); background: var(--card);
}
button {
  padding: 0.45rem 0.9rem; border: 0; border-radius: 6px; font: inherit;
  background: var(--accent); color: var(--accent-ink); cursor: pointer;
}
button.link { background: none; color: var(--link); text-decoration: underline; padding: 0.2rem 0; }
button.danger { background: var(--danger); }
button.warn { background: var(--warn); color: var(--card); }
label.checkbox { display: inline-flex; gap: 0.35rem; align-items: center; }

.round-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.75rem;
  text-decoration: none; background: var(--card);
}
.chip small { color: var(--muted); }
.chip-complete { background: var(--accent-soft); border-color: var(--accent); }
.chip-in_progress { background: var(--warn-soft); }
.chip-certified { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.file-list { list-style: none; padding: 0; }

/* Round page pagination: < 1 2 3 … N > */
.pagination { display: inline-flex; gap: 0.25rem; align-items: center; margin-left: 1rem; }
.pagination .page {
  min-width: 2rem; padding: 0.25rem 0.5rem; text-align: center;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--card); text-decoration: none; font-weight: 600;
}
.pagination a.page:hover { border-color: var(--accent); }
.pagination .page.current {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
}
.pagination .page.ellipsis, .pagination .page.disabled {
  border: none; background: none; color: var(--muted);
}

/* Config tab */
fieldset.radios { border: none; padding: 0; margin: 0; display: grid; gap: 0.4rem; }
fieldset.radios:disabled { opacity: 0.5; }
fieldset.radios label:not(.checkbox) { display: grid; gap: 0.15rem; max-width: 16rem;
  margin-top: 0.5rem; font-size: 0.9rem; color: var(--muted); }

/* Lunch break notice (SPEC §4.1): shown on pairings and standings */
.lunch {
  background: var(--warn-soft); border-radius: 6px;
  padding: 0.4rem 0.75rem; display: inline-block;
}

/* Score entry: board-ordered, keyboard-first */
.boards { display: grid; gap: 0.4rem; }
.board-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 0.5rem 0.75rem;
}
.board-row.has-result { background: var(--accent-soft); }
.board-row form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.board-num {
  min-width: 2.5rem; text-align: center; font-weight: 700; color: var(--muted);
}
.pname { min-width: 10rem; }
.pname em { font-style: normal; font-size: 0.75rem; color: var(--link); font-weight: 700; }
input.score { width: 5rem; text-align: right; }
input.reason { width: 12rem; }
.warnings { margin: 0; padding-left: 1.25rem; color: var(--warn); flex-basis: 100%; }
.note { color: var(--muted); font-size: 0.85rem; font-style: italic; }
.bye-line { color: var(--muted); }

/* Forfeits */
.forfeit-badge {
  background: var(--warn-soft); color: var(--warn); font-weight: 700;
  padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.8rem;
}
/* dry-run/simulated data: deliberately muted, not alarming — it's a
   preview, not a problem, but must never read as a real result */
.sim-badge {
  background: var(--line); color: var(--muted); font-style: italic;
  padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.8rem;
}
.forfeit-menu summary { cursor: pointer; color: var(--muted); font-size: 0.85rem; }
.forfeit-menu form { display: inline-block; margin-right: 0.5rem; }
.forfeit-menu .danger-text { color: var(--danger); }

/* Streamed-game marker */
.stream-toggle { background: none; border: none; padding: 0.1rem 0.3rem;
                 font-size: 1rem; cursor: pointer; }
.stream-toggle.off { opacity: 0.25; filter: grayscale(1); }
.stream-toggle.on { opacity: 1; }

/* Outstanding-scores monitoring */
.outstanding ul { margin: 0.25rem 0 0.5rem; padding-left: 1.25rem; }
.all-in { color: var(--link); font-weight: 700; }
.anomaly {
  background: var(--warn-soft); color: var(--warn); font-weight: 700;
  padding: 0.5rem 0.75rem; border-radius: 6px;
  border: 1px solid var(--warn);
}

/* Print: always light, regardless of active theme (SPEC §2) */
.print-page h1 { margin-bottom: 0; }


/* player sheets: blank scoresheets and the printable scorecard */
/* event title leads the sheet, centred across the full width */
.sheet-title {
  text-align: center; font-weight: 700; font-size: 1.35rem; margin: 0 0 0.5rem;
}
.sheet-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; margin-bottom: 0.5rem;
}
.sheet-head h1, .sheet-player { margin: 0; font-size: 1.15rem; }
/* the QR keeps its own column and cannot bleed into the table below: the
   viewBox added in tom.qr makes the drawing scale with the box, and
   flex-shrink:0 stops the column collapsing under a long player name */
.sheet-qr { width: 96px; flex: 0 0 96px; text-align: center; line-height: 1; }
.sheet-qr svg { display: block; width: 96px; height: 96px; margin: 0 auto; }
.qr-pin { display: block; font-size: 0.75rem; letter-spacing: 0.08em;
          margin-top: 0.15rem; }
.qr-block { text-align: center; margin: 1rem 0; }
.qr-block svg { max-width: 100%; height: auto; }
td.qr-cell svg { height: 64px; width: 64px; }
table.sheet-grid, table.scoresheet {
  width: 100%; border-collapse: collapse; margin-top: 0.6rem;
}
/* ruled both ways, so it reads as a table the player writes into */
table.sheet-grid th, table.sheet-grid td,
table.scoresheet th, table.scoresheet td {
  border: 1px solid var(--ink); padding: 0.35rem 0.3rem; text-align: left;
}
table.sheet-grid td { height: 1.9rem; }
table.scoresheet td { height: 1.5rem; }
/* everything but the opponent is centred, header and value alike, so the
   narrow columns read as boxes to write a number into */
table.scoresheet .num,
table.scoresheet th.num { text-align: center; white-space: nowrap; }
/* W and L are one-character headers, so the browser would size them to the
   letter; both get the same explicit width, enough to write two digits in */
table.scoresheet .wl { width: 2.4rem; min-width: 2.4rem; }
table.scoresheet .circle { white-space: nowrap; text-align: center; }
table.scoresheet .opp { width: 40%; text-align: left; }
.sheet-sign { margin-top: 1.2rem; color: var(--muted); }


/* Zero page margins so the browser has no margin box to draw its own header
   (date, page title) and footer (URL, page numbers) into; the padding below
   restores a printable margin. Chrome/Edge/Firefox also expose a
   "Headers and footers" checkbox — this makes the default come out clean. */
@page { size: auto; margin: 0; }

@media print {
  .print-page { padding: 12mm; }

  :root, :root[data-theme="dark"] {
    --bg: #ffffff;
    --card: #ffffff;
    --ink: #1a2330;
    --muted: #5a6675;
    --line: var(--print-line);
    --accent: #14532d;
    --accent-ink: #ffffff;
    --link: #1a2330;
    --accent-soft: #ffffff;
    --warn: #92400e;
    --warn-soft: #ffffff;
    --danger: #991b1b;
  }
  .no-print, .topbar, button, input.reason { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  main { max-width: none; padding: 0; }
  .card, .board-row { border: 0; box-shadow: none; padding: 0; }
  a { color: inherit; text-decoration: none; }
  th, td { border-bottom: 1px solid var(--print-line); }

  /* one page per sheet: scoresheets and scorecards print a page each */
  .sheet { break-after: page; page-break-after: always; }
  .sheet:last-child { break-after: auto; page-break-after: auto; }
  /* never split a chart row or a card table across pages */
  tr, .sheet-head { break-inside: avoid; page-break-inside: avoid; }
  /* 22 rounds plus header and signature line fit one side at this scale */
  table.scoresheet { font-size: 9.5pt; }
  table.scoresheet td { height: 1.15rem; padding: 0.18rem 0.3rem; }
  .sheet-title { font-size: 1.25rem; }
  .sheet-head h1, .sheet-player { font-size: 1.05rem; }
  .wall-chart.print { font-size: 8pt; }
  .wall-chart.print .wall-run { font-size: 7pt; }
  .wall-scroll { overflow: visible; }
  .wall-chart .sticky { position: static; }
}
