/* Front Office: The Climb. Stadium-night theme, dark first; light on request (data-theme="light"). */
:root {
  --bg: #0b0f14;
  --bg2: #10161d;
  --panel: #151c24;
  --panel2: #1c2530;
  --ink: #edf1f5;
  --muted: #8d9aa8;
  --line: #27313c;
  --accent: #f5b82e;
  --accent-ink: #1a1305;
  --gold: #f5b82e;
  --gold-text: #f5b82e;
  --good: #4ade80;
  --bad: #fb7185;
  --warn: #fbbf24;
  --info: #38bdf8;
  --me: color-mix(in srgb, var(--gold) 12%, var(--panel));
  --bar: #2a3542;
  --track: #222c37;
  --focus: #f5b82e;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --head: 'Avenir Next Condensed', 'Barlow Condensed', 'Roboto Condensed', 'Arial Narrow', system-ui, sans-serif;
  --paper-ink: #1d2126;
  color-scheme: dark;
}
:root[data-theme='light'] {
  --bg: #eef1f4;
  --bg2: #e3e8ed;
  --panel: #ffffff;
  --panel2: #f4f6f8;
  --ink: #12181f;
  --muted: #5b6672;
  --line: #d6dce2;
  --accent: #f0ad18;
  --accent-ink: #1a1305;
  --gold: #f0ad18;
  --gold-text: #8a5a00;
  --good: #15803d;
  --bad: #e11d48;
  --warn: #b45309;
  --info: #0369a1;
  --bar: #d3dbe2;
  --track: #e3e8ed;
  --focus: #b07800;
  --shadow: 0 8px 24px rgba(16, 24, 32, 0.1);
  color-scheme: light;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
#app { max-width: 1100px; margin: 0 auto; padding: 0 16px 48px; }
.boot { padding: 32px 0; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 8px; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; margin-top: 8px; }
h3 { font-size: 1.05rem; }
h1:focus, h2:focus { outline: none; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.num { font-variant-numeric: tabular-nums; }

header.top { padding: 16px 0 8px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.brand { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.brand .title { font-weight: 700; font-size: 1.1rem; }
nav.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
nav.tabs button[aria-current='page'] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 8px; }
.meter { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.meter .label { font-size: 0.8rem; color: var(--muted); }
.meter .value { font-weight: 700; font-size: 1.05rem; }
.meter .sub { font-size: 0.8rem; color: var(--muted); }
.bar { height: 6px; background: var(--line); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); }

.savebar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 0.85rem; color: var(--muted); margin-top: 8px; }
.banner { border-radius: 8px; padding: 10px 12px; margin: 10px 0; border: 1px solid; }
.banner.error { border-color: var(--bad); color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, var(--panel)); }
.banner.warn { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--panel)); }
.banner.info { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--panel)); }

section.panel, .card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

button, .btn {
  font: inherit;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 14px;
  min-height: 40px;
  cursor: pointer;
}
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
input[type='text'] { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); min-height: 40px; }

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
td.r, th.r { text-align: right; }
tr.me td { background: var(--me); font-weight: 600; }
.table-wrap { overflow-x: auto; }

.alloc-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.alloc-row .amt { min-width: 64px; text-align: right; font-weight: 700; }

fieldset.options { border: 0; padding: 0; margin: 0; }
.option { position: relative; display: block; background: var(--panel); border: 2px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; }
.option:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.option:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.option.disabled { opacity: 0.6; cursor: not-allowed; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option .key { display: inline-block; font-weight: 700; background: var(--accent); color: var(--accent-ink); border-radius: 4px; padding: 0 6px; margin-right: 6px; }
.option dl { margin: 8px 0 0; font-size: 0.88rem; }
.option dt { color: var(--muted); font-size: 0.78rem; margin-top: 6px; }
.option dd { margin: 0; }
.tag { display: inline-block; font-size: 0.75rem; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); }
.up { color: var(--good); }
.down { color: var(--bad); }
.win { font-weight: 700; }
.reveal { font-size: 1.05rem; border-left: 4px solid var(--accent); padding: 8px 12px; margin: 10px 0; background: var(--me); }
ul.tight { margin: 4px 0 0; padding-left: 20px; }
ul.tight li { margin: 2px 0; }
details { margin: 8px 0; }
summary { cursor: pointer; font-weight: 600; min-height: 32px; }
pre.evidence { white-space: pre-wrap; font-size: 0.8rem; background: var(--bg); padding: 10px; border-radius: 6px; max-height: 360px; overflow: auto; }
svg.chart { width: 100%; height: auto; max-width: 640px; }
svg.chart text { fill: var(--muted); font-size: 11px; }
svg.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; }
svg.chart .dot { fill: var(--accent); }
svg.chart .grid { stroke: var(--line); }

@media (max-width: 760px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  h1 { font-size: 1.35rem; }
  .meters { grid-template-columns: repeat(2, 1fr); }
  th, td { padding: 5px 6px; }
}

