/* RCJ Scoreboard theme: warm off-white + RoboCup orange palette layered over Bootstrap 5. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap');

/* Tokens */
:root {
  --bg: #f8f5f1;
  --surface: #ffffff;
  --surface-2: #f0ebe7;
  --line: #e8e2dc;
  --line-2: #d4cdd2;
  --ink: #2c1a10;
  --ink-2: #5c5250;
  --mute: #9b9290;
  --dim: #b8b0ac;
  --accent: #f26223;
  --accent-h: #d9531a;
  --accent-soft: #fdf2f0;
  --emphasis: #4d0b18;
  --emphasis-h: #3a0812;
  --emphasis-soft: #f5e8e8;
  --ok: #15803d;
  --ok-soft: #e7f4ea;
  --warn: #8a5a00;
  --warn-soft: #fbefd2;
  --danger: #4d0b18;
  --danger-soft: #f5e8e8;
  /* Bootstrap 5.2+ CSS-var hooks — reskins stock components without !important. */
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--ink);
  --bs-body-font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --bs-body-font-size: 13.5px;
  --bs-body-line-height: 1.5;
  --bs-border-color: var(--line);
  --bs-border-radius: 6px;
  --bs-border-radius-sm: 4px;
  --bs-primary: var(--accent);
  --bs-primary-rgb: 242, 98, 35;
  --bs-secondary: var(--ink-2);
  --bs-danger: var(--danger);
  --bs-danger-rgb: 77, 11, 24;
  --bs-success: var(--ok);
  --bs-warning: var(--warn);
  --bs-link-color: var(--accent);
  --bs-link-hover-color: var(--accent-h);
  --bs-link-color-rgb: 242, 98, 35;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  margin: 0;
}
h1, h2, h3, h4, h5, h6 { color: var(--ink); font-weight: 600; letter-spacing: -0.01em; margin-top: 0; }
h1, .h1 { font-size: 22px; line-height: 1.25; }
h2, .h2 { font-size: 18px; line-height: 1.3; }
h3, .h3 { font-size: 16px; }
h4, .h4 { font-size: 15px; font-weight: 600; }
h5, .h5 { font-size: 14px; font-weight: 600; }
h6, .h6 { font-size: 13px; font-weight: 600; }
code, kbd, samp, pre, .mono { font-family: 'Geist Mono', ui-monospace, SFMono-Regular, monospace; font-size: 0.92em; }
code {
  color: var(--accent);
  background: var(--accent-soft);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(242, 98, 35, 0.22);
  font-size: 0.88em;
}
.text-muted { color: var(--mute) !important; }
small { color: var(--mute); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-h); text-decoration: underline; text-underline-offset: 2px; }

/* App shell */
.app {
  display: grid;
  grid-template-columns: 232px 1fr;
  grid-template-rows: 48px 1fr auto;
  min-height: 100vh;
}
.app.nosidebar { grid-template-columns: 1fr; }
.app.nosidebar .sidebar { display: none; }
.app.nosidebar .main { grid-column: 1; }
.topbar {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 20;
}
.sidebar {
  grid-column: 1;
  grid-row: 2;
  border-right: 1px solid var(--line);
  background: var(--surface);
  overflow-y: auto;
  max-height: calc(100vh - 48px);
  position: sticky;
  top: 48px;
}
.main { grid-column: 2; grid-row: 2; background: var(--bg); min-width: 0; }
/* Hidden until nav.js adds .nav-ready, so a no-JS page never shows a dead hamburger. */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-right: 10px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.nav-toggle:hover { background: var(--surface-2); color: var(--ink); }
/* Driven by .app.nav-open, so it stays hidden without JS. */
.nav-scrim {
  display: none;
  position: fixed;
  inset: 48px 0 0 0;
  background: rgba(44, 26, 16, 0.32);
  z-index: 25;
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .main { grid-column: 1; }
  .topbar .crumbs, .topbar .kbar { display: none; }
  .app.nav-ready .nav-toggle { display: inline-flex; }
  .sidebar {
    position: fixed;
    top: 48px;
    left: 0;
    bottom: 0;
    width: 264px;
    max-height: none;
    z-index: 30;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.2s ease, visibility 0.2s ease;
    box-shadow: 2px 0 14px rgba(44, 26, 16, 0.14);
  }
  .app.nav-open .sidebar { transform: translateX(0); visibility: visible; }
  .app.nav-open .nav-scrim { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}

/* Topbar */
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 16px;
  border-right: 1px solid var(--line);
  height: 100%;
}
.brand .brand-mark {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-family: 'Geist Mono', monospace;
  font-weight: 700;
  font-size: 12px;
  display: grid;
  place-items: center;
}
.brand .brand-name { color: var(--ink); font-weight: 600; letter-spacing: -0.01em; font-size: 14px; }
.brand .brand-name:hover { color: var(--ink); text-decoration: none; }
.brand .brand-slash { color: var(--line-2); }
.brand .brand-sub { color: var(--mute); font-size: 12px; }
.crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 14px;
  color: var(--ink-2);
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  flex-wrap: wrap;
  min-width: 0;
  overflow: hidden;
}
.crumbs a { color: var(--mute); }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs .sep { color: var(--line-2); }
.crumbs .cur { color: var(--ink); }
.topbar-spacer { flex: 1; }
/* Outlined, so it does not compete with a page's own primary action; same height as .kbar. */
.topbar-enter-results {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  margin-right: 12px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.topbar-enter-results-icon { flex: none; }
.topbar-actions .btn { white-space: nowrap; }
/* Icon only on narrow screens; the label stays available to screen readers. */
@media (max-width: 520px) {
  .topbar-enter-results { margin-right: 8px; padding: 0 9px; }
  .topbar-enter-results-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}
.kbar {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: 5px 10px;
  border-radius: 6px;
  color: var(--mute);
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  min-width: 220px;
  cursor: pointer;
}
.kbar .kbd {
  border: 1px solid var(--line-2);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10.5px;
  color: var(--ink-2);
  background: var(--surface);
  font-family: 'Geist Mono', monospace;
}
.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #f47d47);
  margin-left: 12px;
  color: #fff;
  font-size: 11px;
  display: grid;
  place-items: center;
  font-weight: 600;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: 12px; }
