/* App stylesheet. Tokens and rules: docs/design/phase-2/design-direction.md; moved from
   docs/mockups/assets/mockup.css. <html data-look="a|b|c" data-theme="light|dark">;
   no data-look = look A, no data-theme = follow the device setting. */

:root {
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  --text-xs: 12px;   --lh-xs: 16px;
  --text-sm: 14px;   --lh-sm: 20px;
  --text-md: 16px;   --lh-md: 24px;
  --text-lg: 18px;   --lh-lg: 26px;
  --text-xl: 22px;   --lh-xl: 28px;
  --text-2xl: 28px;  --lh-2xl: 34px;

  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --control-h: 44px;
  --page-edge: 16px;
  --page-max: 1280px;
  --panel-width: 440px;
  --drawer-width: 480px;
  --reading-max: 70ch;
}

@media (min-width: 768px) {
  :root { --page-edge: 24px; }
}

@media (min-width: 1024px) {
  :root { --control-h: 36px; --page-edge: 32px; }
}

/* ---------- Color sets (6) ---------- */

:root, [data-look="a"] {
  color-scheme: light;
  --bg: #F7F7F8; --surface: #FFFFFF; --surface-2: #F0F1F3;
  --border: #DCDEE3; --border-strong: #858993;
  --text: #1C1D21; --text-muted: #5C606B;
  --accent: #2F5BEA; --accent-text: #FFFFFF;
  --success: #1D7348; --warning: #995400; --danger: #C0352E;
  --stage-open: #3756A8; --stage-win: #A84B0C; --stage-closed: #62666F;
}

[data-look="b"] {
  color-scheme: light;
  --bg: #FAF7F2; --surface: #FFFFFF; --surface-2: #F3EEE6;
  --border: #E2DACD; --border-strong: #8C8478;
  --text: #14213D; --text-muted: #595F70;
  --accent: #B8481A; --accent-text: #FFFFFF;
  --success: #1F6E46; --warning: #8F5400; --danger: #B3261E;
  --stage-open: #2C4A7A; --stage-win: #1F6E46; --stage-closed: #646978;
}

[data-look="c"] {
  color-scheme: light;
  --bg: #FFFFFF; --surface: #FFFFFF; --surface-2: #F4F4F5;
  --border: #E4E4E7; --border-strong: #85858E;
  --text: #0B0B0C; --text-muted: #5E5E66;
  --accent: #0E7A43; --accent-text: #FFFFFF;
  --success: #15703A; --warning: #9A5800; --danger: #BE2430;
  --stage-open: #3F3F46; --stage-win: #0E7A43; --stage-closed: #6A6A73;
}

[data-theme="dark"], [data-look="a"][data-theme="dark"] {
  color-scheme: dark;
  --bg: #16171B; --surface: #1E1F24; --surface-2: #26282E;
  --border: #383A42; --border-strong: #6E727C;
  --text: #ECEDF0; --text-muted: #A3A7B1;
  --accent: #7D9BF5; --accent-text: #0E1220;
  --success: #5CC894; --warning: #E2A64C; --danger: #F27B73;
  --stage-open: #93AAF0; --stage-win: #F0A262; --stage-closed: #9EA2AC;
}

[data-look="b"][data-theme="dark"] {
  color-scheme: dark;
  --bg: #1A1C24; --surface: #22252F; --surface-2: #2A2E3A;
  --border: #3A3E4C; --border-strong: #737889;
  --text: #F1ECE4; --text-muted: #ABA79F;
  --accent: #F08A52; --accent-text: #1A1C24;
  --success: #6CC792; --warning: #E8B259; --danger: #F2836F;
  --stage-open: #93AAD8; --stage-win: #6CC792; --stage-closed: #A3A6B2;
}

[data-look="c"][data-theme="dark"] {
  color-scheme: dark;
  --bg: #0F1012; --surface: #17181B; --surface-2: #1F2024;
  --border: #303237; --border-strong: #6E7077;
  --text: #F2F2F3; --text-muted: #A1A1AA;
  --accent: #3DD68C; --accent-text: #06210F;
  --success: #5BD394; --warning: #F0B354; --danger: #F47B7B;
  --stage-open: #D4D4D8; --stage-win: #3DD68C; --stage-closed: #9A9AA3;
}

/* Same three dark sets again, for a device set to dark with no data-theme. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #16171B; --surface: #1E1F24; --surface-2: #26282E;
    --border: #383A42; --border-strong: #6E727C;
    --text: #ECEDF0; --text-muted: #A3A7B1;
    --accent: #7D9BF5; --accent-text: #0E1220;
    --success: #5CC894; --warning: #E2A64C; --danger: #F27B73;
    --stage-open: #93AAF0; --stage-win: #F0A262; --stage-closed: #9EA2AC;
  }
  :root[data-look="b"]:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1A1C24; --surface: #22252F; --surface-2: #2A2E3A;
    --border: #3A3E4C; --border-strong: #737889;
    --text: #F1ECE4; --text-muted: #ABA79F;
    --accent: #F08A52; --accent-text: #1A1C24;
    --success: #6CC792; --warning: #E8B259; --danger: #F2836F;
    --stage-open: #93AAD8; --stage-win: #6CC792; --stage-closed: #A3A6B2;
  }
  :root[data-look="c"]:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0F1012; --surface: #17181B; --surface-2: #1F2024;
    --border: #303237; --border-strong: #6E7077;
    --text: #F2F2F3; --text-muted: #A1A1AA;
    --accent: #3DD68C; --accent-text: #06210F;
    --success: #5BD394; --warning: #F0B354; --danger: #F47B7B;
    --stage-open: #D4D4D8; --stage-win: #3DD68C; --stage-closed: #9A9AA3;
  }
}

/* Shadows: 2 levels. Dark themes barely show a shadow, so raised things also get a border. */
:root, [data-look], [data-theme] {
  --shadow-1: 0 2px 8px rgba(20, 22, 30, 0.12);
  --shadow-2: 0 12px 32px rgba(20, 22, 30, 0.18);
}
[data-theme="dark"] {
  --shadow-1: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-2: 0 12px 32px rgba(0, 0, 0, 0.6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --shadow-1: 0 2px 8px rgba(0, 0, 0, 0.5);
    --shadow-2: 0 12px 32px rgba(0, 0, 0, 0.6);
  }
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--lh-md);
  font-weight: 400;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; }
