/* Hand Knee Foot score sheet. Sibling of the game: felt green, gold primary, rounded type. */
:root {
  --bg: #f4f1e8; --surface: #ffffff; --surface-2: #ece8dc; --ink: #1a231d; --muted: #4a574e; --line: #cfc8b5;
  --felt-a: #2b7a4b; --felt-b: #17492f; --felt-edge: #0e2f1f;
  --on-felt: #f6faf6; --on-felt-dim: rgba(246, 250, 246, .8); --panel-line: rgba(255, 255, 255, .2);
  --gold: #f4c24a; --gold-2: #dd9d1c; --gold-ink: #2f2003;
  --good: #1d7a45; --good-bg: #e2f3e8; --warn-bg: #fff1d0; --warn-ink: #5a3b00; --warn-line: #e3b34a;
  --neg: #b3261e; --accent: #17492f; --accent-ink: #ffffff;
  --t0: #2aa9c4; --t1: #e8793a; --t2: #9b6fe0;
  --font: ui-rounded, "SF Pro Rounded", "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 16px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 6px 16px rgba(0, 0, 0, .08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1511; --surface: #18211c; --surface-2: #222e27; --ink: #f1f5f1; --muted: #b0c0b5; --line: #35453b;
    --felt-a: #1d5a39; --felt-b: #0d2f1e; --felt-edge: #071a11;
    --good: #5fd58f; --good-bg: #173524; --warn-bg: #3a2d10; --warn-ink: #ffe3a3; --warn-line: #8a6a22;
    --neg: #ff948a; --accent: #f4c24a; --accent-ink: #2f2003;
    --t0: #4cc3d9; --t1: #ff9a5c; --t2: #b88cf0;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1511; --surface: #18211c; --surface-2: #222e27; --ink: #f1f5f1; --muted: #b0c0b5; --line: #35453b;
  --felt-a: #1d5a39; --felt-b: #0d2f1e; --felt-edge: #071a11;
  --good: #5fd58f; --good-bg: #173524; --warn-bg: #3a2d10; --warn-ink: #ffe3a3; --warn-line: #8a6a22;
  --neg: #ff948a; --accent: #f4c24a; --accent-ink: #2f2003;
  --t0: #4cc3d9; --t1: #ff9a5c; --t2: #b88cf0;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
html[data-text="large"] { font-size: 118%; }
html[data-text="xl"] { font-size: 136%; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.4 var(--font); min-height: 100dvh; overflow-x: hidden; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; padding: 0; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num-text { font-variant-numeric: tabular-nums; }
.neg { color: var(--neg); }

/* ---------- felt blocks ---------- */
.felt { background: radial-gradient(120% 90% at 50% 0%, var(--felt-a) 0%, var(--felt-b) 65%, var(--felt-edge) 100%); color: var(--on-felt); }
.wrap { width: 100%; max-width: 46rem; margin: 0 auto; padding: 0 16px; }
.wrap.wide { max-width: 88rem; }
.page { min-height: 100dvh; display: flex; flex-direction: column; }
.page > main { flex: 1; padding-top: 16px; padding-bottom: calc(var(--safe-b) + 7rem); }
.page.nobar > main { padding-bottom: calc(var(--safe-b) + 2rem); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 3.25rem; padding: 0 1.25rem; border-radius: 14px; font-weight: 750; font-size: 1.05rem;
  background: var(--surface); color: var(--ink); border: 2px solid var(--line); box-shadow: var(--shadow); transition: transform .1s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; box-shadow: none; }
.btn.primary { background: linear-gradient(180deg, var(--gold), var(--gold-2)); color: var(--gold-ink); border-color: #fbe29a; box-shadow: 0 3px 0 #a56f0b, 0 8px 18px rgba(0, 0, 0, .25); }
.btn.primary:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #a56f0b; }
.btn.big { min-height: 3.75rem; font-size: 1.2rem; width: 100%; border-radius: 16px; }
.btn.danger { color: var(--neg); border-color: var(--neg); }
.btn.onfelt { background: rgba(255, 255, 255, .14); color: var(--on-felt); border-color: rgba(255, 255, 255, .35); box-shadow: none; }
.btn.small { min-height: 3rem; padding: 0 1rem; font-size: 1rem; }
.linkbtn { min-height: 3rem; padding: 0 .75rem; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }

/* ---------- top bar & scoreboard ---------- */
.top { position: sticky; top: 0; z-index: 20; padding-top: var(--safe-t); box-shadow: 0 3px 12px rgba(0, 0, 0, .35); }
.topbar { display: flex; align-items: center; gap: .5rem; padding-top: .5rem; padding-bottom: .5rem; }
.topbar .title { flex: 1; min-width: 0; text-align: center; font-weight: 800; font-size: 1.15rem; line-height: 1.2; }
.topbar .title small { display: block; font-weight: 600; font-size: .8rem; color: var(--on-felt-dim); }
.topbar .spacer { min-width: 5rem; }
.topbar .btn { min-height: 3rem; }
.board { display: grid; gap: 8px; padding-bottom: 10px; }
.sb { text-align: left; border-radius: 14px; padding: 8px 10px; background: rgba(0, 0, 0, .28); border: 2.5px solid rgba(255, 255, 255, .16); color: var(--on-felt); min-height: 4.6rem; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
button.sb[aria-selected="true"], .sb.sel { border-color: var(--gold); background: rgba(0, 0, 0, .42); }
.sb .nm { font-weight: 800; font-size: .88rem; display: flex; align-items: center; gap: 6px; min-width: 0; }
.sb .nm span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--c); flex: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); }
.sb .tot { font-size: 1.55rem; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sb .sub { font-size: .76rem; color: var(--on-felt-dim); font-weight: 650; }
.sb .sub b { color: var(--gold); font-weight: 850; }
.leadline { padding-bottom: 8px; font-size: .88rem; font-weight: 700; color: var(--on-felt-dim); text-align: center; }
.leadline b { color: var(--gold); }
.neg-on-felt { color: #ffb4a8; }

/* ---------- cards / sections ---------- */
.card { background: var(--surface); border-radius: var(--r); border: 1.5px solid var(--line); box-shadow: var(--shadow); padding: 14px; }
.card + .card, .card + .stack, .stack > * + * { margin-top: 14px; }
.sidehead { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1.5px solid var(--line); border-left: 10px solid var(--c); margin-bottom: 14px; }
.sidehead h2 { font-size: 1.35rem; font-weight: 850; flex: 1; min-width: 0; overflow-wrap: anywhere; line-height: 1.2; }
.sidehead .opens { text-align: right; font-size: .85rem; color: var(--muted); font-weight: 700; line-height: 1.2; }
.sidehead .opens b { display: block; font-size: 1.5rem; color: var(--ink); font-weight: 900; }
.sec { padding: 0; overflow: hidden; }
.sec + .sec, .sidehead + .sec { margin-top: 14px; }
.sec-h { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface-2); border-bottom: 1.5px solid var(--line); }
.step { width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 900; display: grid; place-items: center; flex: none; }
.sec-h h3 { font-size: 1.12rem; font-weight: 850; line-height: 1.2; }
.sec-h p { font-size: .85rem; color: var(--muted); font-weight: 600; line-height: 1.25; }
.sec-h .grow { flex: 1; min-width: 0; }
.sec-h .subtot { font-size: 1.3rem; font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sec-b { padding: 6px 14px 14px; }
.hint { font-size: .9rem; color: var(--muted); font-weight: 600; padding: 8px 0 4px; }

.seg { display: flex; gap: 6px; padding: 4px; background: var(--surface-2); border-radius: 14px; border: 1.5px solid var(--line); margin: 10px 0 4px; }
.seg button { flex: 1; min-height: 3rem; border-radius: 10px; font-weight: 750; padding: 0 .5rem; line-height: 1.15; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.seg.in-sec { margin-top: 12px; }

.line { display: flex; align-items: center; gap: 10px; padding: 8px 0; min-height: 3.6rem; }
.line + .line { border-top: 1px solid var(--line); }
.line .lab { flex: 1; min-width: 0; }
.line .name { display: block; font-weight: 750; font-size: 1.08rem; line-height: 1.2; }
.line .vals { display: block; font-size: .85rem; color: var(--muted); font-weight: 650; font-variant-numeric: tabular-nums; }
.line .vals b { color: var(--ink); }
.stepper { display: flex; align-items: center; gap: 6px; flex: none; }
.stepper button { width: 3.2rem; height: 3.2rem; border-radius: 12px; background: var(--surface-2); border: 2px solid var(--line); font-size: 1.7rem; font-weight: 800; line-height: 1; display: grid; place-items: center; }
.stepper button.plus { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.stepper button:active { transform: scale(.93); }
.stepper button:disabled { opacity: .35; }
input.cnt { width: 3.6rem; height: 3.2rem; text-align: center; font: inherit; font-size: 1.4rem; font-weight: 850; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); padding: 0; font-variant-numeric: tabular-nums; }
input.cnt.zero { color: var(--muted); font-weight: 650; }
.pointsbox { display: flex; align-items: center; gap: 10px; padding: 10px 0 6px; }
.pointsbox label { flex: 1; font-weight: 750; line-height: 1.25; }
.pointsbox label small { display: block; font-weight: 600; color: var(--muted); font-size: .85rem; margin-top: 2px; }
input.pts { width: 7.5rem; height: 3.4rem; text-align: right; font: inherit; font-size: 1.5rem; font-weight: 850; padding: 0 .75rem; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font-variant-numeric: tabular-nums; }
.subhead { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 850; color: var(--muted); padding: 10px 0 0; border-top: 1.5px dashed var(--line); margin-top: 6px; }

.needs { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0 6px; }
.needs-h { font-weight: 800; font-size: .95rem; padding-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 2.2rem; padding: 0 .75rem; border-radius: 999px; font-weight: 800; font-size: .95rem; border: 2px solid var(--line); background: var(--surface); }
.chip.ok { background: var(--good-bg); border-color: var(--good); color: var(--good); }
.chip.todo { color: var(--muted); border-style: dashed; }
.allset { color: var(--good); font-weight: 850; padding: 2px 0 8px; }

.outbtn { width: 100%; min-height: 4rem; border-radius: 14px; border: 2.5px solid var(--line); background: var(--surface); display: flex; align-items: center; gap: 12px; padding: 0 16px; text-align: left; font-weight: 800; font-size: 1.15rem; }
.outbtn .box { width: 2rem; height: 2rem; border-radius: 8px; border: 3px solid var(--muted); display: grid; place-items: center; flex: none; font-size: 1.3rem; line-height: 1; }
.outbtn span.t { flex: 1; }
.outbtn b { font-variant-numeric: tabular-nums; }
.outbtn[aria-pressed="true"] { background: var(--good-bg); border-color: var(--good); }
.outbtn[aria-pressed="true"] .box { background: var(--good); border-color: var(--good); color: #fff; }

.break { margin-top: 14px; }
.break h3 { font-size: 1.05rem; font-weight: 850; margin-bottom: 6px; }
.brow { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.brow + .brow { border-top: 1px solid var(--line); }
.brow.total { border-top: 2.5px solid var(--ink); font-size: 1.3rem; font-weight: 900; padding-top: 10px; margin-top: 4px; }
.nextside { margin-top: 14px; }

.notice { border-radius: 14px; padding: 12px 14px; font-weight: 650; font-size: .98rem; margin-bottom: 14px; }
.notice.warn { background: var(--warn-bg); color: var(--warn-ink); border: 2px solid var(--warn-line); }
.notice.warn b { display: block; margin-bottom: 4px; }
.notice.warn ul { padding-left: 1.1rem; list-style: disc; }
.notice.info { background: var(--surface-2); border: 2px solid var(--line); }
.notice.edit { background: var(--warn-bg); color: var(--warn-ink); border: 2px solid var(--warn-line); }

.panels { display: grid; gap: 16px; align-items: start; }
.panels .sidehead { margin-bottom: 14px; }

/* ---------- bottom bar ---------- */
.bottombar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--bg); border-top: 1.5px solid var(--line); box-shadow: 0 -6px 18px rgba(0, 0, 0, .15); padding: 10px 0 calc(10px + var(--safe-b)); }
.bottombar .wrap { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.bottombar .btn { min-height: 3.5rem; }
.bottombar .btn.primary { flex: 1; min-width: 10rem; }
.bottombar .btn.sec { padding: 0 .9rem; }

/* ---------- home / setup ---------- */
.hero { text-align: center; padding: calc(var(--safe-t) + 28px) 16px 26px; }
.logo { font-size: clamp(2.2rem, 9vw, 3.2rem); font-weight: 900; letter-spacing: -.02em; line-height: 1; text-shadow: 0 3px 0 rgba(0, 0, 0, .25); }
.logo span { color: var(--gold); }
.tagline { color: var(--on-felt-dim); margin-top: 8px; font-size: 1.1rem; font-weight: 650; }
.h2 { font-size: 1.25rem; font-weight: 850; margin: 22px 0 10px; }
.games { display: grid; gap: 12px; }
.game { display: flex; align-items: stretch; gap: 8px; }
.game .open { flex: 1; text-align: left; padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 2px solid var(--line); box-shadow: var(--shadow); min-height: 4.5rem; min-width: 0; }
.game .open strong { display: block; font-size: 1.1rem; font-weight: 850; overflow-wrap: anywhere; }
.game .open span { display: block; font-size: .92rem; color: var(--muted); font-weight: 650; }
.game .del { width: 3.5rem; border-radius: var(--r); background: var(--surface); border: 2px solid var(--line); color: var(--neg); font-weight: 800; font-size: .85rem; flex: none; }
.badge { display: inline-block; font-size: .78rem; font-weight: 850; padding: 2px 9px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-ink); border: 1.5px solid var(--warn-line); margin-top: 4px; }
.field { display: grid; gap: 6px; margin-top: 12px; }
.field > label, .label { font-weight: 800; font-size: 1rem; }
input.text { width: 100%; min-height: 3.4rem; padding: 0 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 1.2rem; }
.pl-row { display: flex; gap: 8px; }
.pl-row input { flex: 1; min-width: 0; }
.pl-row .btn { width: 3.4rem; padding: 0; flex: none; font-size: 1.5rem; min-height: 3.4rem; }
.teamcard h3 { font-size: 1.15rem; font-weight: 850; display: flex; align-items: center; gap: 8px; }
.stack { display: grid; }
.bigbtns { display: grid; gap: 12px; margin-top: 12px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.muted { color: var(--muted); font-weight: 600; }
.other-app { text-align: center; margin-top: 16px; color: var(--muted); font-size: .9rem; font-weight: 600; }
.other-app a { display: inline-block; padding: 10px 4px; min-height: 44px; color: var(--ink, inherit); font-weight: 750; text-underline-offset: 4px; }

/* ---------- summary / final ---------- */
.banner { text-align: center; padding: 22px 16px; border-radius: var(--r); }
.banner h1 { font-size: 1.7rem; font-weight: 900; line-height: 1.15; }
.banner p { color: var(--on-felt-dim); font-weight: 650; margin-top: 4px; }
.banner .trophy { font-size: 2.6rem; line-height: 1; }
.banner .big { font-size: 3rem; font-weight: 900; color: var(--gold); font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 6px; }
.cmp { display: grid; gap: 12px; margin-top: 14px; }
.res { background: var(--surface); border: 1.5px solid var(--line); border-left: 10px solid var(--c); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow); }
.res h3 { font-size: 1.15rem; font-weight: 850; overflow-wrap: anywhere; }
.res .rt { font-size: 2rem; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.15; }
.res .rt small { font-size: .9rem; color: var(--muted); font-weight: 700; margin-left: 6px; }
.res .runs { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; padding-top: 8px; margin-top: 8px; border-top: 1.5px solid var(--line); }
.openbox { margin-top: 10px; padding: 12px; border-radius: 14px; background: var(--warn-bg); border: 2px solid var(--warn-line); color: var(--warn-ink); display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 800; }
.openbox b { font-size: 2.2rem; line-height: 1; font-variant-numeric: tabular-nums; }
.openbox small { display: block; font-weight: 650; font-size: .85rem; }
.rank { display: flex; align-items: center; gap: 10px; padding: 10px 0; font-weight: 750; }
.rank + .rank { border-top: 1px solid var(--line); }
.rank .nm { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rank .v { font-weight: 900; font-size: 1.2rem; font-variant-numeric: tabular-nums; }

/* ---------- score sheet table ---------- */
.tablewrap { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
table.sheet { width: 100%; border-collapse: collapse; table-layout: fixed; }
.sheet th, .sheet td { padding: 0; border-bottom: 1px solid var(--line); text-align: right; vertical-align: top; }
.sheet thead th { padding: 10px 8px; background: var(--surface-2); font-size: .9rem; font-weight: 850; overflow-wrap: anywhere; vertical-align: bottom; }
.sheet thead th:first-child, .sheet tbody th { text-align: left; width: 5.6rem; white-space: nowrap; }
.sheet tbody th { font-weight: 800; }
.cellbtn { display: block; width: 100%; min-height: 3.6rem; padding: 8px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 850; font-size: 1.1rem; line-height: 1.15; }
.sheet tbody th .cellbtn { text-align: left; }
.cellbtn small { display: block; font-weight: 650; color: var(--muted); font-size: .78rem; margin-top: 2px; }
.sheet tr.open > * { background: var(--surface-2); }
.sheet tfoot td, .sheet tfoot th { padding: 12px 8px; font-weight: 900; font-size: 1.15rem; border-top: 3px solid var(--ink); font-variant-numeric: tabular-nums; }
.sheet tfoot th { text-align: left; }
.detail td { padding: 10px 12px 14px; text-align: left; background: var(--surface-2); }
.dgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr)); }
.dside { background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.dside h4 { margin: 0 0 4px; font-size: 1rem; font-weight: 850; display: flex; justify-content: space-between; gap: 8px; }
.dsec { padding-top: 6px; }
.dsec .dh { display: flex; justify-content: space-between; font-weight: 800; font-size: .92rem; }
.dsec .dl { display: flex; justify-content: space-between; gap: 8px; font-size: .86rem; color: var(--muted); font-weight: 600; padding-left: 8px; font-variant-numeric: tabular-nums; }
.detail .btn { margin-top: 10px; }

/* ---------- rules / settings ---------- */
.rtable { display: grid; grid-template-columns: 1fr 6rem 6rem; gap: 8px 10px; align-items: center; }
.rtable.one { grid-template-columns: 1fr 7.5rem; }
.rtable .h { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 850; color: var(--muted); text-align: center; }
.rtable .h:first-child { text-align: left; }
.rtable input { width: 100%; height: 3.2rem; text-align: right; font: inherit; font-size: 1.15rem; font-weight: 800; padding: 0 .6rem; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); }
.rtable .nm { font-weight: 750; }
.saved { font-size: .9rem; color: var(--good); font-weight: 800; min-height: 1.3em; }

/* ---------- dialog ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .6); display: grid; place-items: center; padding: 16px; }
.dialog { background: var(--surface); color: var(--ink); border-radius: 20px; padding: 20px; width: 100%; max-width: 30rem; max-height: 90dvh; overflow: auto; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
.dialog h2 { font-size: 1.3rem; font-weight: 850; margin-bottom: 8px; }
.dialog p, .dialog li { font-weight: 600; margin-top: 6px; }
.dialog ul { padding-left: 1.1rem; list-style: disc; }
.dialog .acts { display: grid; gap: 10px; margin-top: 18px; }

@media (min-width: 720px) {
  .wrap { padding: 0 24px; }
  .board { gap: 12px; }
  .sb .tot { font-size: 2rem; }
  .sb .nm { font-size: 1rem; }
  .sb .sub { font-size: .88rem; }
  .cmp.n2 { grid-template-columns: 1fr 1fr; }
  .cmp.n3 { grid-template-columns: 1fr 1fr 1fr; }
  .bottombar .btn.primary { flex: 1 1 auto; max-width: 28rem; margin-left: auto; }
  .btn.big { max-width: 28rem; }
  .bigbtns .btn.big { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

html[data-text="xl"] .sb .rnd, html[data-text="xl"] .leadline { display: none; }
html[data-text="xl"] .topbar .spacer { display: none; }
html[data-text="xl"] .topbar .title { font-size: 1.05rem; }
html[data-text="xl"] .sb .tot { font-size: 1.35rem; }
@media (min-width: 720px) { html[data-text="xl"] .sb .rnd, html[data-text="xl"] .leadline { display: block; } }

.sidehead .rename { min-height: 2.75rem; flex: none; }
.renamelab { display: block; font-weight: 800; margin: 4px 0 8px; }
.renameinput { width: 100%; font: inherit; font-size: 1.35rem; font-weight: 800; padding: .7rem .9rem; border-radius: var(--r); border: 2px solid var(--line); background: var(--surface); color: var(--ink); margin-bottom: 14px; }
.renameinput:focus { outline: 3px solid var(--gold, #e0a800); outline-offset: 2px; }

/* Book rows: a "Required" box plus a count of extra books */
.bookrow { flex-wrap: wrap; row-gap: 8px; }
.bookrow .lab { flex: 1 1 100%; }
.reqbox { display: inline-flex; align-items: center; gap: 8px; min-height: 3.2rem; padding: 0 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); font-weight: 800; font-size: 1.02rem; }
.reqbox .box { width: 1.7rem; height: 1.7rem; border-radius: 7px; border: 3px solid var(--muted); display: grid; place-items: center; font-size: 1.1rem; line-height: 1; }
.reqbox[aria-pressed="true"] { border-color: var(--good); background: var(--good-bg); color: var(--good); }
.reqbox[aria-pressed="true"] .box { background: var(--good); border-color: var(--good); color: #fff; }
.stepper.extra { margin-left: auto; }
.stepper.extra .xl { font-size: .85rem; font-weight: 800; color: var(--muted); margin-right: 2px; }
input.cnt:disabled { opacity: .4; }
.outbtn:disabled { opacity: .55; border-style: dashed; }
.pointsbox.pp + .pointsbox.pp { border-top: 1px solid var(--line); }
.brow.pptotal { border-top: 1.5px dashed var(--line); margin-top: 4px; padding-top: 8px; font-weight: 800; }

/* The app's own number pad on touch screens */
.numpad { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--surface-2); border-top: 1.5px solid var(--line); box-shadow: 0 -8px 24px rgba(0, 0, 0, .18); padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
.numpad[hidden] { display: none; }
.padkeys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 480px; margin: 0 auto; }
.padkeys button { height: 3.4rem; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 1.6rem; font-weight: 800; }
.padkeys button:active { transform: scale(.95); }
.padkeys button.done { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-size: 1.2rem; }
.padkeys button.back { font-size: 1.4rem; }
body.padopen main { padding-bottom: 300px; }
.bookrow { column-gap: 8px; }
.bookrow .reqbox { padding: 0 10px; gap: 6px; font-size: .95rem; }
.bookrow .stepper { gap: 4px; }
.bookrow .stepper button { width: 2.8rem; }
.bookrow input.cnt { width: 3rem; }
.bookrow .stepper.extra .xl { font-size: .78rem; }
