/* Look and feel for every page: the SyncHQ logo colours (deep navy side menu and buttons, sky-blue
   accents), Lora headings, Poppins text. Logo navy #03004a, logo sky blue #0099dc. */
:root {
  --bg: #f5f8fc;
  --surface: #ffffff;
  --text: #141936;
  --muted: #5e6680;
  --border: #dde4ee;
  --brand: #1c1a7a;
  --brand-dark: #03004a;
  --brand-soft: #e3f3fb;
  --sidebar: #03004a;
  --success-bg: #e7f3ec;
  --success-text: #1d6b3a;
  --error-bg: #fbeaea;
  --error-text: #a12626;
  --warn-bg: #fbf1de;
  --warn-text: #82560a;
  --radius: 8px;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Fonts (bundled with the app — see public/fonts/README.md). */
@font-face { font-family: "Lora"; src: url("/public/fonts/Lora-Variable.ttf") format("truetype"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/public/fonts/Poppins-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/public/fonts/Poppins-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/public/fonts/Poppins-Bold.ttf") format("truetype"); font-weight: 600 700; font-display: swap; }

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

main { width: 100%; max-width: 1100px; box-sizing: border-box; margin: 0 auto; padding: 40px 40px 56px; }
@media (max-width: 860px) { main { padding: 24px 16px 48px; } }

a { color: var(--brand); }

h1 { font-size: 1.75rem; line-height: 1.2; margin: 0.25em 0 0.5em; }
h2 { font-size: 1.2rem; margin: 0 0 0.6em; }
h3 { font-size: 1rem; margin: 1.2em 0 0.5em; }

code { white-space: nowrap; font-family: ui-monospace, Consolas, monospace; font-size: 0.95em; background: var(--brand-soft); padding: 2px 6px; border-radius: 4px; }

/* The page frame: navy side menu (a top bar with a Menu button on phones) */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex-shrink: 0; box-sizing: border-box; background: var(--sidebar); color: #fff; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; padding: 28px 18px 22px; }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
/* The logo sits on a white nameplate so its navy and blue read clearly on the navy menu. */
.brand { display: block; box-sizing: border-box; width: 100%; background: #fff; border-radius: 12px; padding: 10px 12px; line-height: 0; }
.brand img { display: block; width: 100%; height: auto; }
.brand:focus-visible { outline: 3px solid #7fcdf0; outline-offset: 2px; }
.menu-toggle { display: none; }
.side-menu { display: flex; flex-direction: column; flex: 1; margin-top: 30px; min-height: 0; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 10px; color: #dce3f5; text-decoration: none; padding: 10px 14px; border-radius: 999px; font-size: 0.95rem; }
.side-nav a:hover { background: rgba(255, 255, 255, 0.09); color: #fff; }
.side-nav a[aria-current="page"] { background: var(--brand-soft); color: #03004a; font-weight: 500; }
.side-nav a[aria-current="page"]::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); flex-shrink: 0; }
.side-user { margin-top: auto; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 18px 8px 0; border-top: 1px solid rgba(255, 255, 255, 0.14); }
.side-avatar { grid-row: span 2; width: 38px; height: 38px; border-radius: 50%; background: #7fcdf0; color: #03004a; font-family: var(--serif); font-weight: 600; font-size: 0.9rem; display: grid; place-items: center; }
.side-user .who { color: #fff; font-size: 0.85rem; line-height: 1.3; }
.side-user .logout-button { color: #7fcdf0; font-size: 0.85rem; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.site-footer { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 24px 16px; margin-top: auto; }
@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar { width: auto; height: auto; overflow: visible; position: sticky; top: 0; z-index: 30; padding: 10px 12px 10px 16px; }
  .brand { width: auto; padding: 6px 10px; border-radius: 10px; }
  .brand img { width: auto; height: 34px; }
  .menu-toggle { display: inline-flex; align-items: center; min-height: 44px; background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 999px; padding: 8px 18px; }
  .side-menu { display: none; margin-top: 12px; }
  .side-menu.is-open { display: flex; }
  .side-user { margin-top: 12px; padding-bottom: 6px; }
}

/* Layout helpers */
.stack > * + * { margin-top: 16px; }
.two-col { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
@media (min-width: 860px) {
  .two-col { grid-template-columns: 2fr 1fr; }
}
.row { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) {
  .row { grid-template-columns: 1fr 1fr; }
  .row.three { grid-template-columns: 1fr 1fr 1fr; }
}
.narrow { max-width: 440px; margin: 32px auto; }
.center { text-align: center; }
.muted { color: var(--muted); }
.lead { font-size: 1.05rem; color: var(--muted); max-width: 65ch; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; color: var(--muted); margin: 0; }
.count { display: inline-block; min-width: 1.6em; text-align: center; font-size: 0.8rem; background: var(--brand-soft); color: var(--brand-dark); border-radius: 999px; padding: 0 8px; vertical-align: middle; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.muted-card { background: transparent; border-style: dashed; }
.muted-card ul { margin: 0; padding-left: 1.2em; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 24px 0; }
.card.action { text-decoration: none; color: inherit; transition: border-color 0.15s, box-shadow 0.15s; }
.card.action:hover, .card.action:focus-visible { border-color: var(--brand); box-shadow: 0 10px 28px rgba(3, 0, 74, 0.12); }
.card.action h2 { color: var(--brand); }
.hero { padding: 16px 0 0; }
.hero h1 { font-size: 2rem; max-width: 20ch; }
.hero p { color: var(--muted); max-width: 55ch; font-size: 1.1rem; }

/* Forms */
fieldset { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 16px 20px 20px; margin: 0; }
legend { font-weight: 600; padding: 0 6px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.field label { font-weight: 500; }
.field.checkbox label { font-weight: 400; display: flex; gap: 8px; align-items: center; }
input[type="text"], input[type="email"], input[type="number"], input[type="date"], input[type="password"], input:not([type]) {
  font: inherit; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); width: 100%;
}
input:focus-visible { outline: 3px solid var(--brand-soft); border-color: var(--brand); }
.has-error input { border-color: var(--error-text); }
.error { color: var(--error-text); font-size: 0.9rem; margin: 0; }
.hint { color: var(--muted); font-size: 0.85rem; margin: 0; font-weight: 400; }
.code-input { font-family: ui-monospace, Consolas, monospace; font-size: 1.3rem; letter-spacing: 0.1em; text-transform: uppercase; }

button { font: inherit; cursor: pointer; border-radius: 8px; padding: 10px 18px; border: 1px solid transparent; }
button.primary { background: var(--brand); color: #fff; font-weight: 600; }
button.primary:hover { background: var(--brand-dark); }
button.danger { background: #fff; color: var(--error-text); border-color: var(--error-text); }
button.link { background: none; border: none; padding: 0; color: var(--brand); text-decoration: underline; }
.danger-link { color: var(--error-text) !important; }
form.inline { display: inline; }
.button-row { display: flex; gap: 12px; flex-wrap: wrap; }

.fee-preview { margin-top: 12px; padding: 12px 14px; border-radius: 8px; background: var(--bg); color: var(--muted); }
.fee-preview.has-price { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 8px; margin: 12px 0; }
.alert-error { background: var(--error-bg); color: var(--error-text); }
.alert-success { background: var(--success-bg); color: var(--success-text); }
.alert-info { background: var(--brand-soft); color: var(--brand-dark); }

/* Tables */
table { border-collapse: collapse; width: 100%; }
.data th, .data td, .price-table th, .price-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.data thead th, .price-table thead th { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.data tbody th { font-weight: 500; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
section { margin-bottom: 28px; overflow-x: auto; }

dl.details { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.details dt { color: var(--muted); }
dl.details dd { margin: 0; }
@media (max-width: 480px) {
  dl.details { grid-template-columns: 1fr; }
  dl.details dd { margin-bottom: 8px; }
}

/* Status badges */
.badge { display: inline-block; font-size: 0.8rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; vertical-align: middle; }
.badge-pending, .badge-quote_requested { background: var(--warn-bg); color: var(--warn-text); }
.badge-approved { background: var(--success-bg); color: var(--success-text); }
.badge-denied { background: var(--error-bg); color: var(--error-text); }

/* Outbox */
.email { margin-bottom: 12px; }
.email header { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.email pre { white-space: pre-wrap; font-family: inherit; margin: 0; color: var(--text); }
.tag { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); margin-left: 6px; vertical-align: middle; }
[hidden] { display: none !important; }

/* ---------- Coach entries ---------- */
.button { display: inline-block; font: inherit; text-decoration: none; border-radius: 8px; padding: 10px 18px; border: 1px solid transparent; cursor: pointer; }
a.button.primary { background: var(--brand); color: #fff; font-weight: 600; }
a.button.primary:hover { background: var(--brand-dark); }
button.secondary, a.button.secondary { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
button.secondary:hover, a.button.secondary:hover { background: var(--brand-soft); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.alert-warn { background: var(--warn-bg); color: var(--warn-text); }

.steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.steps a { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: var(--text); font-size: 0.92rem; }
.steps a .num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--bg); font-size: 0.8rem; font-weight: 600; }
.steps a.current { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.steps a.current .num { background: var(--brand); color: #fff; }
.status-line { color: var(--muted); font-size: 0.92rem; }
.status-draft { color: var(--muted); }
.status-submitted { color: var(--success-text); }
.status-held { color: var(--warn-text); }
.continue { margin-top: 20px; }

.table-scroll { overflow-x: auto; }
table.grid { min-width: 760px; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table.grid th { text-align: left; font-size: 0.85rem; color: var(--muted); font-weight: 600; padding: 10px 8px; border-bottom: 1px solid var(--border); }
table.grid td { padding: 6px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.grid tr:last-child td { border-bottom: none; }
table.grid input:not([type]), table.grid input[name] { padding: 7px 9px; }
table.grid input.year { width: 6.5em; }
table.grid .cell-error input, table.grid .cell-error select { border-color: var(--error-text); background: var(--error-bg); }
.cell-msg { display: block; color: var(--error-text); font-size: 0.8rem; margin-top: 2px; }
label.remove { display: flex; gap: 4px; align-items: center; font-size: 0.85rem; color: var(--muted); white-space: nowrap; padding-top: 8px; }
.grid-form .button-row { margin-top: 14px; }

select { font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); width: 100%; }
select:focus-visible { outline: 3px solid var(--brand-soft); border-color: var(--brand); }
select[aria-invalid="true"] { border-color: var(--error-text); }

.slots { background: var(--bg); }
.slots.has-error { border-color: var(--error-text); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 8px; }
.nowrap { white-space: nowrap; }
.nowrap form { margin-left: 10px; }

.upload-card { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.upload-card > div { flex: 1 1 320px; min-width: 0; }
.upload-card h2 { font-size: 1.05rem; }
.upload-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.upload-form input[type="file"] { max-width: 260px; font-size: 0.9rem; }
audio { width: 100%; max-width: 360px; margin-top: 4px; }
.ok { color: var(--success-text); margin: 0 0 6px; }
.missing { color: var(--warn-text); margin: 0 0 6px; }
.warn { color: var(--warn-text); margin: 4px 0; font-size: 0.92rem; }
details { margin-top: 8px; }
details summary { cursor: pointer; color: var(--brand); }
dl.details.compact { margin: 10px 0; font-size: 0.92rem; }
code.code-wrap { white-space: normal; word-break: break-word; }

.pill-list { list-style: none; padding: 0; margin: 8px 0 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.pill-list li { display: inline-flex; align-items: center; gap: 6px; background: var(--brand-soft); color: var(--brand-dark); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 0.92rem; }
.pill-list button.link { text-decoration: none; font-size: 1.1rem; line-height: 1; padding: 0 4px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.inline-form .field { margin-top: 0; }
.inline-form.compact { margin-top: 6px; align-items: center; }
.inline-form.compact input { width: 7em; }
.submit-row { margin-top: 16px; }
.submit-row .hint { margin-top: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Changes, messages, documents ---------- */
.tag-scratched { background: var(--error-bg); color: var(--error-text); }
.tag-alert { background: var(--warn-bg); color: var(--warn-text); }
tr.is-scratched td, .routine-change.is-scratched p { color: var(--muted); }
tr.is-scratched td:first-child { text-decoration: line-through; text-decoration-color: var(--muted); }
.action-form select { width: auto; min-width: 12em; }
.routine-change { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.routine-change:last-child { border-bottom: none; }
.routine-change h3 { margin: 0 0 4px; }
.routine-change p { margin: 0; }
.routine-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.routine-actions select { width: auto; }
.change-log { list-style: none; padding: 0; margin: 0; }
.change-log li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.change-log li .muted { font-size: 0.85rem; margin-right: 8px; }
.doc-list { margin: 0; padding-left: 1.1em; }

.thread { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 80%; padding: 10px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); }
.msg.mine { align-self: flex-end; background: var(--brand-soft); border-color: transparent; }
.msg.announcement { max-width: 100%; align-self: stretch; background: var(--warn-bg); border-color: transparent; }
.msg-meta { margin: 0 0 4px; font-size: 0.8rem; color: var(--muted); }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.compose { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
textarea { font: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; resize: vertical; }
textarea:focus-visible { outline: 3px solid var(--brand-soft); border-color: var(--brand); }
@media (max-width: 560px) { .routine-actions { align-items: stretch; } .msg { max-width: 100%; } }
.two-col > *, .stack > * { min-width: 0; }
.card > table.data { display: block; overflow-x: auto; }
.doc-list { margin-bottom: 14px; }

/* ---------- Running order ---------- */
.icon-button { background: #fff; border: 1px solid var(--border); color: var(--brand); padding: 4px 10px; border-radius: 6px; font-weight: 700; line-height: 1.2; }
.icon-button:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-soft); }
.move-cell form + form { margin-left: 4px; }
.event-card { margin-bottom: 16px; }
.event-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; }
.event-header h2 { margin: 0; }
.event-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.event-tools select { width: auto; }
.category { margin-top: 14px; }
.category h3 { margin: 0 0 4px; font-size: 1rem; }
.order-table .draw-number { width: 4em; font-weight: 700; }
.order-table tr.mine td { background: var(--brand-soft); }
.draw-status { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-start; }
.draw-status h2 { margin-bottom: 4px; }
.draw-status p { margin: 0 0 4px; }
.redraw { margin-top: 12px; }
.redraw form { margin-top: 10px; max-width: 560px; }
.checkbox-line { display: flex; gap: 8px; align-items: flex-start; }
.checkbox-line input { margin-top: 5px; }
.inline-block { display: inline-block; margin-left: 8px; }
.event-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
.event-jump a { padding: 4px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); text-decoration: none; font-size: 0.92rem; }
.event-tools, .event-tools form { max-width: 100%; min-width: 0; }
.event-tools select { max-width: 100%; min-width: 0; flex: 1 1 auto; }
@media (max-width: 560px) { .event-tools .hint { display: none; } }
.table-scroll { position: relative; }

/* ---------- Officials ---------- */
.check-row { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 6px; }
.check { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; }
.event-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 14px; margin-top: 10px; padding: 10px 12px; background: var(--bg); border-radius: 8px; }
.panel-sizes { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important; }
.seat-group { margin: 12px 0; background: var(--bg); }
.seat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 14px; margin-top: 6px; }
.seat label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 2px; }
.seat.has-warning select { border-color: var(--warn-text); background: var(--warn-bg); }
.seat .warn { font-size: 0.82rem; margin: 3px 0 0; }
.panel-box { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 14px; }
.panel-box h3 { margin-top: 0; }
.panel-form { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important; align-items: end; }
.field-button { justify-content: flex-end; }
.panel-box .upload-form { margin-top: 10px; }
.inline-form.compact select { width: auto; }
.round-table input { min-width: 12em; } .round-table input.year { min-width: 0; width: 7em; }
.no-figures { display: inline-block; padding-top: 8px; color: var(--muted); font-size: 0.9rem; white-space: nowrap; }

/* ---------- Judging screens ---------- */
.tag-live { background: var(--success-bg); color: var(--success-text); }
.judge-events { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 12px; }
.judge-event.is-live { border-color: var(--success-text); box-shadow: 0 0 0 2px var(--success-bg); }
.judge-event[aria-disabled="true"] { pointer-events: none; opacity: 0.75; }
.slip-head { display: flex; flex-wrap: wrap; gap: 10px 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px; }
.slip-head > div { display: flex; flex-direction: column; }
.slip-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.slip-number { font-size: 1.6rem; line-height: 1.1; }
.judge-wait, .judge-prompt { text-align: center; padding: 36px 20px; }
.judge-prompt .button-row { justify-content: center; }
.judge-back { margin-top: 16px; }

.sheet-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 720px) { .sheet-grid { grid-template-columns: 1.2fr 1fr; } }
.sheet-rows { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.sheet-head, .sheet-row { display: grid; grid-template-columns: 1fr 3em 8em; align-items: center; gap: 10px; padding: 10px 14px; }
.sheet-head.two, .sheet-row.two { grid-template-columns: 1fr 8em; }
.sheet-head { font-size: 0.8rem; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--border); }
.sheet-row { border-bottom: 1px solid var(--border); cursor: pointer; min-height: 60px; }
.sheet-row:last-child { border-bottom: none; }
.sheet-row.is-selected { background: var(--brand-soft); }
.sheet-row.has-error { background: var(--error-bg); }
.sheet-label { font-weight: 700; font-size: 1.05rem; }
.sheet-num { color: var(--muted); font-weight: 600; }
.score-input { font-size: 1.5rem !important; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; padding: 6px 10px !important; }
.keypad-col { display: flex; flex-direction: column; gap: 10px; }
.keypad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.key { min-height: 58px; font-size: 1.35rem; font-weight: 600; background: linear-gradient(#f4f6f8, #dde3e8); border: 1px solid #c3ccd4; color: var(--text); border-radius: 8px; padding: 0; touch-action: manipulation; }
.key:active { background: #cfd8df; }
.key-fraction { background: linear-gradient(#eef6fb, #d5e7f2); }
.key-clear { font-size: 1.05rem; }
.send-button { min-height: 58px; font-size: 1.3rem; letter-spacing: 0.08em; background: #2e8b57 !important; }
.send-button:hover { background: #26764a !important; }
.sent-sheet { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; max-width: 480px; }
.compact-table td { padding: 6px 8px; }

.now-card { border-color: var(--success-text); }
.now-card h2 { font-size: 1.4rem; margin-bottom: 4px; }
.seat-status { margin: 12px 0; }
.next-form { margin-top: 10px; }
.next-form .button-row { margin-top: 10px; }
@media (min-width: 720px) { .keypad-col { position: sticky; top: 12px; align-self: start; } }
.not-me { margin: -4px 0 14px; }
@media (max-width: 719px) {
  .keypad-col { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0 12px; box-shadow: 0 -6px 12px rgba(22, 35, 47, 0.08); }
  .key { min-height: 48px; }
  .send-button { min-height: 50px; }
}
.score-input::placeholder { color: #b7c2cc; }

/* ---------- STC / DTC / referee ---------- */
.mode-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.mode-tab { background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 8px 14px; border-radius: 999px; }
.mode-tab.current { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.key-setup { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.key-setup label { display: flex; align-items: center; gap: 6px; }
.key-capture { width: 3em !important; text-align: center; font-weight: 700; text-transform: uppercase; }
.stc-counters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.stc-counter { display: flex; flex-direction: column; gap: 8px; }
.stc-tap { min-height: 150px; font-size: 1.5rem; font-weight: 700; border-radius: 14px; border: none; color: #fff; touch-action: manipulation; }
.stc-minor .stc-tap { background: #d4a017; }
.stc-obvious .stc-tap { background: #e07b24; }
.stc-major .stc-tap { background: #c0392b; }
.stc-tap.flash { animation: tap-flash 0.25s; }
@keyframes tap-flash { from { filter: brightness(1.35); transform: scale(0.97); } to { filter: none; transform: none; } }
.stc-count-row { display: flex; gap: 6px; align-items: center; }
.stc-undo { width: 44px; height: 44px; font-size: 1.4rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0; }
.stc-value { font-size: 1.6rem !important; font-weight: 700; text-align: center; }
.stc-sheet.mode-manual .stc-tap, .stc-sheet.mode-manual .stc-undo { display: none; }
@media (max-width: 560px) { .stc-tap { min-height: 110px; font-size: 1.2rem; } }

.review-card { border: 2px solid var(--error-text); }
.review-stop { color: var(--error-text); font-weight: 800; font-size: 1.3rem; letter-spacing: 0.04em; margin: 0 0 6px; }
.diff-list { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 10px; }
.diff-list li { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: var(--bg); }
.diff-list p { margin: 0 0 6px; }
.countdown { font-size: 1.2rem; }

.dtc-table td { vertical-align: middle; }
.dtc-table tr.has-error td { background: var(--error-bg); }
.dtc-table select { width: auto; min-width: 6.5em; }
.dtc-table input[name^="reason_"] { min-width: 10em; }
.pieces { display: flex; flex-wrap: wrap; gap: 4px; }
.piece input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.piece span, .piece-static { display: inline-block; font-family: ui-monospace, Consolas, monospace; font-size: 0.9rem; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); cursor: pointer; }
.piece-static { cursor: default; }
.piece input:checked + span, .piece-static.is-failed { border: 2px solid var(--error-text); background: var(--error-bg); color: var(--error-text); font-weight: 700; border-radius: 50%/40%; }
.piece input:focus-visible + span { outline: 3px solid var(--brand-soft); }
.fail-text { color: var(--error-text); font-weight: 700; }
.sent-sheet.wide { max-width: none; }

.penalty-section { margin-bottom: 12px; }
.penalty-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.penalty-row:last-child { border-bottom: none; }
.penalty-row.is-applied { background: var(--warn-bg); margin: 0 -10px; padding: 10px; border-radius: 6px; }
.penalty-points { display: block; font-size: 0.8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.stepper { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.stepper input { width: 3.2em !important; text-align: center; font-weight: 700; }
.step { width: 44px; height: 44px; font-size: 1.3rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0; }
.referee-buttons { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0; }
.referee-buttons { box-shadow: 0 -6px 12px rgba(22, 35, 47, 0.08); z-index: 2; }
.calls { margin: 8px 0; padding-left: 1.2em; }
.review-table td { vertical-align: top; }
.review-table .calls { margin: 0; padding-left: 1em; }
.final-select { min-width: 8em; font-weight: 600; }
.review-table tr.has-error td { background: var(--error-bg); }

/* ---------- Protests ---------- */
.button.small { padding: 4px 12px; font-size: 0.9rem; }
.tag-ok { background: var(--success-bg); color: var(--success-text); }
.protest-window { margin: 4px 0 12px; }
.protest-window.is-open { color: var(--warn-text); }
.stc-line { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.stc-line p { margin: 0; }
.protest-results ul { padding-left: 1.2em; }
.protest-results li p { display: inline; margin: 0; }
.protest-card.is-open { border-left: 4px solid var(--warn-text); }
.protest-card h2 { font-size: 1.1rem; }
.decision-choice { background: transparent; }
.decision-choice label { font-weight: 400; }
.section-title { margin-top: 28px; }
.judge-alert a { font-weight: 600; }
.dtc-table .tag { white-space: nowrap; margin-left: 0; }
/* On phones, each element of the coach's slip becomes a small card, so the Protest button is in view. */
@media (max-width: 640px) {
  .slip-card .dtc-table thead { display: none; }
  .slip-card .dtc-table, .slip-card .dtc-table tbody { display: block; }
  .slip-card .dtc-table tr { display: grid; grid-template-columns: 2em 1fr auto; gap: 4px 8px; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .slip-card .dtc-table td { border: 0; padding: 0; }
  .slip-card .dtc-table td:nth-child(1) { grid-column: 1; }
  .slip-card .dtc-table td:nth-child(2) { grid-column: 2; }
  .slip-card .dtc-table td:nth-child(4) { grid-column: 3; grid-row: 1; text-align: right; }
  .slip-card .dtc-table td:nth-child(3), .slip-card .dtc-table td:nth-child(5), .slip-card .dtc-table td:nth-child(6) { grid-column: 2 / 4; }
  .slip-card .dtc-table td:empty { display: none; }
  .slip-card .table-scroll { overflow: visible; }
}
.announce-text { font-size: 1.4rem; margin: 12px 0 20px; padding: 12px 16px; border-left: 4px solid var(--brand); background: var(--brand-soft); border-radius: 6px; }
.timing-block { margin: 14px 0; padding: 4px 14px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.timing-block h3 { margin: 8px 0 4px; font-size: 1rem; }
.timing-line { margin: 6px 0; }
.timing-clock { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.timing-clock.timing-over { color: var(--error-text); }
.found-penalties { border-color: var(--brand); }
.found-penalties .penalty-text .small-print { display: block; }
.approve-choice { display: flex; gap: 14px; flex-wrap: wrap; }
.approve-choice label { display: inline-flex; align-items: center; gap: 6px; }
.score-read { margin: 16px 0; padding: 4px 14px 8px; border: 2px solid var(--brand); border-radius: 8px; }
.score-read .announce-text strong { font-size: 1.6rem; }
.big-button { font-size: 1.3rem; padding: 14px 28px; }

/* ---------- Figures ---------- */
.figure-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.figure-top p { margin: 0; }
.figure-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.figure-number { font-size: 3rem; font-weight: 700; line-height: 1.1; }
.figure-score-label { font-weight: 600; display: block; margin-top: 12px; }
.figure-score { font-size: 2.2rem; width: 6em; max-width: 100%; text-align: center; padding: 8px; }
.figure-keypad { grid-template-columns: repeat(3, 1fr); }
.figure-keypad .key-ten { grid-column: 1 / -1; }
.caller-card .figure-number { margin: 4px 0; }
.caller-boxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; margin: 16px 0; }
.caller-box { border: 2px solid var(--border); border-radius: 10px; padding: 10px; text-align: center; display: flex; flex-direction: column; gap: 4px; background: var(--surface); }
.caller-box strong { font-size: 1.8rem; }
.caller-box.is-empty strong { color: var(--muted, #888); }
.caller-box input { font-size: 1.4rem; text-align: center; width: 100%; }
.caller-box.has-error { border-color: var(--error-text); }
.caller-box .error { font-size: 0.8rem; }
.figure-scores td, .figure-scores th { white-space: nowrap; }
tr.is-scratched td { opacity: 0.6; }
@media (max-width: 719px) { .figure-sheet .keypad-col { position: static; box-shadow: none; padding: 0; } .figure-score { width: 100%; } }

/* ---------- Schedule ---------- */
.schedule-setup summary { cursor: pointer; list-style: none; }
.schedule-setup summary::-webkit-details-marker { display: none; }
.schedule-setup summary h2 { display: inline; }
.schedule-setup summary::after { content: ' ▾'; color: var(--muted); }
.minutes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 16px; }
.schedule-table td { vertical-align: middle; }
.schedule-table .sb-time { font-weight: 600; width: 6.5em; }
.schedule-table tr.sb-comp td { background: var(--brand-soft); }
.schedule-table tr.sb-break td, .schedule-table tr.sb-setup td { background: #fbf3dc; }
.schedule-table tr.sb-seats td { color: var(--muted); font-size: 0.92rem; }
.schedule-table tr.sb-awards td { text-align: center; font-style: italic; }
.sb-min { width: 4.5em !important; }
.sb-label { width: 10em !important; }
.sb-actions form { margin-right: 4px; }
.sb-day-form select { width: auto; padding: 2px 4px; }
.add-block { margin-top: 12px; }
.schedule-table form.inline-form { flex-wrap: nowrap; align-items: center; } .schedule-table td:nth-child(3) { white-space: nowrap; }
.schedule-table.public { width: 100%; } .schedule-setup #s-day_count { max-width: 7em; }

/* ---------- Announcer ---------- */
.announce-card h2 { margin-top: 0; }
.announce-timer { margin: 16px 0; font-size: 1.15rem; }
.timer-clock { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.announce-form { margin-top: 8px; }
.music-player { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.music-player audio { width: 100%; }
.announce-schedule { margin-top: 16px; }
.announce-schedule summary { cursor: pointer; }
.schedule-table tr.is-current td { background: var(--success-bg) !important; font-weight: 600; }

/* ---------- Volunteers: deck marshal, score check, videographer ---------- */
.deck-tabs { margin: 12px 0; }
.deck-tabs .count { background: rgba(255,255,255,0.3); color: inherit; }
.deck-card { padding: 14px 16px; }
.deck-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.deck-head p { margin: 0; }
.deck-number { font-size: 1.6rem; font-weight: 700; }
.deck-athletes { margin: 8px 0 0; padding-left: 1.2em; }
.score-check-msg p { margin: 4px 0; font-size: 1.1rem; }
.recorder { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.recorder-preview { width: 100%; max-height: 50vh; background: #000; border-radius: 8px; }
button.danger.big-button { background: var(--error-text); color: #fff; }
.file-button { position: relative; overflow: hidden; align-self: flex-start; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.review-video { margin: 12px 0; }
.review-video video { width: 100%; max-height: 60vh; background: #000; border-radius: 8px; }
.frame-controls { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.frame-controls .scrub { flex: 1; }
.file-button { border: 1px solid var(--brand); color: var(--brand); background: #fff; }

/* ---------- Results ---------- */
.results-card h3 { margin-top: 0; }
.results-card h4 { margin: 18px 0 6px; }
.results-table td, .results-table th { white-space: nowrap; }
.results-table td.small-print { white-space: normal; }
.small-print { font-size: 0.88rem; }
.score-summary table { max-width: 420px; }
.score-summary tr.grand th { font-size: 1.15rem; border-top: 2px solid var(--border); }

/* A judge who is also the referee switches between their two sheets (G-15). */
.seat-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.seat-tab { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; }
.seat-tab.is-current { background: var(--brand); border-color: var(--brand); color: #fff; }
.seat-sent { font-size: 0.8rem; font-weight: 600; color: var(--success-text); }
.seat-tab.is-current .seat-sent { color: #fff; }

/* DTC 1's final slip in a DTC review (G-67). */
.final-slip { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; min-width: 200px; }
@media (max-width: 560px) {
  /* The DTC review stacks each element on phones so DTC 1's final slip isn't cut off. */
  .review-table thead { display: none; }
  .review-table, .review-table tbody { display: block; }
  .review-table tr { display: grid; grid-template-columns: 2em 1fr; gap: 6px 8px; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .review-table td { border: 0; padding: 0; }
  .review-table td:nth-child(n+3) { grid-column: 1 / 3; }
  .review-table .final-slip { min-width: 0; }
}

/* Routines out of order (G-66). */
.ooo-waiting { list-style: none; margin: 0 0 12px; padding: 0; }
.ooo-waiting li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.ooo-card { border-color: var(--brand); }
.swim-later { margin-top: 16px; }
.swim-later summary { cursor: pointer; color: var(--muted); }

/* Entries: USAAS member numbers and the coaches, chaperones & officials table. */
table.grid input.member-number, table.data input.member-number { width: 9em; }
table.grid input.level-input { width: 8em; }


/* ---------- Logo colours: type, buttons, cards and tables ---------- */
h1, h2, h3, .hero h1 { font-family: var(--serif); color: var(--text); }
h1 { font-size: 2.4rem; font-weight: 500; letter-spacing: -0.01em; line-height: 1.12; margin: 0.2em 0 0.45em; }
h2 { font-size: 1.35rem; font-weight: 500; }
h3 { font-size: 1.08rem; font-weight: 600; }
.hero h1 { font-size: 2.7rem; font-weight: 500; }
@media (max-width: 560px) { h1 { font-size: 1.9rem; } .hero h1 { font-size: 2.1rem; } }
.eyebrow { color: var(--brand); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.14em; }
strong, b { font-weight: 600; }
.card { border-color: #e6ebf2; box-shadow: 0 10px 28px rgba(10, 20, 60, 0.05); }
fieldset { border-color: #e6ebf2; }
input[type="text"], input[type="email"], input[type="number"], input[type="date"], input[type="password"], input:not([type]), select, textarea { border-color: #d2dae6; }
button.primary, button.secondary, button.danger, .button { border-radius: 999px; padding: 10px 20px; font-weight: 500; }
button.primary, a.button.primary { font-weight: 500; }
.button.small { padding: 5px 14px; }
.data th, .data td, .price-table th, .price-table td { border-bottom-color: #e6ebf2; }
.data thead th, .price-table thead th, table.grid th { text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.7rem; font-weight: 500; color: var(--muted); border-bottom-color: var(--border); }
.count { background: var(--brand-soft); color: var(--brand); }
.tag { font-weight: 500; letter-spacing: 0.02em; }
.steps a { border-color: #dde4ee; }
.alert { border-radius: var(--radius); }
details summary { color: var(--brand); }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
/* Keypads: warm white keys. */
.key { background: linear-gradient(#ffffff, #eef3f9); border-color: #cfd9e6; }
.key:active { background: #dbe4ef; }
.key-fraction { background: linear-gradient(#eef8fd, #d6edf8); }
.score-input::placeholder { color: #b8c2d0; }
.tag, .count, .badge { font-family: var(--sans); }
.data thead th .hint, table.grid th .hint { text-transform: none; letter-spacing: 0; font-size: 0.75rem; }

/* Detailed score sheets (/results/sheet/…) */
.sheet-links { margin: -4px 0 10px; font-size: 0.92rem; }
.sheet-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.sheet-head h1 { margin: 4px 0 6px; }
.sheet-head p { margin: 0; }
.sheet-key h2 { margin-top: 0; }
.sheet-figures { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 20px; margin: 8px 0 12px; }
.sheet-figure { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--border); }
.sheet-figure-no { font-weight: 700; color: var(--brand); }
.sheet-figure-total { font-weight: 600; border-bottom: 0; }
.card + .card, .sheet-routine + .sheet-routine { margin-top: 16px; }
.sheet-table { font-variant-numeric: tabular-nums; }
.sheet-table tbody.sheet-entry tr:first-child td { border-top: 2px solid var(--border); }
.sheet-table tbody.sheet-entry td { vertical-align: top; }
.sheet-place { font-family: var(--serif, Georgia, serif); font-size: 1.15rem; font-weight: 600; color: var(--brand); white-space: nowrap; }
.sheet-score { font-weight: 700; }
.sheet-behind { color: var(--muted); white-space: nowrap; }
.sheet-table.compact td, .sheet-table.compact th { padding-top: 4px; padding-bottom: 4px; }
.sheet-routine { border-left: 4px solid var(--brand); }
.sheet-routine-head { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; background: var(--brand-soft); margin: -20px -20px 14px; padding: 14px 20px; border-radius: var(--radius) var(--radius) 0 0; }
.sheet-routine-score { display: flex; flex-direction: column; align-items: flex-end; }
.sheet-routine-score strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.sheet-routine .table-scroll + .table-scroll { margin-top: 10px; }
.sheet-extras { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 24px; margin-top: 12px; }
.sheet-extras h3 { font-size: 0.95rem; margin: 0 0 4px; }
.sheet-extras p { margin: 2px 0; }
.sheet-sum { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.sheet-routine.is-scratched { opacity: 0.6; }
@media (max-width: 600px) {
  .sheet-routine-head { grid-template-columns: 44px 1fr; }
  .sheet-routine-score { grid-column: 1 / -1; flex-direction: row; gap: 10px; align-items: baseline; justify-content: flex-start; }
}

/* Figure draw and posted figures */
.figure-list td:first-child { white-space: nowrap; }
.figure-draw-card .button-row { align-items: center; margin-top: 12px; }
.figure-library { margin-top: 14px; }
.figure-library h4 { margin: 12px 0 4px; }
.drawn-group { margin: 4px 0 8px; }
@media (max-width: 600px) { .figure-list td:first-child { white-space: normal; } }
.testing-note { background: #fff4e0; border: 1px dashed #d59a3a; border-radius: 8px; padding: 8px 12px; font-size: 0.9rem; }
.testing-note button { margin-left: 8px; }
.figure-list input { width: 5em; text-align: right; }

/* Figure descriptions on the judge's panel page */
.figure-penalty { display: inline-block; }
.figure-penalty[open] { display: block; margin-top: 6px; }
.figure-penalty summary { list-style: none; cursor: pointer; }
.figure-penalty summary::-webkit-details-marker { display: none; }
.figure-penalty label { display: block; font-weight: 600; margin-top: 8px; }
.figure-penalty .testing-note { margin-top: 6px; }
.caller-penalty { margin: 4px 0 12px; }
.caller-penalty label { display: block; font-weight: 600; }

/* DTC Pass / Fail buttons */
.pf-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: var(--surface); }
.pf-btn { position: relative; cursor: pointer; }
.pf-btn input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pf-btn span { display: block; padding: 8px 16px; min-width: 3.5em; text-align: center; font-weight: 600; color: var(--muted); user-select: none; }
.pf-btn + .pf-btn span { border-left: 1px solid var(--border); }
.pf-pass input:checked + span { background: #1f7a4d; color: #fff; }
.pf-fail input:checked + span { background: #b3261e; color: #fff; }
.pf-btn input:focus-visible + span { outline: 3px solid var(--brand-soft); outline-offset: -3px; }
.has-error .pf-toggle { border-color: #b3261e; }

/* Height charts */
.chart-pdf { margin-left: auto; font-size: 0.75rem; font-weight: 600; color: var(--brand); border: 1px solid var(--brand); border-radius: 999px; padding: 1px 8px; }

/* Meet Administrator: the list of same-size options on "My meet". */
.option-sub { margin-top: -6px; }
.option-group { font-family: Poppins, sans-serif; font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brand); font-weight: 500; margin: 28px 0 10px; }
.option-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.option-row { display: flex; align-items: center; gap: 14px; height: 76px; padding: 0 18px; background: #fff; border: 1px solid #e1e7f0; border-radius: 14px; text-decoration: none; color: inherit; box-shadow: 0 1px 2px rgba(10, 20, 60, 0.04); }
.option-row:hover, .option-row:focus-visible { border-color: var(--brand); background: var(--brand-soft); }
.option-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.option-title { font-weight: 600; font-size: 1rem; color: #141936; }
.option-desc { font-size: 0.84rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.option-status { font-size: 0.78rem; padding: 3px 10px; border-radius: 999px; background: #eef2f8; color: #4a5370; white-space: nowrap; }
.option-status.is-ok { background: #e3f3e8; color: #1f6b3a; }
.option-status.is-live { background: #e6eefb; color: #234a8c; }
.option-status.is-alert { background: #fdeacc; color: #7a4a00; }
.option-arrow { font-size: 1.5rem; color: #a7b1c4; line-height: 1; }
.option-list + .muted-card { margin-top: 28px; }
.narrow-page { max-width: 760px; }
@media (max-width: 800px) {
  .option-list { grid-template-columns: minmax(0, 1fr); }
  .option-row { height: auto; min-height: 76px; padding: 12px 16px; }
  .option-desc { white-space: normal; }
  .option-status { max-width: 45%; white-space: normal; text-align: center; }
}

/* Modify Scores (G-102): the referee's correction forms. */
.modify-form { padding: 12px 0; border-top: 1px solid #e6ebf2; }
.modify-form:first-of-type { border-top: 0; }
.modify-form h3 { margin: 4px 0 8px; }
.modify-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px 14px; margin-bottom: 12px; }
.modify-cell { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--muted); }
.modify-cell input, .modify-cell select { font-size: 1.05rem; padding: 8px 10px; }
.modify-cell.has-error input { border-color: #b3261e; }
.modify-penalties { display: grid; gap: 6px; margin-bottom: 12px; }
.modify-penalty { display: flex; align-items: center; gap: 10px; }
.modify-penalty input { width: 64px; padding: 6px 8px; }
.modify-log { margin-top: 28px; }

/* Global Administrator: the scoring factors grid. */
.factor-card h2 { margin-bottom: 8px; }
.factor-table th, .factor-table td { padding: 4px 6px; }
.factor-table tbody th { font-weight: 500; white-space: nowrap; text-align: left; }
.factor-table .factor-group { text-align: center; border-bottom: 1px solid #e1e7f0; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.factor-table input { width: 68px; padding: 6px 8px; text-align: right; font-size: 0.95rem; }
.factor-table td.factor-error input { border-color: #b3261e; background: #fdecea; }
.factor-table td.factor-changed { background: #fff4d6; }
.factor-table td.factor-changed input { border-color: #c79a2b; }
.factor-save { position: sticky; bottom: 0; background: var(--bg); padding: 14px 0; border-top: 1px solid #e1e7f0; display: flex; gap: 16px; align-items: center; }
.factor-remove { margin-top: 18px; }

/* Coach cards: the Novice generic card choice. */
.card-choices { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.card-choices .hint { margin: 0; }

/* Figure judging: "You have entered a 10. Is that a 1.0 or a 10.0?" */
.ask-ten { border: 2px solid var(--brand); }
.ask-ten .button-row { gap: 16px; }
.ask-ten-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 10px 0; padding: 12px 14px; border: 2px solid var(--brand); border-radius: 12px; background: #fff; }
.ask-ten-inline p { margin: 0; font-weight: 600; flex: 1 1 220px; }
.ask-ten-inline button { min-width: 84px; font-size: 1.1rem; }
.penalty-element { display: flex; flex-direction: column; gap: 2px; font-size: 0.8rem; color: var(--muted); }
.penalty-element input { width: 96px; padding: 8px; }
.away-box { margin: 14px 0 6px; }
.away-box summary { cursor: pointer; color: var(--muted); }
.away-box form { margin: 4px 6px 4px 0; }
.modify-reason { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; max-width: 520px; font-size: 0.9rem; }
.deck-athletes { list-style: none; padding-left: 0; }
.deck-athlete { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.deck-athlete:last-child { border-bottom: none; }
.deck-name { flex: 1 1 160px; font-weight: 600; }
.deck-athlete.is-checked .deck-name { color: var(--muted); }
.deck-out summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; }
.deck-out form { margin-top: 6px; }
.deck-outname { margin-right: 12px; }
.figure-penalty-list { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; margin: 8px 0; display: grid; gap: 6px; }
.figure-penalty-list legend { font-weight: 700; font-size: 0.9rem; padding: 0 4px; }
.figure-penalty-list .checkbox-line { align-items: flex-start; }

/* ---------- Detailed score sheets (Chloe 2026-10-18): figures = a block per swimmer; routines =
   a summary table, then a scorecard per routine (rank on the left, scores in the middle, totals on
   the right). Navy and sky blue from the logo. ---------- */
.rs-label { margin: 0 0 6px; font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand); }
.rs-officials h3 { margin: 8px 0 2px; font-family: var(--sans); font-size: 0.9rem; }
.rs-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px 16px; font-size: 0.9rem; }
.rs-table, .rs-summary { font-variant-numeric: tabular-nums; }
.rs-table td, .rs-table th { padding-top: 4px; padding-bottom: 4px; white-space: nowrap; }
.rs-table thead + tbody td { border-top: 0; }
.rs-table tbody + thead th { padding-top: 12px; }
.rs-table thead th:first-child { color: var(--brand); }
.rs-summary tbody tr:nth-child(even) td { background: #f3f7fc; }
.rs-total { font-weight: 700; color: var(--brand); }
.rs-note { font-size: 0.75rem; color: var(--muted); }
.rs-block { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-top: 14px; }
.rs-block.is-scratched { opacity: 0.6; }
.rs-block .rs-table { margin: 4px 0 8px; }
.rs-bh { display: flex; align-items: center; gap: 14px; background: var(--brand-soft); padding: 10px 16px; flex-wrap: wrap; }
.rs-rank { background: var(--brand-dark); color: #fff; font-weight: 700; font-size: 1.1rem; border-radius: 8px; padding: 4px 12px; min-width: 52px; text-align: center; }
.rs-who { flex: 1; display: flex; flex-direction: column; min-width: 140px; }
.rs-who strong { font-size: 1.05rem; }
.rs-who .muted, .rs-draw { font-size: 0.85rem; }
.rs-big { text-align: right; font-size: 1.35rem; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.rs-big small { display: block; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.rs-card { display: grid; grid-template-columns: 170px minmax(0, 1fr) 220px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-top: 14px; background: var(--surface); }
.rs-left { background: var(--brand-dark); color: #fff; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.rs-left .rs-small { font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.75; margin-top: 6px; }
.rs-rk { font-family: var(--serif); font-size: 2.2rem; line-height: 1.05; font-weight: 600; }
.rs-team { margin-top: 10px; font-size: 1rem; }
.rs-names { font-size: 0.82rem; opacity: 0.9; }
.rs-left .tag { align-self: flex-start; margin-top: 8px; }
.rs-mid { padding: 8px 10px; }
.rs-right { background: var(--brand-soft); padding: 14px; display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.rs-right > div { display: flex; justify-content: space-between; gap: 10px; }
.rs-right .rs-rule { border-top: 1px solid #c6dcec; padding-top: 6px; }
.rs-grand { border-top: 3px solid var(--brand-dark); margin-top: 4px; padding-top: 8px; font-size: 1.25rem; font-weight: 700; color: var(--brand-dark); }
.rs-small-note { margin: -2px 0 2px; font-size: 0.78rem; color: var(--muted); }
@media (max-width: 1000px) {
  .rs-card { grid-template-columns: 1fr; }
  .rs-left { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
  .rs-left .rs-small { display: none; }
  .rs-rk { font-size: 1.6rem; }
  .rs-team, .rs-names { margin-top: 0; }
}
/* Score sheets are wide: give them the room, and keep their tables compact. */
main:has(.rs-card), main:has(.rs-block) { max-width: 1400px; }
.rs-table, .rs-summary { font-size: 0.86rem; }
.rs-table th, .rs-table td, .rs-summary th, .rs-summary td { padding: 4px 7px; }
.rs-summary td.small-print { min-width: 150px; }
.rs-summary td:nth-child(3) { min-width: 130px; }
.rs-right b { white-space: nowrap; }
.rs-card { grid-template-columns: 160px minmax(0, 1fr) 235px; }
@media (max-width: 1000px) { .rs-card { grid-template-columns: 1fr; } }