.topbar-actions .logout-form { display: inline-block; margin: 0; }

/* Footer */
.site-footer {
  grid-column: 1 / -1;
  grid-row: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  min-height: 40px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  font-size: 12px;
  color: var(--mute);
}
.site-footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.site-footer-links a, .site-footer-commit { color: var(--mute); text-decoration: none; }
.site-footer-links a:hover, .site-footer-commit:hover { color: var(--accent); }

/* Sidebar */
.side-section {
  padding: 14px 14px 6px;
  color: var(--mute);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}
.side-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  color: var(--ink-2);
  cursor: pointer;
  position: relative;
  font-size: 13px;
  text-decoration: none;
  border-left: 2px solid transparent;
}
.side-item:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.side-item.active {
  color: var(--ink);
  background: var(--accent-soft);
  font-weight: 500;
  border-left-color: var(--accent);
}
.side-item .icon {
  width: 14px;
  color: var(--mute);
  flex: 0 0 auto;
  font-size: 12px;
  display: inline-grid;
  place-items: center;
}
.side-item.active .icon { color: var(--accent); }
.side-item .count {
  margin-left: auto;
  color: var(--mute);
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
}
.side-item.nested { padding-left: 30px; font-size: 12.5px; }
.side-item.nested-2 { padding-left: 48px; font-size: 12px; color: var(--mute); }
.side-sep { height: 1px; background: var(--line); margin: 8px 12px; }

