@font-face {
  font-family: Barlow;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/Barlow-400.woff2') format('woff2');
}
@font-face {
  font-family: Barlow;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./fonts/Barlow-500.woff2') format('woff2');
}
@font-face {
  font-family: Barlow;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('./fonts/Barlow-600.woff2') format('woff2');
}
@font-face {
  font-family: Barlow;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./fonts/Barlow-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./fonts/BarlowCondensed-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('./fonts/BarlowCondensed-800.woff2') format('woff2');
}

:root {
  color-scheme: dark;
  --canvas: #121313;
  --raised: #1b1d1d;
  --field: #242727;
  --ink: #f1f0e8;
  --muted: #b8bbb7;
  --line: #444947;
  --line-soft: #303433;
  --gold: #c57e27;
  --forest: #1e3527;
  --oxblood: #5f150e;
  --sienna: #944016;
  --navy: #162235;
  --aubergine: #3c1c29;
  font-family: Barlow, sans-serif;
  font-size: 16px;
  font-synthesis: none;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body { margin: 0; background: var(--canvas); }
button, select, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: var(--ink); text-decoration-color: var(--gold); text-underline-offset: .2em; }
button, a, select, summary, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link { position: fixed; z-index: 100; top: -80px; left: 12px; padding: 12px 16px; background: var(--ink); color: var(--canvas); }
.skip-link:focus { top: 12px; }

.site-header { border-bottom: 1px solid var(--line-soft); }
.site-header__inner {
  width: min(100%, 1160px); min-height: 66px; margin: auto;
  padding: 10px max(20px, env(safe-area-inset-right)) 10px max(20px, env(safe-area-inset-left));
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { min-width: 0; display: flex; align-items: center; gap: 14px; }
.brand__mark { flex: none; display: block; width: 46px; height: 46px; object-fit: contain; }
.brand__name { font-family: 'Barlow Condensed', sans-serif; font-size: 1.15rem; line-height: 1; font-weight: 700; white-space: nowrap; }
.brand__name small { display: block; margin-top: 4px; color: var(--muted); font-family: Barlow, sans-serif; font-size: .69rem; font-weight: 600; letter-spacing: .035em; text-transform: uppercase; }
.header-date { flex: none; color: var(--muted); font-family: 'Barlow Condensed', sans-serif; font-size: 1rem; font-weight: 700; white-space: nowrap; }

.primary-nav {
  position: fixed; z-index: 20; bottom: 0; left: 0; right: 0;
  padding: 0 max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-left));
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #181a1a; border-top: 1px solid var(--line);
}
.primary-nav a {
  position: relative; min-height: 60px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px;
  color: var(--muted); text-decoration: none; text-transform: uppercase;
  font-family: 'Barlow Condensed', sans-serif; font-size: 1rem; font-weight: 700; letter-spacing: .025em;
}
.primary-nav a[aria-current='page'] { color: var(--ink); }
.primary-nav a[aria-current='page']::before { content: ''; position: absolute; top: -1px; width: min(60%, 58px); height: 3px; background: var(--gold); }
.nav-icon { font-family: Barlow, sans-serif; font-size: .8rem; line-height: 1; font-weight: 600; color: var(--gold); }