h1 { font-size: var(--text-xl); line-height: var(--lh-xl); }
h2 { font-size: var(--text-lg); line-height: var(--lh-lg); }
h3, h4 { font-size: var(--text-md); line-height: var(--lh-md); }
[data-look="b"] :is(h1, h2, h3, h4) { letter-spacing: -0.01em; }

p { margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.muted { color: var(--text-muted); }
.small { font-size: var(--text-sm); line-height: var(--lh-sm); }
.tiny { font-size: var(--text-xs); line-height: var(--lh-xs); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-size: var(--text-sm); }
.pre { white-space: pre-wrap; }
.reading { max-width: var(--reading-max); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.stack-sm > * + * { margin-top: var(--space-2); }
.stack > * + * { margin-top: var(--space-4); }
.stack-lg > * + * { margin-top: var(--space-5); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.spacer { flex: 1; }

@media (max-width: 767px) {
  .not-phone { display: none !important; }
}
@media (min-width: 768px) {
  .phone-only { display: none !important; }
}
@media (max-width: 1023px) {
  .desktop-only { display: none !important; }
}
@media (min-width: 1024px) {
  .below-desktop { display: none !important; }
}

/* ---------- Page layout ---------- */

.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--space-5) var(--page-edge) var(--space-7);
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.page-header h1 { flex: 1; min-width: 0; }

.section + .section { margin-top: var(--space-6); }
.section > h2 { margin-bottom: var(--space-3); }

/* ---------- Top bar + nav ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  min-height: 56px;
  padding: 0 var(--page-edge);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { display: inline-flex; align-items: center; min-height: var(--control-h); font-weight: 600; white-space: nowrap; color: var(--text); text-decoration: none; }
.topbar nav { display: flex; gap: var(--space-1); }
.topbar nav a,
.topbar .account {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-h);
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: var(--text-sm);
  text-decoration: none;
}
.topbar nav a:hover, .topbar .account:hover { background: var(--surface-2); color: var(--text); }
.topbar nav a[aria-current="page"] { color: var(--text); font-weight: 600; box-shadow: inset 0 -2px var(--accent); border-radius: 0; }
.topbar .account { margin-left: auto; }

@media (max-width: 767px) {
  .topbar nav { display: none; }
}

.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 15;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 56px;
  color: var(--text-muted);
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
  text-decoration: none;
}
.bottom-nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.bottom-nav .icon { width: 22px; height: 22px; }

@media (max-width: 767px) {
  .has-bottom-nav { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  /* Sticky bars stop above the bottom nav (56px links + its top border), or the nav covers them. */
  .has-bottom-nav .save-bar { bottom: calc(57px + env(safe-area-inset-bottom)); }
}
@media (min-width: 768px) {
  .bottom-nav:not(.is-static) { display: none; }
}

.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Buttons ---------- */

/* allauth's own pages draw bare <button>s: their submit button is the primary, one tied to another form is secondary. */
.btn-primary, .btn-secondary, .btn-quiet, .auth-page button:not([class]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-h);
  min-width: var(--control-h);
  padding: 0 var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.btn-primary, .auth-page button:not([class]):not([form]) { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover, .auth-page button:not([class]):not([form]):hover { filter: brightness(1.08); }
.btn-secondary, .auth-page button:not([class])[form] { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover, .auth-page button:not([class])[form]:hover { background: var(--surface-2); }
.btn-secondary.is-danger { color: var(--danger); }
.btn-quiet { background: transparent; color: var(--accent); }
.btn-quiet:hover { background: var(--surface-2); }
.btn-quiet.is-danger { color: var(--danger); }
.icon-only { padding: 0; width: var(--control-h); color: var(--text-muted); }
.icon-only:hover { color: var(--text); }

.star-btn { color: var(--text-muted); font-size: var(--text-md); }
.star-btn::before { content: "☆"; }
.star-btn[aria-pressed="true"] { color: var(--stage-win); }
.star-btn[aria-pressed="true"]::before { content: "★"; }

/* ---------- Inputs ---------- */

.field { display: grid; gap: var(--space-1); }
.field-label { font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: 600; }
.field-hint { font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--text-muted); }
.approve-terms { margin: var(--space-4) 0; }
.approve-terms > summary { cursor: pointer; padding-block: var(--space-3); font-weight: 600; }
.header-coordinator { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-1); }
.header-coordinator .select { width: auto; }
.field-label-row { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--space-1); }
.field-label-row > .field-hint { flex-basis: 100%; font-weight: 400; }
/* A 44px tap target drawn as a small ringed "?"; the negative margins keep the label row its usual height. */
.hint-button {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; margin: -12px 0 -12px -8px; padding: 0;
  border: 0; border-radius: 50%; cursor: pointer;
  background: radial-gradient(circle, transparent 9px, var(--border-strong) 9px, var(--border-strong) 10px, transparent 10.5px);
  color: var(--text-muted); font: inherit; font-size: var(--text-sm); font-weight: 600; line-height: 1;
}
.hint-button[aria-expanded="true"] { color: var(--accent); }
/* School terms (programs/terms.py): an opened hint drops to its own line in plain text. */
th .field-hint, .facts dd .field-hint, h3 .field-hint, .fit-factors .field-hint, .shape-lines .field-hint { display: block; font-weight: 400; white-space: normal; }
th .field-hint { max-width: 16rem; }
.facts > .term-row { grid-column: 1 / -1; margin-top: calc(-1 * var(--space-1)); }
.field-error { font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--danger); }
.errorlist { list-style: none; padding: 0; margin: 0; font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--danger); }

