/* =============================================
     DESIGN TOKENS — Sage & Stone
  ============================================= */
  :root {
    --transition-theme: background 0.45s ease, color 0.45s ease, border-color 0.45s ease, box-shadow 0.45s ease;
  }
  body.theme-sage {
    --bg:          #f9f7f4;
    --bg-alt:      #ffffff;
    --bg-card:     #ffffff;
    --bg-subtle:   #f2efe9;
    --text:        #1c1c1c;
    --text-mid:    #4a4a4a;
    --text-muted:  #7a7a7a;
    --accent:      #3d6b4f;
    --accent-lt:   #e8f0eb;
    --accent-2:    #c9a96e;
    --border:      #e4ded6;
    --border-lt:   #ede9e3;
    --success:     #2e7d4f;
    --warning:     #b07d2a;
    --error:       #b3402e;
    --hero-bg:     linear-gradient(160deg, #f2efe9 0%, #e8f0eb 100%);
    --nav-bg:      rgba(249,247,244,0.92);
    --shadow-sm:   0 2px 12px rgba(0,0,0,0.06);
    --shadow-md:   0 8px 32px rgba(0,0,0,0.08);
    --shadow-lg:   0 20px 60px rgba(0,0,0,0.10);
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body:    'DM Sans', system-ui, sans-serif;
    --radius-sm:   6px;
    --radius-md:   12px;
    --radius-lg:   20px;
    --radius-xl:   28px;
  }

  /* =============================================
     RESET & BASE
  ============================================= */
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }
  body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    transition: var(--transition-theme);
    -webkit-font-smoothing: antialiased;
  }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
  }

  /* =============================================
     NAV
  ============================================= */
  nav {
    position: sticky; top: 0; z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0 3rem;
    display: flex; align-items: center; justify-content: space-between;
    height: 90px;
  }
  .nav-logo {
    text-decoration: none;
    display: flex;
    align-items: center;
  }
  .nav-logo-img {
    height: 78px;
    width: auto;
    display: block;
  }
  .nav-links { display: flex; gap: 2rem; list-style: none; align-items: center; }
  .nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    transition: color 0.2s;
    position: relative;
  }
  .nav-links a::after {
    content: '';
    position: absolute; bottom: -3px; left: 0; right: 0;
    height: 1.5px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform 0.25s;
    transform-origin: left;
  }
  .nav-links a:hover { color: var(--text); }
  .nav-links a:hover::after { transform: scaleX(1); }
  .nav-cta {
    background: var(--accent);
    color: #fff !important;
    padding: 0.5rem 1.3rem;
    border-radius: 6px;
    font-size: 0.83rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-decoration: none;
    transition: opacity 0.2s;
  }
  .nav-cta:hover { opacity: 0.85; }
  .nav-cta::after { display: none !important; }
  .nav-login {
    color: var(--accent) !important;
    font-weight: 600;
  }
  .nav-dropdown {
    position: relative;
  }
  .nav-dropdown > a::after { display: none !important; }
  .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 200px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    z-index: 1000;
    margin-top: 0.5rem;
  }
  .dropdown-menu.active {
    display: flex;
    flex-direction: column;
  }
  .dropdown-menu a {
    padding: 0.75rem 1.2rem;
    color: var(--text-mid);
    font-size: 0.85rem;
    text-decoration: none;
    border-bottom: 1px solid var(--border-lt);
    transition: background 0.2s, color 0.2s;
  }
  .dropdown-menu a:last-child {
    border-bottom: none;
  }
  .dropdown-menu a:hover {
    background: var(--accent-lt);
    color: var(--accent);
  }
  .hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
  .hamburger span { display: block; width: 22px; height: 1.5px; background: var(--text); border-radius: 2px; }
  .mobile-menu {
    display: none; flex-direction: column;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 90px; z-index: 99;
  }
  .mobile-menu.open { display: flex; }
  .mobile-menu a { padding: 0.9rem 2rem; color: var(--text-mid); font-size: 0.9rem; font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--border-lt); }
  .mobile-menu .m-cta { background: var(--accent); color: #fff; text-align: center; font-weight: 700; }

  /* =============================================
     UTILITIES
  ============================================= */
  .container { max-width: 1120px; margin: 0 auto; padding: 0 2rem; }
  .eyebrow {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.9rem;
  }
  .eyebrow::before { content: '— '; }
  .display-heading {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--text);
  }
  .display-heading em { color: var(--accent); font-style: italic; }
  .body-lg { font-size: 1.05rem; color: var(--text-mid); line-height: 1.75; }
  .divider { width: 48px; height: 2px; background: var(--accent); margin: 1.4rem 0; border-radius: 2px; }
  .fade-up { opacity: 0; transform: translateY(18px); transition: opacity 0.5s ease-out, transform 0.5s ease-out; }
  .fade-up.visible { opacity: 1; transform: none; }
  @media (prefers-reduced-motion: reduce) { .fade-up { opacity: 1; transform: none; } }

  .btn-fill {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 0.8rem 1.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
    border: none; cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
    font-family: var(--font-body);
    min-height: 44px;
  }
  .btn-fill:hover { opacity: 0.85; transform: translateY(-1px); }
  .btn-ghost {
    display: inline-block;
    background: transparent;
    color: var(--text);
    padding: 0.8rem 1.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-decoration: none;
    border: 1.5px solid var(--border);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    font-family: var(--font-body);
    min-height: 44px;
  }
  .btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
  .text-link { color: var(--accent); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--accent-lt); transition: border-color 0.2s; }
  .text-link:hover { border-color: var(--accent); }

  /* =============================================
     HERO
  ============================================= */
  #home {
    background: var(--hero-bg);
    padding: 6.5rem 0 5rem;
    overflow: hidden;
    position: relative;
  }
  .hero-inner { display: grid; grid-template-columns: 1fr 1.5fr; gap: 4rem; align-items: center; }
  .hero-tag {
    display: inline-flex; align-items: center; gap: 0.5rem;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-mid);
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.38rem 0.9rem;
    border-radius: 20px;
    margin-bottom: 1.6rem;
    letter-spacing: 0.04em;
  }
  .hero-tag .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
  @keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.5;transform:scale(1.4)} }
  #home h1 {
    font-family: var(--font-display);
    font-size: clamp(2.3rem, 4.6vw, 3.6rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 1.4rem;
    color: var(--text);
  }
  #home h1 em { color: var(--accent); font-style: italic; }
  #home .hero-sub { font-size: 1.05rem; color: var(--text-mid); line-height: 1.75; margin-bottom: 2.2rem; max-width: 500px; }
  .hero-btns { display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: center; }
  .hero-photo {
    aspect-ratio: 4/5;
    border-radius: var(--radius-lg);
    background: linear-gradient(165deg, var(--accent-lt), var(--bg-subtle));
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.8rem; text-align: center; padding: 2rem;
    position: relative; overflow: hidden;
    max-width: 50%;
    justify-self: center;
  }
  .hero-photo img, .about-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; image-rendering: auto; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
  .hero-photo .ph-glyph {
    font-family: var(--font-display);
    font-size: 5.5rem; font-weight: 800;
    color: var(--accent); opacity: 0.16; line-height: 1;
  }
  .hero-photo .ph-note { font-size: 0.74rem; color: var(--text-muted); font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
  .hero-photo .todo-chip {
    position: absolute; top: 1rem; right: 1rem;
    background: rgba(176,125,42,0.12); color: var(--warning);
    font-size: 0.64rem; font-weight: 700; letter-spacing: 0.08em;
    padding: 0.25rem 0.7rem; border-radius: 20px; text-transform: uppercase;
  }

  /* =============================================
     CREDIBILITY STRIP
  ============================================= */
  #credibility {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 1.6rem 0;
  }
  .cred-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1.5rem; flex-wrap: wrap;
  }
  .cred-item { display: flex; align-items: center; gap: 0.7rem; }
  .cred-item strong {
    font-family: var(--font-display);
    font-size: 1.25rem; font-weight: 700; color: var(--accent); line-height: 1.1;
    white-space: nowrap;
  }
  .cred-item span { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; letter-spacing: 0.03em; line-height: 1.35; max-width: 130px; }

  /* =============================================
     HOW IT WORKS
  ============================================= */
  #how {
    padding: 6.5rem 0;
    background: var(--bg);
  }
  .how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 3rem; }
  .how-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.2rem 1.9rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    transition: box-shadow 0.25s, transform 0.25s;
  }
  .how-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
  .how-step-num {
    font-family: var(--font-display);
    font-size: 2.6rem; font-weight: 700;
    color: var(--accent); opacity: 0.25; line-height: 1;
    margin-bottom: 1rem;
  }
  .how-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.6rem; }
  .how-card p { font-size: 0.87rem; color: var(--text-muted); line-height: 1.7; }

  /* =============================================
     LIBRARY (workouts + diet shared)
  ============================================= */
  .library-section { padding: 6.5rem 0; }
  #workouts { background: var(--bg-alt); }
  #diet { background: var(--bg); }
  .lib-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 2.2rem; flex-wrap: wrap; gap: 1rem; }
  .lib-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; }
  .lib-tab {
    padding: 0.45rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.2s;
    letter-spacing: 0.03em;
    min-height: 34px;
  }
  .lib-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
  .lib-tab:not(.active):hover { border-color: var(--accent); color: var(--accent); }
  .lib-panel { display: none; }
  .lib-panel.active { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .lib-panel.single-col.active { grid-template-columns: 1fr; }
  .prog-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.25s;
  }
  .prog-card:hover { box-shadow: var(--shadow-md); }
  .prog-head { padding: 1.3rem 1.5rem 1rem; border-bottom: 1px solid var(--border-lt); }
  .prog-head h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.35rem; }
  .prog-hook { font-size: 0.8rem; color: var(--text-muted); font-style: italic; margin-bottom: 0.7rem; }
  .meta-chips { display: flex; gap: 0.4rem; flex-wrap: wrap; }
  .meta-chip {
    font-size: 0.68rem; font-weight: 700;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    background: var(--accent-lt); color: var(--accent);
    letter-spacing: 0.03em;
  }
  .meta-chip.gold { background: rgba(201,169,110,0.14); color: #9a7c42; }
  .prog-body { padding: 0.9rem 1.5rem 1.5rem; }
  .plan-tbl { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
  .plan-tbl th {
    text-align: left; color: var(--text-muted); font-weight: 600;
    padding: 0.5rem 0 0.4rem; font-size: 0.72rem; letter-spacing: 0.06em;
    text-transform: uppercase; border-bottom: 1px solid var(--border-lt);
  }
  .plan-tbl td { padding: 0.5rem 0; border-bottom: 1px solid var(--border-lt); color: var(--text-mid); }
  .plan-tbl tr:last-child td { border: none; }
  .plan-tbl td:first-child { font-weight: 600; color: var(--text); width: 92px; }
  .plan-note { margin-top: 0.8rem; font-size: 0.76rem; color: var(--text-muted); padding-top: 0.8rem; border-top: 1px solid var(--border-lt); }
  .coach-voice {
    background: var(--bg-subtle);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 0.9rem 1.1rem;
    font-size: 0.82rem; color: var(--text-mid); font-style: italic;
    margin: 0 1.5rem 1.4rem;
    line-height: 1.65;
  }

  /* =============================================
     M&S-STYLE DETAILED PROGRAM CARDS
     (Workouts & Diet Plans — full metadata table + day breakdown)
  ============================================= */
  .program-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
  }
  .program-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text);
  }
  .program-desc {
    color: var(--text-mid);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
  }
  .program-meta-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 1.8rem;
  }
  .program-meta-table tr:not(:last-child) td {
    border-bottom: 1px solid var(--border-lt);
  }
  .program-meta-table td {
    padding: 0.75rem 1.1rem;
    font-size: 0.88rem;
  }
  .program-meta-table .pm-label {
    color: var(--accent);
    font-weight: 600;
    width: 40%;
  }
  .program-meta-table .pm-value {
    color: var(--text-mid);
  }
  .btn-download-workout {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.4rem;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.2s;
  }
  .btn-download-workout:hover { opacity: 0.88; }

  /* ---- Card header: title/description + download CTA side by side ---- */
  .program-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
  }
  .program-head-main { flex: 1 1 320px; min-width: 0; }
  .program-head .btn-download-workout { flex: 0 0 auto; }

  /* ---- At-a-glance stat strip ---- */
  .program-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.7rem;
    margin-bottom: 1.4rem;
  }
  .program-stat-box {
    background: var(--accent-lt);
    border-radius: var(--radius-md);
    padding: 0.8rem 0.9rem;
    text-align: center;
  }
  .program-stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.3;
  }
  .program-stat-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  /* ---- Secondary facts, two columns instead of a long vertical table ---- */
  .program-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.5rem 1.6rem;
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    padding: 1rem 1.2rem;
    margin-bottom: 1.8rem;
  }
  .program-facts .pfact {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    font-size: 0.85rem;
    padding: 0.25rem 0;
  }
  .program-facts dt { color: var(--accent); font-weight: 600; flex: 0 0 auto; }
  .program-facts dd { color: var(--text-mid); margin: 0; }

  /* ---- The weekly plan: one connected block ---- */
  .program-week {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
  }
  .program-week-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: var(--accent);
    padding: 0.75rem 1.2rem;
  }
  .program-week-head h4 {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    margin: 0;
  }
  .program-week-meta { font-size: 0.76rem; color: rgba(255,255,255,0.85); }

  .program-days {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 1px;
    background: var(--border);
    align-items: stretch;
  }
  /* On wide screens use the balanced column count the renderer worked out,
     so 4 days land as 2x2 and 6 days as 3x2 instead of leaving orphan rows. */
  @media (min-width: 900px) {
    .program-days,
    .program-meals { grid-template-columns: repeat(var(--pday-cols, 3), minmax(0, 1fr)); }
  }
  .program-day-block {
    background: var(--bg-card);
    padding: 1.1rem 1.2rem 1.2rem;
    display: flex;
    flex-direction: column;
  }
  .pday-head {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.7rem;
    border-bottom: 2px solid var(--accent-lt);
  }
  .pday-num {
    flex: 0 0 auto;
    background: var(--accent);
    color: #fff;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.24rem 0.5rem;
    border-radius: 4px;
    margin-top: 0.1rem;
  }
  .program-day-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    line-height: 1.3;
  }
  .program-day-focus {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.78rem;
    margin: 0.1rem 0 0;
  }
  /* ---- Diet: sample day meals as connected cards ---- */
  .program-meals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
    gap: 1px;
    background: var(--border);
    align-items: stretch;
  }
  .program-meal-block {
    background: var(--bg-card);
    padding: 1.1rem 1.2rem 1.2rem;
    display: flex;
    flex-direction: column;
  }
  .pmeal-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.7rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--accent-lt);
  }
  .pmeal-food {
    font-size: 0.85rem;
    color: var(--text-mid);
    line-height: 1.55;
    margin: 0 0 0.9rem;
    flex: 1 1 auto;
  }
  .pmeal-macros { display: flex; gap: 0.4rem; flex-wrap: wrap; }
  .pmeal-chip {
    background: var(--bg-subtle);
    border-radius: 999px;
    padding: 0.22rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
  }
  .program-meals-total {
    background: var(--bg-subtle);
    border-top: 1px solid var(--border);
    padding: 0.75rem 1.2rem;
    display: flex;
    gap: 1.4rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-mid);
  }
  .program-meals-total span strong { color: var(--accent); }

  .program-day-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
  .program-day-table th {
    text-align: left;
    background: var(--accent);
    color: #fff;
    padding: 0.55rem 0.8rem;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }
  .program-day-table th:first-child { border-radius: 6px 0 0 6px; }
  .program-day-table th:last-child { border-radius: 0 6px 6px 0; }
  .program-day-table td {
    padding: 0.5rem 0.8rem;
    border-bottom: 1px solid var(--border-lt);
    color: var(--text-mid);
  }
  .program-day-table tr:last-child td { border-bottom: none; }

  .diet-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
  }
  .diet-stat-box {
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
  }
  .diet-stat-value { font-size: 1.4rem; font-weight: 700; color: var(--accent); }
  .diet-stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.2rem; }

  .program-category-tabs {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
  }
  .program-category-tab {
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-alt);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
  }
  .program-category-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

  @media (max-width: 640px) {
    .diet-stats { grid-template-columns: repeat(2, 1fr); }
    .program-meta-table .pm-label { width: 50%; }
    .program-card { padding: 1.3rem; }
    .program-stats { grid-template-columns: repeat(2, 1fr); }
    .program-head .btn-download-workout { width: 100%; }
    .program-day-table { font-size: 0.8rem; }
    .program-day-table th, .program-day-table td { padding: 0.45rem 0.55rem; }
  }

  /* =============================================
     MACRO CALCULATOR
  ============================================= */
  .macro-calc {
    margin-top: 3.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2.2rem;
    box-shadow: var(--shadow-sm);
  }
  .macro-calc h3 { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; margin-bottom: 0.4rem; }
  .macro-calc .mc-sub { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1.6rem; }
  .mc-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem; align-items: end; }
  .mc-results {
    display: none;
    grid-template-columns: repeat(5, 1fr);
    gap: 1px; background: var(--border);
    border: 1px solid var(--border); border-radius: var(--radius-md);
    overflow: hidden; margin-top: 1.6rem;
  }
  .mc-results.show { display: grid; }
  .mc-res-cell { background: var(--bg-card); padding: 1.1rem 0.8rem; text-align: center; }
  .mc-res-cell strong { display: block; font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--accent); line-height: 1.1; margin-bottom: 0.25rem; }
  .mc-res-cell span { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }

  /* =============================================
     FORMS (shared)
  ============================================= */
  .fgroup { display: flex; flex-direction: column; gap: 0.4rem; }
  .fgroup label { font-size: 0.78rem; font-weight: 600; color: var(--text-mid); letter-spacing: 0.02em; }
  .fgroup input, .fgroup select, .fgroup textarea {
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.88rem;
    font-family: var(--font-body);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-height: 44px;
  }
  .fgroup select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a7a7a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.8rem center; padding-right: 2.2rem; }
  .fgroup input:focus, .fgroup select:focus, .fgroup textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-lt); }
  .fgroup textarea { resize: vertical; min-height: 72px; }
  .field-err { font-size: 0.72rem; color: var(--error); font-weight: 600; display: none; }
  .field-err.show { display: block; }

  /* =============================================
     PLAN GENERATOR WIZARD
  ============================================= */
  #generator { padding: 6.5rem 0; background: var(--bg-alt); }
  .wizard-wrap {
    max-width: 720px; margin: 3rem auto 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
  }
  .wiz-progress-track { height: 5px; background: var(--border-lt); }
  .wiz-progress-bar { height: 100%; background: var(--accent); width: 12.5%; transition: width 0.35s ease-out; border-radius: 0 3px 3px 0; }
  .wiz-body { padding: 2.4rem 2.6rem 2.6rem; }
  .wiz-step-label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.5rem; }
  .wiz-q {
    font-family: var(--font-display);
    font-size: 1.5rem; font-weight: 700; line-height: 1.25;
    margin-bottom: 0.5rem;
  }
  .wiz-hint { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1.8rem; }
  .wiz-step { display: none; }
  .wiz-step.active { display: block; animation: stepIn 0.3s ease-out; }
  @keyframes stepIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
  .wiz-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
  .wiz-row.single { grid-template-columns: 1fr; }
  .opt-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
  .opt-cards.three { grid-template-columns: repeat(3, 1fr); }
  .opt-card {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    padding: 1.1rem 1.2rem;
    cursor: pointer;
    text-align: left;
    font-family: var(--font-body);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    min-height: 44px;
  }
  .opt-card:hover { border-color: var(--accent); }
  .opt-card.selected { border-color: var(--accent); background: var(--accent-lt); box-shadow: 0 0 0 3px var(--accent-lt); }
  .opt-card .oc-title { font-size: 0.88rem; font-weight: 700; color: var(--text); display: block; margin-bottom: 0.2rem; }
  .opt-card .oc-desc { font-size: 0.75rem; color: var(--text-muted); line-height: 1.5; display: block; }
  .check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  .check-pill {
    display: flex; align-items: center; gap: 0.6rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    padding: 0.65rem 0.9rem;
    cursor: pointer;
    font-size: 0.84rem; font-weight: 600; color: var(--text-mid);
    transition: border-color 0.2s, background 0.2s;
    min-height: 44px;
  }
  .check-pill:hover { border-color: var(--accent); }
  .check-pill input { accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }
  .check-pill.checked { border-color: var(--accent); background: var(--accent-lt); color: var(--text); }
  .med-notice {
    display: none;
    background: rgba(176,125,42,0.1);
    border: 1px solid rgba(176,125,42,0.35);
    color: var(--warning);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1.1rem;
    font-size: 0.8rem; font-weight: 600;
    margin-top: 1.2rem; line-height: 1.55;
  }
  .med-notice.show { display: block; }
  .privacy-line {
    display: flex; align-items: flex-start; gap: 0.5rem;
    font-size: 0.76rem; color: var(--text-muted);
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
    padding: 0.8rem 1rem; margin-top: 1.2rem; line-height: 1.55;
  }
  .wiz-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 2.2rem; gap: 1rem; }
  .wiz-back {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 0.84rem; font-weight: 600;
    font-family: var(--font-body); padding: 0.6rem 0.4rem;
    transition: color 0.2s; min-height: 44px;
  }
  .wiz-back:hover { color: var(--text); }
  .wiz-back[disabled] { visibility: hidden; }
  .review-block { border: 1px solid var(--border-lt); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 0.7rem; background: var(--bg-card); }
  .review-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.7rem 1.1rem;
    background: var(--bg-subtle);
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted);
  }
  .review-head button { background: none; border: none; color: var(--accent); font-size: 0.74rem; font-weight: 700; cursor: pointer; font-family: var(--font-body); }
  .review-body { padding: 0.8rem 1.1rem; font-size: 0.84rem; color: var(--text-mid); line-height: 1.7; }

  /* Generation state */
  .gen-state { display: none; text-align: center; padding: 3rem 1rem; }
  .gen-state.show { display: block; }
  .gen-spin {
    width: 46px; height: 46px; margin: 0 auto 1.4rem;
    border: 3px solid var(--accent-lt);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }
  .gen-msg { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; color: var(--text); min-height: 1.6em; }

  /* Plan output */
  #planResult { display: none; padding: 2.4rem 2.6rem 2.6rem; }
  #planResult.show { display: block; }
  .plan-out-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 0.4rem; gap: 1rem; flex-wrap: wrap; }
  .plan-out-header h3 { font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; line-height: 1.2; }
  .plan-headline-nums {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 1px; background: var(--border);
    border: 1px solid var(--border); border-radius: var(--radius-md);
    overflow: hidden; margin: 1.4rem 0 1.8rem;
  }
  .phn-cell { background: var(--bg-card); padding: 1rem 0.8rem; text-align: center; }
  .phn-cell strong { display: block; font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; color: var(--accent); line-height: 1.15; margin-bottom: 0.2rem; }
  .phn-cell span { font-size: 0.68rem; color: var(--text-muted); font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
  .out-section { margin-bottom: 1.7rem; }
  .out-section-title { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.7rem; display: flex; align-items: center; gap: 0.5rem; }
  .out-section-title::after { content: ''; flex: 1; height: 1px; background: var(--border-lt); }
  .out-row { display: flex; justify-content: space-between; align-items: baseline; padding: 0.45rem 0; border-bottom: 1px solid var(--border-lt); font-size: 0.84rem; gap: 1.2rem; }
  .out-row:last-child { border: none; }
  .out-row span:first-child { color: var(--text-muted); flex-shrink: 0; }
  .out-row span:last-child { font-weight: 600; color: var(--text); text-align: right; }
  .sub-callout {
    background: rgba(176,125,42,0.08);
    border: 1px solid rgba(176,125,42,0.3);
    border-radius: var(--radius-sm);
    padding: 0.8rem 1rem;
    font-size: 0.78rem; color: var(--text-mid);
    margin-top: 0.8rem; line-height: 1.6;
  }
  .plan-actions { display: flex; gap: 0.8rem; margin-top: 1.6rem; flex-wrap: wrap; }
  .disclaimer-line { font-size: 0.72rem; color: var(--text-muted); margin-top: 1.4rem; line-height: 1.6; }

  /* =============================================
     COMPETITIONS
  ============================================= */
  #competitions { padding: 6.5rem 0; background: var(--bg); }
  .comp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.3rem; margin-top: 2.6rem; }
  .comp-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.6rem 1.7rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.25s;
    position: relative;
  }
  .comp-card:hover { box-shadow: var(--shadow-md); }
  .comp-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.8rem; margin-bottom: 0.7rem; }
  .fed-badge {
    font-size: 0.66rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
    padding: 0.25rem 0.7rem; border-radius: 20px;
    background: var(--accent-lt); color: var(--accent);
  }
  .fed-badge.endurance { background: rgba(201,169,110,0.15); color: #9a7c42; }
  .sample-chip {
    font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em;
    padding: 0.22rem 0.6rem; border-radius: 20px; text-transform: uppercase;
    background: rgba(176,125,42,0.12); color: var(--warning);
  }
  .comp-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.3rem; }
  .comp-meta { font-size: 0.8rem; color: var(--text-muted); line-height: 1.7; }
  .comp-meta strong { color: var(--text-mid); }
  .countdown { display: inline-block; margin-top: 0.7rem; font-size: 0.74rem; font-weight: 700; color: var(--accent); background: var(--accent-lt); padding: 0.28rem 0.8rem; border-radius: 20px; }
  .comp-desc { font-size: 0.82rem; color: var(--text-mid); margin-top: 0.8rem; line-height: 1.65; }

  /* =============================================
     ABOUT / FOUNDER STORY
  ============================================= */
  #about { padding: 6.5rem 0; background: var(--bg-alt); }
  .about-layout { display: grid; grid-template-columns: 1fr 1.55fr; gap: 4.5rem; align-items: start; }
  .about-avatar {
    width: 100%;
    aspect-ratio: 3/4;
    border-radius: var(--radius-lg);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    overflow: hidden;
    position: relative;
    display: flex; align-items: center; justify-content: center;
  }
  .about-avatar-letter { font-family: var(--font-display); font-size: 7rem; font-weight: 700; color: var(--accent); opacity: 0.18; user-select: none; }
  .about-medals { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1.2rem; }
  .medal-badge {
    display: flex; align-items: center; gap: 0.6rem;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 0.55rem 0.9rem;
    font-size: 0.78rem; font-weight: 600; color: var(--text-mid);
  }
  .medal-badge .m-icon { font-size: 1.05rem; }
  .about-right blockquote {
    font-family: var(--font-display);
    font-size: 1.2rem; font-style: italic;
    color: var(--text-mid); line-height: 1.6;
    margin: 1.4rem 0 1.8rem;
    padding-left: 1.5rem;
    border-left: 3px solid var(--accent);
  }
  .about-right p { color: var(--text-mid); font-size: 0.95rem; line-height: 1.8; margin-bottom: 1.1rem; }
  .timeline { margin-top: 2.4rem; position: relative; padding-left: 1.6rem; }
  .timeline::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--border); border-radius: 2px; }
  .tl-item { position: relative; padding-bottom: 1.6rem; }
  .tl-item:last-child { padding-bottom: 0; }
  .tl-item::before {
    content: ''; position: absolute; left: -1.6rem; top: 6px;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--accent); border: 3px solid var(--bg-alt);
    box-shadow: 0 0 0 1.5px var(--accent);
  }
  .tl-year { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.2rem; }
  .tl-item h4 { font-size: 0.92rem; font-weight: 700; margin-bottom: 0.25rem; }
  .tl-item p { font-size: 0.83rem; color: var(--text-muted); line-height: 1.65; margin: 0; }

  /* =============================================
     TESTIMONIALS
  ============================================= */
  #results { padding: 6.5rem 0; background: var(--bg); }
  .testi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; margin-top: 2.6rem; }
  .testi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.8rem 1.6rem;
    box-shadow: var(--shadow-sm);
    position: relative;
  }
  .testi-card .t-quote { font-size: 0.88rem; color: var(--text-mid); line-height: 1.75; font-style: italic; margin-bottom: 1.2rem; }
  .testi-card .t-name { font-size: 0.82rem; font-weight: 700; }
  .testi-card .t-ctx { font-size: 0.74rem; color: var(--text-muted); }

  /* =============================================
     CTA BAND + NEWSLETTER
  ============================================= */
  #cta-band {
    background: var(--accent);
    padding: 4.5rem 0;
    text-align: center;
  }
  #cta-band h2 {
    font-family: var(--font-display);
    color: #fff; font-size: clamp(1.6rem, 3.2vw, 2.4rem);
    font-weight: 700; letter-spacing: -0.02em;
    margin-bottom: 1.6rem; line-height: 1.25;
  }
  #cta-band .btn-inverse {
    display: inline-block;
    background: #fff; color: var(--accent);
    padding: 0.85rem 2.2rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem; font-weight: 700; letter-spacing: 0.04em;
    text-decoration: none; border: none; cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
  }
  #cta-band .btn-inverse:hover { opacity: 0.9; transform: translateY(-1px); }
  #newsletter { padding: 4.5rem 0; background: var(--bg-alt); border-top: 1px solid var(--border); }
  .newsletter-inner { max-width: 560px; margin: 0 auto; text-align: center; }
  .newsletter-inner h3 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; }
  .newsletter-inner p { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 1.5rem; }
  .nl-row { display: flex; gap: 0.7rem; }
  .nl-row input {
    flex: 1; padding: 0.75rem 1rem;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg-card); color: var(--text);
    font-size: 0.88rem; font-family: var(--font-body); outline: none;
    min-height: 44px;
  }
  .nl-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-lt); }
  #nlSuccess { display: none; color: var(--success); font-size: 0.84rem; font-weight: 600; margin-top: 0.9rem; }
  #wkEmailStatus, #dtEmailStatus, #planEmailStatus { font-size: 0.84rem; font-weight: 600; margin-top: 0.9rem; min-height: 1.2em; }
  #wkEmailStatus.ok, #dtEmailStatus.ok, #planEmailStatus.ok { color: var(--success); }
  #wkEmailStatus.err, #dtEmailStatus.err, #planEmailStatus.err { color: #c0392b; }
  .plan-email { margin-top: 1.6rem; padding-top: 1.4rem; border-top: 1px solid var(--border-lt); max-width: 520px; }

  /* =============================================
     CHECK-IN TRACKER
  ============================================= */
  .ck-board {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--shadow-sm);
    margin: 2.2rem 0 1.6rem;
  }
  .ck-goal-row { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 1rem; }
  .ck-advice {
    background: var(--accent-lt); border-radius: var(--radius-sm);
    padding: 1rem 1.2rem; margin-top: 1.4rem;
  }
  .ck-advice p { font-size: 0.88rem; line-height: 1.6; margin: 0.25rem 0; }
  .ck-advice p:first-child { font-weight: 600; }
  .ck-chart { margin-top: 1.4rem; }
  .ck-empty { font-size: 0.85rem; color: var(--text-muted); }
  .ck-form { margin-bottom: 1.6rem; }
  .ck-del {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; font-size: 0.85rem; padding: 0.2rem 0.4rem;
  }
  .ck-del:hover { color: #c0392b; }
  #ckEmailStatus { font-size: 0.84rem; font-weight: 600; margin-top: 0.9rem; min-height: 1.2em; }
  #ckEmailStatus.ok { color: var(--success); }
  #ckEmailStatus.err { color: #c0392b; }

  /* Program video link */
  .video-link {
    display: inline-flex; align-items: center; gap: 0.45rem;
    font-size: 0.8rem; font-weight: 700; color: var(--accent);
    text-decoration: none; margin-top: 0.7rem;
  }
  .video-link:hover { text-decoration: underline; }
  .video-link .vl-play {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.4rem; height: 1.4rem; border-radius: 50%;
    background: var(--accent); color: #fff; font-size: 0.6rem; padding-left: 2px;
  }

  /* =============================================
     21-DAY CHALLENGE
  ============================================= */
  .ch-week { margin-top: 2rem; }
  .ch-week-title {
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--accent); margin-bottom: 0.8rem;
  }
  .ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.8rem; }
  .ch-day {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 0.9rem 1rem; box-shadow: var(--shadow-sm);
  }
  .ch-day strong { display: block; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.4rem; }
  .ch-day p { font-size: 0.84rem; line-height: 1.55; margin: 0.15rem 0; }
  .ch-day p em { color: var(--accent); font-style: normal; font-weight: 600; }
  #chStatus { font-size: 0.84rem; font-weight: 600; margin-top: 0.9rem; min-height: 1.2em; }
  #chStatus.ok { color: var(--success); }
  #chStatus.err { color: #c0392b; }
  .nl-row button:disabled { opacity: 0.6; cursor: wait; }

  /* =============================================
     FOOTER
  ============================================= */
  footer { background: var(--bg-subtle); border-top: 1px solid var(--border); padding: 3.5rem 2rem 2rem; }
  .footer-grid { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 2.5rem; }
  .footer-logo { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--text); margin-bottom: 0.6rem; }
  .footer-logo em { color: var(--accent); font-style: italic; }
  .footer-grid p { font-size: 0.78rem; color: var(--text-muted); line-height: 1.7; }
  .f-col h4 { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.9rem; }
  .f-col a { display: block; font-size: 0.82rem; color: var(--text-mid); text-decoration: none; padding: 0.22rem 0; transition: color 0.2s; }
  .f-col a:hover { color: var(--accent); }
  .footer-bottom {
    max-width: 1120px; margin: 2.5rem auto 0; padding-top: 1.4rem;
    border-top: 1px solid var(--border);
    display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  }
  .footer-bottom p { font-size: 0.72rem; color: var(--text-muted); }

  /* =============================================
     RESPONSIVE
  ============================================= */
  @media (max-width: 900px) {
    nav { padding: 0 1.5rem; }
    .nav-links { display: none; }
    .hamburger { display: flex; }
    .hero-inner { grid-template-columns: 1fr; gap: 2.5rem; }
    .hero-photo { max-width: 380px; }
    .cred-row { justify-content: center; }
    .how-grid { grid-template-columns: 1fr; }
    .lib-panel.active { grid-template-columns: 1fr; }
    .mc-grid { grid-template-columns: 1fr 1fr; }
    .mc-results { grid-template-columns: repeat(3, 1fr); }
    .comp-grid { grid-template-columns: 1fr; }
    .about-layout { grid-template-columns: 1fr; gap: 2.5rem; }
    .about-avatar { max-width: 260px; }
    .testi-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .wiz-body, #planResult { padding: 1.8rem 1.4rem 2rem; }
    .opt-cards.three { grid-template-columns: 1fr 1fr; }
  }
  @media (max-width: 600px) {
    .container { padding: 0 1.2rem; }
    nav { padding: 0 1.2rem; }
    .opt-cards, .opt-cards.three, .check-grid, .wiz-row { grid-template-columns: 1fr; }
    .mc-grid { grid-template-columns: 1fr; }
    .mc-results { grid-template-columns: 1fr 1fr; }
    .plan-headline-nums { grid-template-columns: 1fr; }
    .nl-row { flex-direction: column; }
    .footer-grid { grid-template-columns: 1fr; gap: 1.8rem; }
  }

  /* Active nav link (multi-page) */
  .nav-links a.active { color: var(--text); }
  .nav-links a.active::after { transform: scaleX(1); }
  .mobile-menu a.active { color: var(--accent); font-weight: 700; }

  /* =============================================
     PRINT — plan output only (generator page)
  ============================================= */
  @media print {
    body.page-generator nav, body.page-generator .mobile-menu, body.page-generator footer,
    body.page-generator .page-hero,
    body.page-generator .gen-intro, body.page-generator .wiz-progress-track, body.page-generator .wiz-body,
    body.page-generator .gen-state, body.page-generator .plan-actions,
    body.page-generator .plan-email { display: none !important; }
    body.page-generator #generator { padding: 0.5rem; }
    body.page-generator .wizard-wrap { border: none; box-shadow: none; max-width: 100%; }
    body.page-generator #planResult { display: block !important; padding: 0; }
    body.page-generator { background: #fff; }
  }

  /* =============================================
     MAGAZINE REVAMP — M&F-style layout, Sage & Stone colors
  ============================================= */

  /* --- Full-bleed photo hero (home) --- */
  .mag-hero {
    position: relative;
    background: linear-gradient(135deg, #1c1c1c 0%, #2a2a2a 100%);
    padding: 5.5rem 0 5rem;
  }
  .mag-hero::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(100deg, rgba(20,24,21,0.85) 0%, rgba(20,24,21,0.45) 100%);
    pointer-events: none;
  }

  /* --- Carousel --- */
  .hero-carousel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    width: 100%;
    aspect-ratio: 9 / 12;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  }
  .carousel-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    opacity: 0;
    transition: opacity 1s ease-in-out;
  }
  .carousel-img.active {
    opacity: 1;
  }
  .carousel-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
  }
  .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
  }
  .dot:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.1);
  }
  .dot.active {
    background: rgba(255, 255, 255, 1);
  }

  .mag-hero .container { position: relative; z-index: 1; }
  .mag-hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3.5rem; align-items: center; }
  .mh-kicker {
    display: inline-flex; align-items: center; gap: 0.5rem;
    color: var(--accent-2);
    font-size: 0.72rem; font-weight: 800; letter-spacing: 0.22em; text-transform: uppercase;
    margin-bottom: 1.1rem;
  }
  .mh-kicker::before { content: ''; width: 26px; height: 2px; background: var(--accent-2); }
  .mag-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 5.2vw, 3.9rem);
    line-height: 1.06; color: #fff; letter-spacing: -0.01em;
    margin-bottom: 1.2rem;
  }
  .mag-hero h1 em { color: var(--accent-2); font-style: italic; }
  .mag-hero .mh-sub { color: rgba(255,255,255,0.82); font-size: 1.02rem; line-height: 1.7; max-width: 520px; margin-bottom: 2rem; }
  .mag-hero .hero-btns .text-link { color: #fff; }
  .mh-stats { display: flex; gap: 2.2rem; margin-top: 2.4rem; flex-wrap: wrap; }
  .mh-stats div { color: #fff; }
  .mh-stats strong { display: block; font-family: var(--font-display); font-size: 1.6rem; color: var(--accent-2); }
  .mh-stats span { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.65); }
  .mh-photo { position: relative; }
  .mh-photo img {
    width: 100%; aspect-ratio: 4/5; object-fit: cover; object-position: center top;
    border-radius: var(--radius-lg); border: 3px solid rgba(201,169,110,0.7);
    box-shadow: 0 24px 60px rgba(0,0,0,0.45); display: block;
  }
  .mh-photo .mh-caption {
    position: absolute; left: 1rem; bottom: 1rem;
    background: rgba(28,28,28,0.82); color: #fff; backdrop-filter: blur(6px);
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    padding: 0.45rem 0.8rem; border-radius: 8px; border-left: 3px solid var(--accent-2);
  }

  /* --- Page hero banner (section pages) --- */
  .page-hero {
    position: relative;
    min-height: 300px;
    display: flex; align-items: flex-end;
    background: #1c1c1c center / cover no-repeat;
  }
  .page-hero::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(20,24,21,0.30) 0%, rgba(20,24,21,0.85) 100%);
  }
  .page-hero .ph-inner { position: relative; z-index: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 3.2rem 2rem 2.6rem; }
  .page-hero .ph-kicker {
    color: var(--accent-2); font-size: 0.72rem; font-weight: 800;
    letter-spacing: 0.22em; text-transform: uppercase; margin-bottom: 0.6rem;
    display: inline-flex; align-items: center; gap: 0.5rem;
  }
  .page-hero .ph-kicker::before { content: ''; width: 26px; height: 2px; background: var(--accent-2); }
  .page-hero h1 { font-family: var(--font-display); font-size: clamp(2rem, 4.2vw, 3rem); color: #fff; line-height: 1.1; margin-bottom: 0.5rem; }
  .page-hero h1 em { color: var(--accent-2); font-style: italic; }
  .page-hero .ph-sub { color: rgba(255,255,255,0.82); font-size: 0.98rem; max-width: 560px; }

  /* --- Magazine card grid --- */
  .mag-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; }
  .mag-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-md); overflow: hidden;
    box-shadow: var(--shadow-sm); text-decoration: none; color: inherit;
    display: flex; flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
  }
  .mag-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
  .mag-card .mc-img { aspect-ratio: 16/10; overflow: hidden; background: var(--bg-subtle); }
  .mag-card .mc-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.45s ease; }
  .mag-card:hover .mc-img img { transform: scale(1.07); }
  .mag-card .mc-body { padding: 1.15rem 1.25rem 1.35rem; }
  .mag-card .mc-tag {
    color: var(--accent); font-size: 0.66rem; font-weight: 800;
    letter-spacing: 0.14em; text-transform: uppercase;
  }
  .mag-card h3 { font-family: var(--font-display); font-size: 1.18rem; line-height: 1.25; margin: 0.35rem 0 0.45rem; }
  .mag-card p { font-size: 0.85rem; color: var(--text-mid); line-height: 1.55; }
  .mag-card .mc-more { display: inline-block; margin-top: 0.7rem; color: var(--accent); font-weight: 700; font-size: 0.8rem; }

  /* Generic card thumbnail — reused on Exercises, Articles and Recipes cards */
  .thumb-img { aspect-ratio: 16/10; overflow: hidden; background: var(--bg-subtle); border-radius: var(--radius-md) var(--radius-md) 0 0; }
  .thumb-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.45s ease; }
  .thumb-img:hover img { transform: scale(1.06); }

  .article-full-content { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 0.9rem; line-height: 1.7; color: var(--text-mid); }
  .article-full-content p { margin-bottom: 0.9rem; }
  .article-full-content p:last-child { margin-bottom: 0; }
  details.article-details summary.read-more { cursor: pointer; list-style: none; }
  details.article-details summary.read-more::-webkit-details-marker { display: none; }
  details.article-details[open] summary.read-more::after { content: ' (show less)'; font-weight: 400; opacity: 0.7; }

  /* --- Photo tile tabs (workout/diet categories) --- */
  .lib-tabs.tile-tabs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.8rem; width: 100%; margin-top: 1.6rem; }
  .lib-tabs.tile-tabs.five { grid-template-columns: repeat(5, 1fr); }
  .lib-tab.lib-tile {
    position: relative; aspect-ratio: 15/11;
    border-radius: 10px; overflow: hidden;
    border: 2.5px solid transparent;
    background-color: #1c1c1c; background-size: cover; background-position: center;
    color: #fff; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
    font-size: 0.74rem; line-height: 1.25; text-align: left;
    display: flex; align-items: flex-end;
    padding: 0.7rem 0.75rem; cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
  }
  .lib-tab.lib-tile::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(28,28,28,0.05) 25%, rgba(28,28,28,0.82) 100%);
  }
  .lib-tab.lib-tile span { position: relative; z-index: 1; text-shadow: 0 1px 6px rgba(0,0,0,0.8); }
  .lib-tab.lib-tile:hover { transform: translateY(-3px); }
  .lib-tab.lib-tile.active { border-color: var(--accent-2); }
  .lib-tab.lib-tile.active::after {
    content: '✓';
    position: absolute; top: 0.5rem; right: 0.55rem; z-index: 1;
    background: var(--accent-2); color: #1c1c1c;
    width: 21px; height: 21px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.72rem; font-weight: 900;
  }

  /* --- Section header (magazine style) --- */
  .mag-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.8rem; border-bottom: 3px solid #1c1c1c; padding-bottom: 0.8rem; }
  .mag-section-head h2 { font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2.1rem); }
  .mag-section-head h2 em { color: var(--accent); font-style: italic; }
  .mag-section-head a { color: var(--accent); font-weight: 700; font-size: 0.85rem; text-decoration: none; white-space: nowrap; }

  #explore { padding: 4.5rem 0; }
  .photo-credit { font-size: 0.66rem; color: var(--text-muted); text-align: right; margin-top: 0.6rem; }

  /* ===================== COMPETITION WINS SECTION ===================== */
  #competition-wins {
    padding: 5.5rem 0;
    background: linear-gradient(180deg, var(--bg-subtle) 0%, var(--bg) 100%);
  }

  .wins-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2rem;
    margin-bottom: 4.5rem;
  }

  .wins-gallery-photos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 210px));
    justify-content: center;
    gap: 1.2rem;
    margin-bottom: 3rem;
  }

  .wins-gallery-videos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 4.5rem;
  }

  .gallery-item {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }

  .gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
  }

  .gallery-photo-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 125%;
    background: #000;
    overflow: hidden;
  }

  .gallery-photo-wrap .gallery-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  /* Stage clips are shot vertically (9:16). Matching the box to the footage
     removes the black pillarbox bars and keeps the controls usable. */
  .gallery-video-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 177.78%;
    background: #000;
    overflow: hidden;
  }

  .gallery-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .gallery-caption {
    padding: 1.5rem;
  }

  .gallery-caption h4 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--text);
  }

  .gallery-caption p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
  }

  .wins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.4rem;
  }

  .comp-photo {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
    aspect-ratio: 3 / 4;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }

  .comp-photo:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
  }

  .comp-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .photo-tag {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(8px);
  }

  @media (max-width: 900px) {
    .mag-hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
    .mh-photo { max-width: 340px; margin: 0 auto; }
    .mag-grid { grid-template-columns: 1fr 1fr; }
    .lib-tabs.tile-tabs, .lib-tabs.tile-tabs.five { grid-template-columns: repeat(3, 1fr); }
    .wins-gallery { grid-template-columns: 1fr; }
    /* Vertical clips need real width — two up on tablets */
    .wins-gallery-videos { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .wins-grid { grid-template-columns: repeat(2, 1fr); gap: 1.8rem; }
  }
  @media (max-width: 600px) {
    nav { height: 72px; }
    .nav-logo-img { height: 52px; }
    .mobile-menu { top: 72px; }
    .mag-hero { padding: 3.5rem 0 3rem; }
    .mh-stats { gap: 1.4rem; }
    .mag-grid { grid-template-columns: 1fr; }
    .lib-tabs.tile-tabs, .lib-tabs.tile-tabs.five { grid-template-columns: repeat(2, 1fr); }
    .page-hero { min-height: 230px; }
    .page-hero .ph-inner { padding: 2.4rem 1.2rem 1.8rem; }
    #competition-wins { padding: 3.5rem 0; }
    .wins-gallery { gap: 1.5rem; margin-bottom: 3rem; }
    .wins-gallery-photos { grid-template-columns: repeat(auto-fit, minmax(110px, 150px)); gap: 0.8rem; }
    /* One per row on phones so the video fills the screen width and the
       native play button / scrubber are large enough to actually use */
    .wins-gallery-videos { grid-template-columns: 1fr; gap: 1.2rem; }
    .wins-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .gallery-item { border-radius: var(--radius-md); }
    .gallery-video { border-radius: var(--radius-md) var(--radius-md) 0 0; }
    .gallery-caption { padding: 1rem 1.1rem; }
    .gallery-caption h4 { font-size: 1rem; }
  }

/* ============ MEDIA FALLBACK (QA-006) ============
   Applied by js/main.js when an image/video fails to load — keeps the
   swapped-in placeholder feeling intentional rather than broken. */
.media-fallback {
  background: #26402f;
}
.media-fallback-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 160px;
  background: linear-gradient(135deg, #3d6b4f 0%, #26402f 100%);
  color: rgba(255,255,255,0.85);
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 1rem;
}
