/* Operator app chrome: hub, match centre, builder, cheat sheet, report. */
/* ── Shell ──────────────────────────────────────────────── */
.shell { min-height: 100%; display: flex; flex-direction: column; }
.shell > header {
  padding: 16px 28px;
  display: flex; align-items: center; gap: 16px;
  border-bottom: 1px solid var(--border);
}
.shell > main { flex: 1; padding: 28px; }
.shell > footer {
  padding: 14px 28px;
  border-top: 1px solid var(--border);
  display: flex; gap: 14px; align-items: center;
  color: var(--stone); font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase;
}
.brand {
  font-family: var(--head); font-weight: 700; font-size: 13px;
  letter-spacing: 0.28em; text-transform: uppercase; color: var(--white);
}
.spacer { flex: 1; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--white);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-family: var(--body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, transform 60ms;
  min-height: 48px;
  touch-action: manipulation;
}
.btn:hover  { background: var(--panel-hover); }
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.38; cursor: not-allowed; }

.btn-primary {
  background: var(--red);
  color: var(--white);
  border-color: transparent;
  letter-spacing: 0.2em;
}
.btn-primary:hover { background: var(--red-bright); }

.btn-warn   { background: var(--red-dim); color: var(--white); border-color: var(--red-border); }
.btn-danger { background: var(--danger); color: var(--white); border-color: transparent; }
.btn-ghost  { background: transparent; border-color: var(--border); }
.btn-ghost:hover { background: var(--panel); }

/* ── Forms ──────────────────────────────────────────────── */
.form { display: grid; gap: 16px; max-width: 580px; }
.form label {
  display: grid; gap: 8px;
  font-family: var(--body);
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--stone);
}
.form input, .form select, .form textarea {
  appearance: none;
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 16px;
  font-family: var(--body);
  font-size: 16px;
  outline: none;
  transition: border-color 120ms, background 120ms;
  text-transform: none;
  letter-spacing: normal;
}
.form input:focus, .form select:focus, .form textarea:focus {
  border-color: var(--red);
  background: rgba(152, 27, 50, 0.06);
}
/* Checkboxes keep native rendering — the reset above strips the check mark
 * and leaves no visible on/off state at all. */
.form input[type="checkbox"] {
  appearance: auto;
  -webkit-appearance: checkbox;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  accent-color: var(--red);
  cursor: pointer;
}
.form input[type="checkbox"]:focus { background: none; }
.form select option { background: #1a1a1a; color: var(--white); }
.form .row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow);
}
.card h2 {
  margin: 0 0 12px;
  font-family: var(--head); font-weight: 700;
  font-size: 28px; letter-spacing: 0.01em; line-height: 1;
}
.card h3 {
  margin: 0 0 10px;
  font-family: var(--body); font-size: 10px; font-weight: 600;
  letter-spacing: 0.3em; text-transform: uppercase; color: var(--red);
}

/* ── Landing ────────────────────────────────────────────── */
.landing {
  display: grid; gap: 40px;
  max-width: 1080px;
  margin: 32px auto;
  padding: 0 24px 56px;
}
.hero {
  position: relative;
  border: 1px solid var(--border);
  border-left: 4px solid var(--red);
  border-radius: var(--radius-lg);
  padding: clamp(36px, 5vw, 64px);
  min-height: 420px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  box-shadow: var(--shadow-lg);
}
/* Top-right red accent stripe */
.hero::after {
  content: "";
  position: absolute; top: 0; right: 0;
  width: 140px; height: 4px;
  background: var(--red);
}
.hero-logo {
  display: block;
  width: clamp(240px, 40vw, 480px);
  height: auto;
  margin-bottom: 8px;
}
.hero-tagline {
  margin-top: 28px;
  max-width: 540px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 15px;
  font-weight: 300;
}

/* Grouped section header on the homepage hub */
.link-group { display: grid; gap: 14px; }
.link-group + .link-group { margin-top: 36px; }
.group-head {
  display: flex; align-items: baseline; gap: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.group-head h2 {
  margin: 0;
  font-family: var(--head); font-weight: 700;
  font-size: 18px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--white);
}
.group-head .group-note {
  color: var(--stone); font-size: 12px; font-weight: 300;
  letter-spacing: 0.04em;
}

