  :root {
    --bg: #F7F5F0;
    --bg2: #EDEAE3;
    --bg3: #E3E0D8;
    --surface: #FFFFFF;
    --text: #1A1916;
    --text2: #5C5A54;
    --text3: #8C8A84;
    --green: #1A7A56;
    --green-light: #D6EDE4;
    --green-mid: #2EAB78;
    --amber: #9B6800;
    --amber-light: #FDF0D0;
    --teal: #0F6B7A;
    --teal-light: #D4EFF3;
    --coral: #B84040;
    --coral-light: #FAEBEB;
    --purple: #5B3FA6;
    --purple-light: #EDE9FA;
    --border: rgba(26,25,22,0.1);
    --border2: rgba(26,25,22,0.06);
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
  }

  /* Header */
  .app-header {
    background: var(--text);
    color: white;
    padding: 28px 40px 24px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
  }
  .header-title {
    font-family: 'DM Serif Display', serif;
    font-size: 28px;
    font-style: italic;
    letter-spacing: -0.5px;
    color: white;
  }
  .header-sub {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    margin-top: 2px;
    font-weight: 300;
    letter-spacing: 0.08em;
  }
  .header-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
  }
  .stat-pill {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50px;
    padding: 6px 16px;
    font-size: 12px;
    color: rgba(255,255,255,0.75);
  }
  .stat-pill strong { color: white; font-weight: 600; }

  /* Nav tabs */
  .nav-tabs {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 0;
    overflow-x: auto;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 100;
  }
  .nav-tab {
    padding: 16px 22px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text3);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all 0.2s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
  }
  .nav-tab:hover { color: var(--text2); }
  .nav-tab.active { color: var(--green); border-bottom-color: var(--green); }

  /* Main layout */
  .main { padding: 32px 40px; max-width: 1100px; margin: 0 auto; }
  .section { display: none; }
  .section.active { display: block; }

  /* Cards */
  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
  }
  .card-title {
    font-family: 'DM Serif Display', serif;
    font-size: 17px;
    margin-bottom: 12px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .card-icon {
    width: 30px; height: 30px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
  }
  .icon-green { background: var(--green-light); }
  .icon-amber { background: var(--amber-light); }
  .icon-teal { background: var(--teal-light); }
  .icon-coral { background: var(--coral-light); }
  .icon-purple { background: var(--purple-light); }

  /* Section header */
  .section-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--text3);
    margin: 28px 0 12px;
    text-transform: uppercase;
  }

  /* Day schedule grid */
  .week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 12px;
  }
  .day-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--surface);
    text-align: center;
  }
  .day-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
  .day-card.active-day { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-light); }
  .day-card.workout-day { background: var(--green-light); border-color: rgba(26,122,86,0.2); }
  .day-card.cardio-day { background: var(--teal-light); border-color: rgba(15,107,122,0.2); }
  .day-card.rest-day { background: var(--amber-light); border-color: rgba(155,104,0,0.15); }
  .day-card.prep-day { background: var(--purple-light); border-color: rgba(91,63,166,0.2); }
  .day-name { font-size: 10px; font-weight: 600; letter-spacing: 0.1em; color: var(--text3); margin-bottom: 4px; }
  .day-type { font-size: 12px; font-weight: 500; color: var(--text); margin-bottom: 3px; }
  .day-time { font-size: 10px; color: var(--text3); }

  /* Detail panel */
  .detail-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin-bottom: 24px;
  }
  .detail-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
  }
  .detail-day-name {
    font-family: 'DM Serif Display', serif;
    font-size: 22px;
  }
  .detail-body { padding: 24px; }

  /* Badges */
  .badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 50px;
  }
  .badge-green { background: var(--green-light); color: var(--green); }
  .badge-amber { background: var(--amber-light); color: var(--amber); }
  .badge-teal { background: var(--teal-light); color: var(--teal); }
  .badge-coral { background: var(--coral-light); color: var(--coral); }
  .badge-purple { background: var(--purple-light); color: var(--purple); }
  .badge-gray { background: var(--bg2); color: var(--text2); }

  /* Exercises */
  .exercise-list { display: flex; flex-direction: column; gap: 12px; }
  .exercise-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
  }
  .ex-num {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--green-light);
    color: var(--green);
    font-size: 12px;
    font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .ex-content { flex: 1; min-width: 0; }
  .ex-name { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
  .ex-meta { font-size: 12px; color: var(--green); font-weight: 500; margin-bottom: 4px; }
  .ex-note { font-size: 12px; color: var(--text2); line-height: 1.5; margin-bottom: 6px; }
  .ex-wrist { font-size: 11px; background: var(--amber-light); color: var(--amber); padding: 3px 10px; border-radius: 4px; display: inline-block; margin-bottom: 6px; }
  .yt-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #CC0000;
    text-decoration: none;
    background: #FFF0F0;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(204,0,0,0.15);
    transition: all 0.15s;
    font-weight: 500;
  }
  .yt-link:hover { background: #FFE0E0; }
  .yt-icon { font-size: 13px; }

  /* Meal portions */
  .meal-block {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 10px;
  }
  .meal-time {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text3);
    margin-bottom: 6px;
    text-transform: uppercase;
  }
  .meal-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
  }
  .portion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    margin-top: 8px;
  }
  .portion-item {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: 8px;
    padding: 10px 12px;
    text-align: center;
  }
  .portion-amount {
    font-size: 18px;
    font-weight: 600;
    color: var(--green);
    display: block;
    line-height: 1.2;
    margin-bottom: 2px;
  }
  .portion-unit { font-size: 10px; color: var(--text3); display: block; }
  .portion-label { font-size: 11px; color: var(--text2); display: block; margin-top: 2px; font-weight: 500; }

  /* Tips & alerts */
  .tip-box {
    background: var(--green-light);
    border-left: 3px solid var(--green);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 12px 16px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #0F4D38;
    line-height: 1.6;
  }
  .warn-box {
    background: var(--amber-light);
    border-left: 3px solid var(--amber);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 12px 16px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #5A3D00;
    line-height: 1.6;
  }
  .info-box {
    background: var(--teal-light);
    border-left: 3px solid var(--teal);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 12px 16px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #0A3D45;
    line-height: 1.6;
  }

  /* Two-col grid */
  .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

  /* Prep base cards */
  .prep-card {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 16px;
    background: var(--surface);
  }
  .prep-card-accent { height: 4px; border-radius: 2px; margin-bottom: 10px; }
  .prep-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
  .prep-card p { font-size: 12px; color: var(--text2); line-height: 1.5; }
  .prep-rotation { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }

  /* Lentil tags */
  .lentil-tag {
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 50px;
    background: var(--purple-light);
    color: var(--purple);
    font-weight: 500;
  }

  /* Principles list */
  .principle-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border2);
    align-items: flex-start;
  }
  .principle-item:last-child { border-bottom: none; }
  .p-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
  }
  .p-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
  .p-desc { font-size: 12px; color: var(--text2); line-height: 1.5; }

  /* Progress tracker */
  .progress-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border2);
  }
  .progress-row:last-child { border-bottom: none; }
  .progress-label { font-size: 13px; font-weight: 500; min-width: 120px; }
  .progress-bar-wrap { flex: 1; height: 8px; background: var(--bg2); border-radius: 4px; overflow: hidden; }
  .progress-bar { height: 100%; border-radius: 4px; background: var(--green-mid); }
  .progress-value { font-size: 13px; font-weight: 600; color: var(--green); min-width: 50px; text-align: right; }

  /* Metric stats */
  .metric-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
  }
  .metric-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
  }
  .metric-value { font-family: 'DM Serif Display', serif; font-size: 28px; color: var(--green); }
  .metric-label { font-size: 11px; color: var(--text3); margin-top: 2px; }

  /* Routine timeline */
  .timeline { position: relative; padding-left: 24px; }
  .timeline::before {
    content: '';
    position: absolute;
    left: 7px; top: 8px; bottom: 8px;
    width: 1px;
    background: var(--border);
  }
  .tl-item { position: relative; padding-bottom: 16px; }
  .tl-dot {
    position: absolute;
    left: -20px;
    top: 4px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--green-light);
    border: 2px solid var(--green);
  }
  .tl-time { font-size: 11px; font-weight: 600; color: var(--green); }
  .tl-activity { font-size: 13px; font-weight: 500; }
  .tl-note { font-size: 11px; color: var(--text3); }

  /* Responsive */
  @media (max-width: 700px) {
    .app-header { padding: 20px; }
    .main { padding: 20px; }
    .nav-tabs { padding: 0 12px; }
    .nav-tab { padding: 14px 14px; font-size: 12px; }
    .week-grid { grid-template-columns: repeat(4, 1fr); }
    .grid2, .grid3, .metric-row { grid-template-columns: 1fr; }
    .day-card { padding: 10px 6px; }
  }

  /* Print / save notice */
  .save-bar {
    background: var(--text);
    color: white;
    text-align: center;
    padding: 10px;
    font-size: 12px;
    color: rgba(255,255,255,0.6);
  }
  .save-bar strong { color: white; }