/* Worked out from this area's own stylesheets when it starts (shared/lib/dark-css.js). */
:root { color-scheme: light dark; }
@media print { :root { color-scheme: light; } }
@media screen and (prefers-color-scheme: dark) {
  :root {
    --primary: #c93a33;
    --gold: #f7941d;
    --bg: #0f1318;
    --card: #181d24;
    --text: #e6e9ee;
    --muted: #9aa4b2;
    --border: #2c333d;
    --danger: #ef5a50;
    --cover: #d4c2ff;
    --cover-bg: #2a2140;
    --cover-border: #7a5fc4;
  }
  button, .btn { background: #1e2838; }
  button.danger, .btn.danger { color: #ed8783; border-color: #6d342f; }
  .error { background: #3c1b17; border: 1px solid #6d342f; }
  .notice { background: #3e3317; border: 1px solid #816f37; }
  .scoring-save-status.is-retry, .scoring-save-status.is-error { color: #ed8a82; }
  .scoring-next td { background: #163b25; }
  .badge.round-done { background: #1e2838; }
  .badge.round-next { background: #1b482a; color: #b4f4da; }
  .success { background: #184025; border: 1px solid #347849; }
  .badge { background: #1e2838; }
  .badge.player { background: #16243b; color: #829eed; }
  .badge.coach { background: #422f19; color: #edb082; }
  .badge.team_manager { background: #25173c; color: #ad86ea; }
  .badge.hidden-status { background: #3e3317; color: #eecb8b; }
  a.stat-link:hover, a.stat-link:focus-visible { background: #371915; }
  .training-box tbody tr:first-child th { background: #1e2838; }
  .badge.help-status.new { background: #16243b; color: #829eed; }
  .badge.help-status.open { background: #422f19; color: #edb082; }
  .badge.help-status.closed { background: #1e2838; }
  .badge.refund-status { background: #1e2838; }
  .badge.refund-status.approved { background: #194327; color: #92edb4; }
  .badge.refund-status.paid { background: #194327; color: #92edb4; }
  .badge.refund-status.denied { background: #3b1616; color: #ec8383; }
  .badge.refund-status.submitted { background: #16243b; color: #829eed; }
  .badge.help-bot-down { background: #3b1616; color: #ec8383; }
  .badge.help-bot-up { background: #194327; color: #92edb4; }
  .badge.help-bot-warn { background: #422f19; color: #edb082; }
  .help-msg.club { background: #3e3317; border-color: #816f37; }
  .help-msg.member { background: #16243b; border-color: #2a3e62; }
  .help-file-thumb img { border: 1px solid var(--border, #4d4d4d); }
  header.topbar .nav-menu-items a:hover { background: #322824; }
  .site-banner { background: #3e3317; border: 1px solid #816f37; }
  .chip { background: #371915; }
  .badge.tentative { background: #422f19; color: #edb082; }
  .tg-st-linked { border-color: #35794c; background: #153821; }
  .tg-st-open { border-color: #87673a; background: #392c16; }
  .tg-st-other { background: var(--soft, #1e232d); border-color: var(--line, #424b5a); }
  .tg-conflict { border-color: #8a3e3b; background: #391816; }
  .tg-ok { color: #92edb4; }
  .tg-slots { color: #acb6c3; }
  .tg-wait { color: #edb082; }
  .tg-bad { color: #ec8383; }
  .tg-stage-steps { border: 1px solid #3d5169; }
  .tg-stage-step { background: var(--card); }
  .tg-stage-step + .tg-stage-step { border-left: 1px solid #3d5169; }
  .tg-slot-none, .tg-key-none { background: repeating-linear-gradient(135deg, #23272e, #23272e 6px, #2e323b 6px, #2e323b 12px); }
  .tg-slot-part { background: #1e232d; }
  .tg-nocourt { border-color: #87673a; }
  .tg-key { border: 1px solid var(--line, #424b5a); }
  .tg-badge-confirmed { background: #1b472a; color: #a9ecc3; }
  .tg-badge-locked { background: #192242; color: #9591df; }
  .tg-badge-flagged { background: #422f19; color: #edb082; }
  .tg-held { color: var(--text, #e2e2e2); }
  .tg-dupe-check { background: #3a3316; border-color: #92783e; }
  .tg-badge-dupe { background: #544020; color: #eeaf88; }
  .tg-slot-time { color: #829eed; }
  .tg-slot-gap { background: repeating-linear-gradient(135deg, #23272e, #23272e 6px, #2e323b 6px, #2e323b 12px); }
  .tg-slot-hand { background: #18301e; }
  .tg-sheet .tg-g-boys .tg-input, .tg-sheet .tg-g-boys .tg-text, .tg-key-boys { color: #829eed; }
  .tg-sheet .tg-g-girls .tg-input, .tg-sheet .tg-g-girls .tg-text, .tg-key-girls { color: #ec8383; }
  .tg-key-free { background: #70692a; }
  .tg-key-dribblers { background: #6c2929; }
  .tg-key-omc { background: #8d6336; }
  .tg-key.tg-club-blue { background: #223a59; border-color: #4873a8; }
  .tg-key.tg-club-green { background: #25613a; }
  .tg-key.tg-club-pink { background: #501e3b; border-color: #a04574; }
  .tg-key.tg-club-purple { background: #241c49; border-color: #503c8c; }
  .tg-key.tg-club-teal { background: #2e796a; }
  .tg-key.tg-club-brown { background: #674628; }
  .tg-sheet .tg-use-dribblers .tg-note, .tg-sheet .tg-use-omc .tg-note, .tg-sheet .tg-use-club .tg-note { color: #d0d9e5; }
  .tg-sheet details.tg-unused, .tg-key-unused { background: #163b25; border-color: #3b8958; }
  .tg-key-team { background: var(--card); border-color: #3d5169; }
  .tg-key-open { border: 1px dashed #87673a; background: #392c16; }
  .tg-key-clash { border: 1px dashed #8a3e3b; background: #391816; }
  .tg-key-dupe { background: #3a3316; border-color: #92783e; }
  .tg-start .tg-summary-table { background: var(--card); }
  .tg-summary-table tfoot th, .tg-summary-table tfoot td { border-top: 2px solid var(--line, #424b5a); }
  .tg-summary-table .tg-free { background: #70692a; }
  .tg-use-dribblers { border-color: #7f3c36; background: #3c1b17; }
  .tg-use-omc { border-color: #926b3e; background: #422f19; }
  .tg-use-club { border-color: #34527a; background: #17273c; }
  .tg-use-said { color: var(--text, #e2e2e2); }
  .tg-badge-whole { background: #262c3b; color: #d4d4d4; }
  .tg-st-taken { border-color: var(--line, #424b5a); background: repeating-linear-gradient(135deg, #232323, #232323 5px, #242832 5px, #242832 10px); }
  .tg-error[title]::after { color: #ec8383; }
  .tg-only-room .tg-slot-booked .tg-st-empty.tg-ro::after, .tg-only-room .tg-slot-part .tg-st-empty.tg-ro::after, .tg-only-room .tg-slot-hand .tg-st-empty.tg-ro::after { color: #92edb4; }
  .tg-table tr.tg-row-1 th, .tg-table tr.tg-row-0 th { border-bottom: 1px solid var(--line, #424b5a); }
  .th-time { color: var(--text, #e2e2e2); }
  .th-s-booked, .th-s-part, .th-s-hand { background: #70692a; }
  .th-s-part { background: repeating-linear-gradient(135deg, #70692a, #70692a 6px, #423f19 6px, #423f19 12px); }
  .th-s-none { background: repeating-linear-gradient(135deg, #23272e, #23272e 5px, #2e343f 5px, #2e343f 10px); }
  .th-s-unknown { background: var(--soft, #1e232d); }
  .th-box { background: var(--card); border: 1px solid #657a97; color: #d0d9e5; }
  .th-g-boys .th-text { color: #829eed; }
  .th-g-girls .th-text { color: #ec8383; }
  .th-st-open { background: #392c16; }
  .th-st-other { background: var(--soft, #1e232d); border: 1px dashed #657a97; }
  .th-use-dribblers { background: #6c2929; }
  .th-use-omc { background: #8d6336; }
  .th-club-blue { background: #223a59; border-color: #4873a8; }
  .th-club-green { background: #25613a; }
  .th-club-pink { background: #501e3b; border-color: #a04574; }
  .th-club-purple { background: #241c49; border-color: #503c8c; }
  .th-club-teal { background: #2e796a; }
  .th-club-brown { background: #674628; }
  .th-dupe-check { background: #3a3316; border-color: #92783e; }
  .th-clash, .th-overlap { background: #391816; }
  .th-day.th-refold:hover .th-refold-word { color: var(--text, #e2e2e2); }
  .th-panel { border: 1px solid #395d86; background: #132031; }
  .th-panel-warn, .th-panel-error { color: #ec8383; }
  .th-when { border-top: 1px solid #294160; }
  .th-made { border-top: 1px solid #294160; }
  header.topbar .nav-avatar { background: #50441e; color: #d6dde7; }
  header.topbar .nav-account .nav-menu-items button.quiet:hover { background: #322824; }
  .portal-pill { background: #3a1816; }
  .portal-pill.is-gold { color: #f0d497; background: #3e3017; }
  .portal-pill.is-muted { background: #1e2838; }
  .admin-hub-side nav a.active, .admin-hub-side nav a:hover, .portal-side nav a.active, .portal-side nav a:hover { background: #3a1816; }
  label.season-pill:hover { border-color: #4c5767; }
  .site-banner { background: #3e3317; border: 1px solid #816f37; }
  .hat-banner { background: #3e3017; color: #f0d497; }
  @media (min-width: 641px) {
    header.topbar .nav-menu-items { background: var(--card, var(--card)); color: var(--text, #d0d9e5); border: 1px solid var(--border, #3a404b); }
    header.topbar .nav-menu-items a, header.topbar .nav-menu-items button.quiet { color: var(--text, #d0d9e5); }
    header.topbar .nav-menu-items a.active { color: var(--primary, #ed8783); }
    header.topbar .portal-group-name { color: var(--muted, #b1b5be); }
    header.topbar .nav-menu-items form { border-top-color: var(--border, #3a404b); }
    header.topbar .nav-menu-items .nav-menu-email { color: var(--muted, #b1b5be); }
  }
  @media (min-width: 641px) {
    header.topbar .nav-account .nav-menu-items form { border-top-color: var(--border, #3a404b); }
  }
  .age-pill { color: var(--muted, #b1b5be); border: 1px solid var(--border, #3a404b); }
  .age-pill.age-minor { background: #3e3317; color: #eecb8b; border-color: #7f6b36; }
  .age-pill.age-adult { background: #192742; color: #89a7e6; border-color: #2d4069; }
  .role-tag .badge-good { background: #184025; color: #97e6b1; }
  .role-tag .badge-bad { background: #3c1b17; color: var(--danger, #eb8a85); }
  .role-tag .badge-warn { background: #3e3317; color: #eecb8b; }
  .count-fold > summary.count-fold-line { border: 1px solid var(--border, #3a404b); background: var(--card, var(--card)); color: var(--muted, #b1b5be); }
  .more-actions-list .action-menu-item.danger { color: #eb8a85; }
  .badge.fill-in-clash { background: #3c1b17; color: #eb8a85; }
  .badge.fill-in-close { background: #3e3317; color: #eecb8b; }
  .grade-badge { border: 1.5px solid #37404e; background: var(--card); }
  .grade-badge.grade-boys { color: #83a9ec; background: #16233a; border-color: #324b76; }
  .grade-badge.grade-girls { color: #e98791; background: #39161b; border-color: #73313a; }
}