.input, .select, .textarea, .auth-page input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
  min-height: var(--control-h);
  padding: 0 var(--space-3);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: var(--text-md);
  line-height: var(--lh-md);
  color: var(--text);
}
.textarea { padding: var(--space-2) var(--space-3); min-height: 96px; resize: vertical; }
.input::placeholder { color: var(--text-muted); }
.field.has-error :is(.input, .select, .textarea) { border-color: var(--danger); }

.switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--control-h);
  cursor: pointer;
  position: relative;
}
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  position: relative;
  flex: none;
  width: 40px;
  height: 24px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--border-strong);
  transition: left 0.15s;
}
.switch input:checked + .switch-track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch-track::after { left: 19px; background: var(--accent-text); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch .when-on { display: none; }
.switch input:checked ~ .switch-word .when-on { display: inline; }
.switch input:checked ~ .switch-word .when-off { display: none; }
.switch-word { font-size: var(--text-sm); line-height: var(--lh-sm); }

/* ---------- Chips and badges ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: var(--control-h);
  min-width: var(--control-h);
  padding: 0 var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 600; }

.badge, .stage-badge, .consent-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 var(--space-2);
  border: 1px solid currentColor;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
  font-weight: 600;
  white-space: nowrap;
}
.badge { color: var(--text-muted); border-color: var(--border-strong); }
.stage-badge.is-open { color: var(--stage-open); }
.stage-badge.is-win { color: var(--stage-win); }
.stage-badge.is-closed { color: var(--stage-closed); }
.consent-badge.is-none { color: var(--text-muted); }
.consent-badge.is-waiting { color: var(--warning); }
.consent-badge.is-approved { color: var(--success); }
.consent-badge.is-withdrawn { color: var(--danger); }

.status-overdue { color: var(--danger); }
.status-soon { color: var(--warning); }
.status-ok { color: var(--success); }
.status-danger { color: var(--danger); }

.fit { display: inline-flex; align-items: center; gap: var(--space-2); font-variant-numeric: tabular-nums; }
.fit-of { white-space: nowrap; }

/* ---------- Table ---------- */

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
  font-variant-numeric: tabular-nums;
}
.table th {
  height: 40px;
  padding: 0 var(--space-3);
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.table td {
  height: 44px;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: 0; }
.table .row { cursor: pointer; }
.table .row:hover, .table .row.is-open { background: var(--surface-2); }
.table .is-right { text-align: right; }
.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--control-h);
  min-width: var(--control-h);
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-weight: 600;
  cursor: pointer;
}
th[aria-sort] .sort-btn { color: var(--text); }
.row-title {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-h);
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

/* ---------- Cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}
.card-list { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.grid-more { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); margin-top: var(--space-4); }
.grid-more:empty { display: none; }

/* ---------- Panel, drawer, sheet ---------- */

.panel, .drawer, .sheet {
  position: fixed;
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: var(--shadow-2);
}
.panel, .drawer {
  top: 0; right: 0; bottom: 0;
  width: min(var(--panel-width), 100%);
  border-left: 1px solid var(--border);
}
.drawer { width: min(var(--drawer-width), 100%); }
.sheet {
  left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: min(560px, 100%);
  max-height: 85vh;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.sheet-handle {
  width: 36px; height: 4px;
  margin: var(--space-2) auto 0;
  border-radius: 2px;
  background: var(--border-strong);
  flex: none;
}
.drawer .sheet-handle { display: none; }
/* The pair drawer's content sits in one wrapper (it reloads itself), which takes the drawer's column layout. */
.drawer-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.panel-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-5);
  border-bottom: 1px solid var(--border);
}
.panel-header h2 { flex: 1; min-width: 0; }
.panel-body { flex: 1; overflow-y: auto; padding: var(--space-5); }
.panel-body > section + section { margin-top: var(--space-5); }
.panel-body > section > h3 { margin-bottom: var(--space-2); }
.panel-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border);
}

.backdrop { position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, 0.36); }

@media (max-width: 767px) {
  .panel { width: 100%; border-left: 0; }
  .panel > .panel-header { padding-left: var(--space-2); }
  .drawer .panel-header, .sheet > .panel-header { padding-left: var(--space-4); }
  .drawer {
    top: auto; left: 0;
    width: 100%;
    max-height: 90vh;
    border-left: 0;
    border-top: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .drawer .sheet-handle { display: block; }
  .panel-body { padding: var(--space-4); }
  .panel-footer { padding: var(--space-3) var(--space-4); }
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--space-2) var(--space-4);
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
}
.facts dt { color: var(--text-muted); }
.facts dd { margin: 0; }

.plain-list { margin: 0; padding: 0; list-style: none; }
.plain-list > li + li { margin-top: var(--space-3); }

/* ---------- Tabs ---------- */