/* Link cards */
.links {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.link-card {
  display: grid; gap: 8px;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 4px solid transparent;
  color: inherit;
  transition: background 140ms, border-left-color 140ms, transform 120ms;
}
.link-card:hover {
  background: var(--panel-hover);
  border-left-color: var(--red);
  transform: translateY(-2px);
}
.link-card .label {
  color: var(--red); font-family: var(--body);
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.34em; text-transform: uppercase;
}
.link-card strong {
  font-family: var(--head); font-weight: 700;
  font-size: 26px; letter-spacing: 0.01em;
  color: var(--white);
}
.link-card span { color: var(--stone); font-size: 13px; line-height: 1.55; font-weight: 300; }

/* Picker cards — a card holding several open links (player-profile dropdown,
   vertical-display feed variants), so it doesn't lift/shift under the cursor
   the way the plain link cards do. */
.pp-pick, .vp-pick { border-left-color: var(--red); }
.pp-pick:hover, .vp-pick:hover { transform: none; }
.pp-pick .bld-field { margin-top: 4px; }
.pp-pick-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 2px; }
.pp-pick-actions .bld-btn {
  display: inline-flex; align-items: center;
  padding: 11px 18px; text-decoration: none;
}

/* ── Umpire scoreboard ──────────────────────────────────── */
.umpire {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh; height: 100dvh;
}
.umpire-header {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 12px 22px;
  border-bottom: 1px solid var(--border);
  font-family: var(--body);
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--stone);
}
.umpire-header .center { text-align: center; }
.umpire-header strong { color: var(--white); font-weight: 600; }

.score-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; padding: 12px;
  height: 100%; min-height: 0;
}

.team-panel {
  position: relative;
  display: grid; grid-template-rows: auto 1fr auto;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: transform 60ms, border-color 120ms, box-shadow 120ms, background 120ms;
}
/* Left stripe: neutral until a team is serving (red = serving indicator) */
.team-panel[data-team="1"],
.team-panel[data-team="2"] { border-left: 5px solid var(--border-strong); }
.team-panel.serving { border-left-color: var(--red); }
.team-panel:active { transform: scale(0.99); }
/* Serving state */
.team-panel.serving {
  border-color: var(--red);
  background: rgba(152, 27, 50, 0.06);
  box-shadow: inset 0 0 0 1px var(--red-border), 0 0 50px var(--red-glow);
}

.team-meta { padding: 20px 22px 12px; }
/* Both player names: bold white, stacked. */
.team-name,
.team-players {
  font-family: var(--head); font-weight: 700;
  font-size: clamp(22px, 3vw, 38px);
  letter-spacing: 0.01em; line-height: 1.08;
  color: var(--white); text-transform: uppercase;
}
.team-players { margin-top: 2px; }
.team-players:empty { display: none; }
.serving-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(152, 27, 50, 0.18);
  color: var(--red);
  border: 1px solid var(--red-border);
  font-family: var(--body); font-size: 9px; font-weight: 700;
  letter-spacing: 0.28em; text-transform: uppercase;
  margin-top: 10px;
}
.serving-pill::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--red);
}

.team-score { display: grid; place-items: center; padding: 8px; }
.point-display {
  font-family: var(--display);
  font-size: clamp(80px, 18vh, 220px);
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--white);
}
.point-display.gp {
  color: var(--red);
  font-size: clamp(60px, 14vh, 180px);
  font-style: italic;
}

.team-aux {
  display: grid; grid-template-columns: 1fr auto auto;
  gap: 14px; padding: 14px 20px;
  border-top: 1px solid var(--border);
  align-items: center;
}
.set-pips { display: flex; gap: 10px; flex-wrap: wrap; }
.set-pip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 58px; height: 52px;
  padding: 0 14px; border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  font-family: var(--display);
  font-size: 34px;
  font-variant-numeric: tabular-nums;
  color: var(--stone);
}
.set-pip.complete {
  background: rgba(152, 27, 50, 0.22);
  color: var(--white);
  border-color: var(--red-border);
}
.set-pip.current {
  border-color: var(--border-strong);
  color: var(--white);
}
.set-pip.lost { opacity: 0.48; }
.set-pip sup {
  font-family: var(--body); font-size: 12px;
  margin-left: 3px; letter-spacing: 0.04em;
  opacity: 0.80; vertical-align: super;
}
.sets-count {
  font-family: var(--display);
  font-size: 54px; line-height: 1;
  color: var(--red);
}

