:root {
  --accent: #9f1d2b;
  --accent-ink: #fff;
  --accent-soft: #fbeaec;
  --bg: #f5f5f3;
  --card: #fff;
  --ink: #1d1d1f;
  --muted: #6b6b70;
  --line: #e2e2e0;
  --good: #1f7a3d;
  --good-soft: #e5f4ea;
  --bad: #b3261e;
  --bad-soft: #fdecea;
  --warn: #8a5a00;
  --warn-soft: #fff4d6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 1px 8px rgba(0,0,0,.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #e05564;
    --accent-ink: #fff;
    --accent-soft: #3a1c20;
    --bg: #141416;
    --card: #1e1e21;
    --ink: #ececef;
    --muted: #9a9aa2;
    --line: #34343a;
    --good: #6fcf8f;
    --good-soft: #17301f;
    --bad: #ff7b72;
    --bad-soft: #3a1b19;
    --warn: #f2c14e;
    --warn-soft: #362b10;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
a { color: var(--accent); }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
p { margin: .4rem 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .6rem 16px; padding-top: max(.6rem, env(safe-area-inset-top));
  background: var(--accent); color: var(--accent-ink);
}
.brand { display: flex; align-items: center; gap: .5rem; color: inherit; text-decoration: none; font-weight: 700; }
.brand img { border-radius: 6px; box-shadow: 0 0 0 1px rgba(255,255,255,.4); }
.account { display: flex; align-items: center; gap: .75rem; font-size: .9rem; }
.account .school { opacity: .9; }
.account .settings-link { color: inherit; font-weight: 600; text-decoration: none; opacity: .95; }
.account button { background: transparent; color: inherit; border-color: rgba(255,255,255,.5); padding: .3rem .6rem; }

.container { max-width: 1040px; margin: 0 auto; padding: 16px 16px 80px; }
.crumbs { font-size: .9rem; margin-bottom: .25rem; }
.crumbs a { text-decoration: none; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px;
}
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }

