:root {
  color-scheme: dark;
  --bg: #09100f;
  --bg-soft: #0d1614;
  --panel: #111c19;
  --panel-2: #17241f;
  --line: #263832;
  --text: #f4f7f3;
  --muted: #9bac9f;
  --lime: #c9f551;
  --lime-dark: #17220b;
  --orange: #ff6d3a;
  --red: #ff5c62;
  --amber: #ffbf47;
  --green: #5edf89;
  --cyan: #53e6ff;
  --radius: 18px;
  --shadow: 0 22px 55px rgba(0, 0, 0, .2);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 88% 3%, rgba(201,245,81,.08), transparent 26rem),
    radial-gradient(circle at 5% 38%, rgba(255,109,58,.05), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}
body::before { content: ""; position: fixed; z-index: -1; width: 36rem; height: 36rem; right: -18rem; top: 18%; border-radius: 50%; background: rgba(83,230,255,.055); filter: blur(24px); animation: drift 10s ease-in-out infinite alternate; pointer-events: none; }
@keyframes drift { to { transform: translate(-7rem, 5rem) scale(1.15); } }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.hero {
  max-width: 1240px;
  margin: 0 auto;
  padding: 34px 28px 26px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}
.hero h1 { display: inline-block; margin: 2px 0 -.08em; padding-bottom: .12em; font-size: clamp(2rem, 5vw, 4.2rem); letter-spacing: -.055em; line-height: 1.08; background: linear-gradient(92deg, #fff 10%, var(--lime) 58%, var(--cyan)); background-clip: text; -webkit-background-clip: text; color: transparent; }
.hero-copy { color: var(--muted); margin: 14px 0 0; font-size: 1.05rem; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 17px; }
.hero-tags span { padding: 4px 9px; border: 1px solid #334840; border-radius: 999px; color: #bed0c4; font-size: .65rem; font-weight: 900; letter-spacing: .12em; }
.eyebrow { color: var(--lime); font-weight: 800; font-size: .72rem; letter-spacing: .16em; margin: 0 0 7px; }
.race-clock { flex: 0 0 auto; width: 150px; aspect-ratio: 1; border: 1px solid #3a4c44; border-radius: 50%; display: grid; place-content: center; text-align: center; box-shadow: inset 0 0 0 8px rgba(201,245,81,.04); }
.race-clock span { display: block; font-size: 3rem; line-height: 1; font-weight: 850; color: var(--lime); }
.race-clock small { color: var(--muted); margin-top: 7px; }

.nav { position: sticky; top: 0; z-index: 20; display: flex; gap: 5px; max-width: 1190px; margin: 0 auto; padding: 8px; overflow-x: auto; background: rgba(13,22,20,.94); backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.nav-button { border: 0; border-radius: 10px; color: var(--muted); background: transparent; padding: 11px 15px; cursor: pointer; white-space: nowrap; font-weight: 700; }
.nav-button:hover, .nav-button:focus-visible { color: var(--text); background: var(--panel-2); }
.nav-button.active { color: #10170b; background: var(--lime); }
.athlete-filter-bar { max-width: 1190px; margin: 12px auto 0; padding: 0 8px; display: flex; align-items: center; gap: 14px; }
.athlete-filter-bar label { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.athlete-filter-bar select { width: auto; min-width: 150px; padding: 8px 34px 8px 10px; }
.athlete-filter-bar > span { font-size: .8rem; }

main { max-width: 1240px; margin: 0 auto; padding: 36px 28px 70px; }
.page { display: none; animation: rise .28s ease-out; }
.page.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(7px); } }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; }
h2 { font-size: clamp(1.65rem, 3vw, 2.5rem); margin: 0; letter-spacing: -.035em; }
h3 { margin: 0 0 8px; font-size: 1.15rem; }
.muted { color: var(--muted); }
.section-heading .muted { margin: 6px 0 0; }

.card { background: linear-gradient(145deg, rgba(20,33,29,.97), rgba(14,24,21,.98)); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); transition: border-color .2s ease, transform .2s ease; }
.card:hover { border-color: #3b554b; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-card { min-height: 175px; display: flex; flex-direction: column; justify-content: flex-end; }
.stat-card strong { font-size: clamp(2.15rem, 4vw, 3.4rem); line-height: 1; margin: 20px 0 5px; letter-spacing: -.04em; }
.stat-card > span:last-child { color: var(--muted); font-size: .86rem; }
.stat-label { color: var(--muted); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.accent-card { background: var(--lime); color: #11170d; border-color: var(--lime); }
.accent-card .stat-label, .accent-card > span:last-child { color: #4f6125; }
.readiness-green { border-color: rgba(94,223,137,.65); }
.readiness-green strong { color: var(--green); }
.readiness-amber { border-color: rgba(255,191,71,.65); }
.readiness-amber strong { color: var(--amber); }
.readiness-red { border-color: rgba(255,92,98,.65); }
.readiness-red strong { color: var(--red); }

.momentum-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 30px; margin-bottom: 16px; overflow: hidden; position: relative; }
.momentum-card::after { content: ""; position: absolute; width: 170px; height: 170px; right: -70px; top: -95px; border-radius: 50%; background: rgba(201,245,81,.1); filter: blur(4px); }
.momentum-copy { min-width: 0; }
.momentum-copy h3 { margin-bottom: 12px; }
.momentum-track { height: 12px; overflow: hidden; border-radius: 999px; background: #07100c; border: 1px solid #24372f; }
.momentum-track span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--orange), var(--lime), var(--cyan)); box-shadow: 0 0 18px rgba(201,245,81,.45); transition: width .65s cubic-bezier(.2,.8,.2,1); }
.momentum-metrics { display: grid; grid-template-columns: repeat(3, minmax(90px, 1fr)); position: relative; z-index: 1; }
.momentum-metrics div { padding: 5px 18px; border-left: 1px solid var(--line); }
.momentum-metrics strong { display: block; font-size: 1.55rem; color: var(--lime); }
.momentum-metrics span { display: block; color: var(--muted); font-size: .72rem; }
.achievement-card { margin-bottom: 16px; }
.compact-heading { align-items: center; margin-bottom: 14px; }
.achievement-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.badge { padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: #0b1412; display: grid; gap: 4px; min-height: 92px; align-content: center; }
.badge-icon { font-size: 1.35rem; filter: grayscale(1); opacity: .45; }
.badge strong { font-size: .8rem; }
.badge span:last-child { color: var(--muted); font-size: .68rem; }
.badge.unlocked { border-color: rgba(201,245,81,.48); background: linear-gradient(145deg, rgba(201,245,81,.1), #0b1412); }
.badge.unlocked .badge-icon { filter: none; opacity: 1; }
.badge.unlocked strong { color: var(--lime); }

.two-column { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; margin-bottom: 16px; }
.card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 20px; }
.text-button { appearance: none; border: 0; color: var(--lime); background: none; cursor: pointer; padding: 2px 0; text-decoration: none; font-weight: 750; }
.next-workout { border-left: 3px solid var(--lime); padding-left: 18px; }
.workout-date { color: var(--muted); font-size: .86rem; }
.workout-type { display: inline-flex; background: var(--lime-dark); color: var(--lime); border: 1px solid #32461a; border-radius: 999px; padding: 3px 9px; font-size: .72rem; font-weight: 800; margin-bottom: 8px; }
.session-summary { display: grid; gap: 8px; }
.session-summary strong { font-size: 1.4rem; }
.session-details { color: var(--muted); }
.baseline-card { display: grid; grid-template-columns: minmax(220px, .8fr) 1.2fr; align-items: center; gap: 30px; }
.metric-row { margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.metric-row div { border-left: 1px solid var(--line); padding-left: 14px; }
.metric-row dt { color: var(--muted); font-size: .73rem; text-transform: uppercase; letter-spacing: .08em; }
.metric-row dd { margin: 5px 0 0; font-weight: 800; font-size: 1.05rem; }

.button { display: inline-flex; align-items: center; justify-content: center; border-radius: 11px; border: 1px solid transparent; padding: 10px 15px; cursor: pointer; font-weight: 800; text-decoration: none; transition: transform .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--lime); color: #11170d; }
.button.secondary { background: var(--panel-2); color: var(--text); border-color: var(--line); }
.button.danger { background: var(--red); color: #240407; }
.button.wide { width: 100%; }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button-group, .form-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.plan-list { display: grid; gap: 12px; }
.week-card { padding: 0; overflow: hidden; }
.week-button { width: 100%; border: 0; color: inherit; background: transparent; text-align: left; padding: 20px 22px; display: grid; grid-template-columns: 76px 1fr auto; gap: 18px; align-items: center; cursor: pointer; }
.week-number { color: var(--lime); font-size: .76rem; font-weight: 900; letter-spacing: .11em; }
.week-title strong { display: block; font-size: 1.12rem; }
.week-title span { color: var(--muted); font-size: .86rem; }
.week-toggle { color: var(--muted); font-size: 1.3rem; }
.week-sessions { border-top: 1px solid var(--line); padding: 8px 22px 16px 116px; }
.plan-row { display: grid; grid-template-columns: 110px 105px 1fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid rgba(38,56,50,.7); }
.plan-row:last-child { border-bottom: 0; }
.plan-row time, .plan-kind { color: var(--muted); font-size: .84rem; }
.plan-kind { color: var(--lime); font-weight: 750; }
.plan-workout { min-width: 0; }
.plan-workout > p { margin: 0; }
.plan-video-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.exercise-video-button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #3a5147; border-radius: 999px; padding: 5px 9px; color: #dbe8df; background: #0b1512; cursor: pointer; font-size: .7rem; font-weight: 800; transition: color .15s ease, border-color .15s ease, transform .15s ease; }
.exercise-video-button:hover, .exercise-video-button:focus-visible { color: var(--lime); border-color: var(--lime); transform: translateY(-1px); }
.exercise-video-button > span { color: var(--orange); font-size: .62rem; }
.station-video-button > span { color: var(--cyan); font-size: .8rem; }

.library-heading { align-items: flex-end; }
.video-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.video-card { padding: 0; overflow: hidden; }
.video-card:hover { transform: translateY(-3px); border-color: rgba(201,245,81,.55); }
.video-frame { aspect-ratio: 16 / 9; background: #050908; }
.video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-copy { display: grid; grid-template-columns: auto 1fr; gap: 13px; padding: 17px; align-items: start; }
.video-copy h3 { margin-bottom: 4px; }
.video-copy p { margin: 0; color: var(--muted); font-size: .82rem; }
.station-number { color: #0a110d; background: var(--lime); border-radius: 9px; padding: 5px 7px; font-size: .7rem; font-weight: 950; }
.station-library { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.station-tile { min-height: 145px; display: flex; flex-direction: column; justify-content: flex-end; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(155deg, #14231e, #0b1311); position: relative; overflow: hidden; }
.station-tile::before { content: ""; position: absolute; width: 75px; height: 75px; right: -26px; top: -24px; border: 1px solid rgba(83,230,255,.25); border-radius: 50%; }
.station-tile > span { color: var(--cyan); font-size: .7rem; font-weight: 900; letter-spacing: .12em; margin-bottom: 14px; }
.station-tile strong { font-size: 1rem; }
.station-tile p { margin: 4px 0 0; color: var(--muted); font-size: .75rem; }
.library-note { color: var(--muted); font-size: .8rem; text-align: center; margin: 18px 0 0; }
.movement-library-card { margin-top: 20px; }
.movement-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.movement-tile { min-width: 0; display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; padding: 11px; text-align: left; color: var(--text); background: #0b1412; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.movement-tile:hover, .movement-tile:focus-visible { border-color: var(--lime); background: rgba(201,245,81,.05); }
.movement-play { width: 34px; height: 34px; display: grid; place-content: center; border-radius: 50%; color: #10170c; background: var(--lime); font-size: .72rem; padding-left: 2px; }
.movement-tile small, .movement-tile strong { display: block; }
.movement-tile small { color: var(--muted); font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; }
.movement-tile strong { margin-top: 2px; font-size: .8rem; }

.form-card { max-width: 980px; }
fieldset { border: 0; padding: 0; margin: 0 0 26px; }
legend { width: 100%; border-bottom: 1px solid var(--line); padding: 0 0 10px; margin-bottom: 16px; font-size: 1.05rem; font-weight: 850; }
.form-grid { display: grid; gap: 14px; margin-bottom: 24px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 7px; color: #dce5dd; font-size: .84rem; font-weight: 700; }
input, select, textarea { width: 100%; color: var(--text); background: #0b1412; border: 1px solid #31443d; border-radius: 10px; padding: 11px 12px; outline: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(201,245,81,.11); }
textarea { resize: vertical; }
.station-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-top: 14px; }
.station-grid label { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #0b1412; }
.station-grid input { width: auto; accent-color: var(--lime); }
.form-error { color: #ff8d91; min-height: 1.3em; font-size: .86rem; }

.team-layout, .challenge-layout { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: 16px; align-items: start; }
.compact-form { display: grid; gap: 14px; position: sticky; top: 82px; }
.compact-form h3 { margin-bottom: 2px; }
.compact-form .form-error { margin: 0; }
.form-grid.tight { margin: 0; }
.athlete-grid, .challenge-list { display: grid; gap: 14px; }
.athlete-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.athlete-card { display: grid; gap: 18px; }
.athlete-card p { margin: 0; }
.athlete-card-heading { display: flex; align-items: center; gap: 13px; }
.athlete-card-heading h3 { margin: 0; }
.athlete-card-heading .muted { font-size: .78rem; }
.athlete-avatar { width: 46px; height: 46px; border-radius: 14px; color: #08100d; display: grid; place-content: center; font-weight: 950; font-size: 1.2rem; }
.athlete-label { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-weight: 750; }
.athlete-label i { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.mini-metrics { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini-metrics div { background: #0b1412; border: 1px solid var(--line); border-radius: 11px; padding: 12px; }
.mini-metrics dt { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.mini-metrics dd { margin: 3px 0 0; font-weight: 850; }
input[type="color"] { height: 44px; padding: 5px; cursor: pointer; }
.challenge-card { display: grid; gap: 16px; }
.challenge-heading, .result-line { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.challenge-heading h3 { margin: 0; }
.challenge-target { color: var(--lime); white-space: nowrap; }
.challenge-results { display: grid; gap: 10px; }
.challenge-result { display: grid; gap: 7px; padding: 12px; background: #0b1412; border: 1px solid var(--line); border-radius: 11px; }
.challenge-result small { color: var(--muted); }
.challenge-track { height: 7px; background: #1b2a25; border-radius: 999px; overflow: hidden; }
.challenge-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), var(--lime)); border-radius: inherit; }
.challenge-entry-form { border-top: 1px solid var(--line); padding-top: 16px; }
.challenge-entry-form .form-error { margin: 8px 0; }
.challenge-templates { display: flex; flex-wrap: wrap; gap: 7px; }
.template-chip { border: 1px solid #395146; border-radius: 999px; background: #0b1412; color: #dce5dd; padding: 6px 9px; font-size: .72rem; font-weight: 750; cursor: pointer; }
.template-chip:hover, .template-chip:focus-visible { border-color: var(--lime); color: var(--lime); }

.import-card { max-width: 720px; display: grid; gap: 18px; }
.file-drop { min-height: 245px; border: 1px dashed #52655c; border-radius: 14px; display: grid; place-content: center; justify-items: center; gap: 7px; text-align: center; cursor: pointer; background: rgba(201,245,81,.025); }
.file-drop:hover { border-color: var(--lime); background: rgba(201,245,81,.05); }
.upload-icon { display: grid; place-content: center; width: 52px; height: 52px; border-radius: 50%; background: var(--lime); color: #13190e; font-size: 1.8rem; font-weight: 900; margin-bottom: 6px; }
.import-result { min-height: 1.5em; }
.import-result.success { color: var(--green); }
.import-result.error { color: #ff8d91; }
.info-card { max-width: 720px; margin-top: 16px; }

.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chart-card { min-height: 300px; }
.bar-chart { min-height: 210px; display: flex; align-items: flex-end; gap: 12px; padding-top: 20px; overflow-x: auto; }
.bar-item { min-width: 48px; flex: 1; display: grid; grid-template-rows: 26px 150px 25px; justify-items: center; align-items: end; }
.bar-value { font-size: .75rem; color: var(--muted); }
.bar-track { width: 100%; height: 150px; background: #0a1310; border-radius: 8px 8px 4px 4px; display: flex; align-items: flex-end; overflow: hidden; }
.bar-fill { width: 100%; min-height: 3px; background: linear-gradient(var(--lime), #6e8f25); border-radius: 7px 7px 0 0; }
.bar-label { color: var(--muted); font-size: .72rem; }
.trend-list { display: grid; gap: 10px; margin-top: 24px; }
.trend-row { display: grid; grid-template-columns: 90px 1fr 80px; gap: 12px; align-items: center; font-size: .82rem; }
.trend-track { height: 8px; background: #0a1310; border-radius: 999px; overflow: hidden; }
.trend-fill { height: 100%; border-radius: 999px; background: var(--orange); }
.trend-value { text-align: right; color: var(--muted); }
.recovery-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 24px; }
.recovery-box { background: #0b1412; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.recovery-box strong { display: block; font-size: 1.55rem; }
.recovery-box span { color: var(--muted); font-size: .76rem; }

.table-card { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 1020px; }
th, td { padding: 15px 17px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; }
td { font-size: .86rem; }
tbody tr:hover { background: rgba(201,245,81,.025); }
.type-pill { display: inline-flex; border-radius: 999px; padding: 4px 9px; background: var(--lime-dark); color: var(--lime); text-transform: capitalize; font-size: .75rem; font-weight: 800; }
.table-actions { display: flex; gap: 7px; }
.icon-button { border: 1px solid var(--line); background: var(--panel-2); color: var(--text); border-radius: 8px; padding: 6px 9px; cursor: pointer; }
.icon-button.delete { color: #ff989c; }
.empty-state { padding: 30px; text-align: center; color: var(--muted); }

footer { max-width: 1190px; margin: 0 auto 30px; padding: 20px 4px; color: var(--muted); display: flex; justify-content: space-between; border-top: 1px solid var(--line); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); padding: 12px 16px; background: var(--text); color: #0d1512; border-radius: 10px; font-weight: 750; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .2s ease; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(430px, 100%); padding: 36px; border-radius: 22px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; gap: 14px; }
.login-card h1 { margin: 0; font-size: 2rem; letter-spacing: -.04em; }
.login-card p { margin: 0; }
.brand-mark { width: 54px; height: 54px; display: grid; place-content: center; border-radius: 15px; background: var(--lime); color: #10170c; font-size: 1.6rem; font-weight: 950; margin-bottom: 6px; }
dialog { color: var(--text); background: transparent; border: 0; padding: 0; }
dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(4px); }
.dialog-card { width: min(480px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 26px; box-shadow: var(--shadow); }
.dialog-card .form-actions { justify-content: flex-end; margin-top: 24px; }
.video-dialog { width: 100%; max-width: none; }
.video-dialog-card { width: min(860px, calc(100vw - 32px)); margin: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 20px; box-shadow: var(--shadow); }
.video-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 15px; }
.dialog-close { width: 42px; height: 42px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 50%; color: var(--text); background: var(--panel-2); cursor: pointer; font-size: 1.55rem; line-height: 1; }
.dialog-close:hover, .dialog-close:focus-visible { color: var(--lime); border-color: var(--lime); }
.modal-video-frame { overflow: hidden; border-radius: 14px; border: 1px solid var(--line); }
.video-dialog-footer { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 15px; }
.video-dialog-footer p { margin: 0; max-width: 620px; }
.video-dialog-footer a { flex: 0 0 auto; }

@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .two-column, .baseline-card { grid-template-columns: 1fr; }
  .metric-row { grid-template-columns: repeat(3, 1fr); }
  .chart-grid { grid-template-columns: 1fr; }
  .station-grid { grid-template-columns: repeat(2, 1fr); }
  .team-layout, .challenge-layout { grid-template-columns: 1fr; }
  .compact-form { position: static; }
  .momentum-card { grid-template-columns: 1fr; }
  .momentum-metrics div:first-child { border-left: 0; padding-left: 0; }
  .achievement-grid { grid-template-columns: repeat(3, 1fr); }
  .video-grid { grid-template-columns: 1fr; }
  .station-library { grid-template-columns: repeat(2, 1fr); }
  .movement-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .hero { align-items: center; padding: 25px 18px 20px; }
  .race-clock { width: 92px; }
  .race-clock span { font-size: 2rem; }
  .race-clock small { font-size: .65rem; }
  .nav { margin: 0 12px; }
  .athlete-filter-bar { margin: 10px 12px 0; flex-wrap: wrap; }
  .athlete-filter-bar > span { display: none; }
  main { padding: 28px 16px 55px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { min-height: 145px; padding: 17px; }
  .form-grid.three, .form-grid.two { grid-template-columns: 1fr; }
  .week-button { grid-template-columns: 58px 1fr auto; padding: 16px; gap: 10px; }
  .week-sessions { padding: 5px 16px 14px; }
  .plan-row { grid-template-columns: 90px 1fr; }
  .plan-workout { grid-column: 1 / -1; margin: 0 0 5px; }
  .metric-row { grid-template-columns: repeat(2, 1fr); }
  .station-grid { grid-template-columns: 1fr 1fr; }
  .recovery-stats { grid-template-columns: 1fr; }
  .athlete-grid { grid-template-columns: 1fr; }
  .challenge-heading, .result-line { align-items: flex-start; }
  .achievement-grid { grid-template-columns: 1fr 1fr; }
  .momentum-metrics { grid-template-columns: repeat(3, 1fr); }
  .momentum-metrics div { padding: 4px 9px; }
  .momentum-metrics strong { font-size: 1.25rem; }
  .movement-grid { grid-template-columns: 1fr; }
  .video-dialog-card { padding: 14px; }
  .video-dialog-footer { align-items: flex-start; flex-direction: column; }
}