.tabs {
  display: flex;
  gap: var(--space-1);
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border);
}
.tabs a, .tabs button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  justify-content: center;
  min-height: var(--control-h);
  min-width: var(--control-h);
  padding: 0 var(--space-3);
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.tabs a, .tabs button { flex: none; }
.tabs .tabs-action { margin-left: auto; color: var(--accent); }
.saved-view-link { display: inline-flex; align-items: center; min-height: var(--control-h); }
.tabs [aria-selected="true"], .tabs [aria-current="page"], .tabs [aria-current="true"] {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--accent);
}
.page-header + .tabs { margin-bottom: var(--space-5); }
.sharing-anchor { scroll-margin-top: var(--space-4); }
.program-results .btn-quiet { width: 100%; justify-content: flex-start; text-align: left; }

/* ---------- Menu ---------- */

.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-1));
  z-index: 10;
  min-width: 200px;
  padding: var(--space-1);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
}
.menu-list button, .menu-list a {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: var(--control-h);
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text);
  font-size: var(--text-sm);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.menu-list button:hover, .menu-list a:hover { background: var(--surface-2); }
.menu-list .is-danger { color: var(--danger); }
.menu-list label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-h);
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  cursor: pointer;
}
.menu-list label:hover { background: var(--surface-2); }

/* ---------- Empty state, toast ---------- */

.empty {
  padding: var(--space-7) var(--space-4);
  text-align: center;
  color: var(--text-muted);
}
.empty p { margin-bottom: var(--space-4); }

.toasts {
  position: fixed;
  left: 50%; bottom: var(--space-5);
  z-index: 40;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  width: max-content;
  max-width: calc(100% - 2 * var(--page-edge));
  pointer-events: none;
}
/* Above the phone bottom nav (56px links + its top border). */
@media (max-width: 767px) {
  .has-bottom-nav .toasts { bottom: calc(57px + var(--space-3) + env(safe-area-inset-bottom)); }
  /* The editor's sticky save bar (12px padding, 44px button) sits on the nav, so its toast goes above both. */
  .has-bottom-nav:has(.save-bar) { --save-bar-height: 68px; }
  .has-bottom-nav:has(.save-bar) .toasts { bottom: calc(57px + var(--save-bar-height) + var(--space-3) + env(safe-area-inset-bottom)); }
}
.toast {
  max-width: 100%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow-1);
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
}
.toast.is-static { display: inline-block; }
/* Calm rule 12: success fades by itself; errors stay until the page changes. */
.toasts .toast:not(.is-error) { animation: toast-fade 4s forwards; }
.toast.is-error { pointer-events: auto; }
@keyframes toast-fade {
  0%, 85% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}

/* ---------- School grid ---------- */

.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: var(--space-4) 0; }
.filter-bar .search { flex: 1 1 240px; max-width: 320px; }
.filter-bar .result-count { margin-left: auto; }
@media (max-width: 767px) {
  .filter-bar .search { max-width: none; flex-basis: 100%; }
}
.filter-bar .menu-list { left: 0; right: auto; }
.menu-list.is-long { max-height: min(60vh, 420px); overflow-y: auto; }
.filter-copy { min-width: 0; margin: 0; padding: 0; border: 0; }
.filter-bar > .filter-copy { display: contents; }
.results-head { margin-bottom: var(--space-3); }
.score-for { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.score-for .select { width: auto; min-width: 0; max-width: 100%; }
.cluster.nowrap { flex-wrap: nowrap; }
.chip:has(:checked) { border-color: var(--accent); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 600; }
.chip:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.sheet-section + .sheet-section { margin-top: var(--space-5); }
/* The sheet's sections sit in and out of a fieldset, some hidden by width; a gap spaces only the visible ones. */
.sheet .panel-body, .sheet .filter-copy { display: flex; flex-direction: column; gap: var(--space-5); }
.sheet .panel-body > section + section, .sheet .sheet-section + .sheet-section { margin-top: 0; }
a.sort-btn { text-decoration: none; }
.more-options > summary { list-style: none; margin-top: var(--space-2); }
.more-options > summary::-webkit-details-marker { display: none; }
.more-options[open] > summary { display: none; }
.school-card .spacer { min-width: 0; }
.sheet-section > h3 { margin-bottom: var(--space-2); }
.sheet-section .field-label { font-size: var(--text-md); line-height: var(--lh-md); }
.sheet-section .switch { display: flex; }

.school-card { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); }
.school-card .row-title { display: flex; width: 100%; }
/* Says the card opens, as the row title alone doesn't look tappable. */
.school-card .card-chevron { flex: none; color: var(--text-muted); font-size: 1.25rem; line-height: 1; }
.school-card .facts-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); }

/* Several schools to a player's board: checkboxes join the sheet's form="bulk-add" from the grid. */
.table .select-col { width: 1px; padding-right: 0; }
.select-box { display: inline-flex; align-items: center; justify-content: center; min-width: var(--control-h); min-height: var(--control-h); cursor: pointer; }
.select-box input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.school-card .select-box { margin-left: calc(-1 * var(--space-3)); flex: none; }
.bulk-bar {
  display: none;
  position: sticky;
  bottom: var(--space-3);
  z-index: 5;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
}
.page:has(input[form="bulk-add"]:checked) .bulk-bar { display: flex; }
@media (max-width: 767px) {
  .has-bottom-nav .bulk-bar { bottom: calc(57px + var(--space-2) + env(safe-area-inset-bottom)); }
}