#app {
  width: min(100%, 1160px); min-height: 65vh; margin: 0 auto;
  padding: 30px max(20px, env(safe-area-inset-right)) calc(102px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
.page-heading { max-width: 850px; margin-bottom: 28px; padding-bottom: 19px; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 5px; color: var(--gold); font-family: 'Barlow Condensed', sans-serif; font-size: 1.05rem; font-weight: 700; letter-spacing: .025em; text-transform: uppercase; }
h1, h2, h3, h4, p { overflow-wrap: anywhere; }
h1, h2, h3, h4 { font-family: 'Barlow Condensed', sans-serif; }
h1 { margin: 0; font-size: clamp(3.15rem, 12vw, 5.7rem); font-weight: 800; line-height: .92; letter-spacing: -.025em; text-transform: uppercase; }
h2 { margin: 0; font-size: 1.75rem; font-weight: 700; line-height: 1.08; text-transform: uppercase; }
h3 { margin: 0; font-size: 1.42rem; font-weight: 700; line-height: 1.1; text-transform: uppercase; }
.subheading { margin: 12px 0 0; color: var(--muted); font-size: 1rem; line-height: 1.4; }
.loading, .error { max-width: 800px; padding: 22px 0; border-top: 2px solid var(--gold); line-height: 1.5; }
.error { border-top-color: var(--oxblood); }
.current-flag, .status-flag {
  display: inline-block; padding: 2px 0; color: var(--gold); font-family: 'Barlow Condensed', sans-serif;
  font-size: .94rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
}
.status-flag { color: var(--ink); }
.inline-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin: -14px 0 24px; font-size: .88rem; color: var(--muted); }
.inline-meta span:not(:last-child)::after { content: '·'; margin-left: 9px; color: var(--gold); }

.day-layout { max-width: 850px; }
.day-intro { margin: 0 0 22px; }
.session-line { margin: 0 0 4px; color: var(--muted); font-size: .94rem; font-weight: 600; }
.section-title { margin: 28px 0 6px; padding-bottom: 8px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; border-bottom: 1px solid var(--gold); }
.section-title small { color: var(--muted); font-size: .86rem; font-weight: 500; }
.note-card, .recovery-card, .source-panel { margin: 22px 0; padding: 14px 0 16px; border-top: 1px solid var(--line); }
.note-card--cardio { border-top-color: var(--gold); }
.note-card__label { margin: 0 0 5px; color: var(--gold); font-family: 'Barlow Condensed', sans-serif; font-size: 1rem; font-weight: 700; text-transform: uppercase; }
.note-card p:last-child, .recovery-card p:last-child, .source-panel p:last-child { margin-bottom: 0; }
.note-card__text, .recovery-card__text { margin: 0; color: var(--ink); font-size: 1rem; line-height: 1.55; }
.recovery-card { padding: 24px 0; border-top: 2px solid var(--gold); }
.recovery-card h2 { margin-bottom: 12px; }
.recovery-card__text { max-width: 65ch; font-size: 1.18rem; line-height: 1.5; }