/* Page head */
.main-head {
  padding: 22px 28px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.main-head h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.main-head .eyebrow {
  color: var(--mute);
  font-family: 'Geist Mono', monospace;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.main-head .sub {
  color: var(--mute);
  margin-top: 6px;
  font-family: 'Geist Mono', monospace;
  font-size: 12.5px;
  line-height: 1.5;
}
.main-head .sub a { color: var(--mute); }
.main-head .sub a:hover { color: var(--ink); }
.main-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.meta-row { display: flex; gap: 8px; padding: 0 28px 14px; align-items: center; flex-wrap: wrap; }
.page { padding: 22px 28px 80px; max-width: 1280px; }
.messages-wrap { padding: 14px 28px 0; display: flex; flex-direction: column; gap: 8px; }
.messages-wrap .alert { margin: 0; }

/* Pills and identifier badges */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  background: var(--surface);
}
.pill.ok { color: var(--ok); border-color: rgba(21,128,61,.3); background: var(--ok-soft); }
.pill.accent { color: var(--accent); border-color: rgba(242,98,35,.3); background: var(--accent-soft); }
.pill.mute { color: var(--mute); border-color: var(--line-2); background: var(--surface-2); }
.pill.warn { color: var(--warn); border-color: rgba(138,90,0,.3); background: var(--warn-soft); }
.pill.danger { color: var(--danger); border-color: rgba(77,11,24,.3); background: var(--danger-soft); }
.pill.big { font-size: 12px; padding: 3px 10px; }
.lg-code {
  font-family: 'Geist Mono', monospace;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 13px;
  letter-spacing: 0.04em;
  border: 1px solid rgba(242, 98, 35, 0.25);
}
.kbd, kbd {
  border: 1px solid var(--line-2);
  padding: 0 5px;
  border-radius: 3px;
  font-size: 10.5px;
  color: var(--mute);
  background: var(--surface-2);
  font-family: 'Geist Mono', monospace;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  padding: 6px 11px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: background .12s, border-color .12s, color .12s;
  cursor: pointer;
  line-height: 1.3;
}
.btn:hover {
  background: var(--surface-2);
  border-color: var(--ink-2);
  color: var(--ink);
  text-decoration: none;
}
.btn-sm { padding: 4px 9px; font-size: 11.5px; }
.btn-lg { padding: 9px 16px; font-size: 14px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover, .btn-primary:focus { background: var(--accent-h); border-color: var(--accent-h); color: #fff; }
.btn-outline-primary { color: var(--accent); border-color: rgba(242,98,35,.45); background: var(--surface); }
.btn-outline-primary:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-h); }
.btn-secondary, .btn-outline-secondary { color: var(--ink-2); background: var(--surface); border-color: var(--line-2); }
.btn-outline-secondary:hover, .btn-secondary:hover { color: var(--ink); background: var(--surface-2); border-color: var(--ink-2); }
.btn-danger, .btn-outline-danger { color: var(--danger); background: var(--surface); border-color: rgba(77,11,24,.4); }
.btn-outline-danger:hover, .btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--emphasis-h); }
.btn-warning, .btn-outline-warning { color: var(--warn); background: var(--surface); border-color: rgba(138,90,0,.4); }
.btn-outline-warning:hover, .btn-warning:hover { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.btn-outline-success { color: var(--ok); background: var(--surface); border-color: rgba(21,128,61,.4); }
.btn-outline-success:hover { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.btn-primary .kbd { border-color: rgba(255,255,255,.3); color: rgba(255,255,255,.85); background: rgba(255,255,255,.12); }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: 6px 0 0 6px; }
.btn-group .btn:last-child { border-radius: 0 6px 6px 0; }
.btn-group .btn + .btn { border-left-width: 0; }
.btn-group .btn + .btn:hover { border-left-width: 1px; margin-left: -1px; }

/* Tables */
.table {
  --bs-table-bg: var(--surface);
  --bs-table-color: var(--ink);
  --bs-table-border-color: var(--line);
  --bs-table-hover-bg: var(--surface-2);
  margin-bottom: 0;
  font-size: 13px;
}
.table > :not(caption) > * > * { padding: 8px 12px; border-bottom-color: var(--line); }
.table thead th, .table thead td {
  color: var(--mute);
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 9px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--line) !important;
}
.table-sm > :not(caption) > * > * { padding: 6px 10px; }
.table-danger, .table-danger > th, .table-danger > td {
  --bs-table-bg: var(--danger-soft);
  color: var(--ink-2);
  box-shadow: inset 3px 0 0 var(--danger);
}
.table-warning, .table-warning > th, .table-warning > td {
  --bs-table-bg: var(--warn-soft);
  color: var(--ink-2);
  box-shadow: inset 3px 0 0 var(--warn);
}
.table-success, .table-success > th, .table-success > td { --bs-table-bg: var(--ok-soft); color: var(--ink-2); box-shadow: inset 3px 0 0 var(--ok); }
main .table:not(.table-borderless) {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

/* Linked table rows (row-link.js) */
.table.linked-rows tbody tr[data-href] { cursor: pointer; }
.table.linked-rows tbody tr[data-href]:hover > *,
.table.linked-rows tbody tr[data-href]:active > *,
.table.linked-rows tbody tr:has(a.row-link:focus-visible) > * {
  background: var(--surface-2);
}
.table.linked-rows td a.row-link { color: var(--ink); font-weight: 500; text-decoration: none; }
.table.linked-rows td a.row-link:hover { color: var(--ink); text-decoration: none; }
.table.linked-rows td a.row-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* Badges */
.badge {
  font-family: 'Geist Mono', monospace;
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
  text-transform: none;
}
.badge.bg-secondary, .bg-secondary { background: var(--surface-2) !important; color: var(--ink-2) !important; border-color: var(--line-2); }
.badge.bg-success, .bg-success { background: var(--ok-soft) !important; color: var(--ok) !important; border-color: rgba(21,128,61,.3); }
.badge.bg-warning, .bg-warning { background: var(--warn-soft) !important; color: var(--warn) !important; border-color: rgba(138,90,0,.3); }
.badge.bg-danger, .bg-danger { background: var(--danger-soft) !important; color: var(--danger) !important; border-color: rgba(77,11,24,.3); }

/* Alerts */
.alert {
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.55;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
}
.alert strong { color: var(--ink); font-weight: 600; }
.alert em {
  color: var(--ink);
  font-style: normal;
  background: var(--surface);
  border: 1px solid var(--line-2);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
}
.alert-info { background: var(--accent-soft); border-color: rgba(242, 98, 35, 0.3); color: var(--ink-2); }
.alert-success { background: var(--ok-soft); border-color: rgba(21, 128, 61, 0.35); color: var(--ink-2); }
.alert-warning { background: var(--warn-soft); border-color: rgba(138, 90, 0, 0.35); color: var(--ink-2); }
.alert-danger, .alert-error { background: var(--danger-soft); border-color: rgba(77, 11, 24, 0.35); color: var(--ink-2); }


/* Standings preview */
.standings-preview { list-style: none; margin: 0; padding: 0; }
.standings-preview > li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.standings-preview > li:last-child { border-bottom: none; }
.standings-preview .rank { font-family: 'Geist Mono', monospace; color: var(--mute); flex: 0 0 32px; }
.standings-preview .team { color: var(--ink); font-weight: 500; flex: 1; }
.standings-preview .muted { color: var(--ink-2); }
/* pointer-events stays on so the not-allowed cursor shows. */
.btn:disabled, .btn[disabled], button.btn:disabled { opacity: 0.5; cursor: not-allowed; filter: grayscale(0.4); }
.btn:disabled:hover, .btn[disabled]:hover, button.btn:disabled:hover { background: inherit; border-color: inherit; color: inherit; }

/* Form action row */
.form-actions { display: flex; align-items: center; gap: 10px; padding: 14px 0 0; margin-top: 6px; }
.form-actions .form-actions-help {
  flex: 1;
  font-size: 12.5px;
  color: var(--ink-2);
  text-align: right;
  padding-right: 4px;
}

/* List group */
.list-group {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}
.list-group-item {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
  padding: 11px 14px;
  font-size: 13.5px;
}
.list-group-item:hover { background: var(--surface-2); }
.list-group-item strong { font-weight: 600; }
.list-group-item a { color: var(--accent); }

/* Forms */
.form-control, .form-select {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13.5px;
  padding: 7px 10px;
  border-radius: 6px;
  border-color: var(--line-2);
  background: var(--surface);
  color: var(--ink);
}
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242, 98, 35, 0.15); }
.form-label {
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 500;
  margin-bottom: 4px;
  letter-spacing: 0.01em;
}
.form-text { color: var(--mute); font-size: 11.5px; }
textarea.form-control { line-height: 1.5; }
.invalid-feedback { color: var(--danger); font-size: 11.5px; }
.form-control.is-invalid { border-color: var(--danger); }