.score-list { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-2); font-size: var(--text-sm); line-height: var(--lh-sm); }
.score-list li { display: grid; grid-template-columns: 1fr 96px 2.5em; align-items: center; gap: var(--space-3); }
.score-bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.score-bar span { display: block; height: 100%; background: var(--text-muted); }


/* ---------- Tracking board ---------- */

.tracking-board :is(ul, ol) { margin: 0; padding: 0; }

.due-strip { display: grid; gap: var(--space-2); margin: 0 0 var(--space-5); padding: 0; list-style: none; }
@media (min-width: 768px) {
  .due-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.due-item {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: var(--control-h);
  padding: var(--space-2) var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
  text-align: left;
  cursor: pointer;
}
.due-item:hover { background: var(--surface-2); }

/* Follow-ups page: the due strip's items as rows with Done / Snooze. */
/* "Needs a look" list */
.look-item { display: grid; gap: var(--space-2); }
.look-item p { margin: 0; }
.look-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2); }
.look-value { flex: 1 1 100%; min-width: 0; }
.look-pages { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin-top: var(--space-5); }

.due-group + .due-group { margin-top: var(--space-6); }
.due-group > h2 { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.due-group .count { color: var(--text-muted); font-weight: 400; }
.due-list { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.due-row { gap: var(--space-2); padding: var(--space-3); cursor: auto; }
.due-row:hover { background: var(--surface); }
.due-row-text { display: grid; gap: 2px; min-width: 0; }
@media (min-width: 768px) {
  .due-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
}
@media (max-width: 767px) {
  /* Snooze sits near the left edge on phones; the menu would open off screen. */
  .due-row .menu-list { left: 0; right: auto; }
}

.board-wrap { overflow-x: auto; padding-bottom: var(--space-2); }
/* 8 columns fit side by side at 1280; narrower screens scroll the board, never the page. */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(140px, 1fr); gap: var(--space-3); }
.board-column { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.board-column > h2 {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  padding: 0 var(--space-1);
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
}
.board-column .count { color: var(--text-muted); font-weight: 400; }
.board-column .none { padding: var(--space-3) var(--space-1); color: var(--text-muted); font-size: var(--text-sm); }

.pair-card {
  display: grid;
  gap: var(--space-1);
  width: 100%;
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
  text-align: left;
  cursor: pointer;
}
.pair-card:hover { background: var(--surface-2); }
.pair-card .name { font-weight: 600; }
.pair-card .line { color: var(--text-muted); }
/* A column's card list stays a drop target even when it's empty. */
.board-cards { display: grid; align-content: start; gap: var(--space-2); min-height: 40px; }
.pair-card-ghost { opacity: 0.4; }
@media (min-width: 768px) {
  .board-cards .pair-card { cursor: grab; }
}
.board-help { margin-top: var(--space-4); }
.closed-group .pair-card .stage-badge { justify-self: start; }

/* Phone: one stage at a time. The stage tabs are links to each column; board.js adds .is-target after a redraw. */
@media (max-width: 767px) {
  .board-wrap { overflow: visible; }
  .board { display: block; min-width: 0; }
  .board-column { display: none; }
  .board-column:target,
  .board-column.is-target,
  .board:not(:has(.board-column:target, .board-column.is-target)) .board-column:first-child { display: flex; }
  .board-column > h2 { display: none; }
  .board-column { scroll-margin-top: var(--space-6); }
  .stage-tabs { margin-bottom: var(--space-3); }
  :root:has(.board-column:target) .stage-tabs a { color: var(--text-muted); font-weight: 400; border-bottom-color: transparent; }
  :root:has(#stage-target:target) .stage-tabs a[href="#stage-target"],
  :root:has(#stage-contacted:target) .stage-tabs a[href="#stage-contacted"],
  :root:has(#stage-engaged:target) .stage-tabs a[href="#stage-engaged"],
  :root:has(#stage-evaluating:target) .stage-tabs a[href="#stage-evaluating"],
  :root:has(#stage-visit:target) .stage-tabs a[href="#stage-visit"],
  :root:has(#stage-offer:target) .stage-tabs a[href="#stage-offer"],
  :root:has(#stage-committed:target) .stage-tabs a[href="#stage-committed"],
  :root:has(#stage-signed:target) .stage-tabs a[href="#stage-signed"] {
    color: var(--text); font-weight: 600; border-bottom-color: var(--accent);
  }
}

.closed-group { margin-top: var(--space-5); }
.closed-group > summary {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-h);
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}
.closed-group .card-list { margin-top: var(--space-2); }
@media (min-width: 768px) {
  .closed-group .card-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.stage-bar { display: flex; flex-wrap: wrap; gap: var(--space-1); margin: 0 0 var(--space-3); padding: 0; list-style: none; font-size: var(--text-xs); line-height: var(--lh-xs); }
.stage-bar li { padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-muted); }
.stage-bar li[aria-current="step"] { color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 1px var(--border-strong); }

.timeline { margin: 0; padding: 0; list-style: none; font-size: var(--text-sm); line-height: var(--lh-sm); }
.timeline > li { padding: var(--space-3) 0; border-top: 1px solid var(--border); }
.timeline > li:first-child { border-top: 0; padding-top: 0; }
.timeline .when { color: var(--text-muted); }

/* ---------- Profile editor ---------- */

.progress-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: var(--control-h);
  margin-bottom: var(--space-5);
  padding: var(--space-2) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
  text-align: left;
  cursor: pointer;
}
.progress-btn:hover { background: var(--surface-2); }
.progress-track { flex: 1; max-width: 240px; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.progress-track span { display: block; height: 100%; background: var(--accent); }

.profile-layout { display: block; }
@media (min-width: 1024px) {
  .profile-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--space-6); align-items: start; }
}
.section-nav { position: sticky; top: var(--space-4); margin: 0; padding: 0; list-style: none; }
.section-nav a, .step-list a {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-h);
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
  text-decoration: none;
}
.section-nav a:hover, .step-list a:hover { background: var(--surface-2); }
.section-nav .state, .step-list .state { margin-left: auto; color: var(--text-muted); }
.section-nav .state.status-soon, .step-list .state.status-soon { color: var(--warning); }
.section-nav .state.status-overdue, .step-list .state.status-overdue { color: var(--danger); }
.step-list { margin: 0; padding: 0; list-style: none; }

.profile-section { max-width: 720px; scroll-margin-top: var(--space-6); }
.profile-section + .profile-section { margin-top: var(--space-7); }
.profile-section > h2 { margin-bottom: var(--space-1); }
.profile-section > .intro { margin-bottom: var(--space-4); }
.field-grid { display: grid; gap: var(--space-4); align-items: start; }
@media (min-width: 768px) {
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-grid .wide { grid-column: 1 / -1; }
}
.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-2); align-items: start; }
.stat-grid .input { padding: 0 var(--space-2); }
.read-only { min-height: var(--control-h); display: flex; align-items: center; }

.photo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
}

.share-list { margin: 0; padding: 0; list-style: none; }
.share-list > li { padding: var(--space-3) 0; border-top: 1px solid var(--border); }
.share-list > li:first-child { border-top: 0; }
.share-list .switch { display: flex; }
.family-subhead { margin: var(--space-5) 0 var(--space-2); }
.consent-status { margin-bottom: var(--space-2); }
.sheet-form { display: contents; }
.link-row { padding: var(--space-3) 0; border-top: 1px solid var(--border); }
.link-row:first-child { border-top: 0; }
.link-row .spacer { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 767px) {
  .link-row .spacer { flex: 1 1 100%; }
  .link-row .menu-list { left: 0; right: auto; }
}
.program-results { margin-top: var(--space-2); }
.program-results > li + li { margin-top: 0; }
.program-results .btn-quiet { width: 100%; height: auto; min-height: var(--control-h); justify-content: flex-start; text-align: left; }

/* Phone: one section at a time, like steps. Links to #section ids pick the step; no JS. */
@media (max-width: 767px) {
  .profile-section { display: none; }
  .profile-section:target,
  .profile-sections:not(:has(.profile-section:target)) .profile-section.is-start { display: block; }
  .profile-section + .profile-section { margin-top: 0; }
}
.step-nav { display: flex; justify-content: space-between; gap: var(--space-2); margin-top: var(--space-5); }
.progress-btn { margin-bottom: var(--space-5); }
.photo-row { margin-bottom: var(--space-4); }
details.season > summary {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--control-h);
  list-style: none;
  cursor: pointer;
}
details.season > summary::-webkit-details-marker { display: none; }
details.season[open] .row-edit { display: none; }
.row-summary { min-width: 0; overflow-wrap: anywhere; }
.summary-line { display: block; }
.season-body { margin-top: var(--space-4); }
.add-row { margin-top: var(--space-3); }
.add-row > summary { display: inline-flex; width: fit-content; list-style: none; }
.add-row > summary::-webkit-details-marker { display: none; }
.add-row-body { margin-top: var(--space-3); }
.form-banner { margin-bottom: var(--space-4); }
.add-action { margin-top: var(--space-3); }
.stat-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.stat-fieldset legend { padding: 0; margin-bottom: var(--space-1); }
.save-bar { position: sticky; bottom: 0; padding: var(--space-3) 0; background: var(--bg); }
.save-bar .btn-primary { width: 100%; }

#consent-sheet details > summary { padding-block: var(--space-3); cursor: pointer; }

/* ---------- Player phone views (one centered column on desktop too) ---------- */

.page.is-narrow { max-width: 640px; }
a.due-item { text-decoration: none; }
.stage-group + .stage-group { margin-top: var(--space-5); }
.stage-group > h2 { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); font-size: var(--text-md); line-height: var(--lh-md); }
.stage-group .count { color: var(--text-muted); font-weight: 400; }
.my-schools-more { margin-top: var(--space-5); }
.sheet .drawer-actions { margin-top: var(--space-2); }
.sheet .drawer-also { margin-top: var(--space-3); }
.suggestion { display: grid; gap: var(--space-2); }
.section-lead { margin-bottom: var(--space-3); }
.section-actions { margin-top: var(--space-3); }
.section-subhead { margin: var(--space-4) 0 var(--space-2); }