.umpire-controls {
  display: grid; grid-auto-flow: column; gap: 14px;
  padding: 18px 18px;
  border-top: 1px solid var(--border);
  align-items: stretch;
}
.umpire-controls .btn {
  min-height: 104px; padding: 20px 22px;
  font-size: 21px; font-weight: 600; letter-spacing: 0.06em;
  line-height: 1.15;
}

/* ── Toast banner ───────────────────────────────────────── */
.banner {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  background: var(--white); color: var(--black);
  padding: 10px 20px; border-radius: 999px;
  font-family: var(--body); font-size: 11px; font-weight: 700;
  letter-spacing: 0.2em; text-transform: uppercase;
  box-shadow: var(--shadow); z-index: 50;
  white-space: nowrap;
}
.banner.error   { background: var(--danger); color: var(--white); }
.banner.success { background: var(--red); color: var(--white); }

/* ── Match-end overlay ──────────────────────────────────── */
.match-end-overlay {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  z-index: 10;
}
.match-end-card { text-align: center; padding: 40px 52px; max-width: 520px; }
.match-end-card h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 56px; letter-spacing: 0.04em; text-transform: uppercase;
}
.match-end-card .winner {
  margin-top: 10px;
  font-family: var(--head); font-weight: 700;
  color: var(--red); font-size: 32px;
  letter-spacing: 0.01em; text-transform: uppercase;
}

/* ── Login ──────────────────────────────────────────────── */
.login { display: grid; place-items: center; min-height: 100dvh; padding: 24px; }
.login .card { width: 100%; max-width: 380px; }
.pin-input {
  text-align: center;
  font-family: var(--display);
  font-size: 36px; letter-spacing: 0.25em; padding: 14px;
  font-variant-numeric: tabular-nums;
}

/* ── Setup (picker, import, new match) ──────────────────── */
.setup { max-width: 820px; margin: 32px auto; padding: 0 20px 56px; }
.setup h1 {
  margin: 16px 0 28px;
  font-family: var(--head); font-weight: 700;
  font-size: 44px; letter-spacing: 0.02em; text-transform: uppercase;
}
.setup .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .setup .row { grid-template-columns: 1fr; } }
.setup .actions {
  display: flex; gap: 10px; margin-top: 28px;
  align-items: center; flex-wrap: wrap;
}

/* ── Result rows (completed matches, import preview) ────── */
/* How a paste was read, when it wasn't the plain one-match-per-row form —
   says so before the operator commits the import. */
.import-note {
  margin: 0 0 10px; padding: 10px 14px;
  border-left: 3px solid var(--red);
  background: rgba(0, 0, 0, 0.04); border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--stone); line-height: 1.6;
}
.results-list { display: grid; gap: 8px; }
.result-row {
  display: grid;
  grid-template-columns: minmax(80px, auto) 1fr auto;
  align-items: center;
  gap: 16px; padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  font-size: 13px; line-height: 1.4;
}
.result-row:hover { border-left-color: var(--red); }
.result-row .result-label {
  font-family: var(--body); font-size: 9px; font-weight: 700;
  letter-spacing: 0.28em; text-transform: uppercase; color: var(--red);
}
.result-row .result-verdict {
  font-family: var(--head); font-weight: 600;
  font-size: 17px; letter-spacing: 0.01em;
  text-transform: uppercase; color: var(--white);
}
.result-row .result-verdict .result-winner { color: var(--red); }
.result-row .result-score {
  font-family: var(--display); font-size: 20px;
  color: var(--muted); letter-spacing: 0.02em; white-space: nowrap;
}
.result-score .result-duration {
  color: var(--muted); margin-left: 10px; font-variant-numeric: tabular-nums;
}
/* Completed rows carry Undo / Restart controls; the import preview doesn't, so
   the extra track only appears when there is something to put in it.
   The buttons get their own full-width row underneath rather than a fourth
   column: as a column their min-content width (four nowrap buttons) won the
   layout and squeezed the names into a one-word-per-line sliver. */
