/* ============================================================
   WORKOUT PROGRAMS — /programs and /programs/<slug>
   Generated by scripts/build-programs.mjs. Builds on styles.css
   (colors, nav, store badges, footer) under body.marketing.
   ============================================================ */

.p-page,
.h-programs {
  --line: rgba(255, 255, 255, 0.08);
  --chip: rgba(255, 255, 255, 0.06);
  --chip-on: rgba(74, 209, 122, 0.16);
  --card: #161a21;
  --card-hover: #1b2029;
}

.p-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2.5rem;
}

/* --- List page hero --- */

.p-hero {
  padding: 64px 0 28px;
  background:
    radial-gradient(ellipse 60% 70% at 80% 0%, rgba(74, 209, 122, 0.08) 0%, transparent 70%),
    var(--bg);
}

.p-hero__title {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 16px;
  color: var(--text);
}

.p-hero__sub {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

/* --- Filters --- */

.p-list { padding-bottom: 72px; }

.p-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 28px;
  padding: 22px;
  margin: 8px 0 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.p-filter { min-width: 0; }

.p-filter__label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.p-filter__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.p-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--chip);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.p-chip:hover { border-color: rgba(255, 255, 255, 0.2); }

.p-chip--on {
  background: var(--chip-on);
  border-color: rgba(74, 209, 122, 0.55);
  color: var(--accent);
}

.p-chip:focus-visible,
.p-btn:focus-visible,
.p-card:focus-visible,
.p-clear:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.p-results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.p-results-count {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.p-clear {
  appearance: none;
  background: none;
  border: none;
  color: var(--accent);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}

/* --- Cards --- */

.p-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.p-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.p-card:hover {
  background: var(--card-hover);
  border-color: rgba(74, 209, 122, 0.35);
  transform: translateY(-2px);
}

.p-card[hidden] { display: none; }

.p-card__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.p-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  white-space: nowrap;
}

