:root {
  --bg: #ffffff;
  --fg: #1d1d1f;
  --muted: #5c5c66;
  --accent: #1f6f5c;
  --error: #b3261e;
  --line: #d9d9de;
  --max: 36rem;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151517; --fg: #ececf0; --muted: #a4a4ae; --accent: #6fcfb3; --error: #f2b8b5; --line: #3a3a40; }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 1rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { max-width: var(--max); margin: 0 auto; padding: 2rem 1rem; }
h1 { font-size: 1.5rem; color: var(--accent); margin-top: 0; }
p { color: var(--muted); }
a { color: var(--accent); }
form { margin: 1.5rem 0; }
label { display: block; font-weight: 600; margin-bottom: 0.4rem; }
input[type=email], input[type=text], select {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 1.1rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--muted);
  border-radius: 0.4rem;
  background: var(--bg);
  color: var(--fg);
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
button {
  margin-top: 1rem;
  font: inherit;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border: 0;
  border-radius: 0.4rem;
  background: var(--accent);
  color: var(--bg);
  cursor: pointer;
}
.error { color: var(--error); font-weight: 600; }
.hint, .contact { font-size: 0.9rem; }
h2 { font-size: 1.1rem; margin: 1.75rem 0 0.5rem; }
.bar {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; justify-content: space-between; align-items: center;
  font-size: 0.9rem; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 0.6rem; margin-bottom: 1.5rem;
}
.bar-actions { display: flex; gap: 1rem; align-items: center; }
form.inline { display: inline; margin: 0; }
button.link {
  margin: 0; padding: 0; background: none; color: var(--accent); font-weight: 400; text-decoration: underline;
}
button.secondary { margin: 0; background: var(--line); color: var(--fg); }
.menu, .choices { list-style: none; padding: 0; margin: 0; }
.menu li, .choices li { padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.choices form { margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.placeholder { color: var(--muted); }
.soon { font-size: 0.8rem; margin-left: 0.4rem; padding: 0.05rem 0.4rem; border: 1px solid var(--line); border-radius: 1rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
table.list { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.list th, table.list td { text-align: left; padding: 0.45rem 0.4rem; border-bottom: 1px solid var(--line); }
.cf-turnstile { margin: 1rem 0; min-height: 65px; }
.notice { color: var(--fg); background: var(--line); padding: 0.6rem 0.8rem; border-radius: 0.4rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; margin: 1rem 0; }
.actions form { margin: 0; }
.actions button, .actions .button { margin: 0; }
a.button {
  display: inline-block; font-weight: 600; padding: 0.6rem 1.2rem; border-radius: 0.4rem;
  background: var(--accent); color: var(--bg); text-decoration: none;
}
a.button.secondary { background: var(--line); color: var(--fg); }
button.danger { background: var(--error); color: var(--bg); }
.field { margin-bottom: 1rem; }
.field .help { font-size: 0.85rem; margin: 0.25rem 0 0; }
input[type=file] { font: inherit; }
.preview h2 .count { font-weight: 400; color: var(--muted); }
.diff del { color: var(--error); }
.diff ins { color: var(--accent); text-decoration: none; font-weight: 600; }
.audit td:first-child { white-space: nowrap; }
.pager { display: flex; gap: 1rem; margin: 1rem 0; }
/* Choice lists (radio buttons, tick-boxes), e.g. the CSV mode (1.7) */
fieldset.options { border: 0; margin: 0 0 1rem; padding: 0; }
fieldset.options legend { font-weight: 600; margin-bottom: 0.4rem; padding: 0; }
label.option { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 400; margin: 0.5rem 0; }
label.option input { margin-top: 0.3rem; flex: none; }
.warning { color: var(--fg); border-left: 4px solid var(--error); padding: 0.5rem 0.8rem; }
/* A way back at the top of long pages (audit log, member list) */
p.back { font-size: 0.9rem; margin: 0 0 0.5rem; }
/* Stage 3: the Email pages' links to each other */
nav.subnav { font-size: 0.95rem; margin: 0 0 0.75rem; }
/* Stage 2: lists of people with actions (operator club admins) */
.choices li .actions { margin: 0.3rem 0 0; }
/* Stage 2 leagues */
.demo-banner { font-size: 0.9rem; color: var(--fg); border: 1px dashed var(--accent); border-radius: 0.4rem; padding: 0.35rem 0.7rem; margin: 0 0 1rem; }
.boxes { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); margin: 1rem 0; }
.box { border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.6rem 0.8rem; }
.box h3 { font-size: 1rem; margin: 0 0 0.4rem; }
.box ol { margin: 0; padding-left: 1.4rem; }
.box.mine { border-color: var(--accent); border-width: 2px; }
.me { font-weight: 700; }
.tag { font-size: 0.8rem; margin-left: 0.3rem; padding: 0.05rem 0.4rem; border: 1px solid var(--line); border-radius: 1rem; color: var(--muted); }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.checklist .tick { display: inline-block; width: 1.6rem; font-weight: 700; color: var(--accent); }
.checklist .todo { color: var(--muted); }
.checklist .problem { color: var(--error); }
.checklist p { margin: 0.2rem 0 0 1.6rem; font-size: 0.9rem; }
.order { list-style: none; padding: 0; margin: 0; }
.order li { display: flex; flex-wrap: wrap; gap: 0.3rem 0.6rem; align-items: center; padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.order .pos { width: 1.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.order .who { flex: 1 1 8rem; }
.order form { margin: 0; display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.order button, .order select { margin: 0; font-size: 0.9rem; padding: 0.35rem 0.6rem; width: auto; display: inline-block; }
.order button.arrow { min-width: 2.4rem; }
.draft-box { margin: 1.25rem 0 0; }
.draft-box h3 { font-size: 1rem; margin: 0 0 0.3rem; }
input[type=date], input[type=number] { font: inherit; font-size: 1.1rem; padding: 0.5rem 0.6rem; border: 1px solid var(--muted); border-radius: 0.4rem; background: var(--bg); color: var(--fg); }
table.list td.num, table.list th.num { text-align: right; font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Stage 2 scores: the round as a list of games (L73) and score entry */
.games { padding-left: 1.4rem; margin: 0.5rem 0 1rem; }
.games li { padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
.games li.todo .score { color: var(--muted); font-weight: 400; }
.hint-inline, .change { color: var(--muted); font-size: 0.9rem; }
.change { display: block; }
a.small, button.link.small { font-size: 0.85rem; margin-left: 0.5rem; white-space: nowrap; }
a.small.under { margin-left: 0; }
.pts { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
fieldset.score { border: 1px solid var(--line); border-radius: 0.5rem; margin: 0 0 0.8rem; padding: 0.5rem 0.8rem 0.3rem; }
fieldset.score.has-error { border-color: var(--error); }
.score-check { margin: 0.3rem 0; }
.rule { margin: 0.4rem 0 0.6rem; }
fieldset.score legend { font-weight: 600; padding: 0 0.3rem; }
.score-row { display: grid; grid-template-columns: 1fr 5rem; gap: 0.4rem 0.6rem; align-items: center; margin: 0.4rem 0; }
.score-row label { margin: 0; font-weight: 400; }
.score-row input { width: 5rem; }
/* 2.4a: ratings */
table.list td.delta { white-space: nowrap; color: var(--muted); font-size: 0.9rem; }
.notice.panel p { margin: 0.3rem 0; color: var(--fg); }

details.change-form > summary {
  list-style: none; display: inline-block; cursor: pointer; margin: 0 0 1rem; font-weight: 600;
  padding: 0.6rem 1.2rem; border-radius: 0.4rem; background: var(--line); color: var(--fg);
}
details.change-form > summary::-webkit-details-marker { display: none; }
details.change-form[open] > summary { display: none; }
.admin-bar { border: 1px solid var(--accent); border-radius: 0.4rem; padding: 0.5rem 0.8rem; font-size: 0.95rem; }
.admin-bar .tag.look-count { color: var(--accent); border-color: var(--accent); font-weight: 600; }
a.tag.look { color: var(--accent); border-color: var(--accent); font-weight: 600; text-decoration: none; }

/* 2.4b: the printable ladder (E.9, L70), A4 portrait from the browser's Print */
.print-boxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 0.75rem; }
.print-boxes .print-box { border: 1px solid var(--line); border-radius: 6px; padding: 0.5rem 0.6rem; break-inside: avoid; }
.print-boxes .print-box h3 { margin: 0 0 0.3rem; font-size: 1rem; }
.print-boxes ol { margin: 0; padding-left: 1.3rem; }
@media print {
  @page { size: A4 portrait; margin: 10mm 12mm; }
  body { background: #fff; color: #000; }
  main { max-width: none; padding: 0; }
  .bar, .demo-banner, .guide-bar, .back, .no-print, p.notice[role="status"] { display: none !important; }
  a { color: inherit; text-decoration: none; }
  .print-boxes { grid-template-columns: repeat(4, 1fr); gap: 3mm; }
  .print-boxes .print-box { border-color: #888; padding: 1.5mm 2.5mm; }
  .print-boxes .print-box h3 { font-size: 10.5pt; margin-bottom: 1mm; }
  .print-boxes ol { font-size: 10pt; line-height: 1.3; }
  h1 { font-size: 15pt; margin: 0 0 2mm; }
  h2 { font-size: 12pt; margin: 4mm 0 2mm; break-after: avoid; }
  p { margin: 0 0 2mm; font-size: 10pt; }
  table.list { font-size: 9.5pt; line-height: 1.25; }
  table.list th, table.list td { padding: 0.6mm 1.5mm; }
}
.cell-line { display: block; }
.cell-line + .cell-line { margin-top: 0.3rem; }

/* 2.5b: the WhatsApp summary's text box and its "Copied" note. */
textarea.summary { field-sizing: content; width: 100%; box-sizing: border-box; font: inherit; font-size: 0.95rem; line-height: 1.45; padding: 0.6rem; border: 1px solid var(--muted); border-radius: 0.4rem; background: var(--bg); color: var(--fg); resize: vertical; }
.notice-inline { color: var(--accent); font-weight: 600; margin-left: 0.5rem; }

/* L92: the box standings fit a narrow phone: tighter cells, and short column
   headings (Gms, Pts, Avg) below 420px wide. */
table.standings .short { display: none; }
table.standings abbr { text-decoration: none; }
@media (max-width: 420px) {
  table.standings { font-size: 0.88rem; }
  table.standings th, table.standings td { padding: 0.4rem 0.2rem; }
  table.standings .long { display: none; }
  table.standings .short { display: inline; }
}
.help .short { display: none; }
@media (max-width: 420px) { .help .short { display: inline; } }

/* League poster (1 Nov 2026): one league on one A4 portrait page, in the
   league's colour theme (a class, as the CSP allows no inline styles). */
.field textarea { display: block; width: 100%; font: inherit; font-size: 1rem; padding: 0.6rem 0.7rem; border: 1px solid var(--muted); border-radius: 0.4rem; background: var(--bg); color: var(--fg); resize: vertical; }
.poster-blue   { --p-deep: #143a6b; --p-mid: #2f7fd1; --p-soft: #e2effb; --p-tint: #f3f8fd; }
.poster-pink   { --p-deep: #86204f; --p-mid: #d6528f; --p-soft: #fbe5ef; --p-tint: #fdf3f7; }
.poster-green  { --p-deep: #1d5636; --p-mid: #3a9a5c; --p-soft: #e2f3e7; --p-tint: #f3faf5; }
.poster-purple { --p-deep: #47287a; --p-mid: #7d57c6; --p-soft: #ece6f8; --p-tint: #f7f4fc; }
.poster-orange { --p-deep: #84380d; --p-mid: #e07a26; --p-soft: #fce9d8; --p-tint: #fef6ee; }
.poster-teal   { --p-deep: #0e4f54; --p-mid: #229f9f; --p-soft: #dcf2f1; --p-tint: #f0faf9; }

/* Club admin > Posters: a colour is one tap. */
.poster-setting { border-top: 1px solid var(--line); padding-top: 0.5rem; margin-top: 1.5rem; }
.swatches { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0 1rem; }
.swatches .swatch { display: inline-flex; align-items: center; gap: 0.4rem; width: auto; margin: 0; padding: 0.4rem 0.7rem; background: var(--bg); color: var(--fg); border: 2px solid var(--line); font-size: 0.95rem; }
.swatches .swatch.chosen { border-color: var(--p-deep); font-weight: 700; }
.swatch-chip { display: inline-block; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--p-mid); box-shadow: inset 0 0 0 3px var(--p-soft); border: 2px solid var(--p-deep); }

.poster {
  --p-gold: #f6c544; --p-ink: #1b1d22;
  background: var(--p-soft); color: var(--p-ink); border-radius: 10px; padding: 0.8rem;
  display: flex; flex-direction: column; gap: 0.6rem;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.poster p { color: inherit; margin: 0; }
.poster-head { background: var(--p-deep); color: #fff; border-radius: 8px; padding: 0.7rem 0.9rem; display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.poster-club { font: 900 1.9rem/1.05 "Arial Black", "Helvetica Neue", Arial, system-ui, sans-serif; text-transform: uppercase; letter-spacing: 0.02em; }
.poster-club-long { font-size: 1.55rem; }
.poster-club-longer { font-size: 1.25rem; }
.poster-league { font-size: 1.05rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; opacity: 0.92; margin-top: 0.15rem !important; }
.poster-badge { text-align: center; }
.poster-kind { background: var(--p-gold); color: var(--p-ink); font-weight: 900; font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.25rem 0.7rem; border-radius: 6px; }
.poster-dates { font-size: 0.85rem; margin-top: 0.3rem !important; letter-spacing: 0.04em; }
.poster-strip { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3rem 0.4rem; font-size: 0.85rem; }
.poster-strip li { background: #fff; border: 1px solid var(--p-mid); color: var(--p-deep); border-radius: 1rem; padding: 0.1rem 0.6rem; font-weight: 600; }
.poster-count { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 0.2rem !important; opacity: 0.9; }
.poster-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; align-items: start; }
.poster-card { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 0 rgba(0,0,0,0.08); break-inside: avoid; }
.poster-card h2 { margin: 0; background: var(--p-deep); color: #fff; font-size: 1rem; padding: 0.35rem 0.6rem; display: flex; justify-content: space-between; align-items: baseline; gap: 0.4rem; }
.poster-size { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.85; white-space: nowrap; }
.poster-card table { width: 100%; border-collapse: collapse; }
.poster-card th { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--p-deep); text-align: left; padding: 0.25rem 0.4rem; background: var(--p-tint); }
.poster-card td { padding: 0.3rem 0.4rem; border-top: 1px solid var(--p-soft); }
.poster-card .num { text-align: right; width: 1%; white-space: nowrap; }
.poster-card th.num:first-child, .poster-card td.num:first-child { text-align: center; }
.poster-card td.name { font-weight: 600; max-width: 0; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poster-card td.avg { font-weight: 700; }
.poster-rank { display: inline-block; min-width: 1.7em; padding: 0.05rem 0.25rem; border-radius: 4px; background: var(--p-soft); color: var(--p-deep); font-weight: 800; font-size: 0.85em; text-align: center; }
.poster-rank.top { background: var(--p-gold); color: var(--p-ink); }
.poster-rank.new { background: var(--p-mid); color: #fff; font-size: 0.7em; text-transform: uppercase; letter-spacing: 0.04em; }
.poster-note { font-size: 0.68em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--p-deep); border: 1px solid var(--p-mid); border-radius: 3px; padding: 0 0.25em; white-space: nowrap; }
.poster-card .short { display: none; }
.poster-card abbr { text-decoration: none; }
.poster-sm .poster-card .long { display: none; }
.poster-sm .poster-card .short { display: inline; }
.poster-card .mv { width: 1%; text-align: center; font-weight: 900; }
.mv-up { color: #1c8a3e; }
.mv-down { color: #c0392b; }
.mv-stay { color: #8a8f99; }
.poster-panels { display: flex; gap: 0.6rem; margin-top: auto; }
.poster-panel { flex: 1 1 0; min-width: 0; background: #fff; border-radius: 8px; padding: 0.5rem 0.7rem; border-top: 5px solid var(--p-mid); }
.poster-panel h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--p-deep); margin: 0 0 0.3rem; }
.poster-panel ul { list-style: none; margin: 0; padding: 0; }
.poster-panel li, .poster-panel p { font-size: 0.85rem; line-height: 1.35; overflow-wrap: anywhere; }
.poster-panel li + li { margin-top: 0.15rem; }
.poster-club-note { border-top-color: var(--p-deep); }
.poster-league-note { border-top-color: var(--p-gold); }
.poster-foot { display: flex; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; font-size: 0.72rem; color: var(--p-deep); }
@media (max-width: 480px) {
  .poster { padding: 0.5rem; }
  .poster-club { font-size: 1.45rem; }
  .poster .poster-club-longer { font-size: 1.15rem; }
  .poster-cards { grid-template-columns: minmax(0, 1fr); }
  .poster-panels { flex-direction: column; }
}
@media print {
  @page { size: A4 portrait; margin: 8mm; }
  .poster { min-height: 279mm; border-radius: 0; padding: 5mm; gap: 3.5mm; margin: 0; }
  .poster-head { padding: 4mm 5mm; border-radius: 3mm; flex-wrap: nowrap; }
  .poster-titles { min-width: 0; }
  .poster-badge { flex: none; }
  .poster-club { font-size: 30pt; }
  .poster-league { font-size: 13pt; }
  .poster-kind { font-size: 13pt; }
  .poster-dates { font-size: 10pt; }
  .poster-strip { font-size: 9.5pt; }
  .poster-count { font-size: 8.5pt; }
  .poster-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3.5mm; }
  .poster-cols-3 .poster-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5mm; }
  .poster-card { box-shadow: none; border-radius: 2.5mm; }
  .poster-card h2 { font-size: 12.5pt; padding: 1.6mm 3mm; }
  .poster-card th { font-size: 7.5pt; padding: 0.8mm 2mm; }
  .poster-card td { padding: 1.3mm 2mm; font-size: 12.5pt; }
  .poster-xl .poster-card td { padding: 2.2mm 2.5mm; font-size: 15pt; }
  .poster-xl .poster-card h2 { font-size: 14.5pt; padding: 2.2mm 3mm; }
  .poster-xl .poster-card th { font-size: 8.5pt; padding: 1.2mm 2.5mm; }
  .poster-md .poster-card td { padding: 0.7mm 2mm; font-size: 11pt; }
  .poster-md .poster-card h2 { font-size: 11pt; padding: 1.3mm 2.5mm; }
  .poster-md .poster-card th, .poster-sm .poster-card th { padding: 0.4mm 1.5mm; }
  .poster-md .poster-head, .poster-sm .poster-head { padding: 3mm 4mm; }
  .poster-md .poster-club, .poster-sm .poster-club { font-size: 24pt; }
  .poster .poster-club-long { font-size: 22pt; }
  .poster .poster-club-longer { font-size: 17pt; }
  .poster-sm .poster-card td { padding: 0.45mm 1.5mm; font-size: 9.5pt; }
  .poster-md .poster-strip, .poster-sm .poster-strip { font-size: 8.5pt; }
  .poster-md .poster-panel li, .poster-md .poster-panel p,
  .poster-sm .poster-panel li, .poster-sm .poster-panel p { font-size: 8.5pt; line-height: 1.25; }
  .poster-md .poster-panel, .poster-sm .poster-panel { padding: 2mm 3mm; }
  .poster-sm .poster-card h2 { font-size: 10.5pt; padding: 1.2mm 2mm; }
  .poster-sm .poster-card th { font-size: 6.5pt; padding: 0.5mm 1.5mm; }
  .poster-panel { padding: 2.5mm 3.5mm; border-radius: 2.5mm; }
  .poster-panel h2 { font-size: 9pt; }
  .poster-panel li, .poster-panel p { font-size: 9pt; line-height: 1.3; }
  .poster-foot { font-size: 8pt; }
}

/* 2 Nov: the guided demo's start, when players are waiting to join. */
.waiting-choice .option-card { border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.2rem 1rem 1rem; margin-bottom: 1rem; }
.waiting-choice .option-card h2 { font-size: 1.1rem; }

/* 2 Nov: the box page after saving scores: a confirmation beside the games,
   and a complete round's score boxes folded under one button. */
p.saved { color: var(--accent); font-weight: 600; background: var(--line); padding: 0.6rem 0.8rem; border-radius: 0.4rem; }
details.correct-scores > summary { display: inline-block; cursor: pointer; font-weight: 600; padding: 0.55rem 0.9rem; border-radius: 0.4rem; background: var(--line); color: var(--fg); list-style: none; margin: 0.5rem 0 1rem; }
details.correct-scores > summary::-webkit-details-marker { display: none; }
details.correct-scores[open] > summary { margin-bottom: 1rem; }

/* Stage 3: the operator's pages. Server commands: one block per command, the
   command in a read-only box that wraps on a phone, with a Copy button. */
.command { border-bottom: 1px solid var(--line); padding: 0.4rem 0 0.8rem; }
.command h3 { font-size: 1rem; margin: 0.4rem 0 0.2rem; }
/* Stage 3, Phase 3.4: the operator's lookups and Support view */
.op-detail h3 { font-size: 1rem; margin: 1.25rem 0 0.4rem; }
.op-detail h4 { font-size: 0.95rem; margin: 1rem 0 0.3rem; }
.op-detail ul.games { padding-left: 1.1rem; margin: 0.3rem 0 0.75rem; }
.command p { margin: 0.3rem 0; }
textarea.command-text { field-sizing: content; width: 100%; box-sizing: border-box; font: 0.85rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 0.5rem; border: 1px solid var(--muted); border-radius: 0.4rem; background: var(--bg); color: var(--fg); resize: vertical; overflow-wrap: anywhere; }
form.filters { margin: 0 0 1rem; }
form.filters select { max-width: 100%; }
/* Site › User guides: one block per guide. */
.guide-file { border-bottom: 1px solid var(--line); padding: 0.4rem 0 1rem; }
.guide-file h2 { margin-top: 0.8rem; }
/* Health (3.2): a status word in a coloured outline (the word carries the
   meaning; the colour only repeats it). */
:root { --amber: #8a5a00; }
@media (prefers-color-scheme: dark) { :root { --amber: #f0c36d; } }
.st { display: inline-block; font-size: 0.8rem; font-weight: 600; padding: 0.05rem 0.5rem; border: 2px solid; border-radius: 1rem; white-space: nowrap; vertical-align: 0.1em; }
.st-ok { color: var(--accent); }
.st-check { color: var(--amber); }
.st-act { color: var(--error); }
.health-strip li { display: flex; flex-wrap: wrap; gap: 0.2rem 0.6rem; align-items: baseline; }
.health-strip li .hint { flex-basis: 100%; margin: 0; }
.health-check { border-bottom: 1px solid var(--line); padding-bottom: 0.6rem; }
.health-check h2 { display: flex; flex-wrap: wrap; gap: 0.2rem 0.6rem; align-items: baseline; }
.health-check ul { margin: 0.3rem 0; padding-left: 1.2rem; color: var(--muted); font-size: 0.9rem; }
/* Stage 4: the availability calendar, phones first (fits 390 px, no sideways scroll). */
:root { --green-bg: #d3efdc; --green-fg: #124a2a; }
@media (prefers-color-scheme: dark) { :root { --green-bg: #1e4a31; --green-fg: #cdf2d9; } }
.av-people { list-style: none; padding: 0; margin: 0.5rem 0; font-size: 0.95rem; }
.av-people li { padding: 0.2rem 0; color: var(--muted); }
.av-people strong { color: var(--fg); }
.av-controls { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 1rem 0; }
.av-controls form { margin: 0; }
.av-controls a.button, .av-controls button { margin: 0; padding: 0.5rem 0.9rem; font-size: 0.95rem; }
.av-week h2 { margin: 1.25rem 0 0.25rem; }
.av-head, .av-row {
  display: grid; grid-template-columns: 3rem repeat(3, minmax(0, 1fr)) 4.25rem; gap: 0.3rem; align-items: stretch;
}
.av-head { font-size: 0.8rem; color: var(--muted); text-align: center; padding-bottom: 0.15rem; }
.av-day { border-top: 1px solid var(--line); padding: 0.3rem 0; }
.av-date { display: flex; flex-direction: column; justify-content: center; line-height: 1.15; font-size: 0.85rem; text-decoration: none; color: var(--fg); }
.av-date b { font-size: 1.05rem; }
.av-day.today .av-date { color: var(--accent); }
.av-cell, .av-any {
  margin: 0; min-height: 2.75rem; padding: 0.2rem; border: 1px solid var(--line); border-radius: 0.4rem;
  background: var(--bg); color: var(--fg); font: inherit; font-size: 0.95rem; font-weight: 400;
  display: flex; align-items: center; justify-content: center; gap: 0.2rem; cursor: pointer;
}
.av-cell.mine { border: 2px solid var(--accent); font-weight: 600; }
.av-tick { color: var(--accent); font-weight: 700; }
.av-cell.green { background: var(--green-bg); color: var(--green-fg); }
.av-cell.green .av-tick { color: var(--green-fg); }
.av-any { font-size: 0.8rem; line-height: 1.1; text-align: center; color: var(--accent); }
.av-any.on { background: var(--accent); color: var(--bg); border-color: var(--accent); font-weight: 600; }
span.av-cell, span.av-any { cursor: default; }
.av-day.past .av-cell, .av-day.past .av-any, .av-day.past .av-date { opacity: 0.5; }
.av-day.saving .av-row { opacity: 0.6; }
.av-who { padding: 0.3rem 0 0.1rem 3.3rem; font-size: 0.9rem; }
.av-who p { margin: 0.1rem 0; }
.av-msg { margin: 0.3rem 0 0 3.3rem; font-size: 0.9rem; }
.av-none { display: none; }
.av.only-green .av-day:not(.has-green), .av.only-green .av-week:not(:has(.has-green)) { display: none; }
.av.only-green .av-cell:not(.green) { opacity: 0.35; }
.av.only-green:not(:has(.has-green)) .av-none { display: block; }