.result-row.has-actions {
  grid-template-columns: minmax(80px, auto) 1fr auto;
  grid-template-areas:
    "label verdict score"
    "actions actions actions";
  row-gap: 12px;
}
.result-row.has-actions .result-label  { grid-area: label; }
.result-row.has-actions .result-verdict { grid-area: verdict; }
.result-row.has-actions .result-score  { grid-area: score; }
.result-row.has-actions .result-actions { grid-area: actions; }
/* Let the names actually use the 1fr track instead of bottoming out at
   min-content, and wrap on spaces rather than mid-pair. */
.result-row .result-verdict { min-width: 0; overflow-wrap: break-word; }
.result-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding-top: 12px; border-top: 1px solid var(--border);
}
@media (max-width: 640px) {
  .result-row.has-actions {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "label   label"
      "verdict score"
      "actions actions";
    row-gap: 8px;
  }
}
.result-btn {
  font-family: var(--body); font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); background: transparent;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 14px; min-height: 44px; /* iPad touch target */
  white-space: nowrap; cursor: pointer;
}
.result-btn:hover, .result-btn:focus-visible {
  color: var(--white); border-color: var(--red);
}
.result-btn:active { transform: translateY(1px); }
.result-btn-danger:hover, .result-btn-danger:focus-visible {
  color: var(--danger, #e5484d); border-color: var(--danger, #e5484d);
}
/* ✕ delete on a scheduled row — same column as the ↑↓ reorder buttons */
.reorder-del { color: var(--muted); }
.reorder-del:hover, .reorder-del:focus-visible { color: var(--danger, #e5484d); border-color: var(--danger, #e5484d); }
@media (max-width: 600px) {
  .result-row, .result-row.has-actions { grid-template-columns: 1fr; gap: 4px; padding: 10px 14px; }
  .result-actions { margin-top: 8px; }
}

/* ── Portrait stack (iPad) ──────────────────────────────── */
@media (orientation: portrait) and (max-width: 900px) {
  .score-grid { grid-template-columns: 1fr; grid-auto-rows: 1fr; }
}

/* ── Phone ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .umpire-header {
    grid-template-columns: 1fr 1fr;
    padding: 8px 14px; font-size: 9px; gap: 3px 8px;
    /* 0.22em tracking pushes "Super tiebreak · In progress" onto a second
       line in a half-width column and it collides with the server readout. */
    letter-spacing: 0.1em;
    align-items: start;
  }
  /* Format (best of 3, super tiebreak, …) gets its own full-width line */
  .umpire-header > :first-child { grid-column: 1 / -1; }
  .umpire-header .center { text-align: left; }

  /* Vertical budget is tight with two stacked panels: size the point display
     in dvh (the real visible height on iPhone Safari) and trim paddings so
     the aux strip (pips + set count) is never clipped by the panel. */
  .score-grid { padding: 8px; gap: 8px; }
  .team-meta { padding: 10px 14px 4px; }
  .team-name,
  .team-players { font-size: 19px; }
  .team-aux { padding: 6px 12px; gap: 10px; }
  .team-score { min-height: 0; }
  .point-display { font-size: clamp(48px, 11dvh, 110px); }
  .point-display.gp { font-size: clamp(40px, 9dvh, 90px); }
  .set-pip { min-width: 38px; height: 32px; font-size: 20px; padding: 0 9px; }
  .set-pip sup { font-size: 10px; }
  .sets-count { font-size: 28px; }
  .serving-pill { font-size: 8px; padding: 3px 9px; }

  .umpire-controls {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(48px, auto);
    gap: 7px; padding: 8px;
  }
  /* Courtside tap targets: big enough to hit and read. */
  .umpire-controls .btn { min-height: 48px; font-size: 13px; padding: 6px 8px; letter-spacing: 0.06em; }
  #btn-end-match { grid-column: span 2; }
  #btn-signout   { grid-column: span 1; }

  .hero { padding: 28px; min-height: 300px; }
}

/* ── Landscape short-height (iPhone landscape) ──────────── */
@media (orientation: landscape) and (max-height: 480px) {
  .umpire-header { padding: 5px 14px; font-size: 9px; }
  .score-grid { padding: 7px; gap: 7px; }
  .team-meta { padding: 7px 13px 5px; }
  .team-name,
  .team-players { font-size: 16px; }
  .team-aux { padding: 7px 12px; gap: 8px; }
  .set-pip { min-width: 34px; height: 30px; font-size: 17px; padding: 0 8px; }
  .sets-count { font-size: 26px; }
  .point-display { font-size: clamp(48px, 36vh, 130px); }
  .umpire-controls { padding: 5px 8px; gap: 5px; }
  .umpire-controls .btn { min-height: 30px; font-size: 9px; padding: 4px 8px; }
}

/* ── Umpire: collapsible Trash ───────────────────────────────────
   Closed by default (no `open` attribute in the markup). */
.trash-summary {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; cursor: pointer; list-style: none;
  min-height: 44px; /* iPad touch target */
}
.trash-summary::-webkit-details-marker { display: none; }
.trash-summary::before {
  content: '▸'; color: var(--red); font-size: 12px;
  transition: transform 0.15s ease;
}
.trash-details[open] > .trash-summary::before { transform: rotate(90deg); }
.trash-summary:hover .smallcaps { color: var(--muted); }
.trash-count {
  font-family: var(--body); font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; color: var(--stone);
}

/* ── Umpire: event section headings ──────────────────────────────
   The schedule is one long scroll on the iPad, so each event block has to
   announce itself at a glance from arm's length: red rule, day as an
   eyebrow, then the event name big in the condensed head face. */
.event-head {
  border-top: 2px solid var(--red);
  padding-top: 12px;
  margin-bottom: 10px;
}
.event-head-day {
  font-family: var(--body); font-size: 11px; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--red-bright);
  margin-bottom: 2px;
}
.event-head-title {
  font-family: var(--head); font-weight: 700;
  font-size: 34px; line-height: 1.04;
  letter-spacing: 0.005em; text-transform: uppercase;
  color: var(--text);
}
@media (max-width: 620px) {
  .event-head-title { font-size: 26px; }
}

