:root {
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-2: #ece8de;
  --line: #d8d3c6;
  --text: #172030;
  --muted: #5a6473;
  --navy: #0b2545;
  --navy-2: #13315c;
  --on-navy: #ffffff;
  --gold: #c8a048;
  --gold-deep: #8a6d22;
  --accent: #1f4e9a;
  --focus: #1f4e9a;
  --green: #1b6b3f;
  --green-bg: #e2f2e7;
  --amber: #8c5306;
  --amber-bg: #fbefd6;
  --red: #a4261e;
  --red-bg: #fbe4e1;
  --radius: 12px;
  --radius-s: 8px;
  --shadow: 0 1px 2px rgba(10, 20, 40, 0.06), 0 4px 14px rgba(10, 20, 40, 0.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f141c;
    --surface: #171e29;
    --surface-2: #202a38;
    --line: #2e3947;
    --text: #edf0f4;
    --muted: #a3adba;
    --navy: #0b2545;
    --navy-2: #13315c;
    --on-navy: #ffffff;
    --gold: #d4ad57;
    --gold-deep: #e2c268;
    --accent: #8fb4ff;
    --focus: #8fb4ff;
    --green: #7ad49c;
    --green-bg: #15311f;
    --amber: #f2bb5c;
    --amber-bg: #3a2a0d;
    --red: #ff9a90;
    --red-bg: #3c1512;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f141c;
  --surface: #171e29;
  --surface-2: #202a38;
  --line: #2e3947;
  --text: #edf0f4;
  --muted: #a3adba;
  --navy: #0b2545;
  --navy-2: #13315c;
  --on-navy: #ffffff;
  --gold: #d4ad57;
  --gold-deep: #e2c268;
  --accent: #8fb4ff;
  --focus: #8fb4ff;
  --green: #7ad49c;
  --green-bg: #15311f;
  --amber: #f2bb5c;
  --amber-bg: #3a2a0d;
  --red: #ff9a90;
  --red-bg: #3c1512;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
a { color: var(--accent); }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 8px; letter-spacing: -0.01em; }
h1 { font-size: clamp(28px, 4.2vw, 40px); font-weight: 700; }
h2 { font-size: clamp(22px, 2.6vw, 28px); font-weight: 700; }
h3 { font-size: 18px; font-weight: 650; }
h4 { font-size: 16px; font-weight: 650; }
p { margin: 0 0 12px; }
small, .muted { color: var(--muted); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 900px) { .wrap { padding: 0 32px; } }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.site-head { background: var(--navy); color: var(--on-navy); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding-top: 8px; padding-bottom: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--on-navy); text-decoration: none; font-weight: 650; font-size: 17px; border-radius: var(--radius-s); padding: 0 6px 0 2px; }
.brand svg { width: 30px; height: 30px; flex: none; }
.site-nav { display: flex; flex-wrap: wrap; gap: 2px; margin-left: auto; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--on-navy); text-decoration: none; border-radius: var(--radius-s); font-weight: 500; }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--gold); }
.site-head :focus-visible { outline-color: var(--gold); }
@media (max-width: 599px) { .site-nav { margin-left: 0; width: 100%; } .site-nav a { padding: 0 10px; } }

.hero { padding: 28px 0 16px; }
.hero .lead { font-size: 18px; color: var(--muted); max-width: 62ch; }
.hero .facts { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 10px 0 0; padding: 0; list-style: none; color: var(--muted); }

