:root {
  --brand-primary: #123b5d;
  --brand-secondary: #1d6b8c;
  --brand-accent: #f28c28;
  --page-bg: #f4f7fa;
  --font-scale: 1;
  --ink: #16212a;
  --muted: #667582;
  --line: #d9e1e7;
  --surface: #ffffff;
  --success: #147d64;
  --danger: #b33a3a;
  --warning: #a96710;
  --shadow: 0 16px 40px rgba(18, 59, 93, 0.1);
  --radius-lg: 20px;
  --radius-md: 13px;
  --radius-sm: 8px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: calc(16px * var(--font-scale));
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--page-bg); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--page-bg); line-height: 1.55; }
a { color: var(--brand-secondary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid var(--brand-secondary); outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .45rem; font-size: clamp(1.8rem, 3vw, 2.6rem); line-height: 1.12; letter-spacing: -.035em; }
h2 { font-size: 1.35rem; line-height: 1.25; letter-spacing: -.02em; }
h3 { font-size: 1rem; }
.muted { color: var(--muted); }
.eyebrow { margin-bottom: .3rem; color: var(--brand-secondary); font-size: .76rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 1000; padding: .7rem 1rem; color: white; background: var(--ink); border-radius: 8px; }
.skip-link:focus { top: 1rem; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; min-width: 0; display: flex; flex-direction: column; gap: 1.25rem; padding: 1.4rem; color: #eaf3f8; background: linear-gradient(165deg, var(--brand-primary), #0b293e 76%); }
.brand { display: flex; align-items: center; gap: .8rem; color: inherit; text-decoration: none; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.06rem; letter-spacing: -.01em; }
.brand small { color: rgba(255,255,255,.66); font-size: .73rem; }
.brand-mark, .logo-placeholder { width: 42px; height: 42px; display: inline-block; flex: none; border: 0; border-radius: 0; background: #b5b5b5; }
.main-nav { min-height: 0; display: grid; align-content: start; gap: .2rem; overflow-y: auto; scrollbar-width: thin; }
.main-nav a { padding: .75rem .85rem; color: rgba(255,255,255,.76); border-radius: 10px; font-size: .92rem; font-weight: 650; text-decoration: none; }
.main-nav a:hover, .main-nav a:focus-visible, .main-nav a[aria-current="page"] { color: white; background: rgba(255,255,255,.11); outline: none; }
.sidebar-footer { margin-top: auto; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .7rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.14); }
.user-avatar { width: 34px; height: 34px; display: grid; place-items: center; color: var(--brand-primary); background: #fff; border-radius: 50%; font-weight: 800; }
.user-meta { min-width: 0; }
.user-meta strong, .user-meta small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta strong { font-size: .82rem; }
.user-meta small { color: rgba(255,255,255,.58); font-size: .68rem; }
.user-meta small a { color: #d1e9f6; }
.link-button { padding: .25rem; color: rgba(255,255,255,.78); background: none; border: 0; cursor: pointer; font-size: .76rem; }
.nav-collapsed .app-shell { grid-template-columns: minmax(0, 1fr); }
.nav-toggle { flex: none; }
.action-icon { width: 1.1rem; height: 1.1rem; flex: none; }
.icon-button { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: .4rem; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; cursor: pointer; }
.nav-close { align-self: flex-end; margin-bottom: -.75rem; font-size: 1.8rem; line-height: 1; }
.nav-backdrop { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 190; padding: 0; border: 0; background: rgba(9, 24, 36, .5); cursor: pointer; }

.workspace { min-width: 0; }
.topbar { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem clamp(1rem, 3vw, 2.5rem); background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.topbar strong { display: block; }
.workspace-title { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.topbar .eyebrow { font-size: .66rem; }
.academy-switcher { max-width: 100%; display: flex; align-items: center; gap: .65rem; }
.academy-switcher label { color: var(--muted); font-size: .78rem; }
.academy-switcher select { min-width: 190px; }
.content { width: min(1440px, 100%); margin: 0 auto; padding: clamp(1.2rem, 3vw, 2.5rem); }

.page-header { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.page-header > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.compact-header { align-items: center; }
.page-header p:not(.eyebrow) { margin-bottom: 0; color: var(--muted); }
.header-actions, .inline-actions { min-width: 0; max-width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.panel { min-width: 0; padding: clamp(1rem, 2vw, 1.45rem); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 6px 25px rgba(18,59,93,.035); }
.panel-header { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .65rem; margin-bottom: 1rem; }
.panel-header h2 { margin-bottom: 0; }
.section-grid { min-width: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.section-grid > * { min-width: 0; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; margin-bottom: 1rem; }
.metric-card { position: relative; overflow: hidden; min-height: 125px; padding: 1.2rem; background: white; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.metric-card::after { content: ""; position: absolute; right: -28px; bottom: -46px; width: 110px; height: 110px; border: 18px solid color-mix(in srgb, var(--brand-accent) 18%, transparent); border-radius: 50%; }
.metric-label { color: var(--muted); font-size: .82rem; font-weight: 650; }
.metric-value { display: block; margin-top: .55rem; font-size: 2.15rem; line-height: 1; font-weight: 850; letter-spacing: -.045em; }
.metric-detail { display: block; margin-top: .5rem; color: var(--brand-secondary); font-size: .75rem; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 42px; padding: .62rem .95rem; border: 1px solid transparent; border-radius: 10px; font-weight: 750; text-decoration: none; cursor: pointer; }
.button:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand-accent) 48%, transparent); outline-offset: 2px; }
.button:disabled { opacity: .55; cursor: wait; }
.button-primary { color: white; background: var(--brand-primary); }
.button-primary:hover { background: color-mix(in srgb, var(--brand-primary) 85%, black); }
.button-accent { color: #20170d; background: var(--brand-accent); }
.button-quiet { color: var(--brand-primary); background: #fff; border-color: var(--line); }
.button-danger { color: var(--danger); background: #fff; border-color: #e9caca; }
.button-small { min-height: 34px; padding: .4rem .7rem; font-size: .78rem; }
.button-full { width: 100%; }
.tools-dropdown { position: relative; max-width: 100%; }
.tools-dropdown > summary { list-style: none; user-select: none; color: var(--muted); font-size: .85rem; font-weight: 650; }
.tools-dropdown > summary::-webkit-details-marker { display: none; }
.tools-dropdown > summary::after { content: ""; width: .4rem; height: .4rem; margin-left: .2rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.tools-dropdown[open] { z-index: 40; }
.tools-dropdown[open] > summary { color: var(--brand-primary); background: #edf3f7; }
.tools-dropdown[open] > summary::after { transform: rotate(225deg); }
.tools-panel { position: absolute; top: calc(100% + .4rem); right: 0; display: grid; gap: .25rem; width: max-content; min-width: 220px; max-width: min(340px, calc(100vw - 2rem)); max-height: min(65vh, 560px); overflow-y: auto; padding: .5rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.tools-panel > a, .tools-panel > button, .tools-panel > form > button { width: 100%; min-height: 44px; justify-content: flex-start; padding: .65rem .75rem; color: var(--ink); border: 0; border-radius: 7px; background: transparent; text-align: left; font-size: .85rem; font-weight: 600; text-decoration: none; white-space: normal; }
.tools-panel > form { margin: 0; }
.tools-panel > a:hover, .tools-panel > button:hover, .tools-panel > form > button:hover { background: #f0f5f8; }
.tools-panel .button-danger { color: var(--danger); }
.action-menu { position: relative; max-width: 100%; }
.action-menu[open] { z-index: 40; }
.action-menu summary { list-style: none; user-select: none; }
.action-menu summary::-webkit-details-marker { display: none; }
.action-menu-items { position: absolute; top: calc(100% + .4rem); right: 0; display: grid; width: max-content; max-width: min(320px, calc(100vw - 2rem)); min-width: 200px; max-height: 65vh; overflow: auto; gap: .25rem; padding: .5rem; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.action-menu-items a, .action-menu-items button { padding: .65rem .75rem; border-radius: 7px; color: var(--ink); font-size: .85rem; font-weight: 600; text-decoration: none; }
.action-menu-items a:hover, .action-menu-items button:hover { background: #edf3f7; }
.event-single-form { display: grid; max-width: 780px; gap: 1rem; }
.event-single-form .form-field, .event-single-form p { min-width: 0; margin: 0; }
.event-single-form label { display: block; margin-bottom: .35rem; font-size: .85rem; font-weight: 650; }
.event-single-form small { display: block; margin-top: .3rem; color: var(--muted); }
.event-single-form button { justify-self: start; }
.event-catalog-links { display: flex; flex-wrap: wrap; gap: .6rem; }
.event-standing-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 1rem; }
.event-standing-row { min-width: 0; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; overflow-wrap: anywhere; }
.event-standing-row small { display: block; color: var(--muted); }
.event-standing-row dl { display: grid; gap: .45rem; margin-bottom: 0; }
.event-standing-row dl div { display: flex; justify-content: space-between; gap: 1rem; }
.event-standing-row dt { color: var(--muted); font-size: .8rem; }
.event-standing-row dd { margin: 0; }
.record-list { display: grid; gap: .8rem; }
.record-card { min-width: 0; margin: .8rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; overflow-wrap: anywhere; }
.record-card h2, .record-card h3 { margin-bottom: .45rem; }
.record-card p:last-child { margin-bottom: 0; }
.record-card > summary { min-height: 44px; padding: .4rem 0; cursor: pointer; font-weight: 700; }
.record-card[open] > summary { margin-bottom: .6rem; }
.filter-form { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .7rem; margin-bottom: 1rem; }
.filter-form label { font-weight: 650; font-size: .85rem; }
.content > .panel + .panel { margin-top: 1rem; }
.mobile-cell-label { display: none; }

input, select, textarea { width: 100%; padding: .68rem .75rem; color: var(--ink); background: #fff; border: 1px solid #bdc9d2; border-radius: 9px; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-secondary); outline: 3px solid color-mix(in srgb, var(--brand-secondary) 18%, transparent); }
input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--brand-primary); }
input[type="color"] { width: 68px; height: 44px; padding: .25rem; }
textarea { min-height: 108px; resize: vertical; }
.model-form { max-width: 1000px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem 1.2rem; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field { min-width: 0; }
.field label { display: block; margin-bottom: .35rem; font-size: .83rem; font-weight: 750; }
.field-check { display: flex; align-items: center; gap: .55rem; padding-top: 1.6rem; }
.field-check label { margin-bottom: 0; }
.help, .field-error { display: block; margin-top: .3rem; font-size: .74rem; }
.help { color: var(--muted); }
.field-error { color: var(--danger); font-weight: 650; }
.form-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--line); }

.messages { display: grid; gap: .5rem; margin-bottom: 1rem; }
.message { padding: .75rem .9rem; border-left: 4px solid var(--brand-secondary); border-radius: 8px; background: #e9f5fa; }
.message-success { border-color: var(--success); background: #e9f7f2; }
.message-error { border-color: var(--danger); background: #fbecec; }
.message-warning { border-color: var(--warning); background: #fff3df; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: .65rem .7rem; color: var(--muted); border-bottom: 1px solid var(--line); font-size: .72rem; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.data-table td { padding: .8rem .7rem; border-bottom: 1px solid #edf1f4; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.table-scroll { max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; }
.item-list { display: grid; gap: .65rem; }
.list-row { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem; color: inherit; border: 1px solid #e7edf1; border-radius: 11px; text-decoration: none; }
.list-row > * { min-width: 0; overflow-wrap: anywhere; }
.list-row:hover { border-color: color-mix(in srgb, var(--brand-secondary) 45%, var(--line)); background: #fbfdfe; }
.list-row strong, .list-row small { display: block; }
.list-row small { color: var(--muted); }
.empty-state { padding: 2rem 1rem; color: var(--muted); text-align: center; border: 1px dashed #c5d0d7; border-radius: 12px; }
.empty-state h2, .empty-state h3 { color: var(--ink); }

.badge { display: inline-flex; align-items: center; min-height: 25px; padding: .22rem .55rem; color: var(--brand-primary); background: color-mix(in srgb, var(--brand-secondary) 11%, white); border-radius: 999px; font-size: .71rem; font-weight: 800; }
.badge-live { color: #8b2626; background: #fde8e8; }
.badge-success { color: #0d6e55; background: #e5f5ef; }
.badge-error { color: #8b2626; background: #fde8e8; }
.success-text { color: var(--success); font-weight: 750; }
.plain-list { margin: 0; padding-left: 1.2rem; color: var(--muted); }
.plain-list li + li { margin-top: .6rem; }
.import-summary { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.import-summary span { padding: .5rem .7rem; color: var(--muted); background: #f5f8fa; border: 1px solid var(--line); border-radius: 9px; font-size: .78rem; }
.import-summary strong { margin-right: .2rem; color: var(--ink); }
.row-error { background: #fff7f7; }
.table-note { display: block; margin-top: .2rem; color: var(--muted); }
.cell-errors { margin: 0; padding-left: 1rem; color: var(--danger); font-size: .78rem; }
.confirm-import-form { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.confirm-import-form p { margin-bottom: 0; color: var(--muted); font-size: .85rem; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .8rem 1.3rem; }
.detail-list dt { color: var(--muted); font-size: .75rem; }
.detail-list dd { margin: .1rem 0 0; font-weight: 700; overflow-wrap: anywhere; }

.score-compact { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .7rem; }
.score-compact .team-away { text-align: right; }
.score-number { font-size: 1.3rem; font-weight: 900; letter-spacing: .08em; }
.scoreboard { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: stretch; gap: 1rem; }
.score-team { display: grid; align-content: center; min-height: 260px; padding: 1.4rem; color: white; background: var(--brand-primary); border-radius: var(--radius-lg); text-align: center; }
.score-team.away { background: var(--brand-secondary); }
.score-team h2 { margin-bottom: .4rem; font-size: clamp(1.3rem, 3vw, 2rem); }
.score-team .points { font-size: clamp(4.7rem, 11vw, 8rem); line-height: .9; font-weight: 900; letter-spacing: -.07em; }
.score-center { min-width: 126px; display: grid; place-items: center; align-content: center; padding: 1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); text-align: center; }
.set-tally { font-size: 2.2rem; font-weight: 900; }
.score-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.score-control { display: grid; grid-template-columns: 1fr auto; gap: .55rem; }
.score-control .point-button { min-height: 60px; font-size: 1.25rem; }
.score-control .correction-button { width: 54px; }

.progress-chart { max-width: 100%; min-height: 220px; display: flex; align-items: end; gap: .55rem; overflow-x: auto; padding: 1.4rem .7rem .4rem; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.chart-column { flex: 1 0 44px; min-width: 44px; display: grid; align-items: end; justify-items: center; gap: .35rem; height: 175px; }
.chart-bar { width: min(42px, 80%); min-height: 2px; background: linear-gradient(180deg, var(--brand-accent), var(--brand-secondary)); border-radius: 7px 7px 2px 2px; }
.chart-column small { font-size: .62rem; color: var(--muted); white-space: nowrap; }

.radar-chart { width: 100%; max-width: 560px; height: auto; aspect-ratio: 1; min-height: 0; display: block; margin: 0 auto; overflow: visible; }
.radar-grid polygon, .radar-grid line { fill: none; stroke: #d6e0e7; stroke-width: .8; }
.radar-grid text { fill: var(--muted); font-size: 8px; text-anchor: middle; dominant-baseline: middle; }
.radar-current { fill: color-mix(in srgb, var(--brand-secondary) 28%, transparent); stroke: var(--brand-primary); stroke-width: 2.2; }
.radar-previous { fill: color-mix(in srgb, var(--brand-accent) 15%, transparent); stroke: var(--brand-accent); stroke-width: 1.8; stroke-dasharray: 4 3; }
.chart-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 1rem; color: var(--muted); font-size: .8rem; }
.chart-legend i { width: 18px; height: 4px; display: inline-block; margin-right: .4rem; vertical-align: middle; border-radius: 3px; }
.legend-current { background: var(--brand-primary); }
.legend-previous { background: var(--brand-accent); }
.compact-filter { display: flex; align-items: end; flex-wrap: wrap; gap: .8rem; padding: 1rem; }
.compact-filter .form-grid { flex: 1; }
.metric-editor { margin: 1rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; }
.metric-editor legend { padding: 0 .4rem; color: var(--brand-primary); font-weight: 800; }
.unread-row { border-left: 5px solid var(--brand-accent); background: #fffaf2; }
.bracket-grid { display: flex; gap: 1rem; overflow-x: auto; align-items: stretch; padding-bottom: .5rem; }
.bracket-round { min-width: 210px; display: grid; align-content: center; gap: .7rem; padding: .8rem; background: #f7fafc; border-radius: 12px; }
.bracket-round h3 { margin: 0; font-size: .9rem; }
.bracket-slot { padding: .7rem; background: white; border: 1px solid var(--line); border-radius: 8px; font-weight: 700; }
.help-text { color: var(--muted); font-size: .8rem; }

.login-page { color: #eef6fa; background: var(--brand-primary); }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); }
.login-intro { display: flex; flex-direction: column; justify-content: space-between; padding: clamp(2rem, 7vw, 6rem); background: radial-gradient(circle at 18% 76%, rgba(242,140,40,.26), transparent 25%), linear-gradient(145deg, #123b5d, #0a273b); }
.login-intro h1 { max-width: 720px; font-size: clamp(2.5rem, 6vw, 5rem); }
.login-intro p:not(.eyebrow) { max-width: 630px; color: rgba(255,255,255,.7); font-size: 1.05rem; }
.brand-light { color: white; }
.login-security { font-size: .8rem !important; }
.login-card { display: grid; align-content: center; gap: 1.5rem; padding: clamp(2rem, 6vw, 6rem); color: var(--ink); background: #fff; }
.login-card h2 { margin-bottom: .35rem; font-size: 2rem; }
.stack-form { display: grid; gap: 1rem; max-width: 480px; }
.signup-prompt { max-width: 480px; padding-top: 1.3rem; border-top: 1px solid var(--line); }
.signup-prompt p { margin-bottom: .7rem; font-weight: 650; }
.signup-prompt small { display: block; margin-top: .65rem; color: var(--muted); }

.athlete-heading { min-width: 0; align-items: center; display: flex; gap: 1rem; }
.athlete-heading > div { min-width: 0; }
.athlete-photo { border: 3px solid var(--brand-primary); border-radius: 50%; height: 88px; object-fit: cover; width: 88px; }

@media (max-width: 1000px) {
  .app-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .sidebar { padding: 1.1rem; }
  .section-grid > * { grid-column: span 12; }
  .scoreboard { gap: .6rem; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; max-height: none; padding: 1rem; }
  .nav-ready .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 200; width: min(320px, calc(100vw - 2.5rem)); height: 100vh; height: 100dvh; box-shadow: var(--shadow); }
  .mobile-nav-open { overflow: hidden; }
  .main-nav { grid-template-columns: minmax(0, 1fr); }
  .main-nav a { min-height: 44px; padding: .7rem .85rem; }
  .topbar { min-height: 64px; flex-wrap: wrap; align-items: center; gap: .7rem; }
  .topbar .eyebrow { display: none; }
  .academy-switcher { width: 100%; display: grid; gap: .25rem; }
  .academy-switcher select { min-width: 0; max-width: 100%; }
  .content { padding: 1rem; }
  .page-header { display: flex; flex-direction: column; align-items: stretch; }
  .header-actions { align-self: flex-start; }
  .tools-panel { left: 0; right: auto; max-width: calc(100vw - 2rem); }
  .panel-header [data-tools] .tools-panel { left: auto; right: 0; }
  .page-header > .action-menu > .action-menu-items { left: 0; right: auto; }
  .event-standing-rows { grid-template-columns: minmax(0, 1fr); }
  .event-standing-row dl div { display: block; }
  .event-catalog-links { display: grid; grid-template-columns: minmax(0, 1fr); }
  .filter-form { grid-template-columns: minmax(0, 1fr); }
  .metric-grid, .detail-list { grid-template-columns: minmax(0, 1fr); }
  .metric-card { min-height: 110px; }
  .metric-card:last-child { grid-column: auto; }
  .section-grid > * { grid-column: span 12 !important; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .compact-filter { align-items: stretch; flex-direction: column; }
  .compact-filter .form-grid { width: 100%; }
  .confirm-import-form { align-items: stretch; flex-direction: column; }
  .field-check { padding-top: 0; }
  .scoreboard { grid-template-columns: minmax(0, 1fr); }
  .score-center { grid-column: auto; grid-row: 1; min-width: 0; min-height: auto; display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; }
  .score-team { min-height: 160px; }
  .score-team .points { font-size: 4.8rem; }
  .score-controls { grid-template-columns: minmax(0, 1fr); }
  .score-compact { grid-template-columns: minmax(0, 1fr); }
  .score-compact .team-away { text-align: left; }
  .list-row { flex-wrap: wrap; align-items: flex-start; }
  .athlete-heading { align-items: flex-start; }
  .athlete-photo { flex: none; width: 64px; height: 64px; }
  .chart-legend { justify-content: flex-start; gap: .5rem 1rem; }
  .mobile-cards { display: block; }
  .mobile-cards thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .mobile-cards tbody { display: grid; gap: .8rem; }
  .mobile-cards tbody tr { display: block; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 11px; }
  .mobile-cards td { display: block; width: 100%; padding: .5rem 0; border: 0; overflow-wrap: anywhere; }
  .mobile-cards td + td { border-top: 1px solid #edf1f4; }
  .mobile-cards .mobile-cell-label { display: block; margin-bottom: .2rem; color: var(--muted); font-size: .73rem; font-weight: 650; }
  .mobile-cards input, .mobile-cards select { max-width: 100%; }
  .login-shell { display: block; }
  .login-intro { min-height: 38vh; padding: 1.7rem; gap: 2.5rem; }
  .login-intro h1 { font-size: 2.3rem; }
  .login-security { display: none; }
  .login-card { min-height: 62vh; padding: 1.7rem; }
}

@media (max-width: 480px) {
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card:last-child { grid-column: auto; }
  .header-actions { gap: .45rem; }
  .header-actions > .button { padding-inline: .75rem; }
  .score-team { min-height: 160px; padding: .8rem; }
  .score-team .points { font-size: 4.5rem; }
  .score-controls { gap: .5rem; }
  .detail-list { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media print {
  .sidebar, .nav-backdrop, .topbar, .header-actions, .score-controls, .button, .tools-dropdown, .action-menu { display: none !important; }
  .app-shell { display: block; }
  body, .panel { background: white; box-shadow: none; }
}
/* Guided assessments: compact instructions, single-column capture on phones. */
.assessment-intro { margin-bottom: 1rem; }
.assessment-intro h2 { margin-top: 0; }
.assessment-help { margin: .8rem 0; padding: .8rem; border: 1px solid #d5e1eb; border-radius: .6rem; }
.assessment-help summary { cursor: pointer; font-weight: 650; min-height: 1.5rem; }
.assessment-help p, .assessment-intro p { overflow-wrap: anywhere; }
.assessment-help h3 { font-size: 1rem; }
.assessment-preview { padding: .7rem; background: #eef5f8; border-radius: .5rem; }
.assessment-omit { margin-top: 1rem; display: grid; gap: .8rem; }
.assessment-omit input[type=checkbox] { width: 1.25rem; height: 1.25rem; }
#assessment-form textarea { min-height: 5rem; }
#assessment-protocol-switch { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
#assessment-protocol-switch select { flex: 1 1 18rem; min-width: 0; max-width: 100%; }
@media (max-width: 700px) {
  #assessment-form .form-grid { grid-template-columns: minmax(0, 1fr); }
  #assessment-form .span-2 { grid-column: auto; }
  .assessment-row { align-items: flex-start; flex-direction: column; gap: .6rem; }
  #assessment-protocol-switch { flex-direction: column; align-items: stretch; }
  #assessment-protocol-switch select { flex: initial; }
}
:root .activation-notice { padding: 1rem; line-height: 1.5; }
.help-guides { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.help-guide { margin: 0; min-width: 0; }
.help-guide summary { padding: 1.25rem; cursor: pointer; font-weight: 700; min-height: 44px; }
.help-guide summary:focus-visible { outline: 3px solid #147ca2; outline-offset: -3px; }
.help-guide-body, .help-search { padding: 1.5rem; overflow-wrap: anywhere; }
.help-guide-body h2 { font-size: 1.2rem; }
.help-guide-body h3 { font-size: 1.05rem; }
.help-guide-body p, .help-guide-body li { line-height: 1.7; }
.help-guide-body li { margin-bottom: .65rem; }
.help-guide-body .model-form, .help-search .model-form { display: block; max-width: 100%; }
.help-guide-body .model-form p, .help-search .model-form p { margin: 1rem 0; }
.help-guide-body input[type=file] { width: 100%; max-width: 100%; }
.help-guide-body label, .help-search label { display: block; margin-bottom: .4rem; }
.wrap-code { overflow-wrap: anywhere; white-space: normal; }
.recovery-page .panel { padding: 1.5rem; margin-bottom: 1rem; }
.recovery-page .model-form { display: block; }
.recovery-page .model-form p { margin: 1rem 0; }
.recovery-page label { display: block; margin-bottom: .4rem; }
.recovery-page input[type=file] { max-width: 100%; width: 100%; }
.recovery-page .break-anywhere { overflow-wrap: anywhere; }
.recovery-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }
@media (max-width: 600px) { .recovery-actions { flex-direction: column; } .recovery-actions .button { width: 100%; } }
.recovery-result { max-width: 50rem; padding: 2rem; margin: 3rem auto; }
.recovery-result .panel { padding: 2rem; overflow-wrap: anywhere; }
.data-selection { display: grid; gap: .5rem; }
.rotation-panel { margin: 1rem 0; overflow-wrap: anywhere; }
.rotation-teams { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.rotation-positions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; list-style: none; padding: 0; }
.rotation-positions li { border: 1px solid var(--line); border-radius: .5rem; padding: .75rem; display: grid; gap: .3rem; }
.rotation-positions strong { font-size: 1.4rem; }
.rotation-server { background: #e4f5ef; border: 2px solid #167254 !important; color: #124a39; }
@media (max-width: 760px) { .rotation-teams { grid-template-columns: 1fr; } }
.data-choice { display: flex; align-items: flex-start; gap: .75rem; padding: .75rem; border: 1px solid var(--border, #d5deea); border-radius: .5rem; overflow-wrap: anywhere; }
.data-choice input[type=checkbox] { width: 1.2rem; height: 1.2rem; flex: 0 0 auto; }
.data-choice small { display: block; }
.support-nav { display: grid; gap: .2rem; flex-shrink: 0; }
.support-nav a { padding: .6rem .85rem; color: rgba(255,255,255,.86); border-radius: 10px; font-size: .92rem; font-weight: 650; text-decoration: none; min-height: 44px; }
.support-nav a:hover, .support-nav a:focus-visible, .support-nav a[aria-current=page] { color: white; background: rgba(255,255,255,.11); }
@media (max-width: 700px) {
  .help-guide-body, .help-search { padding: 1rem; }
  .help-guide-body .form-actions { display: flex; flex-direction: column; align-items: stretch; }
  .help-guide-body .button { white-space: normal; text-align: center; }
}