/* ---------- identity & personality ---------- */
:root { --school: #1d4e89; --school-2: #c4622d; --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif; --paper: #fbf8f1; }
header.top { border-bottom: 4px solid var(--school); }
.masthead { display: flex; gap: 12px; align-items: center; }
.masthead .title { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; line-height: 1.15; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.crest { flex: none; vertical-align: middle; }
.school-cell { white-space: nowrap; }
.school-cell .crest { margin-right: 4px; }
h1, h2 { font-family: var(--serif); }
nav.tabs button[aria-current='page'] { background: var(--school); border-color: var(--school); color: #fff; }
button.primary { background: var(--school); border-color: var(--school); color: #fff; }
.bar > span { background: var(--school); }
.option:has(input:checked) { border-color: var(--school); box-shadow: 0 0 0 1px var(--school); }
.option .key { background: var(--school); color: #fff; }

.avatar { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 0.8rem; flex: none; border: 2px solid var(--school-2); }
.quote { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; }
.quote blockquote { margin: 0; font-family: var(--serif); font-size: 1.05rem; font-style: italic; }
.quote figcaption { font-family: system-ui, sans-serif; font-style: normal; font-size: 0.8rem; color: var(--muted); margin-top: 4px; }

.memo { background: var(--paper); border: 1px solid var(--line); border-left: 6px solid var(--school); border-radius: 6px; padding: 14px 18px; margin: 6px 0 14px; }
.memo-head { display: flex; flex-wrap: wrap; gap: 4px 16px; font-family: ui-monospace, Menlo, monospace; font-size: 0.75rem; color: var(--muted); border-bottom: 1px dashed var(--line); padding-bottom: 8px; margin-bottom: 10px; }
.memo-head span:first-child { font-weight: 700; color: var(--ink); letter-spacing: 0.1em; }
.realworld summary { font-size: 0.9rem; color: var(--muted); }

.paper { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 14px 18px; margin-bottom: 14px; }
.paper-mast { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; font-family: var(--serif); font-weight: 700; border-bottom: 3px double var(--ink); padding-bottom: 6px; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; }
.headline { font-size: 1.8rem; line-height: 1.15; margin: 4px 0 8px; }
.dek { color: var(--muted); font-size: 0.92rem; }
.note { border-left: 4px solid var(--school-2); }
.reveal { border-left-color: var(--school); }

.staff { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.staff li { display: flex; gap: 10px; align-items: center; }

.modes { border: 0; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; }
.mode { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 10px; cursor: pointer; }
.mode:has(input:checked) { border-color: var(--school); box-shadow: 0 0 0 1px var(--school); }
.mode input { margin-top: 4px; }

.verdict { border-top: 6px solid var(--muted); }
.verdict-extended { border-top-color: var(--good); }
.verdict-renewed { border-top-color: var(--accent); }
.verdict-probation { border-top-color: var(--warn); }
.verdict-dismissed { border-top-color: var(--bad); }
.verdict-badge { display: inline-block; font-family: var(--serif); font-size: 1.4rem; font-weight: 700; margin-bottom: 6px; }
.parts { display: grid; gap: 6px; margin: 10px 0; }
.part { display: grid; grid-template-columns: 180px 1fr 40px; gap: 8px; align-items: center; font-size: 0.88rem; }
.part .bar { margin: 0; }
.pill { font-size: 0.75rem; border-radius: 10px; padding: 1px 8px; border: 1px solid var(--line); white-space: nowrap; }
.pill-extended { border-color: var(--good); color: var(--good); }
.pill-probation { border-color: var(--warn); color: var(--warn); }
.pill-dismissed { border-color: var(--bad); color: var(--bad); }

.offers { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.offer { display: flex; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.offer h3 { font-family: var(--serif); }

.hof-bar { position: relative; height: 16px; background: var(--line); border-radius: 8px; overflow: visible; margin: 8px 0; }
.hof-bar > span { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--school), var(--school-2)); }
.hof-bar > i { position: absolute; top: -4px; width: 3px; height: 24px; background: var(--ink); margin-left: -2px; }
svg.chart .threshold { stroke: var(--school-2); stroke-width: 2; stroke-dasharray: 6 4; }

@media (max-width: 760px) {
  .part { grid-template-columns: 9.5rem 1fr 32px; }
  .headline { font-size: 1.4rem; }
  .offer { flex-direction: column; }
}

/* ---------- 12-month calendar ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.cal-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; margin-bottom: 12px; }
.cal-wrap > summary { font-size: 0.9rem; }
.cal-scroll { -webkit-overflow-scrolling: touch; }
table.cal { border-collapse: separate; border-spacing: 2px; font-size: 0.78rem; min-width: 760px; table-layout: fixed; }
table.cal th, table.cal td { border: 0; padding: 4px 3px; text-align: center; vertical-align: middle; }
table.cal thead th { font-size: 0.75rem; color: var(--ink); position: relative; }
table.cal th[scope='row'] { text-align: left; width: 82px; font-size: 0.75rem; color: var(--muted); }
table.cal .cur { outline: 2px solid var(--school); outline-offset: -1px; border-radius: 4px; }
table.cal thead th.cur { background: var(--school); color: #fff; }
.here { display: block; font-size: 0.6rem; font-weight: 400; text-transform: uppercase; letter-spacing: 0.04em; }
table.cal td.money { font-size: 0.72rem; line-height: 1.3; }
.cal-badge { display: inline-block; border: 1px solid var(--line); border-radius: 4px; padding: 0 3px; margin: 1px; white-space: nowrap; font-size: 0.7rem; }
.cal-badge.done { background: color-mix(in srgb, var(--good) 14%, var(--panel)); border-color: var(--good); }
.cal-badge.now { background: var(--school); color: #fff; border-color: var(--school); font-weight: 700; }
.cal-quiet { color: var(--muted); }
td.ph { border-radius: 4px; height: 34px; }
.ph-code { display: block; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.03em; opacity: 0.85; }
.ph-res { display: block; font-size: 0.72rem; }
.ph-off { background: color-mix(in srgb, var(--line) 45%, var(--panel)); color: var(--muted); }
.ph-pre, .ph-fall, .ph-spring { background: color-mix(in srgb, var(--school-2) 22%, var(--panel)); }
.ph-in { background: color-mix(in srgb, var(--school) 30%, var(--panel)); }
.ph-post { background: color-mix(in srgb, var(--school) 60%, var(--panel)); color: #fff; }
table.cal.compact td.ph { height: 28px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; color: var(--muted); }
.cal-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -2px; border: 1px solid var(--line); }
.cal-note { margin: 6px 0 2px; }
.month-notes { display: grid; grid-template-columns: 110px 1fr; gap: 4px 12px; margin: 0; }
.month-notes dt { font-weight: 700; }
.month-notes dd { margin: 0; }
table.cal th[scope='row'], table.cal thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--panel); }

/* ---------- AD, desk, money, coaches ---------- */
.masthead { position: relative; }
.masthead .mute { margin-left: auto; font-size: 0.8rem; min-height: 32px; padding: 4px 10px; }
.ad-line { font-size: 0.85rem; margin-top: 2px; line-height: 1.6; }
.ad-avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: linear-gradient(135deg, var(--school), var(--school-2)); color: #fff; font-weight: 700; font-family: var(--serif); flex: none; }
.ad-avatar.sm { width: 22px; height: 22px; font-size: 0.65rem; }
.ad-avatar.lg { width: 84px; height: 84px; font-size: 1.8rem; box-shadow: 0 0 0 4px var(--panel), 0 0 0 6px var(--school-2); }
.profile-card { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.stars { color: #d4a62a; letter-spacing: 1px; white-space: nowrap; }
.stars .off { color: var(--line); }
.pips i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--school); margin-right: 3px; }
.pips i.on { background: var(--school); }
.trophies { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.trophies li { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.trophy { font-size: 2rem; }

.ad-form { margin-bottom: 8px; }
.ad-fields { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.ad-fields label { display: flex; flex-direction: column; font-size: 0.85rem; gap: 4px; }
select { font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); min-height: 40px; }
.bg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.bg-card { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 10px; min-height: 0; }
.bg-card[aria-pressed='true'] { border-color: var(--school); box-shadow: 0 0 0 2px var(--school); }
.attr-mini { display: grid; grid-template-columns: 1fr; font-size: 0.72rem; }
.attr-mini span { display: flex; justify-content: space-between; gap: 6px; }
.perks { color: var(--good); }

.steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip { min-height: 32px; padding: 4px 10px; font-size: 0.82rem; border-radius: 16px; }
.chip[aria-pressed='true'] { background: var(--school); color: #fff; border-color: var(--school); }
.mover summary { font-weight: 600; }
.mover-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.mover-row label { display: flex; flex-direction: column; font-size: 0.85rem; gap: 4px; }

.desk-panel h2 { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.desk-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.desk-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--paper); }
.desk-item.done { opacity: 0.8; background: var(--panel); }
.desk-head { display: flex; gap: 10px; align-items: center; }
.desk-head .tag { margin-left: auto; }
.desk-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.desk-opt { display: flex; flex-direction: column; text-align: left; gap: 2px; padding: 8px 10px; }
.desk-opt:hover:not(:disabled) { border-color: var(--school); }
.morale { display: inline-block; min-width: 54px; padding: 1px 6px; border-radius: 4px; background: linear-gradient(90deg, color-mix(in srgb, var(--school) 35%, transparent) var(--m), transparent var(--m)); }

/* ---------- animations ---------- */
@media (prefers-reduced-motion: no-preference) {
  main.enter > * { animation: rise 0.42s cubic-bezier(.2, .8, .2, 1) both; }
  main.enter > *:nth-child(2) { animation-delay: 0.05s; }
  main.enter > *:nth-child(3) { animation-delay: 0.1s; }
  main.enter > *:nth-child(4) { animation-delay: 0.15s; }
  main.enter > *:nth-child(5) { animation-delay: 0.2s; }
  main.enter > *:nth-child(n+6) { animation-delay: 0.25s; }
  main.enter .paper { animation: paperDrop 0.55s cubic-bezier(.2, 1.4, .4, 1) both; }
  main.enter .verdict-badge { animation: stamp 0.5s cubic-bezier(.2, 1.6, .4, 1) 0.2s both; display: inline-block; }
  main.enter .bar > span, main.enter .hof-bar > span { animation: grow 0.9s ease-out 0.2s both; }
  main.enter .reveal { animation: flash 1s ease-out 0.4s both; }
  .cal thead th.cur { animation: pulse 2.4s ease-in-out infinite; }
  .desk-opt, .option, button { transition: transform 0.08s ease, box-shadow 0.15s ease, border-color 0.15s ease; }
  button:active:not(:disabled) { transform: scale(0.97); }
  .option:hover { transform: translateY(-2px); }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes paperDrop { from { opacity: 0; transform: translateY(-40px) rotate(-3deg) scale(1.04); } to { opacity: 1; transform: none; } }
@keyframes stamp { from { opacity: 0; transform: scale(2.4) rotate(-8deg); } to { opacity: 1; transform: rotate(-2deg); } }
@keyframes grow { from { width: 0; } }
@keyframes flash { 0% { background: var(--school-2); color: #fff; } 100% { } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--school) 50%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); opacity: 0.9; } }
.mbar { display: inline-block; width: 52px; height: 8px; border-radius: 4px; background: var(--line); vertical-align: middle; overflow: hidden; }
.mbar i { display: block; height: 100%; background: var(--good); }
.mbar.low i { background: var(--bad); }

/* ---------- FBS universe: schools, job market, negotiations ---------- */
.crest-placeholder { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 50px; border-radius: 10px; background: var(--school); color: #fff; font-family: var(--serif); font-weight: 700; }
.linklike { background: none; border: 0; padding: 0; min-height: 0; color: inherit; text-align: left; cursor: pointer; font: inherit; text-decoration: underline; text-decoration-color: var(--line); }
.linklike:hover { text-decoration-color: var(--school); }
.school-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.school-card header { display: flex; gap: 12px; align-items: center; }
.school-card h3 { font-family: var(--serif); margin: 0; }
.grades { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.grade { display: flex; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; font-size: 0.74rem; }
.grade b { font-family: var(--serif); font-size: 1rem; min-width: 26px; text-align: center; border-radius: 5px; padding: 1px 3px; color: #fff; }
.g-a b, .grade-chip.g-a { background: #2d7a46; }
.g-b b, .grade-chip.g-b { background: #3b6fa8; }
.g-c b, .grade-chip.g-c { background: #a07a1c; }
.g-d b, .grade-chip.g-d { background: #a33a2e; }
.grade-chip { color: #fff; border-radius: 5px; padding: 1px 6px; font-weight: 700; font-size: 0.8rem; }
.offer-terms { border-top: 1px dashed var(--line); padding-top: 8px; }
.neg { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin: 6px 0; }
.neg label { display: flex; flex-direction: column; font-size: 0.78rem; gap: 3px; }
.neg input[type='number'] { width: 140px; font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); min-height: 36px; }
.neg select { min-height: 36px; padding: 4px 8px; }
.neg p { flex-basis: 100%; margin: 2px 0 0; }
.warn { color: var(--warn); }
.cands { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.cand { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--paper); }
.cand.gone { opacity: 0.55; }
.cand-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
details.ext { display: inline-block; margin: 0 6px 0 0; }
details.ext summary { font-weight: 500; font-size: 0.85rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.kpis div { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.kpis .label { display: block; font-size: 0.75rem; color: var(--muted); }
.kpis b { font-size: 1.3rem; font-family: var(--serif); }

/* ---------- playtest round 1 ---------- */
.acts-col { display: flex; flex-direction: column; gap: 6px; min-width: 190px; }
.act-btn { display: block; box-sizing: border-box; width: 100%; text-align: center; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; min-height: 40px; background: var(--panel); cursor: pointer; font: inherit; color: var(--ink); }
details.ext > summary.act-btn { list-style: none; }
details.ext > summary.act-btn::-webkit-details-marker { display: none; }
details.ext[open] { border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.cal-badge { cursor: default; font: inherit; font-size: 0.7rem; }
button.cal-badge { cursor: pointer; }
.price-in { width: 80px; font: inherit; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); }
.impact-panel { border-left: 4px solid var(--school); }
table.impact td, table.impact th { padding: 4px 8px; }
.weeks { border-top: 4px solid var(--school-2); }
.week-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.week { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; display: flex; flex-direction: column; font-size: 0.8rem; }
.week.now { background: var(--school); color: #fff; border-color: var(--school); }
.week.done { opacity: 0.6; }
.sticky-col { position: sticky; left: 0; background: var(--panel); z-index: 1; }
.wrap-card { border-top: 4px solid var(--school); }
@media (max-width: 760px) { .week-steps { grid-template-columns: repeat(2, 1fr); } }
.desk-item.optional { border-style: dashed; }
.roll-bands { display: block; margin-top: 4px; opacity: 0.85; }

/* ---------- accounts and level picker ---------- */
main.account { max-width: 980px; margin: 0 auto; }
.auth-card { max-width: 420px; margin: 32px auto; }
.auth-form { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.auth-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.auth-form input { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); }
.auth-form button[type="submit"] { min-height: 44px; }
.account-bar { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 6px 0; position: relative; z-index: 1; }
.levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 16px; }
.level { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 18px; border-radius: 14px; border: 2px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; min-height: 170px; position: relative; }
.level-name { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.01em; }
.level-sub { font-weight: 600; opacity: 0.8; }
.level .tag { margin-top: auto; }
.level.ready { cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease; }
.level.ready:hover, .level.ready:focus-visible { transform: translateY(-3px); border-color: #d4a62a; box-shadow: 0 0 0 4px rgba(212, 166, 42, 0.25), 0 10px 24px rgba(0, 0, 0, 0.18); background: linear-gradient(160deg, rgba(212, 166, 42, 0.16), transparent 60%), var(--panel); }
.level.ready .tag.play { background: #d4a62a; color: #1b1b1b; }
.level.soon { opacity: 0.5; filter: grayscale(1); cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .level.ready { transition: none; } .level.ready:hover { transform: none; } }

/* ---------- soccer ---------- */
.sc-crest { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 2px solid; font-weight: 800; font-size: 0.8em; flex-shrink: 0; vertical-align: middle; }
table.league tr.zone-up td:first-child { box-shadow: inset 4px 0 0 #2e7d32; }
table.league tr.zone-po td:first-child { box-shadow: inset 4px 0 0 #1565c0; }
table.league tr.zone-down td:first-child { box-shadow: inset 4px 0 0 #c62828; }
table.league tr.me td { font-weight: 700; background: color-mix(in srgb, var(--school) 10%, transparent); }
.legend { padding: 2px 8px; border-left: 4px solid; margin-right: 8px; }
.legend.zone-up { border-color: #2e7d32; } .legend.zone-po { border-color: #1565c0; } .legend.zone-down { border-color: #c62828; }
.banner.ok { background: #e8f5e9; color: #1b5e20; border: 1px solid #a5d6a7; }
.sc-offers button { padding: 4px 8px; margin: 2px 0; }
.desk-opt.selected { outline: 3px solid var(--school); background: color-mix(in srgb, var(--school) 8%, var(--panel)); }
.desk-item .outcome { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 6px; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.pos-col li.starter { font-weight: 600; }
.neg-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: end; }
.neg-row label { display: flex; flex-direction: column; }
table.targets tr.would-start td:first-child { box-shadow: inset 4px 0 0 #2e7d32; }
.meter.wide { grid-column: span 2; }
.sc-cal { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.sc-month { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-height: 120px; }
.sc-month.done { opacity: 0.85; }
.sc-month.now { border: 2px solid var(--school); box-shadow: 0 0 0 3px color-mix(in srgb, var(--school) 18%, transparent); }
.sc-month-head { margin-bottom: 6px; }
.tag.now { background: var(--school); color: #fff; border-color: var(--school); }
.sc-events { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.sc-event { font-size: 0.72rem; border-radius: 4px; padding: 1px 6px; border: 1px solid var(--line); }
.sc-event.window { background: #e3f2fd; border-color: #90caf9; color: #0d47a1; }
.sc-event.start, .sc-event.end { background: #fff8e1; border-color: #ffe082; color: #6d4c00; }
.sc-event.money { background: #e8f5e9; border-color: #a5d6a7; color: #1b5e20; }
.sc-event.work { background: #f3e5f5; border-color: #ce93d8; color: #4a148c; }
.sc-dots { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 4px; }
.sc-dot { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; font-size: 0.68rem; font-weight: 700; border: 1px solid var(--line); }
.sc-dot.W { background: #2e7d32; color: #fff; border-color: #2e7d32; }
.sc-dot.D { background: #9e9e9e; color: #fff; border-color: #9e9e9e; }
.sc-dot.L { background: #c62828; color: #fff; border-color: #c62828; }
.sc-dot.upcoming { background: transparent; color: var(--muted); }
.sc-dot.away { border-style: dashed; }
.sc-legend .sc-dot { margin: 0 2px 0 8px; }
@media (max-width: 760px) { .meter.wide { grid-column: span 1; } }
.ext-box { border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; margin: 8px 0; }
.neg-box { display: flex; flex-direction: column; gap: 4px; min-width: 260px; }
.odds { white-space: normal; }
details.impact summary { cursor: pointer; color: var(--muted); }
ul.impact li { margin: 2px 0; }
.attrs { display: flex; flex-direction: column; gap: 6px; }
.attr-row { display: grid; grid-template-columns: 80px 1fr 48px 90px; gap: 8px; align-items: center; }
.attr-bar { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.attr-bar span { display: block; height: 100%; background: var(--school); }
/* soccer charts */
svg.chart { width: 100%; height: auto; display: block; }
svg.chart .axis { font-size: 10px; fill: var(--muted); }
svg.chart .zb-up { fill: #2e7d32; opacity: 0.12; }
svg.chart .zb-po { fill: #1565c0; opacity: 0.1; }
svg.chart .zb-down { fill: #c62828; opacity: 0.12; }
svg.chart .pos-line { fill: none; stroke: var(--school); stroke-width: 2.5; }
svg.chart .pos-dot { fill: var(--school); }
svg.chart .pos-now { fill: var(--school); stroke: var(--panel); stroke-width: 2; }
svg.chart .bar-in, .hbar .bar-in { fill: #2e7d32; background: #2e7d32; }
svg.chart .bar-out, .hbar .bar-out { fill: #c62828; background: #c62828; }
.legend-in { color: #2e7d32; } .legend-out { color: #c62828; }
.hbar { display: grid; grid-template-columns: 140px 1fr 70px; gap: 8px; align-items: center; margin: 4px 0; }
.hbar-track { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.hbar-track span { display: block; height: 100%; }
.gauge-track { position: relative; height: 14px; background: var(--line); border-radius: 7px; overflow: visible; margin: 6px 0; }
.gauge-fill { display: block; height: 100%; background: #2e7d32; border-radius: 7px; }
.gauge-fill.over { background: #c62828; }
.gauge-limit { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.tag.story { background: #fff3e0; border-color: #ffb74d; color: #8a4b00; }
.sc-event.cup { background: #ede7f6; border-color: #b39ddb; color: #311b92; }

/* D1 program building */
svg.chart .gpa-team { fill: none; stroke-width: 1.5; opacity: 0.85; }
svg.chart .gpa-c0 { stroke: #c62828; } svg.chart .gpa-c1 { stroke: #2e7d32; } svg.chart .gpa-c2 { stroke: #1565c0; }
svg.chart .gpa-c3 { stroke: #8e24aa; } svg.chart .gpa-c4 { stroke: #ef6c00; }
svg.chart .gpa-l0 { fill: #c62828; } svg.chart .gpa-l1 { fill: #2e7d32; } svg.chart .gpa-l2 { fill: #1565c0; }
svg.chart .gpa-l3 { fill: #8e24aa; } svg.chart .gpa-l4 { fill: #ef6c00; }
.kpis .small { display: block; }
/* Sortable table headings */
th .th-sort { all: unset; cursor: pointer; font-weight: 600; white-space: nowrap; }
th .th-sort:hover, th .th-sort:focus-visible { text-decoration: underline; }
th[aria-sort="ascending"] .th-sort, th[aria-sort="descending"] .th-sort { color: var(--school, inherit); }
/* Show/hide password */
.pw-wrap { position: relative; display: flex; }
.pw-wrap input { flex: 1; padding-right: 72px !important; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 32px; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.pw-toggle:hover, .pw-toggle:focus-visible { border-color: var(--accent); }
/* Account screen */
.danger-zone { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
button.danger { background: var(--bad); color: #fff; border: 1px solid var(--bad); border-radius: 8px; padding: 10px 14px; font: inherit; font-weight: 600; min-height: 44px; cursor: pointer; }
button.danger[disabled] { opacity: 0.6; }
.danger-zone label { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.danger-zone label:has(input[type="checkbox"]) { flex-direction: row; align-items: center; gap: 8px; }

/* Native app and notched screens: keep content clear of the notch and home bar */
body { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
@media (pointer: coarse) {
  button, select, .linklike, input[type="checkbox"] { min-height: 44px; }
  .linklike { display: inline-flex; align-items: center; }
  input, select, textarea { font-size: 16px; }
}
/* Privacy and support pages */
main.doc { max-width: 760px; margin: 0 auto; padding: 16px; }
main.doc ul { padding-left: 20px; }
main.doc li { margin: 6px 0; }
/* A solid strip behind the status bar so scrolled content never shows under the clock and Dynamic Island */
body::before { content: ''; position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top); background: var(--bg); z-index: 10000; pointer-events: none; }

/* New sports */
.ns-gauge, .ns-progress { position: relative; height: 12px; background: var(--line); border-radius: 6px; overflow: hidden; margin: 6px 0; }
.ns-gauge > span, .ns-progress > span { display: block; height: 100%; background: var(--accent); }
.ns-progress > i { position: absolute; top: 0; bottom: 0; width: 2px; background: currentColor; opacity: 0.7; }
.ns-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.ns-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.ns-card.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.ns-card header { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.ns-card h3 { margin: 0; font-size: 1rem; }
.ns-card table { width: 100%; }
.ns-card button { margin-top: auto; }
.ns-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.ns-choice p { margin: 4px 0 0; }
.ns-alert { border-left: 4px solid #c9821a; }
.ns-plan fieldset { border: 0; padding: 0; margin: 6px 0; }
.ns-radio { display: block; font-size: 0.9rem; margin: 2px 0; }

/* =====================================================================
   Redesign (Performance Director family): bold condensed type, cards with
   depth, KPI tiles, a sidebar on desktop and a swipe strip on phones.
   ===================================================================== */
body {
  background:
    radial-gradient(1100px 520px at 85% -12%, color-mix(in srgb, var(--school) 22%, transparent), transparent 62%),
    radial-gradient(900px 480px at -10% 0%, color-mix(in srgb, var(--gold) 7%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  font-size: 15px;
  min-height: 100vh;
}
#app { max-width: 1360px; padding: 0 20px 64px; }
h1, h2, h3, .masthead .title, .level-name, .verdict-badge, .offer h3, .school-card h3 {
  font-family: var(--head);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.12;
}
h1 { font-size: 2rem; margin-bottom: 12px; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; letter-spacing: 0.04em; }
.small { font-size: 0.84rem; }
a { color: var(--info); }

/* ---------- header / masthead ---------- */
header.top { border-bottom: 0; padding: 18px 0 6px; margin-bottom: 10px; }
.masthead {
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--school) 38%, var(--panel)) 0%, var(--panel) 55%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.masthead::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, var(--school), var(--school-2), var(--gold)); }
.masthead .title { font-size: 1.7rem; }
.masthead .crest { filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45)); }
.eyebrow { color: var(--gold-text); letter-spacing: 0.16em; font-weight: 700; font-size: 0.7rem; }
.masthead .mute, .theme-toggle { font-size: 0.78rem; min-height: 32px; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--panel) 70%, transparent); }
.crest-placeholder { border-radius: 12px; background: linear-gradient(135deg, var(--gold), #e07b1a); color: #1a1305; font-family: var(--head); font-weight: 900; }
.account-bar { color: var(--muted); }
.account-bar .linklike { color: var(--ink); }

/* ---------- navigation ---------- */
nav.tabs { gap: 6px; }
nav.tabs button {
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-weight: 650;
  font-size: 0.88rem;
  padding: 7px 14px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
nav.tabs button::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--line); flex: none; }
nav.tabs button:hover { border-color: color-mix(in srgb, var(--gold) 60%, var(--line)); }
nav.tabs button[aria-current='page'] { background: var(--gold); color: var(--accent-ink); border-color: var(--gold); }
nav.tabs button[aria-current='page']::before { background: var(--accent-ink); }

/* Desktop: the nav becomes a sidebar (header is flattened into the page grid). */
@media (min-width: 1000px) {
  #app:has(> header.top nav.tabs) { display: grid; grid-template-columns: 228px minmax(0, 1fr); column-gap: 26px; align-items: start; }
  #app:has(> header.top nav.tabs) > header.top { display: contents; }
  #app:has(> header.top nav.tabs) > header.top > *, #app:has(> header.top nav.tabs) > :not(header) { grid-column: 2; }
  #app:has(> header.top nav.tabs) > header.top > .masthead { margin-top: 18px; }
  #app:has(> header.top nav.tabs) > header.top > nav.tabs {
    grid-column: 1;
    grid-row: 1 / span 30;
    position: sticky;
    top: 0;
    align-self: start;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 3px;
    margin: 0;
    padding: 22px 0 24px;
    max-height: 100vh;
    overflow-y: auto;
  }
  #app:has(> header.top nav.tabs) > header.top > nav.tabs::before {
    content: 'Front Office';
    display: block;
    font-family: var(--head);
    font-weight: 900;
    font-size: 1.35rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1;
    padding: 0 10px 4px;
  }
  #app:has(> header.top nav.tabs) > header.top > nav.tabs::after {
    content: 'The Climb · QAI Lab';
    order: -1;
    display: block;
    color: var(--gold-text);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 0 10px 16px;
  }
  #app:has(> header.top nav.tabs) > header.top > nav.tabs::before { order: -2; }
  #app:has(> header.top nav.tabs) > header.top > nav.tabs button {
    width: 100%;
    justify-content: flex-start;
    border-radius: 10px;
    background: none;
    border-color: transparent;
    padding: 9px 12px;
    font-size: 0.92rem;
  }
  #app:has(> header.top nav.tabs) > header.top > nav.tabs button:hover { background: var(--panel); }
  #app:has(> header.top nav.tabs) > header.top > nav.tabs button[aria-current='page'] { background: var(--gold); color: var(--accent-ink); }
}
/* Phones and tablets: one swipeable strip that sticks to the top. */
@media (max-width: 999px) {
  nav.tabs {
    position: sticky;
    top: env(safe-area-inset-top);
    z-index: 20;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 8px -20px;
    padding: 8px 20px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
  }
  nav.tabs::-webkit-scrollbar { display: none; }
  nav.tabs button { white-space: nowrap; flex: none; }
}

/* ---------- KPI tiles (header meters) ---------- */
.meters { gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-top: 10px; }
.meter {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border-radius: 14px;
  padding: 12px 14px 12px 18px;
}
.meter::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--school); }
.meter:nth-child(6n + 2)::before { background: var(--gold); }
.meter:nth-child(6n + 3)::before { background: var(--info); }
.meter:nth-child(6n + 4)::before { background: var(--bad); }
.meter:nth-child(6n + 5)::before { background: var(--good); }
.meter:nth-child(6n)::before { background: #a78bfa; }
.meter .label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.meter .value { font-family: var(--head); font-size: 1.75rem; font-weight: 800; line-height: 1.1; margin-top: 2px; }
.meter .sub { font-size: 0.76rem; }
.bar, .attr-bar, .hbar-track, .gauge-track, .mbar, .ns-gauge, .ns-progress, .hof-bar { background: var(--track); border-radius: 999px; }
.bar { height: 7px; }
.bar > span, .attr-bar span { border-radius: 999px; background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 70%, #e07b1a), var(--gold)); box-shadow: 0 0 10px color-mix(in srgb, var(--gold) 30%, transparent); }
.savebar { font-size: 0.78rem; }

/* ---------- cards / panels ---------- */
section.panel, .card, .school-card, .offer, .cal-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
section.panel > h2:first-child, section.panel > h3:first-child { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
section.panel > h2:first-child::before { content: ''; width: 4px; height: 1em; border-radius: 2px; background: var(--gold); flex: none; }
.grid2, .grid3 { gap: 16px; }
.grid2 > section.panel, .grid3 > section.panel { margin-bottom: 0; }
.grid2 { margin-bottom: 16px; }

/* ---------- controls ---------- */
button, .btn, .act-btn {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 600;
  color: var(--ink);
}
button:hover:not(:disabled), .act-btn:hover { border-color: color-mix(in srgb, var(--gold) 70%, var(--line)); }
button.primary, .level.ready .tag.play {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--accent-ink);
  font-weight: 750;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--gold) 28%, transparent);
}
button.primary:hover:not(:disabled) { filter: brightness(1.07); border-color: var(--gold); }
.linklike { background: none; border: 0; box-shadow: none; color: inherit; font-weight: 500; }
input[type='text'], input[type='number'], input[type='password'], select, .auth-form input, .price-in, .neg input[type='number'] {
  background: var(--bg2);
  border: 1px solid color-mix(in srgb, var(--muted) 40%, var(--line));
  border-radius: 10px;
  color: var(--ink);
}
.chip { border-radius: 999px; }
.chip[aria-pressed='true'], .bg-card[aria-pressed='true'] { background: var(--gold); color: var(--accent-ink); border-color: var(--gold); box-shadow: none; }
.bg-card[aria-pressed='true'] .muted, .bg-card[aria-pressed='true'] .perks { color: var(--accent-ink); }
.tag, .pill { border-radius: 999px; padding: 2px 9px; font-weight: 700; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; background: var(--panel2); }
.tag.now, .tag.play { background: var(--gold); color: var(--accent-ink); border-color: var(--gold); }

/* ---------- tables ---------- */
th { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; color: var(--muted); }
td, th { border-bottom-color: var(--line); }
tbody tr:hover td { background: color-mix(in srgb, var(--ink) 3%, transparent); }
tr.me td, table.league tr.me td { background: color-mix(in srgb, var(--gold) 13%, var(--panel)); font-weight: 700; }
.sticky-col, table.cal th[scope='row'], table.cal thead th:first-child { background: var(--panel); }

/* ---------- decisions ---------- */
.option {
  background: var(--panel2);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}
.option:hover:not(.disabled) { border-color: color-mix(in srgb, var(--gold) 65%, var(--line)); }
.option:has(input:checked) { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset, 0 10px 28px color-mix(in srgb, var(--gold) 16%, transparent); background: color-mix(in srgb, var(--gold) 7%, var(--panel2)); }
.option .key { background: var(--gold); color: var(--accent-ink); border-radius: 8px; padding: 1px 8px; font-family: var(--head); font-weight: 900; }
fieldset.options { display: grid; gap: 10px; }
.impact-panel { border-left: 4px solid var(--gold); }
.desk-item, .cand { background: var(--panel2); border-radius: 14px; border: 1px solid var(--line); border-left: 4px solid #ff7a1a; }
.desk-item.optional { border-left-color: var(--info); border-style: solid; }
.desk-item.done { border-left-color: var(--good); background: var(--panel2); }
.desk-opt { border-radius: 12px; }
.desk-opt:hover:not(:disabled) { border-color: var(--gold); }
.desk-opt.selected { outline: 2px solid var(--gold); background: color-mix(in srgb, var(--gold) 8%, var(--panel2)); }
.reveal { background: color-mix(in srgb, var(--gold) 10%, var(--panel2)); border-left-color: var(--gold); border-radius: 10px; }

/* Memo and newspaper stay on cream paper in both themes: the game's printed world. */
.memo, .paper, .trophies li { --paper: #fbf7ec; background: var(--paper); color: var(--paper-ink); border-color: #e2dccb; box-shadow: var(--shadow); }
.memo .muted, .paper .muted, .paper .dek, .memo-head { color: #5b636d; }
.memo-head span:first-child { color: var(--paper-ink); }
.paper { border-radius: 6px; padding: 18px 22px; }
.paper-mast { border-bottom-color: var(--paper-ink); }
.paper table td, .paper table th { border-bottom-color: #e2dccb; }
.paper tbody tr:hover td { background: transparent; }
.headline { font-family: var(--serif); font-size: 2.2rem; font-weight: 800; text-transform: none; letter-spacing: -0.01em; }
.paper .tag, .memo .tag { background: #efe8d6; color: #5b4a1a; border-color: #e2dccb; }

/* ---------- verdicts, offers, schools ---------- */
.verdict { border-top-width: 6px; }
.verdict-badge { font-size: 2.4rem; letter-spacing: 0.04em; }
.verdict-extended .verdict-badge { color: var(--good); }
.verdict-probation .verdict-badge { color: var(--warn); }
.verdict-dismissed .verdict-badge { color: var(--bad); }
.offer, .school-card { transition: transform 0.15s ease, border-color 0.15s ease; }
.offer:hover, .school-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); }
.grade b, .grade-chip { font-family: var(--head); }
.g-a b, .grade-chip.g-a { background: #15803d; }
.g-b b, .grade-chip.g-b { background: #2563eb; }
.g-c b, .grade-chip.g-c { background: #b7791f; }
.g-d b, .grade-chip.g-d { background: #be123c; }
.kpis div { background: var(--panel2); border-radius: 12px; border-color: var(--line); }
.kpis b { font-family: var(--head); font-size: 1.5rem; }
.stars { color: var(--gold-text); }
.week { background: var(--panel2); border-radius: 10px; }
.week.now { background: var(--gold); color: var(--accent-ink); border-color: var(--gold); }
.wrap-card, .weeks { border-top-color: var(--gold); }

/* ---------- level picker ---------- */
.levels { gap: 16px; }
.level {
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 4px solid var(--lc, var(--gold));
  border-radius: 16px;
  box-shadow: var(--shadow);
  color: var(--ink);
}
.level:nth-child(1) { --lc: #f5b82e; }
.level:nth-child(2) { --lc: #a855f7; }
.level:nth-child(3) { --lc: #3b82f6; }
.level:nth-child(4) { --lc: #22c55e; }
.level:nth-child(5) { --lc: #ef4444; }
.level:nth-child(6) { --lc: #ff7a1a; }
.level-name { font-size: 1.9rem; color: var(--ink); }
.level-sub { color: var(--lc, var(--gold)); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; opacity: 1; }
.level .small { color: var(--muted); }
.level.ready:hover, .level.ready:focus-visible { border-color: var(--lc); border-top-color: var(--lc); background: color-mix(in srgb, var(--lc) 8%, var(--panel)); box-shadow: 0 0 0 1px var(--lc), 0 14px 30px rgba(0, 0, 0, 0.35); }
.auth-card { border-top: 4px solid var(--gold); }

/* ---------- banners ---------- */
.banner { border-radius: 12px; border: 1px solid var(--line); border-left-width: 4px; background: var(--panel); }
.banner.error { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, var(--panel)); }
.banner.warn { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--panel)); }
.banner.info { border-color: var(--info); background: color-mix(in srgb, var(--info) 9%, var(--panel)); }
.banner.ok { border-color: var(--good); background: color-mix(in srgb, var(--good) 10%, var(--panel)); color: var(--ink); }

/* ---------- calendars and chips that had light-only colors ---------- */
.ph-off { background: color-mix(in srgb, var(--line) 60%, var(--panel)); }
.cal-badge { background: var(--panel2); }
.cal-badge.now, table.cal thead th.cur { background: var(--gold); color: var(--accent-ink); border-color: var(--gold); }
table.cal .cur { outline-color: var(--gold); }
.sc-month { background: var(--panel2); border-radius: 12px; }
.sc-month.now { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 20%, transparent); }
.sc-event { background: var(--panel); }
.sc-event.window { background: color-mix(in srgb, #3b82f6 18%, var(--panel)); border-color: #3b82f6; color: var(--ink); }
.sc-event.start, .sc-event.end { background: color-mix(in srgb, var(--gold) 18%, var(--panel)); border-color: var(--gold); color: var(--ink); }
.sc-event.money { background: color-mix(in srgb, var(--good) 16%, var(--panel)); border-color: var(--good); color: var(--ink); }
.sc-event.work { background: color-mix(in srgb, #a855f7 18%, var(--panel)); border-color: #a855f7; color: var(--ink); }
.sc-event.cup { background: color-mix(in srgb, #8b5cf6 18%, var(--panel)); border-color: #8b5cf6; color: var(--ink); }
.tag.story { background: color-mix(in srgb, #ff7a1a 18%, var(--panel)); border-color: #ff7a1a; color: var(--ink); }
.week-steps .week b { font-family: var(--head); text-transform: uppercase; }
svg.chart .line, svg.chart .pos-line { stroke: var(--gold); }
svg.chart .dot, svg.chart .pos-dot, svg.chart .pos-now { fill: var(--gold); }
.ns-gauge > span, .ns-progress > span { background: linear-gradient(90deg, var(--school), var(--gold)); }
.ns-card { background: var(--panel2); border-radius: 14px; }
.ns-card.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.ns-alert { border-left: 4px solid var(--warn); }
.morale { background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 35%, transparent) var(--m), transparent var(--m)); }

@media (max-width: 760px) {
  #app { padding: 0 14px 48px; }
  nav.tabs { margin: 8px -14px; padding: 8px 14px; }
  h1 { font-size: 1.55rem; }
  .masthead { padding: 12px 14px; border-radius: 14px; }
  .masthead .title { font-size: 1.3rem; }
  /* Stat tiles: one swipeable row instead of a tall stack. */
  .meters { display: flex; overflow-x: auto; gap: 8px; margin: 8px -14px 0; padding: 2px 14px 6px; scroll-snap-type: x proximity; scrollbar-width: none; }
  .meters::-webkit-scrollbar { display: none; }
  .meter { flex: 0 0 138px; scroll-snap-align: start; padding: 9px 10px 9px 14px; }
  .meter .label { font-size: 0.6rem; letter-spacing: 0.08em; }
  .meter .value { font-size: 1.3rem; }
  .meter .sub { display: none; }
  .masthead { gap: 10px; padding-right: 54px; }
  .masthead .crest { width: 36px; height: 41px; }
  .masthead .ad-line, .masthead .small.muted { font-size: 0.74rem; }
  .masthead .mute { position: absolute; top: 10px; right: 10px; font-size: 0; padding: 4px 8px; min-height: 30px; }
  .masthead .mute::first-letter { font-size: 1rem; }
  .account-bar { gap: 2px 10px; }
  section.panel, .card { padding: 14px; border-radius: 14px; }
  .headline { font-size: 1.6rem; }
}
.desk-item .desk-opt, .desk-item button:not(.linklike):not(.primary) { background: var(--panel); border: 1px solid var(--line); }
.desk-item .desk-opt:hover:not(:disabled) { background: color-mix(in srgb, var(--gold) 6%, var(--panel)); }

/* ---------- living situations ---------- */
.stance { display:inline-block; margin-left:6px; padding:1px 8px; border-radius:999px; font-size:11px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; vertical-align:middle; border:1px solid var(--line); }
.stance-firm { background: color-mix(in srgb, var(--info) 18%, transparent); color: var(--info); }
.stance-middle { background: color-mix(in srgb, var(--muted) 15%, transparent); color: var(--muted); }
.stance-lenient { background: color-mix(in srgb, var(--warn, #e8a33d) 20%, transparent); color: var(--warn, #e8a33d); }
.precedent-line { margin-top:6px; }
.memo .banner.precedent { margin-top:12px; background:#fff1d0; color:#5a3a00; border:1px solid #e3a93a; border-left:5px solid #d98a00; }
section.panel.booster-offer { box-shadow: inset 5px 0 0 var(--gold), var(--shadow); border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.booster-offer h2 { margin-top: 2px; }
.booster-actions { display:flex; gap:8px; flex-wrap:wrap; margin:10px 0 6px; }

/* Stars on a gold (selected) card: dark ink for earned stars, faint ink for the rest. */
.chip[aria-pressed='true'] .stars, .bg-card[aria-pressed='true'] .stars, .bg-card.selected .stars { color: var(--accent-ink); }
.chip[aria-pressed='true'] .stars .off, .bg-card[aria-pressed='true'] .stars .off, .bg-card.selected .stars .off { color: color-mix(in srgb, var(--accent-ink) 22%, transparent); }
.bg-card[aria-pressed='true'] .up, .bg-card[aria-pressed='true'] .muted { color: var(--accent-ink); }

/* ---------- revenue & media ---------- */
.rev-kpis { display:grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap:10px; margin:12px 0; }
.rev-kpis > div { background: var(--panel2); border:1px solid var(--line); border-radius:12px; padding:10px 12px; display:flex; flex-direction:column; gap:2px; }
.rev-kpis .label { font-size:11px; text-transform:uppercase; letter-spacing:.06em; color: var(--muted); }
.rev-kpis b { font-family: var(--head); font-size:20px; }
.rev-bar { height:4px; background: var(--line); border-radius:2px; margin-top:4px; max-width:160px; }
.rev-bar span { display:block; height:100%; background: var(--gold); border-radius:2px; }
table.rev-table td, table.rev-table th { white-space: nowrap; }
.md-offer { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; padding:10px 12px; border:1px solid var(--line); border-radius:12px; margin:8px 0; background: var(--panel2); }