.exercise-list { display: grid; grid-template-columns: minmax(0, 1fr); }
.exercise { min-width: 0; padding: 6px 0 24px; border-bottom: 1px solid var(--line); }
.exercise:first-child { border-top: 1px solid var(--line); }
.exercise__main { padding: 14px 0 10px; }
.exercise__heading { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: start; gap: 8px 10px; }
.exercise__number { color: var(--gold); font-family: 'Barlow Condensed', sans-serif; font-size: 1.65rem; font-weight: 800; line-height: 1; }
.exercise__heading h3 { min-width: 0; padding-top: 1px; font-size: clamp(1.5rem, 6vw, 2rem); }
.exercise__next, .exercise__done { padding: 3px 0 3px 8px; border-left: 2px solid var(--gold); color: var(--gold); font-family: 'Barlow Condensed', sans-serif; font-size: .92rem; font-weight: 700; text-transform: uppercase; white-space: nowrap; }
.exercise__done { border-left-color: var(--muted); color: var(--muted); }
.exercise--complete .exercise__heading h3 { color: var(--muted); }
.exercise__status { margin: 8px 0 0 48px; color: var(--gold); font-size: .82rem; font-weight: 600; line-height: 1.4; }
.prescribed-label, .performed-label { margin: 13px 0 0; color: var(--gold); font-family: 'Barlow Condensed', sans-serif; font-size: .95rem; font-weight: 700; text-transform: uppercase; }
.performed-label { margin: 0 0 10px; }
.athletes { margin: 6px 0 0 48px; display: grid; }
.athlete { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 12px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.athlete__name, .metric__label { color: var(--muted); font-size: .86rem; font-weight: 600; text-transform: uppercase; }
.athlete__value { color: var(--ink); font-family: 'Barlow Condensed', sans-serif; font-size: 1.6rem; font-weight: 800; line-height: 1; white-space: nowrap; }
.athlete__value small { font-family: Barlow, sans-serif; font-size: .75rem; font-weight: 600; }
.athlete__reps { grid-column: 2; color: var(--ink); font-size: .95rem; font-weight: 500; text-align: right; }
.athlete--skip .athlete__value { color: var(--muted); }
.metrics { margin: 10px 0 0 48px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.metrics--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metric { min-width: 0; padding: 5px 0; border-top: 1px solid var(--line-soft); }
.metric__label { display: block; font-family: 'Barlow Condensed', sans-serif; font-size: .85rem; }
.metric__value { display: block; margin-top: 1px; font-family: 'Barlow Condensed', sans-serif; font-size: 1.45rem; font-weight: 700; line-height: 1.1; }
.exercise details { margin-left: 48px; border-top: 1px solid var(--line-soft); }
.exercise details summary { min-height: 44px; padding: 11px 0; color: var(--muted); font-family: 'Barlow Condensed', sans-serif; font-size: 1rem; font-weight: 700; cursor: pointer; list-style: none; text-transform: uppercase; }
.exercise details summary::-webkit-details-marker, .disclosure > summary::-webkit-details-marker { display: none; }
.exercise details summary::after, .disclosure > summary::after { content: '+'; float: right; color: var(--gold); font-family: Barlow, sans-serif; font-size: 1.15rem; line-height: 1; }
.exercise details[open] > summary::after, .disclosure[open] > summary::after { content: '−'; }
.exercise__details { padding: 7px 0 15px; display: grid; gap: 12px; }
.exercise__details dl { margin: 0; }
.exercise__details dt { color: var(--gold); font-family: 'Barlow Condensed', sans-serif; font-size: .92rem; font-weight: 700; text-transform: uppercase; }
.exercise__details dd { margin: 2px 0 0; color: var(--ink); font-size: .95rem; line-height: 1.5; }

.log-panel > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--ink) !important; }
.log-panel__count { flex: none; color: var(--muted); font-family: Barlow, sans-serif; font-size: .84rem; font-weight: 500; }
.log-panel__body { padding: 8px 0 18px; }
.athlete-log + .athlete-log { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.athlete-log__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.athlete-log__head h4 { margin: 0; font-size: 1.35rem; font-weight: 700; text-transform: uppercase; }
.athlete-log__head span { color: var(--muted); font-size: .88rem; font-weight: 600; }
.history-note { margin: 7px 0 12px; color: var(--gold); font-size: .88rem; line-height: 1.45; overflow-wrap: anywhere; }
.history-note:empty { display: none; }
.log-skip { color: var(--muted); font-size: .95rem; }
.set-entry { padding: 12px 0; border-top: 1px solid var(--line-soft); }
.set-entry__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; font-size: .95rem; }
.set-entry__top strong { font-family: 'Barlow Condensed', sans-serif; font-size: 1.15rem; font-weight: 700; text-transform: uppercase; }
.set-done { min-height: 44px; padding: 4px 0 4px 10px; display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: .88rem; font-weight: 600; cursor: pointer; }
.set-done input { width: 24px; height: 24px; accent-color: var(--gold); }
.set-entry__fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.set-entry__fields label, .substitution-log__fields label { min-width: 0; color: var(--muted); font-size: .82rem; font-weight: 500; }
.set-entry__fields input, .substitution-log__fields input {
  display: block; width: 100%; min-width: 0; min-height: 46px; margin-top: 5px; padding: 8px 10px;
  border: 1px solid #6c7470; border-radius: 2px; background: var(--field); color: var(--ink);
  font-size: 1.05rem; font-weight: 500; font-variant-numeric: tabular-nums;
}
.set-entry__fields input::placeholder { color: var(--muted); }
.exercise .substitution-log { margin: 14px 0 0; }
.exercise .substitution-log summary { min-height: 44px; }
.substitution-log__fields { display: grid; gap: 11px; padding: 8px 0; }