/* Breadcrumbs */
.breadcrumb {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  color: var(--mute);
  margin-bottom: 10px;
}
.breadcrumb-item a { color: var(--mute); }
.breadcrumb-item a:hover { color: var(--ink); text-decoration: underline; }
.breadcrumb-item.active { color: var(--ink); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--line-2); content: "/"; }

/* Reorder grip */
.bi-grip-vertical { color: var(--dim); cursor: grab; }
.bi-grip-vertical:hover { color: var(--ink-2); }

/* Panel */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0 28px 20px;
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  gap: 12px;
}
.panel-title { font-weight: 600; font-size: 13px; color: var(--ink); }
.panel-title .muted {
  color: var(--mute);
  font-weight: 400;
  margin-left: 6px;
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
}
.panel-body { padding: 14px 16px; }
.panel-body.padless { padding: 0; }
.panel-empty { padding: 22px 16px; color: var(--mute); text-align: center; font-size: 13px; }
.module-search { display: flex; align-items: center; gap: 8px; }
.module-search input[type="search"] { width: 260px; max-width: 100%; }
.module-search-count { font-family: 'Geist Mono', monospace; font-size: 12px; white-space: nowrap; }

/* Key-value grid */
dl.kv { display: grid; grid-template-columns: 160px 1fr; gap: 0; margin: 0; font-size: 13px; }
dl.kv dt {
  color: var(--mute);
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  border-top: none;
}
dl.kv dd {
  color: var(--ink);
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
dl.kv > dt:last-of-type, dl.kv > dd:last-of-type { border-bottom: none; }
dl.kv .desc { white-space: pre-wrap; line-height: 1.55; color: var(--ink-2); }

/* Leagues list */
.leagues-list { display: flex; flex-direction: column; }
.league-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: background .12s;
}
.league-row:last-child { border-bottom: none; }
.league-row:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.league-row .league-name { font-weight: 500; color: var(--ink); font-size: 14px; }
.league-row .league-meta {
  margin-left: auto;
  color: var(--mute);
  font-family: 'Geist Mono', monospace;
  font-size: 11.5px;
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Grouped table rows */
.table tr.group-head > td {
  background: var(--surface-2);
  color: var(--ink-2);
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 7px 12px;
  border-top: 1px solid var(--line);
}
.table tr.group-head > td .muted {
  color: var(--mute);
  font-weight: 400;
  margin-left: 6px;
  text-transform: none;
  letter-spacing: 0;
}
.table tr.is-withdrawn td { color: var(--mute); }
.table tr.is-withdrawn td .team-name { color: var(--mute); text-decoration: line-through; text-decoration-color: var(--dim); }

/* Keyboard hint row */
.kb-hint {
  display: flex;
  gap: 16px;
  font-family: 'Geist Mono', monospace;
  font-size: 11.5px;
  color: var(--mute);
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  flex-wrap: wrap;
}
.kb-hint .k {
  border: 1px solid var(--line-2);
  padding: 0 5px;
  border-radius: 3px;
  background: var(--surface);
  color: var(--ink-2);
  margin-right: 4px;
}
@media (max-width: 760px) {
  .main-head, .meta-row, .panel { padding-left: 16px; padding-right: 16px; }
  .panel { margin-left: 14px; margin-right: 14px; }
  dl.kv { grid-template-columns: 110px 1fr; }
}

/* Bootstrap spacing overrides */
.mt-4 { margin-top: 24px !important; }
.mb-3 { margin-bottom: 16px !important; }

/* Standings table */
.table.standings td.num, .table.standings th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table.standings tbody tr[data-cut="true"] > td { border-top: 2px solid var(--accent); }
.table.standings tbody tr[data-qualifies="false"] > td { color: var(--mute); }
.panel-subhead {
  padding: 14px 14px 6px;
  color: var(--mute);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}

/* Stage progress table */
.progress-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.progress-section-head .muted {
  color: var(--mute);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}
.progress-table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
.progress-table { min-width: 840px; table-layout: fixed; border: 0; border-radius: 0; }
.progress-table > :not(caption) > * > * { vertical-align: middle; }
.progress-table thead th { white-space: nowrap; }
.progress-table th:nth-child(1), .progress-table td:nth-child(1) { width: 78px; }
.progress-table th:nth-child(2), .progress-table td:nth-child(2) { width: 30%; }
.progress-table th:nth-child(3), .progress-table td:nth-child(3) { width: 150px; }
.progress-table th:nth-child(4), .progress-table td:nth-child(4) { width: 126px; }
.progress-table th:nth-child(5), .progress-table td:nth-child(5) { width: 88px; }
.progress-table th:nth-child(6), .progress-table td:nth-child(6) { width: 102px; }
.progress-table th:nth-child(7), .progress-table td:nth-child(7) { width: 70px; }
.progress-table tbody tr:last-child > td { border-bottom: 0; }
.progress-table tbody tr:hover > td { background: #fffaf7; }
.progress-table tbody tr.progress-status-scheduled > td { box-shadow: inset 3px 0 0 var(--warn); }
.progress-code { color: var(--accent); font-weight: 600; white-space: nowrap; }
.progress-teams { min-width: 0; overflow-wrap: anywhere; }
.progress-team-pair { min-width: 0; }
.progress-team { color: var(--ink); font-weight: 600; }
.progress-vs {
  color: var(--mute);
  font-family: 'Geist Mono', ui-monospace, SFMono-Regular, monospace;
  font-size: 11px;
  margin: 0 7px;
}
.progress-status-result { display: flex; align-items: center; gap: 8px; }
.progress-result { font-weight: 600; white-space: nowrap; }
.progress-nowrap { white-space: nowrap; }
.progress-missing { color: var(--mute); font-style: italic; }
.progress-action, .progress-action-head { text-align: right; }
/* status-<status> variants are emitted by the progress template. */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 3px 8px;
  font-family: 'Geist Mono', ui-monospace, SFMono-Regular, monospace;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--ink-2);
  background: var(--surface-2);
}
.status-completed { color: var(--ok); border-color: rgba(21, 128, 61, 0.28); background: var(--ok-soft); }
.status-scheduled { color: var(--warn); border-color: rgba(138, 90, 0, 0.28); background: var(--warn-soft); }
.status-cancelled { color: var(--mute); border-color: var(--line-2); background: var(--surface-2); }
.status-withdrawn_forfeit { color: var(--danger); border-color: rgba(77, 11, 24, 0.28); background: var(--danger-soft); }
@media (max-width: 760px) {
  .progress-table-wrap { overflow-x: visible; }
  .progress-table { min-width: 0; }
  .progress-table, .progress-table tbody, .progress-table tr, .progress-table td { display: block; width: 100% !important; }
  .progress-table tbody { padding: 10px; background: var(--surface-2); }
  .progress-table tbody tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    overflow: hidden;
  }
  .progress-table tbody tr + tr { margin-top: 10px; }
  .progress-table tbody tr.progress-status-scheduled { border-left: 3px solid var(--warn); }
  .progress-table tbody tr.progress-status-scheduled > td { box-shadow: none; }
  .progress-table td {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 12px;
    align-items: baseline;
    border-bottom: 1px solid var(--line);
    padding: 8px 10px;
    text-align: left;
  }
  .progress-table td::before {
    content: attr(data-label);
    color: var(--mute);
    font-family: 'Geist Mono', ui-monospace, SFMono-Regular, monospace;
    font-size: 10.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .progress-table td:last-child { border-bottom: 0; }
  .progress-table .progress-action { text-align: left; }
  .progress-table .progress-action .btn { justify-self: start; }
  .progress-section-head { padding-top: 12px; }
}