/* ── Umpire: reorder the scheduled order of play ─────────────── */
.sched-item { display: flex; align-items: stretch; gap: 12px; flex-wrap: wrap; position: relative; }
.sched-item .sched-card { flex: 1; margin: 0; }
/* Edit sits in the card's top-right corner. The card's label line is padded
   clear of it so a long "Match 3 · Super tiebreak to 10 · win by 2" doesn't
   run underneath. */
.sched-edit-btn {
  position: absolute; top: 10px; right: 12px; z-index: 2;
  font-family: var(--body); font-size: 10px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); background: var(--bg);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 0 16px; min-height: 40px; cursor: pointer;
}
.sched-edit-btn:hover, .sched-edit-btn:focus-visible { color: var(--text); border-color: var(--red); }
.sched-edit-btn:active { transform: translateY(1px); }
.sched-item .sched-card .label { padding-right: 74px; }
/* The match that's on court keeps its slot in the order of play, greyed out
   and inert — the live card at the top of the page is where you score it. */
.sched-ghost { align-items: center; }
.sched-ghost .sched-card { opacity: 0.45; }
.sched-ghost .sched-reorder { opacity: 0.35; }
.sched-ghost-chip {
  font-family: var(--body); font-size: 10px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--red); white-space: nowrap;
  border: 1px solid var(--red-border); border-radius: 999px;
  padding: 6px 12px; align-self: center;
}
/* A played match keeps its slot in the order of play. The result reads as
   finished — dimmed, no left accent — while the controls stay fully legible,
   because fixing a wrongly-filed result is exactly what they are for. */