.p-pill--level-beginner { background: rgba(74, 209, 122, 0.14); color: #6fe09a; }
.p-pill--level-intermediate { background: rgba(96, 165, 250, 0.14); color: #8ab9fb; }
.p-pill--level-advanced { background: rgba(244, 114, 182, 0.14); color: #f59ac9; }

.p-card__title {
  margin: 4px 0 0;
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.p-card__tagline {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  flex: 1;
}

.p-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.p-card__cta {
  margin-top: 4px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.p-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 16px;
}

.p-empty p { margin: 0 0 16px; }

/* --- Buttons --- */

.p-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 22px;
  border-radius: 12px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.1s ease, opacity 0.15s ease;
}

.p-btn:hover { transform: translateY(-1px); }

.p-btn--primary {
  background: var(--accent);
  color: #0e1014;
}

.p-btn--ghost {
  background: none;
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

.p-btn--block {
  display: flex;
  width: 100%;
  text-align: center;
}

/* --- Bottom band --- */

.p-band {
  padding: 64px 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.p-band__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.p-band__title {
  margin: 0 0 8px;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -0.02em;
}

.p-band__sub {
  margin: 0;
  color: var(--muted);
  max-width: 520px;
  line-height: 1.6;
}

/* ============================================================
   Program page
   ============================================================ */

.p-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 28px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.p-crumbs a {
  color: var(--muted);
  text-decoration: none;
}

.p-crumbs a:hover { color: var(--text); }

.p-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 48px;
  align-items: start;
  padding: 18px 0 40px;
}

.p-head__title {
  margin: 14px 0 10px;
  font-size: clamp(30px, 4.5vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.p-head__tagline {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.p-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.p-facts div {
  background: var(--card);
  padding: 14px 16px;
}

.p-facts dt {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.p-facts dd {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.p-section {
  padding-top: 40px;
}

.p-section h2 {
  margin: 0 0 14px;
  font-size: 24px;
  letter-spacing: -0.015em;
}

.p-section p {
  color: #c9ced6;
  line-height: 1.75;
  margin: 0 0 14px;
}

.p-fit {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.p-list-check,
.p-list-dash,
.p-tips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.p-list-check li,
.p-list-dash li,
.p-tips li {
  position: relative;
  padding-left: 28px;
  color: #c9ced6;
  line-height: 1.6;
}

.p-list-check li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.p-list-dash li::before {
  content: '–';
  position: absolute;
  left: 4px;
  color: var(--muted);
}

.p-tips li::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

/* Weekly schedule */

.p-week {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.p-day {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 8px;
  border-radius: 12px;
  background: rgba(74, 209, 122, 0.12);
  border: 1px solid rgba(74, 209, 122, 0.3);
  text-align: center;
  min-width: 0;
}

.p-day--rest {
  background: var(--card);
  border-color: var(--line);
}

.p-day__name {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.p-day__what {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}

.p-day--rest .p-day__what { color: var(--muted); font-weight: 500; }

/* Workout tables */

.p-workouts {
  display: grid;
  gap: 16px;
}

.p-workout {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.p-workout__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.p-workout__head h3 {
  margin: 0;
  font-size: 17px;
}

.p-workout__head span {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}

.p-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.p-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 18px;
}

.p-table td {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

.p-table .p-sets,
.p-table th:nth-child(2) {
  width: 64px;
  text-align: center;
}

.p-table .p-reps,
.p-table th:nth-child(3) {
  width: 140px;
  text-align: right;
}

.p-table .p-sets,
.p-table .p-reps {
  font-weight: 600;
  white-space: nowrap;
}

/* How to run it */

.p-howto {
  margin: 0;
  display: grid;
  gap: 14px;
}

.p-howto div {
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.p-howto dt {
  font-weight: 700;
  margin-bottom: 6px;
}

.p-howto dd {
  margin: 0;
  color: #c9ced6;
  line-height: 1.7;
}

/* FAQ */

.p-faq {
  display: grid;
  gap: 10px;
}

.p-faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 18px;
}

.p-faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 28px 16px 0;
  font-weight: 600;
  position: relative;
}

.p-faq summary::-webkit-details-marker { display: none; }

.p-faq summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 14px;
  font-size: 20px;
  color: var(--muted);
}

.p-faq details[open] summary::after { content: '−'; }

.p-faq details p { margin: 0 0 16px; }

/* CTA blocks */

.p-cta {
  background: var(--card);
  border: 1px solid rgba(74, 209, 122, 0.25);
  border-radius: 18px;
  padding: 20px;
}

.p-cta__mobile,
.p-cta__desktop { display: none; }

.is-mobile .p-cta__mobile { display: block; }
.is-desktop .p-cta__desktop { display: flex; }

.p-cta__lead {
  margin: 16px 0 10px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  line-height: 1.5;
}

.js-store-slot .m-store-btn {
  width: 100%;
  padding: 12px 18px;
}

.p-cta__note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.p-cta__desktop {
  flex-direction: column;
  gap: 16px;
}

.p-cta__qr {
  width: 148px;
  height: 148px;
  padding: 8px;
  background: #fff;
  border-radius: 12px;
}

.p-cta__qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

.p-cta__title {
  margin: 0 0 6px;
  font-weight: 700;
  font-size: 16px;
}

.p-cta__desc {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.p-cta__desktop .m-store-btns { gap: 8px; }

.p-cta-inline { display: none; margin-top: 24px; }

.p-side__sticky {
  position: sticky;
  top: 88px;
}

.p-cta-bottom .p-cta { max-width: 520px; }

/* On desktop the sidebar carries the CTA, so skip the bottom repeat. */
.is-desktop .p-cta-bottom { display: none; }

/* Related */

.p-related {
  padding: 24px 0 72px;
  border-top: 1px solid var(--line);
}

.p-related h2 {
  margin: 24px 0 18px;
  font-size: 24px;
}

.p-related__all {
  margin: 22px 0 0;
}

.p-related__all a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

/* Sticky mobile import bar */

.p-sticky-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(14, 16, 20, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  transform: translateY(110%);
  transition: transform 0.2s ease;
}

.p-sticky-bar--show { transform: translateY(0); }
.p-sticky-bar[hidden] { display: none; }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1024px) {
  .p-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .p-side { display: none; }
  .p-cta-inline { display: block; }
  .is-desktop .p-cta-bottom { display: block; }
  .p-cta__desktop { flex-direction: row; align-items: center; }
  .p-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .p-wrap { padding: 0 1.25rem; }
  .p-hero { padding: 40px 0 18px; }
  .p-hero__sub { font-size: 16px; }

  /* Filters: one compact row per group that scrolls sideways. */
  .p-filters {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 16px 0 16px 16px;
  }
  .p-filter__chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-right: 16px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .p-filter__chips::-webkit-scrollbar { display: none; }

  .p-grid { grid-template-columns: minmax(0, 1fr); }
  .p-band__inner { flex-direction: column; align-items: flex-start; }

  .p-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p-fit { grid-template-columns: minmax(0, 1fr); gap: 28px; }

  /* Week: a compact vertical list beats 7 squeezed columns. */
  .p-week { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .p-day {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    text-align: left;
  }

  .p-table { font-size: 14px; }
  .p-table th, .p-table td { padding-left: 14px; padding-right: 14px; }
  .p-table .p-sets, .p-table th:nth-child(2) { width: 44px; }
  .p-table .p-reps, .p-table th:nth-child(3) { width: 104px; }
  .p-table .p-reps { white-space: normal; }

  .p-cta__desktop { flex-direction: column; align-items: flex-start; }

  /* Leave room for the sticky import bar. */
  .p-program .m-footer { padding-bottom: 96px; }
}

/* --- Homepage section (generated into public/index.html) --- */

.h-programs {
  padding: 96px 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background:
    radial-gradient(ellipse 50% 60% at 15% 0%, rgba(74, 209, 122, 0.07) 0%, transparent 70%),
    var(--bg);
}

.h-programs__inner {
  max-width: 1100px;
  margin: 0 auto;
}

.h-programs__head {
  max-width: 680px;
}

.h-programs__eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.h-programs h2 {
  scroll-margin-top: 96px;
  margin: 0 0 18px;
  color: var(--text);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.h-programs__sub {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.h-programs__quick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 32px 0 28px;
}

.h-programs__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.h-programs__quick-label {
  margin-right: 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.h-programs__quick .p-chip {
  text-decoration: none;
}

.h-programs__quick .p-chip:hover {
  border-color: rgba(74, 209, 122, 0.55);
  color: var(--accent);
}

.h-programs__more {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

@media (max-width: 1024px) {
  /* Two columns: show two featured cards so the third isn't alone on a row. */
  .h-programs__grid .p-card:nth-child(n+3) { display: none; }
}

@media (max-width: 768px) {
  .h-programs { padding: 64px 1.25rem; }
  .h-programs h2 br { display: none; }
  .h-programs__sub { font-size: 16px; }
  .h-programs__quick {
    display: block;
    margin: 24px 0 22px;
  }
  .h-programs__quick-label {
    display: block;
    margin: 0 0 10px;
  }
  /* One swipeable row of chips, running edge to edge. */
  .h-programs__chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0 -1.25rem;
    padding: 0 1.25rem 4px;
    scrollbar-width: none;
  }
  .h-programs__chips::-webkit-scrollbar { display: none; }
  .h-programs__chips .p-chip { flex-shrink: 0; }
  .h-programs__grid { grid-template-columns: minmax(0, 1fr); }
  .h-programs__grid .p-card:nth-child(n+3) { display: flex; }
  .h-programs__more .p-btn { display: flex; width: 100%; }
  .b-promo { align-items: flex-start; }
}

/* --- AI program builder (/program-builder, public/assets/builder.js) --- */

/* Results table has a 4th column (rest), sized like reps. */
.b-result .p-table .p-reps,
.b-result .p-table th:nth-child(3),
.b-result .p-table th:nth-child(4) {
  width: 84px;
  text-align: right;
}

.b-wrap { max-width: 860px; }

.b-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.b-loading {
  padding: 80px 0 120px;
  text-align: center;
}

.b-spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 22px;
  border-radius: 50%;
  border: 4px solid rgba(74, 209, 122, 0.18);
  border-top-color: var(--accent);
  animation: b-spin 0.9s linear infinite;
}

@keyframes b-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .b-spinner { animation-duration: 2.5s; }
}

.b-loading__title {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
}

.b-loading__msg {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.b-result { padding: 24px 0 24px; }
.b-result__head { margin-bottom: 8px; }

.b-note {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(250, 204, 21, 0.08);
  border: 1px solid rgba(250, 204, 21, 0.35);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}

.b-cta { margin: 24px 0 8px; }
.b-cta .p-cta__desktop { flex-direction: row; align-items: center; }

.b-coach p { color: var(--muted); }

.b-again {
  margin: 32px 0 64px;
  text-align: center;
}

/* Weight column, sized like reps and rest. */
.b-result .p-table--weights th:nth-child(5) { width: 84px; text-align: right; }

/* Superset members: an accent rule down the left and a small label. */
.p-row--superset td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.p-ss {
  display: block;
  margin-top: 2px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

/* "About this program": the AI's description, as a section and a dialog. */
.b-about { margin-top: 14px; }

.b-overview__block + .b-overview__block,
.b-overview__chips + .b-overview__block { margin-top: 18px; }
.b-overview__block h3 {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.b-overview__block p { margin: 0; color: var(--text); line-height: 1.6; }
.b-overview__chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.b-overview__label { color: var(--muted); font-size: 13px; font-weight: 600; margin-right: 4px; }
.b-overview__styles { margin: 0; }
.b-overview__styles dt { color: var(--text); font-weight: 700; }
.b-overview__styles dd { margin: 2px 0 10px; color: var(--muted); line-height: 1.55; }

.b-overview {
  width: min(640px, calc(100vw - 32px));
  max-height: min(86vh, 900px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  overflow: hidden;
  flex-direction: column;
}
.b-overview[open] { display: flex; }
.b-overview::backdrop { background: rgba(0, 0, 0, 0.6); }
.b-overview__head {
  position: relative;
  padding: 24px 56px 20px 24px;
  background: linear-gradient(135deg, rgba(74, 209, 122, 0.22), rgba(74, 209, 122, 0.04));
  border-bottom: 1px solid var(--line);
}
.b-overview__eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.b-overview__head h2 { margin: 0; font-size: 24px; line-height: 1.2; }
.b-overview__tagline { margin: 8px 0 0; color: var(--muted); line-height: 1.5; }
.b-overview__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--chip);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.b-overview__body { padding: 20px 24px; overflow-y: auto; }
.b-overview__foot { padding: 16px 24px 20px; border-top: 1px solid var(--line); }

@media (max-width: 768px) {
  /* A bottom sheet on phones. */
  .b-overview {
    width: 100vw;
    max-width: 100vw;
    max-height: 90vh;
    margin: auto 0 0;
    border-radius: 20px 20px 0 0;
  }
  .b-overview__head { padding: 20px 52px 16px 16px; }
  .b-overview__body { padding: 16px; }
  .b-overview__foot { padding: 12px 16px 16px; }
  .b-result .p-table--weights th:nth-child(5) { width: 58px; }
}

@media (max-width: 768px) {
  .b-cta .p-cta__desktop { flex-direction: column; align-items: flex-start; }
  .b-result .p-table th, .b-result .p-table td { padding-left: 10px; padding-right: 10px; }
  .b-result .p-table th:first-child, .b-result .p-table td:first-child { padding-left: 14px; }
  .b-result .p-table th:last-child, .b-result .p-table td:last-child { padding-right: 14px; }
  .b-result .p-table .p-reps,
  .b-result .p-table th:nth-child(3),
  .b-result .p-table th:nth-child(4) { width: 58px; }
}

.b-promo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(74, 209, 122, 0.08);
  border: 1px solid rgba(74, 209, 122, 0.3);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.b-promo:hover { border-color: rgba(74, 209, 122, 0.6); background: rgba(74, 209, 122, 0.12); }
.b-promo strong { color: var(--accent); }

.b-promo__label {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #0e1014;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* --- AI builder wizard --- */

/* Layout rules below set display on some of these; keep [hidden] winning. */
.w-intro[hidden], .w-shell[hidden], .w-view[hidden], .w-loading[hidden], .b-result[hidden] { display: none !important; }

.w-main {
  padding: 0 0 72px;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(74, 209, 122, 0.08) 0%, transparent 70%),
    var(--bg);
}

/* Intro */
.w-intro { padding: 64px 1.25rem 24px; }
.w-intro__inner { max-width: 720px; margin: 0 auto; text-align: center; }

.w-intro__title {
  margin: 10px 0 16px;
  color: var(--text);
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.w-intro__sub {
  margin: 0 auto;
  max-width: 600px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.w-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 26px 0 34px;
  padding: 0;
  list-style: none;
}

.w-badges li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(74, 209, 122, 0.1);
  border: 1px solid rgba(74, 209, 122, 0.3);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.w-badges svg { width: 16px; height: 16px; color: var(--accent); }

.w-how {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 34px;
  padding: 0;
  list-style: none;
  text-align: left;
}

.w-how li {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.w-how strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 16px;
}

.w-how__icon,
.w-view__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(74, 209, 122, 0.12);
  color: var(--accent);
}

.w-how__icon svg, .w-view__icon svg { width: 24px; height: 24px; }

.w-start {
  min-width: 260px;
  padding: 18px 28px;
  font-size: 18px;
}

.w-last {
  display: block;
  margin: 16px auto 0;
  padding: 6px 8px;
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.w-fineprint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* Wizard shell */
.w-shell {
  max-width: 760px;
  margin: 32px auto 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  scroll-margin-top: 84px;
}

.w-top { padding: 22px 28px 0; }

.w-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.w-progress__bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.35s ease;
}

.w-count {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.w-stage {
  position: relative;
  overflow: hidden;
}

.w-view { padding: 22px 28px 8px; background: var(--card); }

.w-view__title {
  margin: 16px 0 6px;
  color: var(--text);
  font-size: clamp(24px, 3.4vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  outline: none;
}

.w-view__sub {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

/* Slide transitions */
.w-view--leaving { position: absolute; top: 0; left: 0; right: 0; pointer-events: none; }
.w-in-right { animation: w-in-right 0.38s cubic-bezier(0.25, 0.8, 0.25, 1) both; }
.w-in-left { animation: w-in-left 0.38s cubic-bezier(0.25, 0.8, 0.25, 1) both; }
.w-out-left { animation: w-out-left 0.38s cubic-bezier(0.25, 0.8, 0.25, 1) both; }
.w-out-right { animation: w-out-right 0.38s cubic-bezier(0.25, 0.8, 0.25, 1) both; }

/* A full-width push, like the app: the new view slides in from the edge
   while the old one slides out the other side. */
@keyframes w-in-right { from { transform: translateX(100%); } to { transform: none; } }
@keyframes w-in-left { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes w-out-left { from { transform: none; opacity: 1; } to { transform: translateX(-100%); opacity: 0.4; } }
@keyframes w-out-right { from { transform: none; opacity: 1; } to { transform: translateX(100%); opacity: 0.4; } }

/* Chips (multi-select) */
.w-group + .w-group { margin-top: 20px; }

.w-group__label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.w-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.w-chip {
  appearance: none;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--chip);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.w-chip:hover { border-color: rgba(74, 209, 122, 0.4); }

/* Number fields (age, weight, height) with their unit after them. */
.w-inputs { display: flex; flex-wrap: wrap; gap: 8px; }
.w-input {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px 0 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--chip);
  color: var(--muted);
  font-size: 15px;
}
.w-input:focus-within { border-color: rgba(74, 209, 122, 0.6); }
.w-input input {
  width: 88px;
  padding: 11px 0 11px 14px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px; /* 16px stops iOS zooming in on focus */
  outline: none;
}

.w-chip[aria-pressed="true"] {
  background: var(--chip-on);
  border-color: rgba(74, 209, 122, 0.6);
  color: var(--accent);
  font-weight: 600;
}

/* Cards (single choice) */
.w-cards { display: flex; flex-direction: column; gap: 10px; }

.w-card {
  appearance: none;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  padding: 16px 52px 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--chip);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.w-card:hover { border-color: rgba(74, 209, 122, 0.4); }
.w-card__title { font-size: 17px; font-weight: 600; }
.w-card__desc { color: var(--muted); font-size: 14px; line-height: 1.45; }

.w-card__check {
  position: absolute;
  top: 50%;
  right: 18px;
  width: 22px;
  height: 22px;
  margin-top: -11px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
}

.w-card[aria-pressed="true"] { background: var(--chip-on); border-color: rgba(74, 209, 122, 0.6); }
.w-card[aria-pressed="true"] .w-card__check { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 4px #0e1014; }

/* Tiles (days per week) */
.w-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }

.w-tile {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 18px 6px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--chip);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.w-tile__num { font-size: 30px; font-weight: 800; line-height: 1; }
.w-tile__cap { color: var(--muted); font-size: 13px; }
.w-tile:hover { border-color: rgba(74, 209, 122, 0.4); }
.w-tile[aria-pressed="true"] { background: var(--chip-on); border-color: rgba(74, 209, 122, 0.6); color: var(--accent); }

.w-chip, .w-card, .w-tile, .w-review__edit, .w-nav .p-btn, .w-start { -webkit-tap-highlight-color: transparent; }

.w-chip:focus-visible, .w-card:focus-visible, .w-tile:focus-visible,
.w-review__edit:focus-visible, .w-last:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Review */
.w-review { margin: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }

.w-review__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.w-review__row + .w-review__row { border-top: 1px solid var(--line); }
.w-review__text { flex: 1; min-width: 0; }
.w-review dt { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.w-review dd { margin: 3px 0 0; color: var(--text); font-size: 15px; line-height: 1.45; }

.w-review__edit {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* Footer nav */
.w-error {
  margin: 12px 28px 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(244, 114, 182, 0.1);
  border: 1px solid rgba(244, 114, 182, 0.35);
  color: #f9c2dd;
  font-size: 15px;
}

.w-nav {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  gap: 12px;
  padding: 18px 28px 22px;
  border-radius: 0 0 24px 24px;
  background: linear-gradient(to bottom, rgba(22, 26, 33, 0.85), var(--card) 40%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.w-back { flex: 0 0 auto; min-width: 110px; }
.w-next { flex: 1; }
.w-next:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* Loading */
.w-loading { max-width: 560px; margin: 0 auto; padding: 120px 1.25rem 140px; text-align: center; }
.w-loading__title { margin: 0 0 8px; color: var(--text); font-size: 24px; }
.w-loading__msg { margin: 0; color: var(--muted); font-size: 16px; min-height: 1.5em; }

.p-builder .b-result { padding-top: 48px; }

@media (prefers-reduced-motion: reduce) {
  .w-progress__bar { transition: none; }
}

@media (max-width: 768px) {
  .w-intro { padding: 40px 1.25rem 8px; }
  .w-intro__sub { font-size: 16px; }
  .w-how { grid-template-columns: minmax(0, 1fr); }
  .w-how li { flex-direction: row; align-items: flex-start; padding: 16px; }
  .w-how__icon { flex-shrink: 0; width: 40px; height: 40px; }
  .w-start { width: 100%; min-width: 0; }

  /* Edge-to-edge wizard on phones that fills the screen, so Back/Next sit at the bottom like the app. */
  .w-shell {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 60px);
    min-height: calc(100dvh - 60px);
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
  }
  .w-stage { flex: 1; }
  .w-nav { margin-top: auto; }
  .w-top { padding: 18px 1.25rem 0; }
  .w-view { padding: 16px 1.25rem 8px; background: var(--bg); }
  .w-view__title { margin-top: 14px; }
  .w-error { margin: 12px 1.25rem 0; }
  .w-nav {
    padding: 14px 1.25rem calc(14px + env(safe-area-inset-bottom));
    border-radius: 0;
    border-top: 1px solid var(--line);
    background: rgba(14, 16, 20, 0.92);
  }
  .w-back { min-width: 96px; }
  .w-chip { font-size: 14px; padding: 9px 14px; }
  .w-tiles { gap: 8px; }
  .w-tile { padding: 14px 4px; }
  .w-tile__num { font-size: 26px; }
  .w-tile__cap { font-size: 12px; }
}

/* --- Builder intro: SEO content below the start button --- */

.w-intro__lead {
  margin: -6px 0 14px;
  color: var(--text);
  font-size: clamp(18px, 2.4vw, 22px);
  font-weight: 600;
}

.w-learn {
  max-width: 760px;
  margin: 56px auto 0;
  padding-top: 40px;
  border-top: 1px solid var(--line);
  text-align: left;
}

.w-learn__section + .w-learn__section { margin-top: 40px; }

.w-learn h2 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: clamp(22px, 3vw, 28px);
  letter-spacing: -0.015em;
}

.w-learn p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.w-learn a { color: var(--accent); }

.w-why {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.w-why > div {
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.w-why strong { display: block; margin-bottom: 6px; color: var(--text); font-size: 16px; }
.w-why p { margin: 0; font-size: 14px; line-height: 1.55; }

.w-learn__cta { margin: 40px 0 8px; text-align: center; }

.b-promo--wide {
  display: flex;
  margin: 8px 0 0;
}

.b-promo--wide > span:nth-child(2) { flex: 1; }

@media (max-width: 768px) {
  .w-learn { margin-top: 40px; padding-top: 32px; }
  .w-why { grid-template-columns: minmax(0, 1fr); }
  .w-learn__cta .w-start { width: 100%; }
}

/* Builder landing pages (/program-builder/<slug>) */
.w-crumbs { justify-content: center; padding: 0 0 16px; }

.w-preset {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 560px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}

.w-preset svg { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--accent); }

.w-variants { display: flex; flex-wrap: wrap; gap: 8px; }

.w-learn .w-variants a { color: var(--text); text-decoration: none; }

.w-examples { margin-top: 16px; }

.w-learn .w-examples a { color: inherit; }

/* Comparison page (/best-ai-workout-plan-generators) */
.c-wrap { max-width: 860px; padding-bottom: 64px; }
.c-head { padding-top: 48px; }

.c-disclosure {
  margin: 0;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.c-disclosure strong { color: var(--text); }

.c-page .p-section a { color: var(--accent); }

.c-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.c-table { min-width: 560px; }
.c-table th[scope="row"], .c-table thead th:first-child { width: 32%; }
.c-table thead th:nth-child(n+2) { width: auto; text-align: left; }
.c-table th[scope="row"] { font-size: 15px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--text); padding: 12px 18px; border-top: 1px solid var(--line); vertical-align: top; }
.c-table td { color: var(--muted); font-size: 14px; }
.c-table .c-ours { background: rgba(74, 209, 122, 0.06); }

.c-tools { display: grid; gap: 16px; }

.c-tool {
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.c-tool--ours { border-color: rgba(74, 209, 122, 0.45); }

.c-tool__head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.c-tool__head h3 { margin: 0; font-size: 20px; letter-spacing: -0.01em; }
.c-page .c-tool__head a { color: var(--text); text-decoration: none; }

.c-tool__num {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--chip);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.c-tag {
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(74, 209, 122, 0.15);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  vertical-align: middle;
}

.c-page .c-tool__best { margin: 0 0 14px; }

.c-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; margin: 0 0 16px; }
.c-facts dt { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.c-facts dd { margin: 2px 0 0; font-size: 15px; line-height: 1.5; }

.c-pros { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.c-pros__label { margin: 0 0 6px !important; color: var(--text) !important; font-weight: 600; font-size: 14px; }
.c-pros ul { margin: 0; }

.c-cta { text-align: center; }
.c-cta .m-store-btns { justify-content: center; }
.c-page .c-cta__apps { margin: 20px 0 10px; font-size: 14px; color: var(--muted); }

@media (max-width: 768px) {
  .c-wrap { padding: 0 16px 48px; }
  .c-head { padding-top: 32px; }
  .c-tool { padding: 18px; }
  .c-facts, .c-pros { grid-template-columns: minmax(0, 1fr); }
}

/* Guides (/guides) */
.g-wrap { max-width: 760px; padding-bottom: 64px; }
.g-head { padding: 20px 0 8px; }
.g-head--index { padding-top: 48px; }
.g-meta { margin: -10px 0 0; color: var(--muted); font-size: 14px; }

.g-body { padding-top: 16px; }
.g-body h2 { margin: 44px 0 14px; font-size: 26px; letter-spacing: -0.015em; scroll-margin-top: 80px; }
.g-body p, .g-body li { color: #c9ced6; font-size: 17px; line-height: 1.75; }
.g-body p { margin: 0 0 16px; }
.g-body a, .g-faq a { color: var(--accent); }
.g-body .p-tips, .g-body .p-list-dash { margin: 0 0 16px; }
.g-body .p-tips li, .g-body .p-list-dash li { margin-bottom: 8px; }
.g-body strong { color: var(--text); }

.g-summary {
  margin: 8px 0 28px;
  padding: 20px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
}
.g-summary__label { margin: 0 0 8px !important; color: var(--text) !important; font-weight: 700; }
.g-summary ol, .g-steps { margin: 0 0 16px; padding-left: 22px; }
.g-summary ol { margin: 0; }
.g-summary li, .g-steps li { margin-bottom: 6px; }

.g-body .c-scroll { margin: 4px 0 20px; }
.g-table { min-width: 520px; }
.g-table td { font-size: 15px; color: #c9ced6; }
.g-table td:first-child { color: var(--text); font-weight: 600; }
.g-table th:nth-child(n+2) { width: auto; text-align: left; }

.g-plan { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin: 4px 0 20px; }

.g-cta {
  margin: 48px 0 8px;
  padding: 26px;
  background: var(--card);
  border: 1px solid rgba(74, 209, 122, 0.45);
  border-radius: 16px;
}
.g-body .g-cta h2 { margin-top: 0; }

.g-faq { padding-top: 32px; }
.g-faq h2 { margin: 0 0 14px; font-size: 26px; }

.g-more { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); }
.g-more h2 { margin: 0 0 10px; font-size: 20px; }
.g-more ul { margin: 0; padding-left: 20px; }
.g-more a { color: var(--accent); }

.g-list { display: grid; gap: 14px; padding-top: 16px; }
.g-card {
  display: block;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: inherit;
  text-decoration: none;
}
.g-card:hover { border-color: rgba(74, 209, 122, 0.6); }
.g-card h2 { margin: 0 0 8px; font-size: 22px; }
.g-card p { margin: 0 0 12px; color: var(--muted); line-height: 1.6; }
.g-card__meta { color: var(--accent); font-size: 14px; font-weight: 600; }

@media (max-width: 768px) {
  .g-wrap { padding: 0 16px 48px; }
  .g-body p, .g-body li { font-size: 16px; }
  .g-plan { grid-template-columns: minmax(0, 1fr); }
  .g-cta { padding: 20px; }
}