/* Up-next fixture queue */
.upnext { list-style: none; margin: 0; padding: 0; }
.upnext-row { border-bottom: 1px solid var(--line); }
.upnext-row:last-child { border-bottom: 0; }
.upnext-dayhead {
  padding: 8px 16px 4px;
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--mute);
  background: var(--surface);
}
.upnext-dayhead + .upnext-row { border-top: 0; }
.upnext-link {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 7px 16px;
  color: var(--ink);
  text-decoration: none;
}
a.upnext-link:hover { background: var(--surface-2); }
a.upnext-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.upnext-time {
  font-family: 'Geist Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.upnext-time.upnext-tbd { color: var(--dim); }
.upnext-match { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 7px; min-width: 0; }
.upnext-team { font-weight: 500; color: var(--ink); }
.upnext-vs { font-size: 11px; color: var(--mute); }
.upnext-meta { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.upnext-venue {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
}
@media (max-width: 620px) {
  .upnext-link { grid-template-columns: auto 1fr; grid-template-areas: "time meta" "match match"; gap: 4px 12px; }
  .upnext-time { grid-area: time; }
  .upnext-match { grid-area: match; }
  .upnext-meta { grid-area: meta; justify-self: end; }
}

/* Inline form */
.inline-form { display: inline-flex; align-items: center; gap: 8px; }
.inline-form select { padding: 4px 8px; font-size: 13px; }

/* Sidebar sign-out form */
.side-logout-form { padding: 0; margin: 0; }
.side-logout-button {
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  width: 100%;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.side-logout-button:hover { background: var(--hover, rgba(0, 0, 0, 0.04)); }

/* Match results entry */
.mre-toolbar { display: flex; align-items: center; gap: 14px; padding: 0 28px 14px; flex-wrap: wrap; }
.mre-toolbar-group { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mre-toolbar-label {
  color: var(--mute);
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-right: 4px;
}
.mre-toolbar-spacer { flex: 1; }
.mre-toolbar input[type="date"] { width: auto; max-width: 160px; }
.mre-toolbar select.form-select { width: auto; max-width: 220px; }
.mre-jump {
  display: inline-flex;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  overflow: hidden;
}
.mre-jump .mre-jump-prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  background: var(--surface-2);
  color: var(--mute);
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  border-right: 1px solid var(--line);
}
.mre-jump input {
  appearance: none;
  border: 0;
  background: var(--surface);
  padding: 5px 10px;
  font-family: 'Geist Mono', monospace;
  font-size: 12.5px;
  color: var(--ink);
  width: 160px;
  outline: none;
}
.mre-jump input::placeholder { color: var(--dim); }
.mre-jump button {
  appearance: none;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--surface);
  padding: 0 11px;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
}
.mre-jump button:hover { background: var(--surface-2); color: var(--ink); }
.mre-time-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 18px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.mre-rows > .mre-time-group:first-child { border-top: none; }
.mre-time-group .mre-time-count {
  color: var(--mute);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}
.mre-rows .mre-row + .mre-row, .mre-rows .mre-time-group + .mre-row { border-top: 1px solid var(--line); }
.mre-rows > .mre-time-group + .mre-row { border-top: none; }
.mre-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  column-gap: 18px;
  padding: 14px 18px 12px;
  background: var(--surface);
  transition: background .12s;
  position: relative;
  margin: 0;
}
.mre-row:hover { background: var(--surface-2); }
.mre-row.is-locked { color: var(--mute); }
.mre-team {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
  line-height: 1.25;
  min-width: 0;
}
.mre-row.is-locked .mre-team { color: var(--mute); font-weight: 500; }
.mre-team-home { text-align: right; padding-right: 4px; }
.mre-team-away { text-align: left; padding-left: 4px; }
.inspection-marker { display: inline-block; margin: 0 4px; font-size: 12px; line-height: 1; cursor: help; }
.inspection-marker.inspection-missing { color: var(--warn); }
.inspection-marker.inspection-failed { color: var(--danger); }
.inspection-marker.inspection-ok { color: var(--ok); }
.mre-score { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.mre-row .match-stepper {
  display: inline-flex;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  overflow: hidden;
  height: 44px;
  padding: 0;
  width: auto;
  flex-wrap: nowrap;
}
.mre-row .match-stepper button {
  appearance: none;
  border: 0;
  background: var(--surface);
  color: var(--ink-2);
  width: 32px;
  font-size: 16px;
  font-weight: 600;
  font-family: 'Geist Mono', monospace;
  cursor: pointer;
  display: grid;
  place-items: center;
  line-height: 1;
  padding: 0;
  transition: background .12s, color .12s;
}
.mre-row .match-stepper button:hover { background: var(--accent-soft); color: var(--accent); }
.mre-row .match-stepper-input {
  appearance: none;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: var(--surface);
  width: 64px;
  text-align: center;
  font-family: 'Geist Mono', monospace;
  font-weight: 600;
  font-size: 22px;
  color: var(--ink);
  padding: 0;
  outline: none;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  flex: 0 0 auto;
}
.mre-row .match-stepper-input::-webkit-outer-spin-button,
.mre-row .match-stepper-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.mre-row .match-stepper-input::placeholder { color: var(--dim); font-weight: 400; }
.mre-row .match-stepper:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242, 98, 35, 0.15); }
.mre-row .match-stepper:focus-within button { color: var(--accent); }
.mre-row .match-stepper:has(input:placeholder-shown) .match-stepper-input,
.mre-row .match-stepper:has(input[value=""]) .match-stepper-input {
  color: var(--dim);
}
.mre-colon {
  font-family: 'Geist Mono', monospace;
  font-size: 22px;
  font-weight: 600;
  color: var(--mute);
  line-height: 1;
  padding-bottom: 3px;
  user-select: none;
}
.mre-save.btn {
  height: 44px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.mre-save.btn .kbd { margin-left: 8px; }
.mre-meta {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
  margin-top: 4px;
  font-family: 'Geist Mono', monospace;
  font-size: 11.5px;
  color: var(--mute);
  flex-wrap: wrap;
}
.mre-meta .lg-code { font-size: 11.5px; padding: 2px 7px; }
.mre-meta .mre-meta-sep { color: var(--line-2); }
.mre-meta .mre-league-abbrev { color: var(--ink-2); font-weight: 500; }
.mre-meta .mre-when { color: var(--ink-2); }
.mre-meta .mre-where { color: var(--mute); }
.mre-meta .mre-open-link { margin-left: auto; color: var(--accent); font-weight: 500; text-decoration: none; }
.mre-meta .mre-open-link:hover { text-decoration: underline; }
.mre-meta .mre-refapp-link {
  margin-left: auto;
  font-family: inherit;
  font-size: inherit;
  color: var(--accent);
  font-weight: 500;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.mre-meta .mre-refapp-link:hover { text-decoration: underline; }
.mre-status { grid-column: 1 / -1; font-size: 12.5px; color: var(--mute); margin-top: 6px; min-height: 0; }
.mre-status:empty { display: none; }
.mre-status .mre-error {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid rgba(77, 11, 24, 0.18);
  border-radius: 4px;
  padding: 6px 10px;
  font-family: 'Inter', sans-serif;
}
.mre-status a {
  margin-left: 8px;
  color: var(--danger);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.mre-ghost {
  list-style: none;
  margin: 0 28px 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mre-ghost-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: var(--ok-soft);
  border: 1px solid rgba(21, 128, 61, 0.3);
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-2);
}
.mre-ghost-item .lg-code { font-size: 11.5px; padding: 2px 7px; }
.mre-ghost-item strong {
  font-family: 'Geist Mono', monospace;
  font-weight: 600;
  color: var(--ok);
  font-size: 13px;
}
.mre-ghost-item a {
  margin-left: auto;
  color: var(--ink-2);
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.mre-ghost-item .mre-countdown { font-family: 'Geist Mono', monospace; font-size: 11.5px; color: var(--mute); }
.mre-ghost-item .mre-warn { color: var(--warn); font-weight: 500; }
.mre-empty { padding: 32px 18px; text-align: center; color: var(--mute); font-size: 13px; }
@media (max-width: 760px) {
  .mre-row { grid-template-columns: 1fr; row-gap: 8px; padding: 14px 14px 12px; }
  .mre-team-home, .mre-team-away { text-align: left; padding: 0; }
  .mre-score { justify-content: center; }
  .mre-save.btn { width: 100%; justify-content: center; }
  .mre-toolbar { padding-left: 14px; padding-right: 14px; }
  .mre-ghost { margin-left: 14px; margin-right: 14px; }
}

/* Form layout */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); column-gap: 18px; }

/* Upload row and module combobox */
.photo-upload-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.photo-upload-row .form-control { width: auto; flex: 1 1 200px; max-width: 320px; }
.module-combobox { position: relative; flex: 1 1 200px; max-width: 320px; }
.module-combobox .form-control { width: 100%; max-width: none; }
@media (min-width: 761px) {
  /* Same fixed width for the combobox and the MAC field so the trailing buttons line up.
     Desktop only: in the mobile column layout the flex basis would become a height. */
  .photo-upload-row .module-combobox, .photo-upload-row input[data-mac-scan] { flex: 0 0 320px; max-width: 320px; }
}
.module-combobox-list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  max-height: 240px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.module-combobox-option {
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.module-combobox-option:hover, .module-combobox-option.is-active { background: var(--hover, rgba(0, 0, 0, 0.05)); }
.module-combobox-empty { padding: 6px 8px; font-size: 13px; }

/* Photo list */
.photo-list { list-style: none; margin: 0; padding: 0 16px 14px; display: flex; flex-wrap: wrap; gap: 14px; }
.photo-item { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.photo-item img { border-radius: 6px; border: 1px solid var(--line); display: block; }

/* Row actions */
.row-actions { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; }
.row-actions form { display: inline; margin: 0; }

/* Wide tables: horizontal-scroll fallback for tables not converted to .stack cards. */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap > .table { margin-bottom: 0; }
@media (max-width: 760px) {
  .table-wrap .table:not(.stack) th, .table-wrap .table:not(.stack) td { white-space: nowrap; }
  /* Scoped .table.stack > tbody > tr > td so it beats Bootstrap's table rule without !important. */
  .table.stack thead, .progress-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
  .table.stack,
  .table.stack > tbody,
  .table.stack > tbody > tr,
  .table.stack > tbody > tr > td,
  .table.stack > tbody > tr > th {
    display: block;
    width: auto;
  }
  .table.stack > tbody > tr { padding: 8px 14px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
  .table.stack > tbody > tr:last-child { border-bottom: 0; }
  .table.stack > tbody > tr > td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    min-height: 38px;
    padding: 7px 0;
    border: 0;
    border-bottom: 1px dashed var(--line);
    text-align: right;
    white-space: normal;
    font-variant-numeric: tabular-nums;
  }
  .table.stack > tbody > tr > td:last-child { border-bottom: 0; }
  .table.stack > tbody > tr > td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    text-align: left;
    color: var(--mute);
    font-family: 'Geist Mono', monospace;
    font-size: 10.5px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 500;
  }
  .table.stack > tbody > tr > td[data-label=""]::before { content: none; }
  .table.stack > tbody > tr > td.hide-sm { display: none; }
  .table.stack > tbody > tr > td.stack-title {
    display: block;
    text-align: left;
    border-bottom: 0;
    padding: 2px 0 4px;
    min-height: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
  }
  .table.stack > tbody > tr > td.stack-title::before { content: none; }
  .table.stack > tbody > tr > td.stack-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding-top: 10px;
    border-bottom: 0;
  }
  .table.stack > tbody > tr > td.stack-actions::before { content: none; }
  .table.stack > tbody > tr > td.stack-actions .row-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
  }
  .table.stack > tbody > tr > td.stack-actions .row-actions form { display: block; margin: 0; }
  .table.stack > tbody > tr > td.stack-actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 40px;
    padding: 9px 14px;
  }
}