.workout-progress, .resume-banner, .session-finish { max-width: 850px; margin: 20px 0; padding: 15px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.workout-progress { border-top-color: var(--gold); }
.workout-progress__status { margin: 0 0 8px; font-family: 'Barlow Condensed', sans-serif; font-size: 1.35rem; font-weight: 700; text-transform: uppercase; }
.workout-progress__athletes { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.workout-progress__athletes span { color: var(--ink); font-size: .95rem; font-weight: 600; }
.session-finish { border-top-color: var(--gold); }
.session-finish p, .resume-banner p:not(.eyebrow) { margin: 0 0 10px; line-height: 1.5; }
.session-finish button, .resume-banner button, .backup-actions button, .import-label, .jump-current, .text-link {
  min-height: 44px; padding: 9px 13px; border: 1px solid var(--gold); border-radius: 2px;
  background: transparent; color: var(--ink); font-weight: 600; font-size: .92rem; text-decoration: none;
}
.session-finish button { background: var(--gold); color: var(--canvas); font-weight: 700; }
.resume-banner { border-top-color: var(--gold); }
.feedback { max-width: 850px; padding: 12px 0; border-top: 2px solid var(--gold); color: var(--ink); font-weight: 600; }

.disclosure { max-width: 850px; margin: 0; border-bottom: 1px solid var(--line); }
.disclosure:first-of-type { border-top: 1px solid var(--line); }
.disclosure > summary { min-height: 56px; padding: 15px 0; color: var(--ink); font-family: 'Barlow Condensed', sans-serif; font-size: 1.2rem; font-weight: 700; cursor: pointer; list-style: none; text-transform: uppercase; }
.disclosure__body { padding: 4px 0 23px; }
.note-list { margin: 0; display: grid; gap: 17px; }
.note-list dt { color: var(--gold); font-family: 'Barlow Condensed', sans-serif; font-size: .98rem; font-weight: 700; text-transform: uppercase; }
.note-list dd { margin: 2px 0 0; font-size: .97rem; line-height: 1.5; }
.note-list__item { margin: 0; }
.review-heading { margin-top: 25px; }

.program-current { margin: 0 0 20px; color: var(--gold); font-family: 'Barlow Condensed', sans-serif; font-size: 1.18rem; font-weight: 700; text-transform: uppercase; }
.program-controls { max-width: 850px; padding: 6px 0 20px; border-top: 1px solid var(--gold); border-bottom: 1px solid var(--line); }
.program-controls__grid { display: grid; gap: 11px; }
.program-controls label { display: block; color: var(--muted); font-family: 'Barlow Condensed', sans-serif; font-size: 1rem; font-weight: 700; text-transform: uppercase; }
.program-controls select {
  display: block; width: 100%; min-height: 50px; margin-top: 3px; padding: 6px 34px 8px 0;
  border: 0; border-bottom: 1px solid #777d79; border-radius: 0;
  background: var(--canvas); color: var(--ink); font-family: Barlow, sans-serif;
  font-size: 1rem; font-weight: 600; text-transform: none;
}
.jump-current { display: inline-flex; align-items: center; margin-top: 15px; }
.program-result { margin-top: 32px; }
.program-result .day-layout { max-width: none; }
.recent-history, .backup-tools { max-width: 850px; }
.recent-history ul { margin: 0; padding: 0; list-style: none; }
.recent-history li + li { border-top: 1px solid var(--line-soft); }
.recent-history li button { display: block; width: 100%; min-height: 52px; padding: 8px 0; border: 0; background: transparent; color: var(--ink); text-align: left; font-weight: 600; }
.recent-history li small { display: block; margin-top: 3px; color: var(--muted); font-size: .84rem; font-weight: 500; }
.backup-tools p { line-height: 1.5; font-size: .94rem; }
.backup-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.import-label { position: relative; display: inline-flex; align-items: center; overflow: hidden; cursor: pointer; }
.import-label input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.import-label:focus-within { outline: 3px solid var(--gold); outline-offset: 3px; }
.backup-actions .danger-button { border-color: #a3635b; color: var(--ink); }
.next-label { color: var(--muted); line-height: 1.5; }

.guide-list { max-width: 850px; counter-reset: section; }
.guide-section { counter-increment: section; }
.guide-section > summary { display: grid; grid-template-columns: 46px minmax(0, 1fr) 20px; align-items: baseline; gap: 10px; min-height: 75px; padding: 18px 0; }
.guide-section > summary::before { content: counter(section, decimal-leading-zero); color: var(--gold); font-family: 'Barlow Condensed', sans-serif; font-size: 1.6rem; font-weight: 800; }
.guide-section > summary::after { grid-column: 3; float: none; }
.guide-section > summary h2 { display: block; grid-column: 2; margin: 0; font-size: 1.48rem; font-weight: 700; line-height: 1.1; }
.guide-section[open] > summary { border-bottom: 1px solid var(--line-soft); }
.guide-section .disclosure__body { padding: 20px 0 28px 56px; }
.source-content { max-width: 72ch; color: var(--ink); font-size: 1rem; line-height: 1.63; overflow-wrap: anywhere; }
.source-content > :first-child { margin-top: 0; }
.source-content p { margin: 0 0 1.1em; }
.source-content strong, .source-content b { font-weight: 700; }
.source-content h3 { margin: 1.5em 0 .4em; font-size: 1.42rem; }
.source-content ol, .source-content ul { padding-left: 1.3em; }
.source-content li { margin-bottom: .65em; }
.source-content .callout { margin: 18px 0; padding: 14px 0 14px 18px; border-left: 2px solid var(--gold); }
.source-content .warn { border-left-color: #b9796d; }
.source-content .tablewrap { width: 100%; overflow-x: auto; }
.source-content table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.source-content th, .source-content td { padding: 9px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
.source-content th { color: var(--gold); font-family: 'Barlow Condensed', sans-serif; font-size: 1rem; font-weight: 700; text-transform: uppercase; }
.source-content small { color: var(--muted); }

@media (max-width: 430px) {
  .brand__name { font-size: 1.02rem; }
  .brand__name small { font-size: .62rem; }
  .header-date { font-size: .9rem; }
  .guide-section .disclosure__body { padding-left: 0; }
}
@media (max-width: 360px) {
  .brand { gap: 9px; }
  .brand__mark { width: 42px; height: 42px; }
  .header-date { font-size: .82rem; }
  .exercise__heading { grid-template-columns: 34px minmax(0, 1fr); }
  .exercise__next, .exercise__done { grid-column: 2; justify-self: start; }
  .athletes, .metrics, .exercise details { margin-left: 44px; }
}
@media (max-width: 320px) {
  .site-header__inner { padding-left: 14px; padding-right: 14px; }
  .brand__name small { display: none; }
  .set-entry__fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-section > summary { grid-template-columns: 38px minmax(0, 1fr) 18px; gap: 7px; }
}
@media (max-width: 900px) {
  .source-content .tablewrap { overflow: visible; }
  .source-content table, .source-content thead, .source-content tbody, .source-content tr, .source-content td { display: block; width: 100%; }
  .source-content thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .source-content tr { margin: 0 0 15px; border-top: 1px solid var(--line); }
  .source-content td { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
  .source-content td::before { content: attr(data-label); display: block; color: var(--gold); font-family: 'Barlow Condensed', sans-serif; font-size: .95rem; font-weight: 700; text-transform: uppercase; }
}
@media (min-width: 720px) {
  #app { padding: 42px max(35px, env(safe-area-inset-right)) 90px max(35px, env(safe-area-inset-left)); }
  .primary-nav { position: sticky; top: 0; bottom: auto; grid-template-columns: repeat(3, auto); justify-content: center; gap: 35px; padding: 0 20px; border-top: 0; border-bottom: 1px solid var(--line); }
  .primary-nav a { min-height: 54px; padding: 0 8px; flex-direction: row; gap: 9px; }
  .primary-nav a[aria-current='page']::before { top: auto; bottom: -1px; width: 100%; }
  .program-controls__grid { grid-template-columns: 1.4fr 1fr 1.1fr; gap: 20px; }
  .exercise__details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