section.block { padding: 20px 0; }
section.block + section.block { border-top: 1px solid var(--line); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.cards { display: grid; gap: 12px; }
@media (min-width: 720px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.meet h2, .meet h3 { margin-bottom: 4px; }
.meet .when { color: var(--muted); margin: 0 0 4px; }
.meet .status { margin: 0 0 12px; }
.meet .actions { margin-top: auto; }
.meet { display: flex; flex-direction: column; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 0 16px; border-radius: var(--radius-s); border: 1px solid var(--navy); background: var(--navy); color: var(--on-navy); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-danger { background: var(--surface); color: var(--red); border-color: var(--red); }
.btn:disabled { opacity: 0.5; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions-center { justify-content: center; }

.seg { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 10px 0; }
.seg-inner { display: flex; width: max-content; max-width: 100%; margin: 0 auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 4px; }
.seg button { min-height: 44px; min-width: 96px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--navy); color: var(--on-navy); }
.js .panel[hidden] { display: none; }

.table-wrap { overflow-x: auto; padding: 6px; margin: 0 -6px; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: normal; }
.table td.name, .table td.name a { white-space: nowrap; }
.table th { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.table .num { text-align: right; white-space: nowrap; }
.table tr.top td { font-weight: 600; }
.table-compact th, .table-compact td { padding: 6px 6px; font-size: 14px; }
.table a.cell-link { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; margin: -11px 0; color: var(--text); font-weight: 600; text-decoration: none; }
.table a.cell-link:hover { text-decoration: underline; }

.event-block { padding: 18px 0 8px; }
.event-block + .event-block { border-top: 1px solid var(--line); }
.event-block header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 6px; }
.event-block header h3 { margin: 0; }
.event-block header .note { color: var(--muted); font-size: 14px; }

.entry { border-top: 1px solid var(--line); }
.entry:last-child { border-bottom: 1px solid var(--line); }
.entry summary { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; min-height: 52px; padding: 8px 6px; cursor: pointer; list-style: none; border-radius: var(--radius-s); }
.entry summary::-webkit-details-marker { display: none; }
.entry summary::marker { content: ""; }
.place { font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.place-1 { color: var(--gold-deep); }
.school { font-weight: 600; }
.school small { display: block; font-weight: 400; color: var(--muted); }
.raw { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.pct { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; min-width: 64px; }
.entry-body { padding: 0 6px 16px 60px; }
@media (max-width: 599px) { .entry-body { padding-left: 6px; } }
.entry-body .tie { background: var(--surface-2); border-radius: var(--radius-s); padding: 10px 12px; margin: 10px 0; }
.entry-body .links { margin-top: 10px; }
.judges { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; margin-top: 6px; }
.judges th, .judges td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; vertical-align: top; }
.judges th { color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; overflow-wrap: normal; }
.judges td.num { white-space: nowrap; overflow-wrap: normal; }
.judges-cats th:first-child, .judges-cats td:first-child { min-width: 150px; }
.judges .short { display: none; }
@media (max-width: 599px) { .judges .long { display: none; } .judges .short { display: inline; } .judges-cats th, .judges-cats td { padding: 6px 4px; } .judges-cats th:first-child, .judges-cats td:first-child { min-width: 112px; } }
.judges td.wrap { white-space: normal; overflow-wrap: anywhere; }
.judges td.num, .judges th.num { text-align: right; }

.chip { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; line-height: 1.3; }
.chip-ok { background: var(--green-bg); color: var(--green); }
.chip-wait { background: var(--amber-bg); color: var(--amber); }
.chip-off { background: var(--red-bg); color: var(--red); }

.notice { background: var(--amber-bg); color: var(--amber); border-radius: var(--radius-s); padding: 10px 14px; margin: 0 0 16px; }
.callout { background: var(--surface-2); border-radius: var(--radius-s); padding: 12px 14px; margin: 12px 0; }

.faq h3 { margin-top: 18px; }
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { padding: 6px 0; }
.contact-list a { display: inline-flex; align-items: center; min-height: 44px; }
.link-row { display: inline-flex; align-items: center; min-height: 44px; }

.schools { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
@media (min-width: 600px) { .schools { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .schools { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.schools a { display: flex; flex-direction: column; justify-content: center; min-height: 64px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; font-weight: 600; }
.schools a small { font-weight: 400; color: var(--muted); }

input, select { font: inherit; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); color: var(--text); max-width: 100%; }
label { font-weight: 600; font-size: 14px; }
.field { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.field > div { display: flex; flex-direction: column; gap: 4px; }

.op-event { margin: 14px 0; }
.op-event header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 10px; }
.op-event header h3 { margin: 0; }
.roster { width: 100%; border-collapse: collapse; }
.roster th, .roster td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: 15px; overflow-wrap: normal; white-space: nowrap; }
.roster td.school-cell { white-space: normal; }
.roster th { color: var(--muted); font-size: 13px; }
.roster tr.is-withdrawn td { color: var(--muted); }
.roster tr.is-withdrawn .school-name { text-decoration: line-through; }
.roster input[type="text"] { width: 110px; }
@media (max-width: 719px) {
  .op-event .table-wrap { overflow: visible; padding: 0; margin: 0; }
  .roster thead { display: none; }
  .roster, .roster tbody { display: block; }
  .roster tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who action" "move action"; gap: 6px 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .roster td { display: block; border: 0; padding: 0; }
  .roster td.order-cell { display: none; }
  .roster td.time-cell { grid-area: who; font-weight: 600; }
  .roster td.school-cell { grid-area: who; margin-left: 76px; }
  .roster td.move-cell { grid-area: move; }
  .roster td.action-cell { grid-area: action; }
  .roster input[type="text"] { width: 96px; }
}
.roster .num { text-align: right; }
.judge-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.judge-list li { padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface-2); font-variant-numeric: tabular-nums; }
.judge-list li.is-in { background: var(--green-bg); color: var(--green); border-color: transparent; }
.pdf-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.op-msg { min-height: 24px; color: var(--muted); font-size: 14px; }

.site-foot { margin-top: 40px; padding: 28px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.site-foot p { margin: 0 0 6px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media print {
  @page { size: letter; margin: 0.6in; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .site-head, .seg, .no-print, .btn, .actions, .site-foot, .schools { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .card { box-shadow: none; border: 1px solid #999; }
  .event-block { break-inside: avoid; page-break-inside: avoid; border-top: 0; padding-top: 0; }
  .event-block + .event-block { break-before: page; page-break-before: always; }
  .judges th, .judges td, .table th, .table td { padding: 3px 6px; font-size: 10pt; }
  .table-wrap { overflow: visible; }
  a { color: #000; text-decoration: none; }
}
