@font-face {
  font-family: 'Crimson Pro';
  src: url('fonts/crimson-pro-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f2f4f6;
  --panel: #ffffff;
  --ink: #18212d;
  --muted: #4b5664;
  --line: #d2d8df;
  --soft: #e7ebef;
  --accent: #b32a2f;
  --primary: #1d2f4a;
  --on-primary: #ffffff;
  --odd: #2b5a9c;
  --odd-soft: #e3ecf8;
  --even: #0f7560;
  --even-soft: #def2ec;
  --warn-bg: #fff4dc;
  --warn-line: #e2b54a;
  --ok: #1d6b3a;
  --head: 'Crimson Pro', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --r: 6px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121820;
    --panel: #1a222d;
    --ink: #e7ecf2;
    --muted: #a6b1be;
    --line: #2f3b4a;
    --soft: #222c39;
    --accent: #ec7a7e;
    --primary: #d6e1ef;
    --on-primary: #121820;
    --odd: #8db2ea;
    --odd-soft: #1d2b40;
    --even: #5cc9a8;
    --even-soft: #15302a;
    --warn-bg: #33290f;
    --warn-line: #8a6a1c;
    --ok: #6fd08f;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 var(--body);
}
a { color: var(--odd); }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--panel); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

h1, h2, h3, .h3 { font-family: var(--head); font-weight: 700; line-height: 1.15; letter-spacing: 0; }
h1 { font-size: clamp(1.9rem, 5.2vw, 2.7rem); margin: 0 0 6px; max-width: 22ch; }
h2 { font-size: 1.6rem; margin: 2rem 0 0.6rem; }
h3, .h3 { font-size: 1.3rem; margin: 1.4rem 0 0.5rem; }

/* top bar: a strip like a shelf edge */
.topbar { background: var(--panel); border-bottom: 3px solid var(--accent); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-family: var(--head); font-weight: 700; font-size: 1.35rem; }
.topbar nav { display: flex; gap: 16px; }
.topbar nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; padding: 10px 0; }
.topbar nav a:hover { color: var(--ink); text-decoration: underline; }

.hero { padding: 22px 0 10px; }
.lede { margin: 0; color: var(--muted); max-width: 62ch; }

/* tool */
.tool { margin: 10px 0 28px; }
.tbar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-bottom: 10px; }
.tsel { display: flex; flex-direction: column; font-size: 0.85rem; color: var(--muted); flex: 1 1 220px; max-width: 420px; }
.tsel select { margin-top: 2px; }
.tbar-actions { display: flex; gap: 8px; align-items: center; }
.more { position: relative; }
.more > summary { list-style: none; cursor: pointer; }
.more > summary::-webkit-details-marker { display: none; }
.more-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 12px; display: flex; flex-direction: column; min-width: 260px; box-shadow: 0 6px 18px rgb(0 0 0 / 0.15); }
.more-menu .linkbtn { text-align: left; padding: 10px 0; }