.result-ghost { background: transparent; }
.result-ghost:hover { border-left-color: transparent; }
.result-ghost .result-label,
.result-ghost .result-verdict,
.result-ghost .result-score { opacity: 0.5; }
.sched-done-chip {
  font-family: var(--body); font-size: 10px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--stone); white-space: nowrap;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 0 12px; margin-right: 4px;
  display: inline-flex; align-items: center; min-height: 44px;
}
/* "File under…" picker on untagged scheduled matches — moves them into an
   event's block. Sized as an iPad touch target like the reorder buttons. */
.sched-file-under {
  flex-shrink: 0; min-height: 44px; padding: 0 12px;
  font-family: var(--body); font-size: 12px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--white); background: var(--panel);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  cursor: pointer;
}
.sched-reorder { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.reorder-btn {
  width: 54px; flex: 1; min-height: 40px;
  border: 1px solid var(--border-strong); background: var(--panel);
  color: var(--white); border-radius: var(--radius);
  font-size: 22px; line-height: 1; cursor: pointer; touch-action: manipulation;
}
.reorder-btn:hover { background: var(--panel-hover); border-color: var(--red); }
.reorder-btn:active { transform: scale(0.96); }
.reorder-btn[disabled] { opacity: 0.3; cursor: not-allowed; }

/* ── Light theme — operator / setup surfaces ────────────────
 * Applied via <html class="theme-light"> on the hub, builder, cheat sheet,
 * umpire app and 1 Point control. Broadcast surfaces stay dark. Swapping the
 * ink/paper tokens inverts every token-styled component in one move. */
html.theme-light {
  --white: #17130e;                     /* ink (swapped) */
  --black: #f7f6f3;                     /* paper (swapped) */
  --muted: rgba(23, 19, 14, 0.56);
  --stone: rgba(23, 19, 14, 0.44);
  --panel: rgba(0, 0, 0, 0.04);
  --panel-hover: rgba(0, 0, 0, 0.08);
  --border: rgba(0, 0, 0, 0.14);
  --border-strong: rgba(0, 0, 0, 0.30);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.10);
  --shadow-lg: 0 20px 70px rgba(0, 0, 0, 0.14);
}
/* Red-filled elements keep true white text regardless of the ink swap. */
html.theme-light .btn-primary,
html.theme-light .banner.success,
html.theme-light .critical-card,
html.theme-light .serving-pill { color: #fff; }
/* The hero logo artwork is white — invert to ink on paper. */
html.theme-light .hero-logo { filter: invert(1); }


/* Light-theme fixes for hardcoded dark form fields (builder + shared forms). */
html.theme-light .form input,
html.theme-light .form select,
html.theme-light .form textarea,
html.theme-light .bld-field input[type="text"],
html.theme-light .bld-field input[type="datetime-local"],
html.theme-light .bld-field input[type="number"],
html.theme-light .bld-field select,
html.theme-light .bld-out input {
  background: rgba(0, 0, 0, 0.05);
}
html.theme-light .form select option,
html.theme-light .bld-field option { background: #fff; color: var(--white); }
html.theme-light .bld-btn { color: #fff; }
html.theme-light .bld-btn.ghost { color: var(--white); }

/* "No data" pill — shown by the live score bugs when there is nothing to
 * display, so an operator can tell the source works and simply has no match. */
.nodata-pill {
  position: fixed; left: 48px; top: 48px; z-index: 5;
  width: max-content;
  background: rgba(0, 0, 0, 0.82); border-left: 3px solid var(--red);
  border-radius: 6px; padding: 14px 22px;
  font-family: var(--body); font-size: 15px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}
.nodata-pill.hidden { display: none; }
/* Inside the viewer's overlay wrap the wrap itself is already positioned. */
.overlay-wrap .nodata-pill { position: static; }

/* Full-screen viewer: animated pattern background layer (?fx=rotate|zoom|flow).
 * The wrap clips the oversized rotating square; the viewer's own static
 * pattern is dropped so the moving layer shows through. */
.viewer-bgwrap { position: fixed; inset: 0; overflow: hidden; z-index: 0; }
html.viewer-fx .viewer { position: relative; z-index: 1; background: transparent; }
html.overlay .viewer-bgwrap { display: none !important; }