/* Standings mobile card */
.table.standings .st-meta { display: none; }
@media (max-width: 760px) {
  .table.standings thead { display: none; }
  .table.standings > tbody > tr {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
  }
  .table.standings > tbody > tr:last-child { border-bottom: 0; }
  .table.standings > tbody > tr[data-cut="true"] { border-top: 2px solid var(--accent); }
  .table.standings > tbody > tr > td {
    border: 0;
    padding: 0;
    white-space: normal;
    font-variant-numeric: tabular-nums;
  }
  .table.standings .st-rank { font-weight: 600; color: var(--mute); min-width: 1.4em; }
  .table.standings .st-team { flex: 1; min-width: 0; font-weight: 500; }
  .table.standings .st-team .pill { display: none; }
  .table.standings .st-pts { font-weight: 700; }
  .table.standings .st-pts::after { content: " pts"; font-weight: 500; color: var(--mute); font-size: 11px; }
  .table.standings .st-stat { display: none; }
  .table.standings .st-meta {
    display: block;
    flex-basis: 100%;
    color: var(--mute);
    font-family: 'Geist Mono', monospace;
    font-size: 11.5px;
  }
}

/* Row disclosure (details/summary) */
.row-disclosure { display: inline-block; }
.row-disclosure > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Geist Mono', monospace;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  padding: 5px 11px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: var(--surface);
  user-select: none;
}
.row-disclosure > summary::-webkit-details-marker { display: none; }
.row-disclosure > summary::after {
  content: "▸";
  color: var(--mute);
  font-size: 10px;
  transition: transform .12s;
}
.row-disclosure[open] > summary { color: var(--ink); border-color: var(--ink-2); }
.row-disclosure[open] > summary::after { transform: rotate(90deg); }
.row-disclosure > summary:hover { background: var(--surface-2); color: var(--ink); }
.row-disclosure-body { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
.row-disclosure-body form { display: block; margin: 0; }
@media (max-width: 760px) {
  .table.stack .row-disclosure, .table.stack .row-disclosure > summary { width: 100%; }
  .table.stack .row-disclosure > summary { justify-content: center; min-height: 40px; }
  .table.stack .row-disclosure-body .btn { width: 100%; justify-content: center; min-height: 40px; }
  .photo-upload-row { flex-direction: column; align-items: stretch; }
  .photo-upload-row .form-control, .photo-upload-row .form-select, .photo-upload-row .module-combobox { width: 100%; max-width: none; flex: none; }
  .photo-upload-row .btn { width: 100%; justify-content: center; }
}

/* MAC QR scanner */
.mac-scan-btn { margin-left: 0.5rem; }
/* The flex gap already spaces the button; a margin would overflow the mobile row. */
.photo-upload-row .mac-scan-btn { margin-left: 0; }
.mac-scan-overlay {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  padding: 1rem;
}
.mac-scan-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  max-width: 32rem;
  width: 100%;
}
.mac-scan-video { width: 100%; max-height: 70vh; border-radius: 0.5rem; background: #000; object-fit: cover; }
.mac-scan-hint, .mac-scan-error { color: #fff; margin: 0; text-align: center; }

/* Public "next matches" big-screen display */
.display { max-width: 1600px; margin: 0 auto; padding: clamp(16px, 2vw, 40px); }
.display-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: .75rem; margin-bottom: clamp(12px, 1.5vw, 28px);
}
.display-title { margin: 0; font-size: clamp(1.6rem, 3vw, 3rem); color: var(--emphasis); }
.display-sub { font-weight: 400; color: var(--mute); }
.display-updated { font-size: clamp(.8rem, 1vw, 1.1rem); color: var(--mute); font-variant-numeric: tabular-nums; }
.display-grid { display: grid; gap: clamp(12px, 1.5vw, 28px); }
.display-grid.is-multi { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.display .panel { margin: 0; }
.display .display-now { border-left: 4px solid var(--accent); margin-bottom: clamp(12px, 1.5vw, 28px); }
.display .upnext-row { font-size: clamp(1rem, 1.4vw, 1.6rem); }
.display .upnext-link { grid-template-columns: auto 1fr auto; }
.display .upnext-time { font-size: inherit; }
.display .upnext-row.is-now { font-weight: 600; }
.display-empty {
  padding: clamp(24px, 5vw, 80px); text-align: center;
  color: var(--mute); font-size: clamp(1.2rem, 2vw, 2rem);
}