/* ---------- Public resume (always look A, light) ---------- */

.resume-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-2); max-width: 816px; margin: 0 auto; padding: var(--space-3) var(--page-edge); }
.resume-toolbar .btn-secondary { margin-left: auto; }
.resume { max-width: 816px; margin: 0 auto; padding: var(--space-6) var(--page-edge); background: var(--surface); overflow-wrap: anywhere; }
.resume-note { margin: 0 0 var(--space-5); padding: var(--space-3) var(--space-4); background: var(--surface-2); border-radius: var(--radius-md); }
.resume-top { display: flex; gap: var(--space-4); align-items: flex-start; }
.resume-top .spacer { min-width: 0; }
.resume-contact { margin-top: var(--space-3); }
.resume-line { margin-top: var(--space-1); }
.resume-section ul:not(.plain-list) { margin: 0; padding-left: 18px; }
.resume-section > .resume-subhead { margin-top: var(--space-4); }
.resume-top .photo { width: 88px; height: 88px; font-size: var(--text-lg); }
.resume-name { font-size: var(--text-2xl); line-height: var(--lh-2xl); }
.key-stats { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin: var(--space-3) 0 0; }
.key-stats div { display: grid; }
.key-stats dt { order: 2; color: var(--text-muted); font-size: var(--text-xs); line-height: var(--lh-xs); }
.key-stats dd { order: 1; margin: 0; font-size: var(--text-lg); line-height: var(--lh-lg); font-weight: 600; font-variant-numeric: tabular-nums; }
.coach-note { margin-top: var(--space-4); padding: var(--space-3) var(--space-4); border-left: 3px solid var(--border-strong); background: var(--surface-2); }
.resume-section { margin-top: var(--space-5); }
.resume-section > h2 { margin-bottom: var(--space-2); padding-bottom: var(--space-1); border-bottom: 1px solid var(--border); }
.resume-cols { display: grid; gap: var(--space-5); margin-top: var(--space-5); }
.resume-cols > .resume-section { margin-top: 0; }
@media (min-width: 768px) {
  .resume-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.resume .table-wrap { border: 0; border-radius: 0; }
.resume .table td, .resume .table th { height: auto; padding: var(--space-1) var(--space-2); white-space: nowrap; }
.resume-footer { margin-top: var(--space-5); color: var(--text-muted); }

@media print {
  @page { size: letter; margin: 0.45in; }
  html, body { background: #FFFFFF; }
  .no-print { display: none !important; }
  .resume .table-wrap { overflow: visible; }
  .resume .table td { white-space: normal; }
  .resume { max-width: none; padding: 0; font-size: 10.5px; line-height: 14px; }
  .resume .small, .resume .table, .resume .facts { font-size: 10px; line-height: 13px; }
  .resume h2 { font-size: 12px; line-height: 16px; }
  .resume-name { font-size: 22px; line-height: 26px; }
  .key-stats dd { font-size: 14px; line-height: 18px; }
  .key-stats dt { font-size: 9px; line-height: 12px; }
  .resume-section { margin-top: 10px; break-inside: avoid; }
  .resume-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 10px; gap: 16px; }
  .resume .coach-note { margin-top: 8px; padding: 6px 10px; }
  .resume-footer { margin-top: 10px; font-size: 9px; line-height: 12px; }
  .resume a { color: inherit; }
}

/* ---------- Account page ---------- */

.outreach-page { max-width: 720px; }
.outreach-rows { display: grid; gap: var(--space-3); }
.outreach-school { font-size: var(--text-md); }
.outreach-page.outreach-wide { max-width: 1200px; }
.outreach-layout { display: grid; gap: var(--space-4); }
.outreach-row[aria-current="true"] { border-color: var(--accent); }
.outreach-body { min-height: 16rem; }
.outreach-results { margin-bottom: var(--space-3); }
.outreach-card { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-3); display: grid; gap: var(--space-1); }
.outreach-card p { margin: 0; }
.outreach-flags, .outreach-facts { margin: 0; padding-left: 1.25rem; }
@media (min-width: 768px) {
  .outreach-layout.has-review { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; }
}
@media (max-width: 767px) {
  .outreach-layout.has-review .outreach-list { display: none; }
}
.account-page { max-width: 640px; }
.account-page .facts dd { overflow-wrap: anywhere; }
.appearance-form { display: grid; gap: var(--space-5); margin-top: var(--space-3); }
.choice-group { display: grid; gap: var(--space-1); margin: 0; padding: 0; border: 0; min-width: 0; }
.choice-group legend { padding: 0; margin-bottom: var(--space-2); }
.choice {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  min-height: var(--control-h);
  cursor: pointer;
}
.choice input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.choice-text { flex: 1; min-width: 0; }
.look-preview { display: inline-flex; gap: var(--space-2); }
.look-swatches { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.look-swatches span { width: 16px; height: 16px; }
.look-swatches span:nth-child(1) { background: var(--bg); }
.look-swatches span:nth-child(2) { background: var(--surface); }
.look-swatches span:nth-child(3) { background: var(--accent); }
.appearance-form .btn-primary { justify-self: start; }

/* School panel (redesign plan 1, Task 8) */
.panel-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.panel-body > h3 + * { margin-top: var(--space-2); }
.coach { display: flex; align-items: flex-start; gap: var(--space-2); }
.panel .coach-add { margin-top: var(--space-2); }
.fit-breakdown > p { margin-top: var(--space-2); }
.former-coaches { margin-top: var(--space-2); }
.former-coaches > summary { list-style: none; cursor: pointer; padding-left: 0; }
.coach .spacer { min-width: 0; overflow-wrap: anywhere; }
.panel-body .facts + p.small { margin: var(--space-2) 0 0; }
.former-coaches > summary::-webkit-details-marker { display: none; }
.shape-lines { margin: var(--space-2) 0 0; }
.shape-lines p { margin: 0; }
.shape-lines p + p { margin-top: var(--space-1); }
.coach-add summary { cursor: pointer; color: var(--accent); }
.panel .coach-add > summary { list-style: none; padding-left: 0; margin: 0; }
.panel .coach-add > summary::-webkit-details-marker { display: none; }
.panel .coach-add .form { margin-top: var(--space-3); }
.drawer .drawer-actions, .drawer .drawer-add, .drawer .drawer-offer { margin-top: var(--space-2); }
.drawer .drawer-also { margin-top: var(--space-3); }
/* The Snooze menu sits next to "Done" near the drawer's left edge, so its list opens to the right. */
.drawer .drawer-actions .menu-list { left: 0; right: auto; }
.drawer .drawer-add > summary { list-style: none; }
.drawer .drawer-add > summary::-webkit-details-marker { display: none; }
.drawer .drawer-add > form { margin-top: var(--space-3); }
.timeline p { overflow-wrap: anywhere; }
.evidence, .roster-link { margin-top: var(--space-2); }
.roster-link + .table { margin-top: var(--space-2); }
.footer-menu { margin-right: auto; }
.footer-menu .menu-list { top: auto; bottom: calc(100% + var(--space-1)); left: 0; right: auto; }
.back-link { padding-left: 0; margin-bottom: var(--space-3); }
.history { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.history del { color: var(--text-muted); }
/* Forms in the panel drawn by Django's as_div (no classes on the widgets), given the .input look. */
.form { display: flex; flex-direction: column; gap: var(--space-2); }
.form input:not([type="checkbox"]), .form select, .form textarea {
  width: 100%;
  min-height: var(--control-h);
  padding: var(--space-2) var(--space-3);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}
.form input[type="checkbox"] { width: 24px; height: 24px; }
.check-row { display: flex; align-items: center; gap: var(--space-2); min-height: var(--control-h); }
.check-row input { width: 24px; height: 24px; flex: none; }
.form label { display: block; font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--text-muted); }
.form .helptext { font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--text-muted); }
.form > div { display: flex; flex-direction: column; gap: var(--space-1); }
.form > div:has(> input[type="checkbox"]) { flex-direction: row; align-items: center; gap: var(--space-2); }
@media (max-width: 767px) {
  .panel-footer > .btn-secondary, .panel-footer > .btn-primary { flex: 1 1 auto; }
}