button, .btn {
  font: inherit; font-weight: 600; cursor: pointer;
  padding: .5rem .9rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  text-decoration: none; display: inline-flex; align-items: center; gap: .35rem;
  min-height: 38px;
}
button:hover, .btn:hover { border-color: var(--muted); }
button:disabled { opacity: .5; cursor: default; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.danger { color: var(--bad); }
button.link { border: none; background: none; color: var(--accent); padding: .2rem .3rem; min-height: 0; font-weight: 500; }
button.icon { padding: .2rem .5rem; min-height: 32px; min-width: 36px; justify-content: center; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

input, select, textarea {
  font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: .45rem .6rem; min-height: 38px;
  max-width: 100%;
}
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { width: 100%; min-height: 120px; }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .2rem; }
.field { margin-bottom: .75rem; }
.field input, .field select { width: 100%; }
.form-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; }
.form-row .field { margin-bottom: 0; }
.w-xs { width: 70px; } .w-sm { width: 100px; } .w-md { width: 160px; }
.check { display: flex; align-items: center; gap: .4rem; color: var(--ink); font-size: .95rem; }
.check input { min-height: 0; }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a {
  padding: .6rem .9rem; text-decoration: none; color: var(--muted); font-weight: 600;
  border-bottom: 3px solid transparent; white-space: nowrap;
}
.subtabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: -6px 0 14px; }
.subtabs a { padding: .3rem .8rem; border-radius: 99px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .9rem; border: 1px solid var(--line); }
.subtabs a.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: .45rem .5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
tbody tr:hover { background: color-mix(in srgb, var(--accent-soft) 40%, transparent); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.inactive td { color: var(--muted); }
tr.to-cut td { background: var(--bad-soft); color: var(--bad); text-decoration: line-through; }
tr.to-cut td:first-child { text-decoration: none; }
.pos { font-weight: 700; font-variant-numeric: tabular-nums; width: 2.5rem; }

.pill { display: inline-block; padding: .05rem .5rem; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--bg); border: 1px solid var(--line); }
.pill.active { background: var(--good-soft); color: var(--good); border-color: transparent; }
.pill.injured, .pill.dropped, .pill.cut { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

.chg { font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.chg.up { color: var(--good); } .chg.down { color: var(--bad); } .chg.same, .chg.new { color: var(--muted); }

.notice { padding: .7rem .9rem; border-radius: 8px; margin-bottom: 12px; background: var(--accent-soft); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice.good { background: var(--good-soft); color: var(--good); }

.season-list { list-style: none; padding: 0; margin: 0 0 .75rem; }
.season-list li a {
  display: flex; justify-content: space-between; padding: .6rem .7rem; border-radius: 8px;
  text-decoration: none; color: var(--ink); border: 1px solid var(--line); margin-bottom: .4rem;
}
.season-list li a:hover { border-color: var(--accent); }
.season-list .year { font-weight: 700; }

/* Ladder editing */
.ladder-edit { list-style: none; padding: 0; margin: 0; }
.ladder-edit li {
  display: flex; align-items: center; gap: .5rem; padding: .35rem .4rem;
  border-bottom: 1px solid var(--line); background: var(--card);
}
.ladder-edit li.dragging { opacity: .4; }
.ladder-edit li.flash { background: var(--accent-soft); }
.ladder-edit .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ladder-edit .meta { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.ladder-edit input.jump { width: 56px; text-align: center; min-height: 32px; padding: .2rem; }
.handle { cursor: grab; color: var(--muted); user-select: none; padding: 0 .2rem; }

/* Score entry */
.seg { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.seg button { font-weight: 600; }
.seg button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.rounds { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .75rem; }
.rounds button { min-width: 44px; justify-content: center; position: relative; }
.rounds button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.rounds button.done::after { content: "✓"; font-size: .7rem; color: var(--good); margin-left: 2px; }
.rounds button.issue::after { content: "!"; font-size: .75rem; color: var(--bad); margin-left: 2px; }
.rounds button.on.done::after { color: #8fe0a8; }

.entry-list { list-style: none; padding: 0; margin: 0; }
.entry-list li { display: flex; align-items: center; gap: .6rem; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.entry-list .pos { color: var(--muted); font-weight: 600; width: 2rem; text-align: right; }
.entry-list .name { flex: 1; font-weight: 500; }
.entry-list input { width: 76px; text-align: center; font-size: 1.15rem; font-weight: 700; min-height: 44px; }
input.dup { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.status-line { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin-bottom: .6rem; font-size: .9rem; }
.saving { color: var(--muted); font-size: .85rem; }

.score-grid input { width: 46px; text-align: center; padding: .25rem; min-height: 32px; }
.score-grid th, .score-grid td { padding: .25rem .3rem; }
.score-grid .drill-head { text-align: center; border-left: 2px solid var(--line); }
.score-grid .drill-start { border-left: 2px solid var(--line); }
.score-grid td.name { white-space: nowrap; position: sticky; left: 0; background: var(--card); z-index: 1; }
.score-grid td.total, .score-grid th.total { font-weight: 700; background: var(--bg); }

.penalty { color: var(--warn); font-weight: 600; }

/* Pool play */
.round-block { margin: .9rem 0; }
.round-block h3 { margin-bottom: .35rem; }
.match { display: grid; grid-template-columns: 1fr 64px 12px 64px 1fr; align-items: center; gap: .4rem; padding: .3rem 0; border-bottom: 1px solid var(--line); }
.match .pa { text-align: right; font-weight: 500; }
.match .pb { font-weight: 500; }
.match .dash { text-align: center; color: var(--muted); }
.match .penalty { grid-column: 1 / -1; text-align: center; }
.match .penalty:empty { display: none; }
.match input { width: 64px; text-align: center; font-size: 1.1rem; font-weight: 700; min-height: 42px; }
.match.forfeit input { opacity: .7; }
.match input.win { border-color: var(--good); background: var(--good-soft); color: var(--good); }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.post-pool h3 { font-size: 1.1rem; margin-bottom: .2rem; }
.post-list { padding-left: 0; list-style: none; margin: .5rem 0 0; }
.post-list li { padding: .2rem 0; border-bottom: 1px solid var(--line); }
.kind { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .05rem .4rem; border-radius: 4px; background: var(--accent-soft); color: var(--accent); margin-right: .4rem; }
.pool-plan { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-top: .75rem; }
.pool-plan .card { margin: 0; background: var(--bg); }
.pool-plan ol { margin: .5rem 0 0; padding-left: 0; list-style: none; font-size: .92rem; }
.pool-plan li { padding: .1rem 0; }
@media print {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .post-pool { break-inside: avoid; border: 1px solid #999 !important; padding: 8px !important; }
}

/* Challenge matches */
.challenge-ladder { list-style: none; padding: 0; margin: 0; }
.challenge-ladder .rung { display: flex; align-items: center; gap: .6rem; padding: .45rem .5rem; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.challenge-ladder .rung .name { flex: 1; font-weight: 500; }
.challenge-ladder .rung.protected { background: var(--bg); }
.challenge-ladder .gap { padding: .15rem 0 .15rem 2.6rem; font-size: .85rem; min-height: 8px; }
.challenge-ladder .gap.locked { color: var(--muted); }
.challenge-row { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.challenge-row .who { margin-bottom: .4rem; }
.challenge-row.done { background: color-mix(in srgb, var(--good-soft) 50%, transparent); padding: .6rem; border-radius: 8px; border-bottom: none; margin-bottom: .4rem; }
.early-box { margin-top: 1rem; padding: .8rem; border: 1px dashed var(--accent); border-radius: 10px; background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.challenge-row.early { border-bottom: none; }
.result-line { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.record { display: grid; gap: .45rem; margin: .4rem 0; }
.score-line, .tb-row { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.score-line .sname { font-weight: 600; min-width: 5.5rem; }
.score-line .sname:first-child { text-align: right; }
.tb-row { padding-left: 5.9rem; }
.tb-row[hidden] { display: none; }
input.games { width: 60px; text-align: center; font-size: 1.1rem; font-weight: 700; min-height: 42px; }
.dots { display: inline-flex; gap: 3px; }
.dot { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--muted); }
.dot.on { background: var(--accent); border-color: var(--accent); }
@media (max-width: 600px) { .tb-row { padding-left: 0; } .score-line .sname { min-width: 0; } }

#toasts { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: .4rem; z-index: 50; width: min(92vw, 420px); }
.toast { padding: .65rem .9rem; border-radius: 8px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow); font-weight: 500; }
.toast-error { background: var(--bad); color: #fff; }

.auth-card { max-width: 420px; margin: 40px auto; }

@media (max-width: 600px) {
  .container { padding: 12px 12px 80px; }
  .card { padding: 12px; }
  .hide-sm { display: none; }
  .account .school { display: none; }
  h1 { font-size: 1.3rem; }
}

@media print {
  .topbar, .tabs, .actions, button, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border: none; padding: 0; }
}
.bar { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent, #3b82f6); border-radius: 99px; }
.bar span.done { background: var(--good); }
tr.done-row td { background: var(--good-soft); }
[hidden] { display: none !important; }
.w-lg { width: 100%; max-width: 30rem; }
tr.highlight td { background: var(--warn-soft); }
.subtabs a.alert:not(.active) { border-color: var(--warn); color: var(--warn); }
.correction { border-top: 1px solid var(--line); padding: .7rem 0; }
.card.editing { outline: 2px solid var(--warn); }
.picker { display: inline-flex; gap: .4rem; flex-wrap: wrap; }
.match-form .form-row { margin-bottom: .5rem; }
.player-names { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.player-names button { padding: .8rem; font-size: 1rem; text-align: left; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; }
.stat { border: 1px solid var(--line); border-radius: 10px; padding: .7rem .8rem; }
.stat .big { font-size: 1.6rem; font-weight: 800; }
.stat .label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.entry-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; border-top: 1px solid var(--line); padding: .5rem 0; }
.fix-box { background: var(--bg); border-radius: 8px; padding: .6rem; margin: .3rem 0 .6rem; }
.fix-box textarea { width: 100%; min-height: 3.5rem; font: inherit; }

/* Pool score sheets (printed for the courts) */
.score-sheet { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.sheet-rounds { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px 18px; align-items: start; }
.sheet-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.sheet-table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); border-bottom: 1px solid var(--line); padding: 4px 6px; }
.sheet-table .round-row th { background: var(--bg); color: var(--ink); font-size: .85rem; text-transform: none; letter-spacing: 0; }
.sheet-table .round-row .bye { font-weight: 400; color: var(--muted); }
.sheet-table td { padding: 4px 6px; border-bottom: 1px solid var(--line); }
.sheet-table .nm { white-space: nowrap; }
.sheet-table .pts, .sheet-table .court { width: 3rem; text-align: center; }
.sheet-table .dash { width: .8rem; text-align: center; color: var(--muted); padding: 0; }
.sheet-table.totals { break-inside: auto; }
.write-box { display: inline-block; min-width: 2.4rem; height: 1.5rem; line-height: 1.5rem; border: 1.5px solid #888; border-radius: 4px; text-align: center; font-weight: 700; }
@media print {
  main:has(.sheets) .crumbs, main:has(.sheets) .page-head { display: none !important; }
  .score-sheet { border: none; border-radius: 0; padding: 0; margin: 0; }
  .score-sheet + .score-sheet { break-before: page; }
  .sheet-rounds { grid-template-columns: 1fr 1fr; gap: 6px 16px; }
  .sheet-table { font-size: 9pt; break-inside: avoid; }
  .sheet-table td { padding: 1px 4px; }
  .sheet-table th { padding: 2px 4px; }
  .sheet-table .round-row th { background: #e8e8e8 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .write-box { border-color: #000; height: 1.05rem; line-height: 1.05rem; min-width: 2rem; }
  .score-sheet h2 { font-size: 14pt; }
  .score-sheet p { margin: .15rem 0 .3rem !important; font-size: 8.5pt; }
  .sheet-table .pts, .sheet-table .court { width: 2.5rem; }
}

.fix-badge { margin: .15rem 0 .35rem .5rem; padding: .15rem .6rem; min-height: 0; border-radius: 99px; font-size: .8rem; font-weight: 700; background: var(--warn-soft); color: var(--warn); border: 1px solid transparent; }
.fix-badge:hover { border-color: var(--warn); }

.day-group + .day-group { margin-top: 1rem; }
.day-head { font-size: .95rem; margin: .2rem 0 .4rem; color: var(--muted); }

/* Locked pairs on the challenge ladder */
.challenge-ladder .gap.locked { margin: 2px 0 2px 1.6rem; padding: .35rem .7rem; border-radius: 6px; background: var(--bad-soft, #fde8e8); color: var(--bad, #b42318); font-weight: 700; font-size: .85rem; border-left: 4px solid var(--bad, #b42318); }
.challenge-ladder .gap.warn-gap { color: var(--warn); font-weight: 600; }
.challenge-ladder .rung.is-locked { border-color: var(--bad, #b42318); }
.lock-tag { margin-left: .5rem; font-size: .75rem; font-weight: 700; color: var(--bad, #b42318); background: var(--bad-soft, #fde8e8); padding: .05rem .45rem; border-radius: 99px; white-space: nowrap; }

/* WULD score sheets */
.wuld-sheet td.nm { min-width: 11rem; }
.wuld-sheet.wide { font-size: .85rem; }
.wuld-sheet.wide td.nm { min-width: 7rem; }
.wuld-sheet .drill-cell { border-left: 2px solid var(--line); }
.wuld-sheet .blank-row td { height: 1.9rem; }
.write-line { display: inline-block; width: 10rem; border-bottom: 1px solid #888; height: 1rem; }
.sheets .score-sheet.landscape { overflow-x: auto; }
@media print {
  #toasts { display: none !important; }
  .wuld-sheet { break-inside: auto; }
  .wuld-sheet td { padding: 1px 3px; }
  .wuld-sheet .blank-row td { height: auto; }
  .wuld-sheet .write-box { height: 1rem; line-height: 1rem; }
  .wuld-sheet.wide { font-size: 7.5pt; }
  .wuld-sheet.wide td, .wuld-sheet.wide th { padding: 0 2px; }
  .wuld-sheet.wide .write-box { min-width: 1.25rem; height: .72rem; line-height: .72rem; font-size: 6.5pt; border-width: 1px; }
  .wuld-sheet.wide thead th { white-space: nowrap; overflow: hidden; font-size: 7pt; }
  .score-sheet.landscape .sheet-head { margin-bottom: 0; }
  .score-sheet.landscape p, .score-sheet.landscape .small { font-size: 7.5pt; }
  .wuld-sheet.wide .pts { width: 1.4rem; }
  .score-sheet.landscape .sheet-head h2 { font-size: 12pt; }
  .wuld-sheet .drill-cell { border-left: 2px solid #000; }
  .sheets .score-sheet.landscape { overflow: visible; }
}
@media print {
  main:has(.sheets) { padding: 0 !important; }
}

.flag-row { align-items: center; margin-bottom: .35rem; }
.flag-row .flag-text { min-width: 18rem; flex: 1 1 18rem; }

td.hours-done { color: var(--good); font-weight: 700; }
@media print { td.hours-done { color: #0a7a2f !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

a.player-link { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
a.player-link:hover { color: var(--accent); text-decoration-color: var(--accent); }

.toast-undo { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.toast-undo .undo-btn { background: transparent; color: var(--bg); border: 1px solid currentColor; min-height: 0; padding: .2rem .7rem; font-weight: 700; }
.undo-link { background: transparent; border: 1px solid rgba(255,255,255,.5); color: #fff; min-height: 0; padding: .25rem .6rem; font-size: .85rem; }
.undo-link:hover { border-color: #fff; }

/* Lock markers on the tryout ladder */
tr.lock-row td { padding: 2px 8px 2px 3.2rem; border-bottom: none; }
.lock-note { font-size: .8rem; font-weight: 600; color: var(--warn); }
.lock-note.locked { color: var(--bad, #b42318); font-weight: 700; }
tr.lock-row.locked td { background: var(--bad-soft, #fde8e8); }
.ladder-edit li.lock-note { list-style: none; padding: .15rem .6rem .15rem 3rem; background: transparent; border: none; box-shadow: none; min-height: 0; }
.ladder-edit li.lock-note.locked { background: var(--bad-soft, #fde8e8); border-radius: 6px; }
@media print { tr.lock-row.locked td { background: #fde8e8 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

.pill.dbl-pill { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* Ladder tab: lineup positions, doubles card, printable team sheet */
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.pos-input { width: 5.5rem; padding: .25rem .4rem; font-weight: 600; transition: background .3s; }
.pos-input.saved { background: var(--good-soft); }
details.dbl-card > summary { cursor: pointer; list-style-position: inside; }
details.dbl-card[open] > summary { margin-bottom: .5rem; }
#print-sheet { display: none; }
@media print {
  body.printing-sheet > *:not(#print-sheet) { display: none !important; }
  body.printing-sheet #print-sheet { display: block; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: #000; }
  .pos-input { border: none; padding: 0; background: none; width: auto; }
}
#print-sheet .ps-head { text-align: center; margin-bottom: 10px; }
#print-sheet .ps-school { font-size: 11pt; text-transform: uppercase; letter-spacing: .08em; color: #444; }
#print-sheet h1 { font-size: 20pt; margin: 2px 0; }
#print-sheet .ps-sub { font-size: 12pt; color: #333; }
#print-sheet table { width: 100%; border-collapse: collapse; font-size: 11.5pt; }
#print-sheet th { text-align: left; border-bottom: 2px solid #000; padding: 5px 8px; font-size: 10pt; text-transform: uppercase; letter-spacing: .04em; }
#print-sheet td { padding: 2.5px 8px; border-bottom: 1px solid #bbb; }
#print-sheet .num { text-align: right; width: 3.5rem; }
#print-sheet tr:nth-child(even) td { background: #f3f4f6; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
#print-sheet tr.ps-dbl td:last-child { font-weight: 700; }
#print-sheet tr.ps-out td { color: #777; }
#print-sheet tr.ps-line td { padding: 0; border-bottom: 3px double #000; background: none; }
#print-sheet tr { break-inside: avoid; }
#print-sheet .ps-foot { margin-top: 6px; font-size: 9pt; color: #444; }
.pos-cell { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.pos-saved { color: var(--good); font-size: .8rem; font-weight: 700; }
#print-sheet td.ps-locked { font-weight: 800; }
#print-sheet .ps-lock { font-size: .85em; }
button.lock-btn { color: var(--muted); font-weight: 500; }
button.lock-btn:hover { color: var(--ink); }

/* Managers: score entry only. Buttons outside score areas are hidden (the server checks too). */
.role-manager #app button:not(.mgr-ok, .mgr-ok button, .score-area button, .seg button) { display: none !important; }
.role-manager .coach-only { display: none !important; }
/* Assistant coaches without "Can delete": hide every delete / remove button. */
.no-delete #app .del { display: none !important; }
.role-pill { font-size: .75rem; padding: .1rem .5rem; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); }
.people-table td { vertical-align: middle; }
.account .role-pill { background: rgba(255,255,255,.18); color: #fff; border-color: rgba(255,255,255,.45); font-weight: 600; }
.team-pick .team-boxes { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: .35rem 0 0 1.6rem; }
.team-limited { font-weight: 600; }
.passcode-box { background: var(--bg); border-radius: 10px; padding: .7rem .8rem; margin: .75rem 0; }
.passcode-input { font-size: 1.15rem; font-weight: 700; letter-spacing: .08em; }

/* Schools page (site owner) */
.site-admin + .site-admin { margin-top: .5rem; }
.login-details { background: var(--card, #fff); color: inherit; border-radius: 6px; padding: .6rem .75rem; margin: .5rem 0; white-space: pre-wrap; font-size: .9rem; }
.people-table .can-delete { display: flex; margin-top: .3rem; }

/* A test copy of the app (SITE_LABEL is set): slate top bar and a bright label. */
.test-site .topbar { background: #334155; }
.site-label { background: #fbbf24; color: #1c1917; font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: .15rem .45rem; border-radius: 999px; margin-left: .5rem; white-space: nowrap; }
