:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-soft: #fbfaf6;
  --ink: #202421;
  --muted: #65706a;
  --line: #dedbd2;
  --teal: #28756d;
  --coral: #bd5548;
  --gold: #b6822d;
  --green: #507a45;
  --shadow: 0 18px 45px rgba(37, 42, 38, 0.1);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

.hero-inner,
.day-nav,
main {
  width: min(1240px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  width: 100%;
  margin: 0 0 18px;
  padding: 34px 0 28px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f2ea 100%);
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  display: grid;
  gap: 18px;
}

.header-copy {
  min-height: 0;
  padding: 8px 0 0;
}

.header-table-card {
  width: 100%;
  min-height: 0;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.program-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.9rem;
}

.program-table th,
.program-table td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.program-table th {
  background: #e9f2ef;
  color: #244b45;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.program-table td:first-child {
  width: 76px;
  color: var(--coral);
  font-weight: 900;
  white-space: nowrap;
}

.program-table td:nth-child(3) {
  width: 112px;
  color: var(--teal);
  font-weight: 850;
  white-space: nowrap;
}

.program-table tr:last-child td {
  border-bottom: 0;
}

.program-table tr.is-today td {
  background: #fff6e5;
}

.program-table tr.is-today td:first-child {
  background: var(--teal);
  color: #fff;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
  overflow-wrap: anywhere;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.quick-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.quick-stats span {
  display: inline-flex;
  gap: 7px;
  align-items: baseline;
  min-height: 42px;
  padding: 9px 13px;
  background: #f2eadf;
  border: 1px solid #e4d7c6;
  border-radius: 8px;
  color: #3f463f;
  font-size: 0.95rem;
}

.quick-stats strong {
  color: var(--teal);
  font-size: 1.25rem;
}

.today-plan-link {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  align-items: baseline;
  width: fit-content;
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 12px 26px rgba(32, 36, 33, 0.16);
}

.today-plan-link:hover,
.today-plan-link:focus-visible {
  background: var(--teal);
  border-color: var(--teal);
  outline: none;
}

.today-plan-link span {
  color: #b8e2dc;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.today-plan-link strong {
  font-size: 1rem;
  line-height: 1.2;
}

.day-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 8px;
  margin: 0 auto 24px;
  padding: 10px;
  overflow-x: auto;
  background: rgba(246, 244, 239, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  backdrop-filter: blur(12px);
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.day-nav a {
  flex: 0 0 auto;
  padding: 9px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #2e3834;
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
}

.day-nav a:hover,
.day-nav a:focus-visible {
  border-color: var(--teal);
  color: var(--teal);
  outline: none;
}

.day-nav a.is-today {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

main {
  display: grid;
  gap: 26px;
  padding-bottom: 60px;
}

.panel,
.workout-day {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.panel {
  padding: clamp(22px, 4vw, 34px);
}

.section-heading,
.day-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.section-heading h2,
.day-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 4vw, 2.45rem);
  line-height: 1;
  letter-spacing: 0;
}

.note {
  max-width: 74ch;
  margin: 18px 0 0;
  color: var(--muted);
}

.pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.pill-grid span {
  padding: 9px 12px;
  background: #edf4f1;
  border: 1px solid #cddfd9;
  border-radius: 8px;
  color: #244b45;
  font-weight: 750;
}

.pill-grid.compact span {
  background: #f8f1e7;
  border-color: #ead8bd;
  color: #5f4322;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 24px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.week-day {
  min-height: 188px;
  padding: 15px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.week-day:hover,
.week-day:focus-visible {
  border-color: var(--coral);
  outline: none;
}

.week-day span {
  color: var(--coral);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.week-day strong {
  margin: 12px 0;
  font-size: 1rem;
  line-height: 1.2;
}

.week-day em {
  color: var(--muted);
  font-size: 0.88rem;
  font-style: normal;
}

.week-day small {
  color: #48645f;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.25;
}

.week-day.is-today {
  background: #edf6f3;
  border-color: var(--teal);
  box-shadow: inset 0 0 0 1px var(--teal);
}

.week-day.is-today::after {
  content: "Today";
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 8px;
  background: var(--teal);
  border-radius: 999px;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.week-day.is-today span {
  color: var(--teal);
}

.workout-day {
  padding: 0;
}

.workout-day.is-today {
  box-shadow: inset 0 0 0 2px rgba(40, 117, 109, 0.42);
}

.workout-day.is-today .day-heading {
  background: linear-gradient(90deg, #e9f2ef 0%, #fff8ec 100%);
}

.workout-day.is-today .day-heading .eyebrow::after {
  content: "Today";
  display: inline-block;
  margin-left: 8px;
  padding: 3px 7px;
  background: var(--teal);
  border-radius: 999px;
  color: #fff;
  font-size: 0.68rem;
  vertical-align: 1px;
}

.day-heading {
  padding: clamp(22px, 4vw, 34px);
  background: linear-gradient(90deg, #ffffff 0%, #f8f4ed 100%);
  border-bottom: 1px solid var(--line);
}

.day-heading > span {
  flex: 0 0 auto;
  padding: 8px 12px;
  background: #e9f2ef;
  border: 1px solid #cbded8;
  border-radius: 8px;
  color: var(--teal);
  font-weight: 850;
}

.segment {
  padding: clamp(20px, 3.5vw, 30px) clamp(22px, 4vw, 34px);
  border-bottom: 1px solid var(--line);
}

.segment:last-child {
  border-bottom: 0;
}

.segment h3,
.option h3 {
  margin-bottom: 8px;
  color: #27312e;
  font-size: 1.15rem;
}

.segment p:last-child,
.option p:last-child {
  margin-bottom: 0;
}

.exercise-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.exercise {
  min-width: 0;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  grid-template-rows: 175px auto;
}

.exercise img {
  width: 100%;
  height: 175px;
  object-fit: contain;
  background: #f4f3ef;
  border-bottom: 1px solid var(--line);
  padding: 8px;
}

.exercise-body {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  padding: 13px;
}

.step {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--ink);
  border-radius: 50%;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 900;
}

.exercise h4 {
  margin-bottom: 5px;
  font-size: 1rem;
  line-height: 1.18;
}

.exercise p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
}

.interval-grid,
.option-grid {
  display: grid;
  gap: 14px;
  padding: clamp(20px, 3.5vw, 30px) clamp(22px, 4vw, 34px);
}

.interval-grid {
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}

.interval-grid div,
.option {
  padding: 18px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.interval-grid span,
.option span {
  display: block;
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 850;
  text-transform: uppercase;
}

.interval-grid strong {
  display: block;
  font-size: 1.18rem;
  line-height: 1.2;
}

.option-grid {
  grid-template-columns: repeat(2, 1fr);
}

.rules-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.rules-list li {
  padding: 15px 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.library-grid figure {
  margin: 0;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.library-grid img {
  width: 100%;
  height: 170px;
  object-fit: contain;
  background: #f4f3ef;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}

.library-grid figcaption {
  padding: 11px 12px 13px;
  font-weight: 800;
  line-height: 1.2;
}

@media (max-width: 980px) {
  .header-copy,
  .header-table-card {
    min-height: 0;
  }

  .exercise-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .interval-grid,
  .option-grid,
  .rules-list,
  .library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .site-header {
    padding: 24px 0 22px;
  }

  .header-table-card {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
  }

  .program-table,
  .program-table tbody,
  .program-table tr,
  .program-table td {
    display: block;
  }

  .program-table {
    min-width: 0;
    background: transparent;
    border: 0;
    font-size: 0.92rem;
  }

  .program-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .program-table tbody {
    display: grid;
    gap: 10px;
  }

  .program-table tr {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
  }

  .program-table td {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px;
    width: auto;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    white-space: normal;
  }

  .program-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  .program-table td:first-child {
    display: block;
    width: auto;
    background: #e9f2ef;
    color: var(--teal);
    font-size: 1rem;
  }

  .program-table td:first-child::before {
    content: none;
  }

  .program-table td:nth-child(3) {
    width: auto;
    color: var(--teal);
  }

  .program-table tr:last-child td {
    border-bottom: 1px solid var(--line);
  }

  .program-table tr td:last-child {
    border-bottom: 0;
  }

  .week-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .week-day {
    min-height: 0;
    gap: 10px;
  }
}

@media (max-width: 640px) {
  .hero-inner,
  main,
  .day-nav {
    width: min(100% - 20px, 1240px);
  }

  .site-header {
    padding: 18px 0 20px;
  }

  .header-copy {
    padding-top: 0;
  }

  .header-table-card {
    padding: 0;
  }

  h1 {
    font-size: clamp(2.55rem, 13vw, 3.35rem);
  }

  .quick-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .quick-stats span {
    display: grid;
    justify-items: center;
    gap: 1px;
    min-height: 62px;
    padding: 8px 7px;
    text-align: center;
    line-height: 1.15;
  }

  .today-plan-link {
    display: grid;
    width: 100%;
    gap: 3px;
    justify-items: center;
    text-align: center;
  }

  .section-heading,
  .day-heading {
    display: block;
  }

  .day-heading > span {
    display: inline-block;
    margin-top: 14px;
  }

  .exercise-list,
  .interval-grid,
  .option-grid,
  .rules-list,
  .week-grid,
  .library-grid {
    grid-template-columns: 1fr;
  }

  .exercise {
    grid-template-columns: 128px minmax(0, 1fr);
    grid-template-rows: auto;
  }

  .exercise img {
    height: 100%;
    min-height: 128px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .exercise-body {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 9px;
    padding: 12px;
  }

  .step {
    width: 30px;
    height: 30px;
    font-size: 0.82rem;
  }

  .exercise h4 {
    font-size: 0.96rem;
  }

  .exercise p {
    font-size: 0.88rem;
  }

  .library-grid img {
    height: 190px;
  }
}

@media (max-width: 520px) {
  .program-table td {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .exercise {
    grid-template-columns: 1fr;
  }

  .exercise img {
    height: 175px;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .library-grid img {
    height: 160px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .day-nav {
    position: static;
  }

  .panel,
  .workout-day,
  .header-copy,
  .header-table-card {
    box-shadow: none;
  }

  .workout-day {
    break-inside: avoid;
  }
}