/* ---------- Sign-in pages (and the parent's approve page) ---------- */

.auth-page main.card {
  width: calc(100% - 2 * var(--page-edge));
  max-width: 420px;
  margin: var(--space-6) auto;
  padding: var(--space-5);
}
.auth-page main > * + * { margin-top: var(--space-3); }
.auth-page main form { display: grid; gap: var(--space-3); }
.auth-page main form > button { justify-self: start; }
.auth-page main form > p { display: grid; gap: var(--space-1); }
.auth-page input[type="radio"] { justify-self: start; }
.auth-page main form > div:not(.field, .field-grid) { display: flex; flex-wrap: wrap; gap: var(--space-2); }
/* allauth's two hidden-input forms; their buttons point at them with form="…", which works while hidden. */
#resend, #logout-from-stage { display: none; }
.auth-page label:not(.field) { font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: 600; }
.approve-items { margin-left: var(--space-5); padding: 0; }

/* Player's own email draft on My schools: the Draft button reads "Writing..." while its request runs. */
.busy-label { display: none; }
.htmx-request .busy-label { display: inline; }
.htmx-request .idle-label { display: none; }
#my-draft .draft-body { min-height: 220px; }

/* ---------- Public page (/about/) ---------- */

.about { max-width: 720px; margin: 0 auto; padding: var(--space-5) var(--space-4) var(--space-7); }
.about > section + section { margin-top: var(--space-6); }
.about h2 { margin-bottom: var(--space-2); }
.about-hero { display: flex; gap: var(--space-5); align-items: center; padding: var(--space-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.about-hero > div { display: grid; gap: var(--space-2); justify-items: start; }
.about-welcome { font-size: var(--text-lg); line-height: var(--lh-lg); }
.photo-spot { flex: none; width: 112px; height: 112px; border-radius: 50%; border: 2px dashed var(--border-strong); display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: var(--text-sm); }
.photo-spot.is-small { width: 48px; height: 48px; font-size: 11px; }
.placeholder-text { color: var(--text-muted); font-style: italic; }
.about-expect { padding: var(--space-4) var(--space-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.about-expect ul { margin: 0; padding-left: var(--space-5); }
.team-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.team-cards li { display: flex; gap: var(--space-3); align-items: center; padding: var(--space-3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.stories-soon { padding: var(--space-5); border: 2px dashed var(--border); border-radius: var(--radius-md); text-align: center; color: var(--text-muted); }
.stories-soon p { margin: var(--space-1) 0 0; }
.story-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); margin-top: var(--space-4); }
.story-tiles span { height: 64px; border-radius: var(--radius-sm); background: var(--surface-2); }
.about-footer { margin-top: var(--space-7); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.about-footer p { margin: 0; }
@media (max-width: 767px) {
  .about-hero { flex-direction: column; align-items: flex-start; padding: var(--space-4); }
}
.team-card-edit { padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.team-card-edit:last-of-type { border-bottom: 0; margin-bottom: var(--space-3); }
.team-card-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.inquiry-form { max-width: 520px; }
/* The honeypot: off screen for people, still in the form for bots. */
.inquiry-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.about-thanks { padding: var(--space-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }

/* ---------- Inquiries ---------- */

.inquiries-layout { display: grid; gap: var(--space-4); margin-top: var(--space-4); }
.inquiry-list { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.inquiry-row a { display: grid; gap: 2px; padding: var(--space-3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text); text-decoration: none; }
.inquiry-row a:hover { border-color: var(--border-strong); }
.inquiry-row-top { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: baseline; }
.inquiry-row .muted { overflow-wrap: anywhere; }
.inquiry-message { padding: var(--space-3); background: var(--surface-2); border-radius: var(--radius-sm); overflow-wrap: anywhere; }
.inquiry-detail > * + * { margin-top: var(--space-3); }
.nav-badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-text); font-size: 11px; line-height: 18px; font-weight: 600; text-align: center; }
@media (min-width: 900px) {
  .inquiries-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; }
  .inquiry-list { order: -1; }
}