.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--ink); overflow-x: auto; scrollbar-width: none; }
.tabs [role="tab"] {
  flex: 1 1 0; min-width: 0; min-height: 46px; padding: 8px 10px; border: 1px solid var(--line); border-bottom: 0;
  background: var(--soft); color: var(--muted); font: 600 0.98rem var(--body); border-radius: 6px 6px 0 0; cursor: pointer; white-space: nowrap;
}
.tabs [role="tab"][aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.panel { padding: 16px 0 4px; }

/* controls */
input[type="text"], input[type="number"], input[type="date"], input[type="time"], select, textarea {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); padding: 9px 10px; min-height: 44px; width: 100%; max-width: 100%;
}
textarea { min-height: 110px; }
input:focus, select:focus, textarea:focus { border-color: var(--odd); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 16px;
  border: 1px solid var(--ink); border-radius: var(--r); background: var(--panel); color: var(--ink); font: 600 1rem var(--body); cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn.primary:hover { filter: brightness(1.15); }
.btn.small { min-height: 40px; padding: 6px 12px; font-size: 0.95rem; }
.btn:disabled, .linkbtn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.danger { border-color: var(--accent); color: var(--accent); }
.linkbtn { background: none; border: 0; padding: 10px 2px; min-height: 44px; color: var(--odd); font: inherit; font-size: 0.97rem; text-decoration: underline; cursor: pointer; }
.linkbtn.danger { color: var(--accent); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0; }
.row.between { justify-content: space-between; margin-top: 0; }
.hint { color: var(--muted); font-size: 0.93rem; margin: 6px 0; }
.tag { display: inline-block; font-size: 0.8rem; font-weight: 600; color: var(--accent); border: 1px solid currentColor; border-radius: 3px; padding: 0 5px; vertical-align: 1px; }
.empty { color: var(--muted); }
.note, .store-note { background: var(--warn-bg); border-left: 4px solid var(--warn-line); padding: 10px 12px; margin: 0 0 12px; }
.demo-bar { background: var(--odd-soft); border-left: 4px solid var(--odd); padding: 10px 12px; margin: 0 0 12px; }
.warn { background: var(--warn-bg); border-left: 4px solid var(--warn-line); padding: 10px 12px; margin: 12px 0; }
.result { font-family: var(--head); font-size: 1.45rem; margin: 12px 0 6px; }
.summary { font-weight: 600; margin: 16px 0 6px; max-width: 70ch; }

/* setup */
.field { margin-bottom: 12px; max-width: 560px; }
.field > label { display: block; font-weight: 600; margin-bottom: 4px; }
.prog select { font-weight: 600; }
.cols { display: grid; gap: 4px 32px; }
@media (min-width: 860px) { .cols { grid-template-columns: 1.6fr 1fr; } }
.count { font-family: var(--body); font-size: 0.9rem; color: var(--muted); font-weight: 600; margin-left: 4px; }
.teams, .rooms { list-style: none; margin: 0; padding: 0; }
.trow {
  display: grid; grid-template-columns: 26px 1fr 1fr 44px; grid-template-areas: "n name name x" ". school members x";
  gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line);
}
.trow .num { grid-area: n; align-self: center; color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.trow .t-name { grid-area: name; font-weight: 600; }
.trow .t-school { grid-area: school; }
.trow .t-members { grid-area: members; }
.trow .x { grid-area: x; }
@media (min-width: 1000px) {
  .trow { grid-template-columns: 26px 1.2fr 1fr 1.2fr 44px; grid-template-areas: "n name school members x"; }
}
.rrow { display: grid; grid-template-columns: 1fr 1fr 44px; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.x { width: 44px; height: 44px; border: 1px solid transparent; background: none; color: var(--muted); font-size: 1.5rem; line-height: 1; border-radius: var(--r); cursor: pointer; align-self: center; }
.x:hover { color: var(--accent); border-color: var(--line); }
.x:disabled { visibility: hidden; }
.paste summary { list-style: none; }
.paste summary::-webkit-details-marker { display: none; }
.paste[open] { flex-basis: 100%; }
details.opts { border-top: 1px solid var(--line); margin-top: 14px; }
details.opts > summary { cursor: pointer; font-weight: 600; padding: 12px 0; min-height: 44px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 10px 16px; align-items: end; }
.f { display: flex; flex-direction: column; gap: 3px; font-size: 0.9rem; color: var(--muted); }
.f.wide { grid-column: 1 / -1; max-width: 560px; }
.f.inline { flex-direction: row; align-items: center; gap: 8px; }
.f.inline select { width: auto; }
.checks { display: flex; flex-direction: column; gap: 2px; margin: 12px 0; }
.c { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.c input { width: 20px; height: 20px; accent-color: var(--primary); }

/* battle list */
.filter { justify-content: space-between; }
.blist { list-style: none; margin: 0 0 8px; padding: 0; }
.bt {
  width: 100%; display: grid; grid-template-columns: 74px 1fr auto; grid-template-areas: "time teams st" "room teams st";
  gap: 0 12px; align-items: center; text-align: left; background: var(--panel); color: var(--ink); border: 0; border-bottom: 1px solid var(--line);
  padding: 10px 8px 10px 12px; min-height: 58px; font: inherit; cursor: pointer; border-left: 4px solid transparent;
}
.bt:hover { background: var(--soft); }
.bt.next { border-left-color: var(--accent); }
.bt:disabled { cursor: default; opacity: 0.75; }
.bt-time { grid-area: time; font-weight: 600; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.bt-room { grid-area: room; color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }
.bt-teams { grid-area: teams; overflow-wrap: anywhere; }
.bt-teams .win { font-weight: 700; }
.bt-teams .v { color: var(--muted); margin: 0 3px; }
.tbd { color: var(--muted); font-style: italic; }
.bt-st { grid-area: st; font-size: 0.85rem; color: var(--muted); text-align: right; max-width: 120px; }
.bt-st.done { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.bt-st.live { color: var(--accent); font-weight: 600; }

/* scorer */
.scorer { max-width: 760px; }
.vis-h { margin: 6px 0 10px; font-size: 1.4rem; overflow-wrap: anywhere; }
.vis-h:focus { outline: none; }
.board { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.side { padding: 10px 12px 12px; display: flex; flex-direction: column; min-width: 0; }
.side.odd { background: var(--odd-soft); border-top: 5px solid var(--odd); }
.side.even { background: var(--even-soft); border-top: 5px solid var(--even); text-align: right; }
.side .lab { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.side .tn { font-family: var(--head); font-weight: 700; font-size: 1.2rem; line-height: 1.2; overflow-wrap: anywhere; }
.side .sc { font-size: clamp(2.6rem, 11vw, 3.6rem); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums lining-nums; margin-top: 4px; }
.side.odd .sc { color: var(--odd); }
.side.even .sc { color: var(--even); }
.side.won .tn::after { content: ' ✓'; }
.ask { margin: 14px 0; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.qhead { margin: 0 0 6px; font-size: 1.05rem; }
.for { margin: 6px 0; padding-left: 10px; border-left: 4px solid; }
.for.odd { border-color: var(--odd); }
.for.even { border-color: var(--even); }
.for.steal { margin-top: 14px; }
.obs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 8px; }
.obs.small { grid-template-columns: repeat(auto-fit, minmax(min(100%, 112px), 1fr)); }
.ob {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 56px; padding: 8px 12px;
  border: 1px solid var(--ink); border-radius: var(--r); background: var(--panel); color: var(--ink); font: 600 1rem var(--body); cursor: pointer; text-align: left;
}
.ob b { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.ob.miss { border-color: var(--line); color: var(--muted); }
.ob:hover { background: var(--soft); }
.ob[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.obs.small .ob { min-height: 48px; font-size: 0.92rem; }
.two { min-height: 40px; }
.tools { border-top: 0; }
.totals .grid { margin-bottom: 10px; }
.tbbox .tbteam { margin: 10px 0; }
.tbteam p { margin: 0 0 6px; }
.tbteam .pts, .wteam .pts { font-weight: 700; margin-left: 6px; font-variant-numeric: tabular-nums; }
.tbq { margin-bottom: 8px; }
.tbq .hint { margin: 0 0 4px; display: block; }

.table-fit { overflow-x: auto; max-width: 100%; }
.qgrid { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; margin-top: 6px; }
.qgrid th, .qgrid td { border-bottom: 1px solid var(--line); padding: 2px 8px; text-align: center; }
.qgrid thead th { font-size: 0.85rem; overflow-wrap: anywhere; vertical-align: bottom; }
.qgrid thead .odd { color: var(--odd); }
.qgrid thead .even { color: var(--even); }
.qgrid td.k { text-align: left; color: var(--muted); font-size: 0.85rem; }
.qgrid td.second { color: var(--muted); }
.qgrid tr.cur { background: var(--soft); }
.qgrid tr.sub th, .qgrid tr.sub td { font-weight: 600; background: var(--soft); text-align: left; }
.qgrid tr.sub td, .qgrid tr.tot td { text-align: center; }
.qgrid tr.tot th, .qgrid tr.tot td { font-weight: 800; border-top: 2px solid var(--ink); text-align: left; }
.qgrid tr.tot td { text-align: center; }
.qbtn { min-width: 44px; min-height: 40px; border: 0; background: none; color: var(--odd); font: 600 0.95rem var(--body); text-decoration: underline; cursor: pointer; }

/* standings and bracket */
.stand { border-collapse: collapse; width: 100%; max-width: 640px; font-variant-numeric: tabular-nums; }
.stand th, .stand td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.stand .num { text-align: right; }
.stand .school { display: block; font-size: 0.82rem; color: var(--muted); }
.seeds { padding-left: 0; list-style: none; columns: 2 220px; }
.seeds li { padding: 4px 0; break-inside: avoid; }
.seed { display: inline-block; min-width: 1.8em; color: var(--muted); font-weight: 700; font-size: 0.85rem; }
.bracket { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 16px; overflow-x: auto; padding-bottom: 6px; }
@media (max-width: 640px) { .bracket { grid-auto-flow: row; } }
.kround h3 { margin-top: 0; font-size: 1.1rem; }
.kmatch { border-left: 3px solid var(--line); padding: 4px 0 4px 10px; margin-bottom: 12px; }
.kl { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; overflow-wrap: anywhere; }
.kl.win { font-weight: 700; }
.kl.win::before { content: ''; }
.kl.bye { color: var(--muted); font-style: italic; }
.ks { font-variant-numeric: tabular-nums; font-weight: 600; }
.kmatch .linkbtn { min-height: 36px; padding: 4px 0; }

/* written rounds */
.segs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.seg { min-height: 44px; padding: 6px 14px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: var(--r); font: 600 0.95rem var(--body); cursor: pointer; }
.seg.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.wteam { padding: 10px 0; border-bottom: 1px solid var(--line); }
.wteam p { margin: 0 0 6px; }
.cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
.cell { min-height: 44px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); color: var(--muted); font: 600 0.9rem var(--body); cursor: pointer; }
.cell.ok { background: var(--even-soft); color: var(--even); border-color: var(--even); }
.cell.no { color: var(--ink); }
.cell.over { background: var(--warn-bg); border-color: var(--warn-line); color: var(--ink); font-size: 0.8rem; }
.cell.max { color: var(--ink); }

/* print chooser */
.plist { border: 0; padding: 0; margin: 0 0 8px; display: grid; gap: 4px; max-width: 640px; }
.pchoice { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.pchoice input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--primary); flex: none; }
.pchoice .hint { display: block; margin: 2px 0 0; }

/* toast: fixed to the bottom of the screen so Undo is always reachable */
.toast {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 40; width: min(600px, calc(100% - 24px));
  background: var(--ink); color: var(--bg); border-radius: 8px; padding: 10px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.3);
}
.toast > span { flex: 1 1 200px; }
.toast .btn { background: var(--bg); color: var(--ink); border-color: var(--bg); }
.toast .btn.danger { color: var(--accent); }
.toast .linkbtn { color: var(--bg); }
.toast.linkbox { flex-direction: column; align-items: stretch; }
.toast.linkbox p { margin: 0; }
.toast.linkbox .row { margin: 0; }
.toast.linkbox .c { color: var(--bg); }

/* content */
.content { max-width: 760px; padding-bottom: 20px; border-top: 1px solid var(--line); margin-top: 8px; }
.content p { max-width: 70ch; }
.rules { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
.rules th, .rules td { border-bottom: 1px solid var(--line); padding: 8px 8px 8px 0; text-align: left; vertical-align: top; }
.rules thead th { font-size: 0.85rem; color: var(--muted); }
.rules tbody th { font-weight: 600; }
@media (max-width: 640px) {
  .rules thead { display: none; }
  .rules tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .rules th, .rules td { display: block; border: 0; padding: 2px 0; }
  .rules td::before { content: attr(data-l); }
}
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; padding: 12px 0; min-height: 44px; }
.faq details p { margin: 0 0 14px; }
.sources { font-size: 0.9rem; color: var(--muted); margin-top: 24px; }

footer { border-top: 1px solid var(--line); padding: 18px 0 28px; font-size: 0.9rem; color: var(--muted); }
.sb-footer p { margin: 6px 0; }

@media (max-width: 560px) {
  .bt { grid-template-columns: 62px 1fr auto; padding-left: 8px; }
  .bt-st { max-width: 92px; }
  .topbar nav { gap: 12px; }
  .trow { grid-template-columns: 22px 1fr 1fr 44px; gap: 6px 4px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

.print-root { display: none; }

/* ---------------------------------------------------------------- print */
@page { margin: 12mm; }
@media print {
  :root { --ink: #000; --muted: #333; --line: #888; --bg: #fff; --panel: #fff; }
  body { background: #fff; color: #000; font-size: 11pt; }
  body.printing > *:not(.print-root) { display: none !important; }
  body.printing .print-root { display: block; }
  body:not(.printing) .topbar nav, body:not(.printing) .tabs, body:not(.printing) .tbar, body:not(.printing) footer,
  body:not(.printing) .toast, body:not(.printing) .content, body:not(.printing) button, body:not(.printing) .skip { display: none !important; }

  .sheet { break-after: page; page-break-after: always; }
  .sheet:last-child { break-after: auto; page-break-after: auto; }
  .ph { display: flex; justify-content: space-between; gap: 12px; font-size: 9.5pt; border-bottom: 1.5pt solid #000; padding-bottom: 3pt; margin-bottom: 8pt; }
  .sheet h2 { font-size: 18pt; margin: 4pt 0 6pt; }
  .sheet h3 { font-size: 13pt; margin: 10pt 0 4pt; }
  .rule { font-size: 9.5pt; margin: 4pt 0 6pt; }
  .line { display: inline-block; min-width: 46mm; border-bottom: 0.8pt solid #000; min-height: 1.3em; line-height: 1.3; vertical-align: bottom; padding: 0 2pt; }
  .line.short { min-width: 16mm; }

  .teams2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; margin: 4pt 0 6pt; }
  .teams2 .lab { display: block; font-size: 9pt; font-weight: 700; text-transform: none; margin-bottom: 2pt; }
  .teams2 .pick { display: block; font-size: 12pt; font-weight: 600; margin: 1pt 0; }
  .sh { width: 100%; border-collapse: collapse; table-layout: fixed; }
  .sh col.c-q { width: 12mm; } .sh col.c-k { width: 34mm; } .sh col.c-n { width: 26mm; }
  .sh th, .sh td { border: 0.8pt solid #000; padding: 0 4pt; height: var(--rh, 7.4mm); font-size: 10.5pt; }
  .sh thead th { height: auto; padding: 3pt 4pt; text-align: left; font-size: 9.5pt; }
  .sh td.qn { text-align: center; font-weight: 700; }
  .sh td.k { font-size: 9pt; }
  .sh td.stl span { font-size: 7pt; color: #555; vertical-align: top; }
  .sh td.na { text-align: center; color: #555; }
  .sh tr.sub td { font-weight: 700; font-size: 9pt; border-top: 1.5pt solid #000; }
  .sh tr.tot td { font-weight: 800; border-top: 2pt solid #000; font-size: 11pt; }
  .tbsh { margin-top: 7pt; }
  .tbsh thead th { font-weight: 700; }
  .tbsh th, .tbsh td { height: 6.4mm; }
  .sign { display: flex; flex-wrap: wrap; gap: 6pt 14mm; margin-top: 10pt; font-size: 10pt; }

  .mod .list, .list { width: 100%; border-collapse: collapse; font-size: 10pt; margin-bottom: 6pt; }
  .list th, .list td { border-bottom: 0.6pt solid #888; padding: 3pt 4pt; text-align: left; vertical-align: top; }
  .list thead th { border-bottom: 1.2pt solid #000; font-size: 9pt; }
  .list .num { text-align: right; }
  .list.places th { width: 40mm; font-weight: 700; }
  .list .mod { color: #444; font-size: 9pt; }
  .list tbody.keep { break-inside: avoid; page-break-inside: avoid; }
  .list tr.gh th { padding-top: 7pt; font-size: 10.5pt; border-bottom: 1pt solid #000; }
  .script { padding-left: 16pt; font-size: 10.5pt; }
  .script li { margin-bottom: 4pt; }

  .pbracket { display: flex; gap: 6mm; align-items: stretch; }
  .pcol { flex: 1 1 0; display: flex; flex-direction: column; justify-content: space-around; min-width: 0; }
  .pcol h3 { font-size: 11pt; margin: 0 0 4pt; }
  .pm { border: 0.8pt solid #000; margin: 3pt 0; break-inside: avoid; }
  .pl { display: flex; justify-content: space-between; gap: 4pt; padding: 2pt 4pt; font-size: 9.5pt; min-height: 7mm; align-items: center; }
  .pl + .pl { border-top: 0.6pt solid #888; }
  .pl.win { font-weight: 700; }
  .pl.bye { color: #555; font-style: italic; }
  .pl .seed { font-size: 8pt; min-width: 1.6em; }

  .grid-w th, .grid-w td { height: 7mm; text-align: center; font-size: 9pt; padding: 0 2pt; }
  .grid-w td.tn { text-align: left; font-size: 9.5pt; }
  .grid-w { table-layout: auto; }
  .ansl td { height: var(--rh, 9mm); }

  .cert { display: flex; align-items: center; justify-content: center; min-height: 250mm; }
  .cert-in { border: 3pt double #000; outline: 0.8pt solid #000; outline-offset: 3mm; padding: 26mm 14mm; width: calc(100% - 8mm); box-sizing: border-box; min-height: 200mm; text-align: center; display: flex; flex-direction: column; justify-content: center; }
  .c-ev { font-size: 14pt; margin: 0 0 10mm; font-family: var(--head); }
  .c-title { font-family: var(--head); font-size: 38pt; margin: 0 0 8mm; font-weight: 700; }
  .c-to { font-size: 12pt; margin: 0 0 4mm; font-style: italic; }
  .c-team { font-family: var(--head); font-size: 28pt; font-weight: 700; margin: 0 0 4mm; }
  .c-mem { font-size: 13pt; margin: 0 0 3mm; }
  .c-school { font-size: 12pt; margin: 0 0 16mm; color: #333; }
  .c-sign { display: flex; justify-content: space-around; gap: 10mm; font-size: 10pt; margin-top: 18mm; }
  .c-sign > span { display: flex; flex-direction: column; align-items: center; }
  .c-sign .line { min-width: 60mm; margin-bottom: 2pt; text-align: center; }
}
@media screen and (max-width: 380px) {
  .tabs [role="tab"] { flex: 1 1 auto; padding: 8px 5px; font-size: 0.86rem; }
  .brand { white-space: nowrap; font-size: 1.2rem; }
  .brand svg { width: 24px; height: 24px; }
  .topbar nav { gap: 10px; }
  .topbar nav a { font-size: 0.85rem; }
}

/* fresh-eyes: paste link beside the Teams heading, so a pasted list is the first thing on offer */
.teams-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 16px; }
.teams-head .paste[open] { flex-basis: 100%; margin-bottom: 8px; }
.teams-head .paste textarea { width: 100%; }
.ask .qhead:focus { outline: none; }
