/* GBYSA — mobile-first, high contrast for sunlight, big touch targets. No external fonts. */

:root {
  /* Club colors: black & gold (the variable keeps its old name; it is the club black). */
  --navy: #111111;
  --navy-2: #2b2b2b;
  --gold: #ffc72c;
  --gold-dark: #e6ac00;
  --green: #0a7d3b;
  --green-dark: #08652f;
  --green-bg: #dcfce7;
  /* Warnings and "saved on phone, not uploaded yet": orange-red, never gold. */
  --amber: #9a3412;
  --amber-bg: #ffedd5;
  --amber-border: #ea580c;
  --red: #b91c1c;
  --red-bg: #fee2e2;
  --grey: #374151;
  --grey-bg: #e5e7eb;
  --text: #0f172a;
  --muted: #475569;
  --border: #94a3b8;
  --line: #cbd5e1;
  --bg: #f1f5f9;
  --card: #ffffff;
  --focus: #1d4ed8;
  --radius: 12px;
  --topbar-h: 56px;
  --gutter: 16px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.4;
  -webkit-tap-highlight-color: rgba(17, 17, 17, 0.15);
}
body.has-sheet { overflow: hidden; }

h1, h2, h3, p { margin: 0; }
a { color: var(--navy); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.muted { color: var(--muted); font-size: 16px; }

/* ---------- boot ---------- */
.boot { min-height: 80vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: var(--gutter); text-align: center; }
.boot-brand { font-size: 40px; font-weight: 800; color: var(--navy); letter-spacing: 0.04em; }
.boot-msg { font-size: 18px; color: var(--muted); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px;
  padding-left: max(12px, env(safe-area-inset-left));
  padding-right: max(12px, env(safe-area-inset-right));
  background: var(--navy); color: #fff;
}
.brand { color: var(--gold); font-weight: 800; font-size: 20px; letter-spacing: 0.04em; text-decoration: none; flex: none; padding: 8px 0; }
.topbar-title { flex: 1 1 auto; min-width: 0; font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pill {
  flex: none; max-width: 70%;
  min-height: 44px; padding: 4px 12px;
  border-radius: 999px; border: 2px solid transparent;
  font-size: 15px; font-weight: 700; line-height: 1.15;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer;
}
/* Shorter pill on phones so the group title beside it is never cut off (see app.js pillState);
   the countdown and "Retry now" stay one tap away in the sync sheet. */
.pill .hide-narrow, .pill .hide-xnarrow { display: inline; }
@media (max-width: 500px) { .pill .hide-narrow { display: none; } }
@media (max-width: 440px) { .pill .hide-xnarrow { display: none; } }
.pill-ok { background: var(--green-bg); color: #065f2c; border-color: #86efac; }
.pill-warn { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-border); }
.pill-error { background: var(--red-bg); color: var(--red); border-color: #f87171; }
.pill-offline { background: var(--grey-bg); color: var(--grey); border-color: #9ca3af; }

.subbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 var(--gutter);
  background: #fff; border-bottom: 1px solid var(--line);
  min-height: 48px;
}
.back-link {
  display: inline-flex; align-items: center; min-height: 48px; padding-right: 12px;
  font-weight: 700; font-size: 17px; color: var(--navy); text-decoration: none; white-space: nowrap;
}
.coach-chip {
  margin-left: auto; min-width: 0; max-width: 70%;
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 4px 12px;
  border: 1px solid var(--border); border-radius: 999px; background: #fff;
  font-size: 15px; font-weight: 600; color: var(--navy);
  white-space: nowrap; cursor: pointer;
}
.coach-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.coach-change { flex: none; color: var(--muted); }

.banner {
  padding: 10px var(--gutter);
  background: var(--amber-bg); color: var(--amber);
  border-bottom: 2px solid var(--amber-border);
  font-size: 16px; font-weight: 600;
}
.banner.banner-offline { background: var(--grey-bg); color: var(--grey); border-bottom-color: #9ca3af; }

/* ---------- layout ---------- */
.view {
  display: block;
  width: 100%; max-width: 760px; margin: 0 auto;
  padding: 16px var(--gutter) 120px;
}
.view.view-wide { max-width: 1200px; }
.screen-title { font-size: 26px; line-height: 1.2; margin-bottom: 8px; }
.section-title { font-size: 18px; margin: 20px 0 8px; color: var(--navy); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; padding: 8px 20px;
  border-radius: var(--radius); border: 2px solid var(--navy);
  background: #fff; color: var(--navy);
  font-size: 18px; font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--gold); border-color: var(--navy); color: var(--navy); }
.btn-primary:not(:disabled):active { background: var(--gold-dark); }
.btn-secondary { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-warning { background: var(--amber-bg); border-color: var(--amber-border); color: var(--amber); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--navy); }
.btn-lg { min-height: 56px; font-size: 19px; }
.btn-md { min-height: 56px; font-size: 17px; padding: 6px 16px; }
.btn-sm { min-height: 44px; font-size: 16px; padding: 4px 12px; }
.btn-block { display: flex; width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row > .btn { flex: 1 1 140px; }

/* ---------- forms ---------- */
.label { display: block; font-weight: 700; margin: 16px 0 6px; }
.input {
  display: block; width: 100%;
  min-height: 56px; padding: 10px 14px;
  border: 2px solid var(--border); border-radius: var(--radius);
  background: #fff; font-size: 20px;
}
.input:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.25); }
.input-xl { min-height: 64px; font-size: 24px; }
.form-card { max-width: 520px; margin: 8px auto; display: flex; flex-direction: column; }
.form-card .btn { margin-top: 16px; }
.form-error { color: var(--red); font-weight: 600; min-height: 1.4em; margin-top: 8px; font-size: 16px; }

.alert { padding: 12px 14px; border-radius: var(--radius); font-size: 16px; margin: 12px 0; border: 2px solid; }
.alert-info { background: #e0ecff; border-color: #93b4f5; color: #102a5c; }
.alert-error { background: var(--red-bg); border-color: #f87171; color: var(--red); font-weight: 600; }
.alert-warn { background: var(--amber-bg); border-color: var(--amber-border); color: var(--amber); }

/* ---------- home ---------- */
.tiles { display: grid; gap: 14px; grid-template-columns: 1fr; }
.tile {
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  min-height: 112px; padding: 18px 20px; width: 100%;
  border: 2px solid var(--navy); border-radius: 16px; background: #fff; color: var(--navy);
  text-align: left; text-decoration: none; cursor: pointer;
}
.tile-primary { background: var(--gold); border-color: var(--navy); color: var(--navy); min-height: 136px; }
.tile-title { font-size: 24px; font-weight: 800; }
.tile-sub { font-size: 16px; opacity: 0.95; }
.tile-badge { align-self: flex-start; font-size: 14px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--amber-bg); color: var(--amber); }
.roster-status { margin-top: 16px; }
.home-foot { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.home-foot .btn-row > .btn { flex-basis: 200px; }
.help { display: flex; flex-direction: column; gap: 14px; max-width: 40em; }
.help-card { display: flex; flex-direction: column; gap: 10px; }
.help-steps { margin: 0; padding-left: 1.4em; display: flex; flex-direction: column; gap: 8px; font-size: 17px; line-height: 1.4; }
.help-qa { border-top: 1px solid var(--line); padding: 10px 0; }
.help-qa summary { font-weight: 700; cursor: pointer; min-height: 32px; }
.help-qa p { margin: 8px 0 0; line-height: 1.45; }

/* ---------- empty states ---------- */
.empty { text-align: center; padding: 32px 8px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty-title { font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
.empty-msg { color: var(--muted); font-size: 16px; max-width: 34em; }

/* ---------- group picker ---------- */
.groups { display: flex; flex-direction: column; gap: 14px; }
.continue-btn { min-height: 64px; font-size: 20px; }
.group-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.group-age { font-size: 28px; color: var(--navy); }
.group-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.btn-group {
  flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px;
  min-height: 72px; padding: 8px 14px; text-align: left;
  background: #fff; border: 2px solid var(--navy); color: var(--navy);
}
.btn-group-main { font-size: 20px; font-weight: 800; }
.btn-group-sub { font-size: 16px; font-weight: 600; color: var(--muted); }
.btn-group-all { background: #f1f1f1; }

/* ---------- search + list ---------- */
.search-bar {
  position: sticky; top: var(--topbar-h); z-index: 10;
  margin: -16px calc(-1 * var(--gutter)) 0;
  padding: 12px var(--gutter) 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.search-row { display: flex; gap: 10px; }
.search-input { flex: 1 1 auto; min-width: 0; min-height: 60px; font-size: 26px; font-weight: 700; }
.keypad-toggle { flex: none; min-width: 76px; }
.chips { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 44px; padding: 6px 14px;
  border-radius: 999px; border: 2px solid var(--border); background: #fff;
  font-size: 16px; font-weight: 700; color: var(--navy); cursor: pointer;
}
.chip.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
/* "Here today" is an on/off switch that stacks with All / Not rated / Rated: set apart, gold when on. */
.chip-here { margin-left: 8px; }
.chip-here.is-active { background: var(--gold); border-color: var(--gold); color: #111; }
/* Phones: all four chips fit on one line ("Here today" reads "Here"; aria-label keeps the full text). */
@media (max-width: 440px) {
  .chip { padding: 6px 12px; }
  .chip .chip-more { display: none; }
}
.count-line { margin: 10px 0 6px; }
.results { display: flex; flex-direction: column; gap: 8px; }
.more-note { text-align: center; padding: 12px; }

.prow {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 76px; padding: 10px 12px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  text-align: left; cursor: pointer; touch-action: manipulation;
}
.prow:active { background: #f1f1f1; }
.prow-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.prow-name { font-size: 19px; overflow-wrap: anywhere; }
.prow-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.prow-pos { font-size: 16px; color: var(--muted); }
/* Natural width up to a cap (short tags like "Not rated" stay on one line; the name wraps instead). */
.prow-status { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; max-width: 36%; }
.prow-prior { font-size: 16px; color: var(--muted); white-space: nowrap; }
.prow-prior strong { color: var(--navy); }

.bib {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--navy); color: #fff; font-weight: 800; font-size: 20px; letter-spacing: -0.02em;
}
.bib-none { background: var(--grey-bg); color: var(--grey); }
.bib-lg { width: 84px; height: 84px; font-size: 28px; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  background: #ececec; color: var(--navy); font-size: 16px; font-weight: 700; white-space: nowrap;
}
.tag {
  display: inline-block; padding: 3px 8px; border-radius: 6px;
  font-size: 16px; font-weight: 700; line-height: 1.2; text-align: center;
}
.tag-none { background: var(--grey-bg); color: var(--grey); }
.tag-rated { background: var(--green-bg); color: #065f2c; }
.tag-ok { background: var(--green-bg); color: #065f2c; }
.tag-warn { background: var(--amber-bg); color: var(--amber); }
.tag-error { background: var(--red-bg); color: var(--red); }
/* Small "GotSport" marker on ratings imported from GotSport (they count like any other). */
.tag-sm { padding: 1px 6px; font-size: 13px; letter-spacing: 0.01em; }
.tag-source { background: #ececec; color: var(--navy); border: 1px solid #b0b0b0; }

/* ---------- sheets ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(15, 23, 42, 0.55);
  display: flex; align-items: stretch; justify-content: center;
}
.sheet {
  display: flex; flex-direction: column;
  width: 100%; max-width: 100%; height: 100%; height: 100dvh;
  background: #fff; outline: none;
}
.sheet-head {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 8px 8px var(--gutter);
  padding-top: max(8px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
}
.sheet-title { font-size: 20px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-close { flex: none; }
.sheet-body { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px var(--gutter); overscroll-behavior: contain; }
.sheet-foot {
  flex: none; padding: 12px var(--gutter);
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: #fff;
}
.overlay-small { align-items: center; padding: var(--gutter); }
.sheet-small { height: auto; max-height: 90vh; max-width: 480px; border-radius: 16px; }
.dialog-msg { font-size: 18px; }

@media (min-width: 700px) {
  .overlay-full { align-items: center; padding: 24px; }
  .sheet-full { height: auto; max-height: 92vh; max-width: 600px; border-radius: 16px; }
}
/* Short screens (phone in landscape): the pinned footer is taller than the screen, so the
   whole sheet scrolls instead. Kept at 500px so small portrait phones keep the pinned footer. */
@media (max-height: 500px) {
  .sheet { overflow-y: auto; overscroll-behavior: contain; }
  .sheet-body { flex: none; overflow: visible; }
  .player-sheet .rate-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ---------- player sheet ---------- */
.ps-head { display: flex; align-items: center; gap: 14px; }
.ps-id { min-width: 0; }
.ps-name { font-size: 26px; font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.ps-group { font-size: 19px; font-weight: 700; color: var(--navy); margin-top: 2px; }
.ps-pos { font-size: 16px; color: var(--muted); margin-top: 2px; }
/* One-line summary of existing ratings: stays visible above the pinned grid on short phones. */
.ps-rated { font-size: 17px; font-weight: 800; color: #065f2c; margin-top: 2px; }
.ps-prior { margin-top: 12px; font-size: 18px; }
.ps-mine { font-weight: 700; color: var(--amber); background: var(--amber-bg); padding: 8px 12px; border-radius: 8px; font-size: 16px; }
.rating-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rating-item { display: flex; align-items: center; gap: 12px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; }
.rating-item.is-pending { border-color: var(--amber-border); background: #fff7ed; }
.rating-item.is-rejected { border-color: #f87171; background: #fef2f2; }
.rating-value { flex: none; min-width: 2.2em; font-size: 26px; font-weight: 800; color: var(--navy); text-align: center; }
.rating-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.rating-coach { font-weight: 700; overflow-wrap: anywhere; }
.rate-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rate-btn {
  min-height: 64px; border-radius: var(--radius);
  border: 2px solid var(--navy); background: #fff; color: var(--navy);
  font-size: 28px; font-weight: 800; cursor: pointer; touch-action: manipulation;
}
.rate-btn.is-selected { background: var(--navy); color: #fff; box-shadow: 0 0 0 4px rgba(255, 199, 44, 0.9); }
.rate-btn.is-selected::after { content: " ✓"; font-size: 22px; }
.ps-actions { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin-top: 10px; }
.ps-actions .btn { min-height: 60px; }
.ps-foot-label { font-size: 16px; font-weight: 800; color: var(--navy); margin-bottom: 6px; }
.player-sheet .sheet-foot { padding-top: 8px; box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.08); }
.player-sheet .bib-lg { width: 72px; height: 72px; font-size: 24px; }
.player-sheet .alert { margin: 10px 0 6px; padding: 8px 12px; }
@media (max-height: 600px) { .player-sheet .ps-foot-label { display: none; } }

/* ---------- sync details ---------- */
.sync-detail { display: flex; flex-direction: column; gap: 12px; }
.sync-head { font-size: 20px; font-weight: 800; padding: 10px 14px; border-radius: var(--radius); border: 2px solid; }
.item-row { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.item-row.item-rejected { border-color: #f87171; background: #fef2f2; }
.item-main { display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }

/* ---------- check-in ---------- */
.checkin-results { display: flex; flex-direction: column; gap: 12px; }
.checkin-card { display: flex; flex-direction: column; gap: 12px; }
.checkin-card.is-here { border-color: #86efac; background: #f0fdf4; }
.checkin-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.bib-huge { font-size: 84px; font-weight: 900; line-height: 1; color: var(--navy); letter-spacing: -0.03em; }
.bib-missing { font-size: 20px; font-weight: 800; color: var(--amber); background: var(--amber-bg); padding: 10px 14px; border-radius: 10px; }
.checkin-who { min-width: 0; flex: 1 1 160px; }
.checkin-name { font-size: 24px; font-weight: 800; overflow-wrap: anywhere; }
.checkin-group { font-size: 20px; font-weight: 700; color: var(--navy); }
/* Small phones: bib beside the name, so the button sits higher (above the keyboard). */
@media (max-width: 420px) {
  .checkin-top { flex-wrap: nowrap; gap: 12px; }
  .bib-huge { font-size: 64px; }
}

/* ---------- toasts / update bar ---------- */
.toasts {
  position: fixed; left: 0; right: 0; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 70;
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 var(--gutter);
  pointer-events: none;
}
.toast {
  pointer-events: none; /* never steal a tap meant for Save */
  max-width: 520px; width: 100%;
  padding: 14px 18px; border-radius: var(--radius);
  background: var(--navy); color: #fff; font-size: 18px; font-weight: 700;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transition: opacity 0.2s, transform 0.2s;
}
/* While a sheet is open its Save button lives at the bottom: show toasts at the top. */
body.has-sheet .toasts { bottom: auto; top: max(12px, env(safe-area-inset-top)); }
/* While a search box has focus the on-screen keyboard covers the bottom of the screen (iOS
   Safari and Android Chrome don't lift fixed elements above it): show toasts at the top.
   A separate rule: browsers without :has() drop only this one. */
body:has(.search-input:focus) .toasts { bottom: auto; top: max(12px, env(safe-area-inset-top)); }
/* …and keep them to one short line there, so they don't hide the next player's name. */
body.has-sheet .toast {
  padding: 8px 14px; font-size: 16px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.toast-success { background: var(--green); }
.toast-error { background: var(--red); }
.toast-warning { background: var(--amber-bg); color: var(--amber); border: 2px solid var(--amber-border); }
.toast-out { opacity: 0; transform: translateY(8px); }

.update-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; /* below sheets: never covers Save */
  padding: 10px var(--gutter); padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: var(--navy);
  display: flex; justify-content: center;
}
.update-bar .btn { width: 100%; max-width: 520px; }
body.has-sheet .update-bar { display: none; }

/* ---------- wider screens ---------- */
@media (min-width: 700px) {
  :root { --gutter: 24px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tile-primary { grid-column: 1 / -1; }
}
@media (max-width: 380px) {
  .chip { padding: 6px 11px; }
  .chips { gap: 6px; }
  .bib { width: 54px; height: 54px; font-size: 18px; }
  .prow { gap: 10px; padding: 8px 10px; }
  .search-input { font-size: 24px; }
}

/* ---------- print (admin check-in list etc.) ---------- */
@media print {
  .topbar, .subbar, .banner, .update-bar, .toasts, .no-print { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .view { max-width: none; padding: 0; }
}

/* Advanced Evaluation (optional block in the player sheet, collapsed by default). */
.adv { margin-top: 16px; }
.adv-toggle { justify-content: space-between; }
.adv-body { display: grid; gap: 14px; margin-top: 12px; }
.adv-label { font-size: 16px; font-weight: 800; color: var(--navy); margin-bottom: 6px; }
.adv-grid { display: grid; gap: 6px; grid-template-columns: repeat(5, 1fr); }
.adv-btn {
  min-height: 48px; border-radius: var(--radius); border: 2px solid var(--navy); background: #fff; color: var(--navy);
  font-size: 20px; font-weight: 800; cursor: pointer; touch-action: manipulation;
}
.adv-btn.is-selected { background: var(--navy); color: #fff; box-shadow: 0 0 0 4px rgba(255, 199, 44, 0.9); }
.pos-chips { flex-wrap: wrap; }
.pos-chip { min-height: 48px; }
.adv-hint { font-size: 15px; margin-top: 6px; }
.rating-extras { font-size: 15px; font-weight: 700; color: var(--navy); }

/* Coordinator's practice screen (Phase 2): per group, teams + spots with a team picker. */
.practice-group { margin-bottom: 14px; }
.practice-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.practice-group-head .section-title { margin: 0; }
.practice-group.is-locked { border-color: var(--navy); }
.practice-sub { font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 14px 0 2px; }
.practice-team-list, .practice-spot-list { list-style: none; margin: 0; padding: 0; }
.practice-team { display: flex; align-items: flex-start; justify-content: space-between; gap: 2px 12px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.practice-team-name { display: flex; flex-direction: column; }
.practice-coach { font-size: 14px; }
.practice-team-spot { display: flex; flex-direction: column; align-items: flex-end; text-align: right; font-size: 16px; font-weight: 700; }
.practice-team-spot.is-none { color: var(--amber); }
.practice-park-line { font-size: 14px; font-weight: 400; }
.practice-spot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(124px, 40%); align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.practice-spot-when { display: flex; flex-direction: column; min-width: 0; font-size: 16px; }
.practice-when > span { display: block; }
.practice-when .practice-when-sep { display: none; }
.practice-pick, .practice-take { min-height: 48px; font-size: 16px; font-weight: 700; padding: 6px 4px 6px 8px; }
.practice-open .section-title { margin-top: 0; }
.practice-lock-row { margin-top: 14px; }
.input[readonly] { background: #f1f5f9; color: var(--muted); }
.link-button { border: 0; background: none; padding: 4px 0; font: inherit; text-align: left; color: var(--navy); text-decoration: underline; cursor: pointer; }
.practice-not-listed { border-left: 4px solid var(--amber-border); background: var(--amber-bg); }
.practice-lock-row .muted { margin-top: 6px; }
.practice-sheet-link { margin-top: 16px; }

/* The practice sheet (admin edits it, coordinators read it): the old Excel sheet's shape. */
.psheet-wrap {
  --psheet-day: 116px; --psheet-time: 136px;
  overflow-x: auto; margin: 6px 0; background: #fff;
  border: 1px solid var(--border); border-radius: 8px; -webkit-overflow-scrolling: touch;
}
.psheet-wrap:focus { outline: none; }
.psheet-wrap:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.psheet { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: 15px; user-select: none; -webkit-user-select: none; }
.psheet th, .psheet td { height: 34px; padding: 0 8px; white-space: nowrap; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.psheet thead th { background: #f1f5f9; color: var(--navy); font-weight: 800; text-align: center; }
.psheet thead .psheet-park { background: var(--navy); color: #fff; border-right-color: #fff; }
.psheet thead .psheet-part { font-size: 13px; font-weight: 700; color: var(--muted); }
.psheet thead .psheet-part-names th, .psheet thead .psheet-area[rowspan="2"] { border-bottom: 2px solid var(--navy); }
/* A field's first column, then a park's first column (stronger). */
.psheet .psheet-area-start { border-left: 1px solid #94a3b8; }
.psheet .psheet-park-start { border-left: 2px solid var(--navy); }
.psheet .psheet-day, .psheet .psheet-time { position: sticky; z-index: 2; background: #f8fafc; text-align: left; font-weight: 700; }
.psheet .psheet-day { left: 0; width: var(--psheet-day); min-width: var(--psheet-day); max-width: var(--psheet-day); vertical-align: top; padding-top: 7px; }
.psheet .psheet-time { left: var(--psheet-day); width: var(--psheet-time); min-width: var(--psheet-time); max-width: var(--psheet-time); font-weight: 600; }
.psheet thead .psheet-corner { z-index: 3; background: #f1f5f9; vertical-align: bottom; padding-bottom: 6px; border-bottom: 2px solid var(--navy); }
.psheet tbody .psheet-time { box-shadow: 2px 0 0 var(--border); }
.psheet .psheet-day-start > * { border-top: 2px solid var(--navy); }
.psheet tbody tr:first-child > * { border-top: 0; }
.psheet .psheet-row:not(.psheet-session-end) td { border-bottom: 1px dashed #d5dbe3; }
/* A merged block (BU14 on 1A–1B × both rows): one cell, solid edges. */
.psheet .psheet-row td.psheet-cell.is-merged { border-bottom: 1px solid #94a3b8; border-right: 1px solid #94a3b8; }
/* A row this field doesn't have (it has fewer rows than the field with the most). */
.psheet-cell.is-none { background: repeating-linear-gradient(135deg, #eef1f5, #eef1f5 5px, #e3e8ee 5px, #e3e8ee 10px); cursor: not-allowed; }
.psheet-short { display: none; }
.psheet-cell { position: relative; min-width: 88px; text-align: center; background: #fff; cursor: cell; }
.psheet-readonly .psheet-cell { cursor: default; }
.psheet-cell.is-team-locked, .psheet-sample.is-team-locked { background: #c6efce; color: #0b5d1e; }
.psheet-cell.is-open, .psheet-sample.is-open { background: #ffeb9c; color: #6b4300; }
.psheet-entry.is-team, .psheet-entry.is-team-locked, .psheet-sample.is-team, .psheet-sample.is-team-locked { font-weight: 700; }
.psheet-entry.is-placeholder, .psheet-sample.is-placeholder { color: #6b7280; font-style: italic; }
.psheet-sep { margin: 0 3px; color: var(--muted); }
.psheet-cell.is-selected::after { content: ''; position: absolute; inset: 0; background: rgba(29, 78, 216, 0.16); pointer-events: none; }
.psheet-cell.is-anchor { box-shadow: inset 0 0 0 2px var(--focus); }
.psheet-wrap:not(:focus-within) .psheet-cell.is-selected::after { background: rgba(29, 78, 216, 0.06); }
.psheet-wrap:not(:focus-within) .psheet-cell.is-anchor { box-shadow: none; }
.psheet-cell.is-editing { padding: 0; }
.psheet-input {
  position: absolute; left: 0; top: 0; z-index: 4; height: 100%; width: max(100%, 11em);
  padding: 0 6px; border: 2px solid var(--focus); background: #fff; font: inherit; font-weight: 700; outline: none;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}
.psheet-count { position: absolute; left: 0; top: 100%; z-index: 4; padding: 1px 6px; border-radius: 0 0 4px 4px; background: var(--focus); color: #fff; font-size: 12px; font-weight: 700; }
.psheet-cell.is-saving { color: var(--muted); }
.psheet-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; margin: 4px 0 0; }
.psheet-key { display: inline-flex; align-items: center; gap: 6px; }
.psheet-sample { display: inline-block; min-width: 64px; padding: 1px 6px; border: 1px solid var(--line); background: #fff; text-align: center; font-size: 14px; }
@media (max-width: 700px) {
  .psheet-wrap { --psheet-day: 44px; --psheet-time: 48px; }
  .psheet { font-size: 14px; }
  .psheet th, .psheet td { padding: 0 6px; height: 38px; }
  .psheet-cell { min-width: 78px; }
  .psheet-long { display: none; }
  .psheet-short { display: inline; }
}
