    :root {
      --bg: #0f0f1a;
      --text: #e0e0ff;
      --card: #1a1a2e;
      --accent: #00d4ff;
      --border: #333366;
      --hover: #2a2a4a;
      --success: #00ff9d;
    }
    body {
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
      background: var(--bg);
      color: var(--text);
      margin: 0;
      padding: 20px 10px;
      line-height: 1.6;
    }
    h1 {
      text-align: center;
      color: var(--accent);
      margin-bottom: 10px;
      text-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
    }
    .subtitle {
      text-align: center;
      color: #a0a0ff;
      margin-bottom: 20px;
      font-size: 1.1rem;
    }

    /* ── Tab Nav ── */
    .tab-nav {
      display: flex;
      justify-content: center;
      gap: 8px;
      margin-bottom: 35px;
    }
    .tab-btn {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 10px 24px;
      color: #a0a0ff;
      font-size: 1rem;
      font-weight: 600;
      cursor: pointer;
      transition: background 0.2s, border-color 0.2s, color 0.2s;
      display: inline-flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
    }
    .tab-ico { font-size: 1.05rem; line-height: 1; }
    .tab-lbl { font-size: 0.78rem; line-height: 1.1; }
    .wk-docs-bar {
      display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
      margin: 0 0 14px; padding: 10px 12px;
      background: rgba(30,36,56,0.7); border: 1px solid rgba(80,90,130,0.35);
      border-radius: 10px;
    }
    .wk-docs-label { font-size: 0.72rem; color: #7080a0; font-weight: 600; margin-right: 4px; }
    .wk-docs-link {
      font-size: 0.78rem; font-weight: 600; color: #00d4ff; text-decoration: none;
      padding: 5px 10px; border-radius: 6px; border: 1px solid rgba(0,212,255,0.3);
      background: rgba(0,212,255,0.08);
    }
    .wk-docs-link:hover { background: rgba(0,212,255,0.16); }
    .log-sub-nav { display: flex; gap: 8px; margin: 0 0 14px; }
    .log-sub-btn {
      flex: 1; padding: 9px 12px; border-radius: 8px; font-weight: 600; font-size: 0.88rem;
      border: 1px solid rgba(80,90,130,0.4); background: rgba(30,36,56,0.7); color: #a0a8c0; cursor: pointer;
    }
    .log-sub-btn.active {
      border-color: #00d4ff; color: #00d4ff; background: rgba(0,212,255,0.1);
    }
    .log-panel { display: none; }
    .log-panel.active { display: block; }

    .tab-btn:hover {
      background: var(--hover);
      border-color: var(--accent);
    }
    .tab-btn.active {
      background: linear-gradient(135deg, #1e1e3a, #2a2a4a);
      border-color: var(--accent);
      color: var(--accent);
      box-shadow: 0 0 12px rgba(0, 212, 255, 0.2);
    }
    .tab-panel { display: none; }
    .tab-panel.active { display: block; }

    /* ── Stats Bar ── */
    .stats-bar {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 15px;
      margin: 0 0 40px;
    }
    .stat-card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 15px 25px;
      min-width: 140px;
      text-align: center;
      box-shadow: 0 4px 15px rgba(0,0,0,0.5);
      transition: transform 0.2s;
    }
    .stat-card:hover {
      transform: translateY(-5px);
      border-color: var(--accent);
    }
    .stat-value {
      font-size: 2.2rem;
      font-weight: bold;
      color: var(--accent);
      margin: 5px 0;
    }
    .stat-label {
      font-size: 0.95rem;
      color: #b0b0ff;
    }

    /* ── Accordions ── */
    .accordion {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 12px;
      margin-bottom: 20px;
      overflow: hidden;
      box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    }
    .accordion-header {
      background: linear-gradient(135deg, #1e1e3a, #2a2a4a);
      padding: 18px 24px;
      cursor: pointer;
      font-weight: bold;
      font-size: 1.3rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
      transition: background 0.3s;
    }
    .accordion-header:hover {
      background: linear-gradient(135deg, #2a2a4a, #3a3a5a);
    }
    .accordion-header::after {
      content: '▼';
      font-size: 1.1rem;
      transition: transform 0.3s;
    }
    .accordion.active .accordion-header::after {
      transform: rotate(180deg);
    }
    .accordion-content {
      max-height: 0;
      overflow: hidden;
      transition: max-height 0.5s ease-out, padding 0.3s;
      padding: 0 24px;
    }
    .accordion.active .accordion-content {
      max-height: 3000px;
      padding: 24px;
    }

    /* ── Tables ── */
    table {
      width: 100%;
      border-collapse: collapse;
      margin: 10px 0;
    }
    th, td {
      padding: 14px 12px;
      text-align: left;
      border-bottom: 1px solid var(--border);
    }
    th {
      background: #1e1e3a;
      color: var(--accent);
      font-weight: bold;
    }
    tr:hover {
      background: var(--hover);
    }
    .exercise-title {
      font-weight: 600;
      color: #a0d0ff;
    }
    .notes {
      white-space: pre-wrap;
      font-size: 0.95rem;
      color: #b0b0ff;
    }

    /* ── Volume Cards ── */
    .vol-bar {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 8px;
      margin: 0 0 32px;
    }
    .vol-card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 8px 14px;
      text-align: center;
      min-width: 80px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.4);
      transition: transform 0.2s, border-color 0.2s;
    }
    .vol-card:hover {
      transform: translateY(-3px);
      border-color: var(--accent);
    }
    .vol-card-value {
      font-size: 1.5rem;
      font-weight: 700;
      color: var(--accent);
      line-height: 1.2;
    }
    .vol-card-label {
      font-size: 0.72rem;
      color: #8090bb;
      white-space: nowrap;
      margin-top: 2px;
    }
    .vol-card-target {
      font-size: 0.62rem;
      opacity: 0.55;
      margin-top: 2px;
    }
    .vol-card.vol-under .vol-card-value { color: #fbbf24; }
    .vol-card.vol-on .vol-card-value { color: #34d399; }
    .vol-card.vol-over .vol-card-value { color: #22d3ee; }


    /* ── Supplements ── */
    .subsection-label {
      font-size: 0.8rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.1em;
      color: #6080aa;
      margin: 20px 0 10px;
    }
    .subsection-label:first-child { margin-top: 0; }
    .protocol-tbl { table-layout: fixed; width: 100%; }
    .protocol-tbl th:nth-child(2), .protocol-tbl td:nth-child(2) { width: 120px; }
    .protocol-tbl th:nth-child(3), .protocol-tbl td:nth-child(3) { width: 180px; }
    .nutrition-notes-tbl { table-layout: fixed; width: 100%; }
    .nutrition-notes-tbl th:nth-child(1), .nutrition-notes-tbl td:nth-child(1) { width: 50%; }
    .nutrition-notes-tbl th:nth-child(2), .nutrition-notes-tbl td:nth-child(2) { width: 50%; }
    .nutrition-notes-tbl td { vertical-align: top; }
    .section-heading {
      font-size: 1.2rem;
      font-weight: 700;
      color: var(--accent);
      margin: 0 0 16px;
      padding-bottom: 8px;
      border-bottom: 1px solid var(--border);
    }
    .section-block {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 24px;
      margin-bottom: 24px;
      box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    }
    .supplement-grid {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
    }
    .supplement-pill {
      background: #1e1e3a;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 8px 16px;
      font-size: 0.95rem;
      color: #c0d0ff;
      transition: border-color 0.2s, background 0.2s;
    }
    .supplement-pill:hover {
      border-color: var(--accent);
      background: var(--hover);
      color: var(--accent);
    }
    .empty-state {
      color: #555577;
      font-style: italic;
      font-size: 1rem;
      padding: 12px 0;
    }

    /* ── Bloodwork ── */
    .bw-nav { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:24px; }
    .bw-nav-btn {
      background: var(--card); border: 1px solid var(--border); color: #8090bb;
      padding: 7px 18px; border-radius: 20px; cursor: pointer; font-size: 0.85rem;
      font-family: inherit; transition: all 0.2s;
    }
    .bw-nav-btn.active { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 700; }
    .bw-nav-btn:hover:not(.active) { border-color: var(--accent); color: var(--accent); }
    .bw-panel { display: none; }
    .bw-panel.active { display: block; }
    .bw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px; }
    .bw-card {
      background: var(--card); border: 1px solid var(--border); border-radius: 10px;
      overflow: hidden; transition: border-color 0.2s;
    }
    .bw-card:hover { border-color: var(--accent); }
    .bw-card-head { padding: 14px 16px 6px; }
    .bw-marker-name {
      font-size: 0.78rem; font-weight: 700; color: #7080aa;
      text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px;
    }
    .bw-value-row { display: flex; align-items: baseline; gap: 7px; margin-bottom: 3px; flex-wrap: wrap; }
    .bw-val { font-size: 1.6rem; font-weight: 700; color: var(--accent); line-height: 1; }
    .bw-val.out { color: #ff6b6b; }
    .bw-unit { font-size: 0.74rem; color: #556088; }
    .bw-badge { font-size: 0.67rem; font-weight: 700; padding: 2px 7px; border-radius: 4px; letter-spacing: 0.05em; align-self: center; }
    .bw-badge.in { background: rgba(76,175,80,0.15); color: #66bb6a; }
    .bw-badge.high { background: rgba(255,107,107,0.18); color: #ff6b6b; }
    .bw-badge.low { background: rgba(100,181,246,0.18); color: #64b5f6; }
    .bw-ref { font-size: 0.71rem; color: #506088; }
    .bw-note { font-size: 0.67rem; color: #445577; font-style: italic; margin-top: 3px; }
    .bw-spark { padding: 6px 10px 2px; }
    .bw-hist-btn {
      display: block; width: 100%; background: none; border: none;
      border-top: 1px solid var(--border); color: #556088; padding: 8px 14px;
      cursor: pointer; font-size: 0.77rem; font-family: inherit; text-align: left;
      transition: all 0.2s;
    }
    .bw-hist-btn:hover { color: var(--accent); background: var(--hover); }
    .bw-history { display: none; }
    .bw-history table { width: 100%; border-collapse: collapse; }
    .bw-history td, .bw-history th {
      padding: 6px 14px; font-size: 0.77rem;
      border-top: 1px solid rgba(51,51,102,0.5); text-align: left;
    }
    .bw-history th { color: #6080aa; font-weight: 600; }
    .bw-history .high { color: #ff6b6b; font-weight: 700; }
    .bw-history .low { color: #64b5f6; font-weight: 700; }
    .bw-history .norm { color: #66bb6a; }
    .bw-no-data { color: #444466; font-size: 0.77rem; padding: 14px; text-align: center; }

    /* ── Workout Inner Nav ── */
    .wk-sub-nav { display:flex; gap:10px; margin-bottom:28px; flex-wrap: wrap; }
    .wk-sub-btn {
      background: var(--card); border: 1px solid var(--border); color: #8090bb;
      padding: 8px 22px; border-radius: 20px; cursor: pointer; font-size: 0.88rem;
      font-family: inherit; transition: all 0.2s; font-weight: 600;
    }
    .wk-sub-btn.active { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 700; }
    .wk-sub-btn:hover:not(.active) { border-color: var(--accent); color: var(--accent); }
    .wk-panel { display: none; }
    .wk-panel.active { display: block; }

    /* ── Workout History ── */
    .wh-cat-nav { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:20px; }
    .wh-cat-btn {
      background: var(--card); border: 1px solid var(--border); color: #8090bb;
      padding: 5px 14px; border-radius: 14px; cursor: pointer; font-size: 0.8rem;
      font-family: inherit; transition: all 0.2s;
    }
    .wh-cat-btn.active { background: rgba(0,212,255,0.12); color: var(--accent); border-color: var(--accent); font-weight: 700; }
    .wh-cat-btn:hover:not(.active) { border-color: var(--accent); }
    /* ── Workout Calendar ── */
    .wh-cal { margin-bottom: 20px; }
    .wh-month-block { margin-bottom: 18px; }
    .wh-month-sep {
      font-size: 0.8rem; font-weight: 800; text-transform: uppercase;
      letter-spacing: 0.12em; color: var(--accent); padding: 6px 2px 8px;
      border-bottom: 1px solid rgba(0,212,255,0.2); margin-bottom: 6px;
    }
    .wh-cal-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
    .wh-cal-hcell { text-align: center; font-size: 0.73rem; font-weight: 700; color: #4a5888; text-transform: uppercase; letter-spacing: 0.08em; padding: 5px 0; }
    .wh-cal-week { margin-bottom: 4px; }
    .wh-cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
    .wh-cal-day { background: #111126; border: 1px solid #1e1e40; border-radius: 8px; min-height: 78px; padding: 7px 8px; transition: border-color 0.2s; }
    .wh-cal-day.workout { cursor: pointer; background: var(--card); border-color: var(--border); }
    .wh-cal-day.workout:hover { border-color: var(--accent); }
    .wh-cal-day.active { border-color: var(--accent); background: #171730; }
    .wh-cal-day.today .wh-cal-daynum { color: var(--accent); font-weight: 900; }
    .wh-cal-daynum { font-size: 0.7rem; font-weight: 700; color: #2e3a60; margin-bottom: 5px; line-height: 1; }
    .wh-cal-month-label { font-size: 0.6rem; color: #3a4a66; font-weight: 700; display: inline-block; margin-left: 4px; }
    .wh-cal-tag { font-size: 0.62rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; display: inline-block; margin-bottom: 3px; }
    .wh-tag-push { background: rgba(255,140,0,0.15); color: #ffaa44; }
    .wh-tag-pull { background: rgba(100,150,255,0.15); color: #80aaff; }
    .wh-tag-legs { background: rgba(100,255,150,0.12); color: #66ee99; }
    .wh-tag-upper { background: rgba(200,100,255,0.12); color: #cc88ff; }
    .wh-tag-pump { background: rgba(255,100,180,0.12); color: #ff88cc; }
    .wh-tag-cardio { background: rgba(0,212,255,0.1); color: #66ddff; }
    .wh-tag-upper-a { background: rgba(0,200,255,0.14); color: #00d4ff; }
    .wh-tag-upper-b { background: rgba(140,80,255,0.14); color: #bb88ff; }
    .wh-tag-lower-a { background: rgba(80,220,120,0.14); color: #55dd88; }
    .wh-tag-lower-b { background: rgba(255,160,50,0.14); color: #ffaa44; }
    .wh-cal-cmeta { font-size: 0.61rem; color: #3d4d77; margin-top: 2px; }
    /* ── Weekly summary strip ── */
    .wh-week-summary {
      display: flex; flex-wrap: wrap; gap: 4px;
      padding: 5px 6px;
      background: rgba(0,212,255,0.04);
      border: 1px solid rgba(0,212,255,0.12);
      border-top: none;
      border-radius: 0 0 6px 6px;
      margin-bottom: 4px;
    }
    .whs-pill {
      display: inline-flex; align-items: baseline; gap: 3px;
      background: rgba(255,255,255,0.04);
      border: 1px solid rgba(255,255,255,0.06);
      border-radius: 4px;
      padding: 3px 7px;
    }
    .whs-val { font-size: 0.78rem; font-weight: 700; color: var(--accent); line-height: 1; }
    .whs-lbl { font-size: 0.58rem; font-weight: 600; color: #4a5888; text-transform: uppercase; letter-spacing: 0.05em; line-height: 1; }
    .whs-net-pos .whs-val { color: #66ee99; }
    .whs-net-neg .whs-val { color: #ffaa44; }
    .wh-cal-detail {
      border: 1px solid rgba(0,212,255,0.3); border-top: none;
      border-radius: 0 0 8px 8px; background: rgba(0,212,255,0.03);
      padding: 10px 14px 12px; margin-bottom: 4px;
    }
    .wh-detail-title { font-size: 0.88rem; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
    .wh-cal-detail table { width: 100%; border-collapse: collapse; }
    .wh-cal-detail th { padding: 5px 10px; font-size: 0.67rem; color: #4a5888; font-weight: 600; text-align: right; background: rgba(0,0,0,0.25); }
    .wh-cal-detail th:first-child { text-align: left; }
    .wh-cal-detail td { padding: 6px 10px; font-size: 0.76rem; border-top: 1px solid rgba(51,51,102,0.35); text-align: right; color: #7090bb; }
    .wh-cal-detail td:first-child { text-align: left; color: #c0caf0; font-weight: 600; }
    .wh-e1rm-val { color: var(--accent); font-weight: 700; }
    /* ── Calendar detail: exercise toggle rows ── */
    .wh-ex-toggle {
      display: flex; align-items: center; gap: 8px;
      padding: 6px 8px; border-radius: 4px;
      border-top: 1px solid rgba(51,51,102,0.35);
      transition: background 0.15s;
    }
    .wh-ex-toggle:not(.no-toggle) { cursor: pointer; }
    .wh-ex-toggle:not(.no-toggle):hover { background: rgba(255,255,255,0.03); }
    .wh-ex-name-lbl { flex: 1; font-size: 0.76rem; color: #c0caf0; font-weight: 600; }
    .wh-ex-toggle-arrow { font-size: 0.6rem; color: #4a5888; transition: transform 0.2s; flex-shrink: 0; }
    .wh-ex-toggle.open .wh-ex-toggle-arrow { transform: rotate(90deg); }
    .wh-ex-e1rm { font-size: 0.74rem; color: var(--accent); font-weight: 700; min-width: 44px; text-align: right; flex-shrink: 0; }
    .wh-type-chips { display: flex; gap: 3px; flex-shrink: 0; flex-wrap: wrap; }
    .wh-type-chip { font-size: 0.6rem; font-weight: 700; padding: 1px 5px; border-radius: 3px; }
    /* Set detail sub-rows */
    .wh-sets-detail { display: none; padding: 2px 8px 6px 20px; }
    .wh-sets-detail.open { display: block; }
    .wh-set-row { display: flex; align-items: center; gap: 8px; padding: 3px 4px; font-size: 0.72rem; border-top: 1px solid rgba(51,51,102,0.2); }
    .wh-set-chip { font-size: 0.6rem; font-weight: 700; padding: 1px 6px; border-radius: 3px; min-width: 52px; text-align: center; flex-shrink: 0; }
    /* Set / chip type colors */
    .wh-set-U { background: rgba(160,160,200,0.12); color: #7888aa; }
    .wh-set-W { background: rgba(0,212,255,0.12); color: #00d4ff; }
    .wh-set-F { background: rgba(255,80,80,0.15); color: #ff8888; }
    .wh-set-D { background: rgba(200,100,255,0.15); color: #cc88ff; }
    .wh-set-wt { color: #9090bb; flex: 1; }
    .wh-set-reps { color: #6090aa; white-space: nowrap; }
    .wh-progress-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px,1fr)); gap:14px; }
    .wh-cat-section { margin-bottom: 32px; }
    .wh-cat-section:last-child { margin-bottom: 0; }
    .wh-cat-hdr {
      display: flex; align-items: baseline; gap: 10px;
      margin-bottom: 12px; padding-bottom: 8px;
      border-bottom: 1px solid var(--border);
    }
    .wh-cat-hdr-label { font-size: 0.82rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; }
    .wh-cat-hdr-count { font-size: 0.7rem; color: #4a5888; }
    .wh-ex-card {
      background: var(--card); border: 1px solid var(--border); border-radius: 10px;
      overflow: hidden; transition: border-color 0.2s;
    }
    .wh-ex-card:hover { border-color: var(--accent); }
    .wh-ex-head { padding: 12px 14px 4px; display:flex; justify-content:space-between; align-items:center; gap:8px; }
    .wh-ex-name { font-size: 0.78rem; font-weight: 700; color: #c0d0ff; text-transform: uppercase; letter-spacing: 0.04em; }
    .wh-cat-badge { font-size: 0.65rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; white-space: nowrap; flex-shrink: 0; }
    .wh-cat-badge.Chest { background: rgba(255,140,105,0.15); color: #ff8c69; }
    .wh-cat-badge.Back { background: rgba(100,150,255,0.15); color: #80aaff; }
    .wh-cat-badge.Shoulders { background: rgba(255,204,85,0.15); color: #ffcc55; }
    .wh-cat-badge.Arms { background: rgba(255,100,200,0.12); color: #ff88cc; }
    .wh-cat-badge.Legs { background: rgba(100,255,150,0.12); color: #66ee99; }
    .wh-cat-badge.Core { background: rgba(160,224,255,0.12); color: #a0e0ff; }
    .wh-cat-badge.Other { background: rgba(200,200,200,0.1); color: #9090aa; }
    .wh-ex-trend { font-size: 0.75rem; color: #6090aa; padding: 0 14px 6px; }
    .wh-trend-up { color: #66bb6a; font-weight: 700; }
    .wh-trend-dn { color: #ff8888; font-weight: 700; }
    .wh-chart-wrap { padding: 2px 10px; }
    .wh-date-row { display:flex; padding: 2px 10px 6px; }
    .wh-date-lbl { font-size: 0.58rem; color: #3d4d77; flex:1; text-align:center; }
    .wh-date-lbl:first-child { text-align: left; }
    .wh-date-lbl:last-child { text-align: right; }
    .wh-stats-row { display:flex; border-top: 1px solid var(--border); }
    .wh-stat { flex:1; padding: 9px 4px; text-align:center; border-left: 1px solid var(--border); }
    .wh-stat:first-child { border-left: none; }
    .wh-stat-val { font-size: 1rem; font-weight: 700; color: var(--accent); line-height: 1.2; }
    .wh-stat-lbl { font-size: 0.62rem; color: #4a5888; }
    /* ── Chart tooltip ── */
    #wh-tooltip {
      position: fixed; z-index: 9999; pointer-events: none;
      background: #1a1a2e; border: 1px solid var(--accent);
      border-radius: 7px; padding: 7px 12px;
      font-size: 0.72rem; color: #c0caf0; line-height: 1.55;
      box-shadow: 0 4px 18px rgba(0,0,0,0.55);
      white-space: nowrap;
    }
    /* ── Session history dropdown per card ── */
    .wh-hist-details { border-top: 1px solid var(--border); }
    .wh-hist-summary {
      padding: 7px 14px; font-size: 0.7rem; color: #4a5888;
      cursor: pointer; user-select: none; list-style: none; outline: none;
    }
    .wh-hist-summary::-webkit-details-marker { display: none; }
    .wh-hist-summary::before { content: '▶  '; font-size: 0.58rem; }
    details[open] > .wh-hist-summary::before { content: '▼  '; }
    .wh-hist-tbl { padding: 0 14px 10px; overflow-x: auto; }
    .wh-hist-tbl table { width: 100%; border-collapse: collapse; font-size: 0.69rem; }
    .wh-hist-tbl th { color: #3d4d77; padding: 3px 6px; text-align: right; font-weight: 600; border-bottom: 1px solid rgba(51,51,102,0.4); }
    .wh-hist-tbl th:first-child { text-align: left; }
    .wh-hist-tbl td { padding: 3px 6px; border-top: 1px solid rgba(51,51,102,0.2); color: #7090bb; text-align: right; }
    .wh-hist-tbl td:first-child { text-align: left; color: #a0b0d0; }

    /* ── Footer ── */
    footer {
      text-align: center;
      margin-top: 50px;
      color: #666688;
      font-size: 0.9rem;
    }

    @media (max-width: 768px) {
      .stat-card { min-width: 120px; padding: 12px 18px; }
      table { font-size: 0.95rem; }
      th, td { padding: 10px 8px; }
      .tab-btn { padding: 9px 14px; font-size: 0.9rem; }
    }

    /* ── Mobile (≤ 480px) ── */
    @media (max-width: 480px) {
      /* Tighter page padding */
      body { padding: 10px 8px; }
      h1 { font-size: 1.35rem; }
      .subtitle { font-size: 0.88rem; margin-bottom: 12px; }

      /* Main tab nav: fixed bottom bar for always-visible switching */
      .tab-nav {
        position: fixed; bottom: 0; left: 0; right: 0; z-index: 9500;
        display: flex; flex-wrap: nowrap; gap: 0; margin: 0;
        background: rgba(15, 15, 26, 0.97); backdrop-filter: blur(10px);
        border-top: 1px solid #333366;
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -4px 20px rgba(0,0,0,0.45);
      }
      .tab-btn {
        flex: 1 1 0; padding: 10px 4px; font-size: 0.72rem; text-align: center;
        border-radius: 8px; border: none; background: transparent;
        min-width: 0; line-height: 1.25;
      }
      .tab-btn.active {
        background: rgba(0, 212, 255, 0.12);
        box-shadow: none;
      }
      body { padding-bottom: 72px; }

      /* Sub-navs */
      .wk-sub-nav { gap: 6px; }
      .wk-sub-btn { padding: 7px 10px; font-size: 0.8rem; }
      .wh-inner-nav { gap: 6px; }
      .wh-tab-btn { padding: 7px 10px; font-size: 0.8rem; }
      .wh-cat-nav { gap: 5px; }
      .wh-cat-btn { padding: 5px 10px; font-size: 0.75rem; }

      /* Stats cards */
      .stat-card { min-width: 90px; padding: 10px 12px; }
      .stat-value { font-size: 1.6rem; }
      .stat-label { font-size: 0.8rem; }

      /* Accordion content */
      .accordion-content { padding: 14px 10px; }

      /* All tables: horizontally scrollable */
      table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
      /* Override white-space for cells that should still wrap (exercise names, notes) */
      .exercise-title, .notes, td:first-child { white-space: normal; }
      th, td { padding: 8px 8px; font-size: 0.82rem; }

      /* Protocol & nutrition tables: revert to normal table display so columns lay out side-by-side */
      .protocol-tbl,
      .nutrition-notes-tbl {
        display: table;
        overflow-x: visible;
        white-space: normal;
        table-layout: auto !important;
        width: 100%;
      }
      .protocol-tbl th, .protocol-tbl td,
      .nutrition-notes-tbl th, .nutrition-notes-tbl td { white-space: normal; }
      /* Override the high-specificity :nth-child width rules from base CSS */
      .protocol-tbl th:nth-child(1), .protocol-tbl td:nth-child(1),
      .protocol-tbl th:nth-child(2), .protocol-tbl td:nth-child(2),
      .protocol-tbl th:nth-child(3), .protocol-tbl td:nth-child(3) { width: auto !important; }
      .nutrition-notes-tbl th:nth-child(1), .nutrition-notes-tbl td:nth-child(1),
      .nutrition-notes-tbl th:nth-child(2), .nutrition-notes-tbl td:nth-child(2) { width: auto !important; }

      /* Calendar: compact cells */
      .wh-cal-day { min-height: 50px; padding: 4px 3px; border-radius: 5px; }
      .wh-cal-hcell { font-size: 0.6rem; padding: 3px 0; letter-spacing: 0; }
      .wh-cal-daynum { font-size: 0.62rem; margin-bottom: 2px; }
      .wh-cal-month-label { display: none; }
      .wh-cal-tag { font-size: 0.52rem; padding: 1px 3px; margin-bottom: 1px; }
      .wh-cal-cmeta { display: none; } /* hide "7 ex · 1.2mi" — too small to read */

      /* Progress chart cards: single column, more readable */
      .wh-progress-grid { grid-template-columns: 1fr; gap: 10px; }
      .wh-date-lbl { font-size: 0.65rem; }
      .wh-stat-lbl { font-size: 0.68rem; }

      /* Bloodwork grid: single column */
      .bw-grid { grid-template-columns: 1fr; gap: 10px; }
      .bw-nav { gap: 6px; }
      .bw-nav-btn { padding: 6px 12px; font-size: 0.8rem; }

      /* Section headings */
      .section-heading { font-size: 1rem; }
      .subsection-label { font-size: 0.75rem; }

      /* Vol cards */
      .vol-card { min-width: 66px; padding: 6px 10px; }
      .vol-card-value { font-size: 1.25rem; }
      .vol-card-label { font-size: 0.65rem; }

      /* Calendar detail popup */
      .wh-cal-detail { padding: 8px 8px 10px; }
      .wh-ex-name-lbl { font-size: 0.7rem; }

      #hevy-sync-btn  { top: 8px; left: 8px; font-size: 0.72rem; padding: 5px 10px; }
      #fitbit-sync-btn { top: 44px; left: 8px; font-size: 0.72rem; padding: 5px 10px; }
    }

    /* ══ Theme Picker ══ */
    #theme-picker { position: fixed; top: 14px; right: 18px; z-index: 1000; }
    #theme-picker-btn {
      width: 40px; height: 40px; border-radius: 50%;
      background: var(--card); border: 1px solid var(--border);
      font-size: 1.1rem; cursor: pointer; display: flex;
      align-items: center; justify-content: center;
      box-shadow: 0 2px 10px rgba(0,0,0,0.3);
      transition: border-color 0.2s, box-shadow 0.2s;
    }
    #theme-picker-btn:hover { border-color: var(--accent); }
    #theme-picker-panel {
      display: none; position: absolute; top: 48px; right: 0;
      background: var(--card); border: 1px solid var(--border);
      border-radius: 12px; padding: 8px 6px;
      box-shadow: 0 6px 24px rgba(0,0,0,0.4);
      flex-direction: column; gap: 2px; min-width: 130px;
    }
    #theme-picker-panel.open { display: flex; }
    .tp-row {
      display: flex; align-items: center; gap: 9px;
      padding: 7px 10px; border-radius: 8px; cursor: pointer;
      transition: background 0.15s;
    }
    .tp-row:hover, .tp-row.active { background: var(--hover); }
    .tp-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
    .tp-row.active .tp-dot { box-shadow: 0 0 0 2px var(--text); }
    .tp-label { font-size: 0.78rem; color: var(--text); white-space: nowrap; }

    /* ══ Theme variables ══ */
    [data-theme="nord"] {
      --bg: #0d1117; --text: #d8dee9; --card: #161b22;
      --accent: #88c0d0; --border: #2d3748; --hover: #21262d; --success: #a3be8c;
    }
    [data-theme="ember"] {
      --bg: #12100e; --text: #ede0c8; --card: #1c1a16;
      --accent: #e8a838; --border: #3d3020; --hover: #2a2318; --success: #d4a84b;
    }
    [data-theme="mocha"] {
      --bg: #1e1e2e; --text: #cdd6f4; --card: #24273a;
      --accent: #cba6f7; --border: #45475a; --hover: #313244; --success: #a6e3a1;
    }

    /* ══════════ LIGHT MODE ══════════ */
    body.light, [data-theme="light"] {
      --bg: #f0f2ff;
      --text: #1a1a3a;
      --card: #ffffff;
      --accent: #0077aa;
      --border: #c0cae8;
      --hover: #e8ebff;
      --success: #009955;
    }
    /* Structural */
    body.light h1 { text-shadow: 0 0 15px rgba(0,120,180,0.2); }
    body.light .subtitle { color: #4455bb; }
    body.light footer { color: #8890bb; }
    body.light #theme-picker-btn { box-shadow: 0 2px 10px rgba(0,0,60,0.12); }
    body.light #theme-picker-btn:hover { box-shadow: 0 0 10px rgba(0,120,180,0.2); }
    /* Tabs */
    body.light .tab-btn { color: #4455aa; }
    body.light .tab-btn.active {
      background: linear-gradient(135deg, #dde2ff, #e8ecff);
      color: var(--accent); box-shadow: 0 0 10px rgba(0,100,200,0.1);
    }
    /* Stat cards */
    body.light .stat-card { box-shadow: 0 4px 12px rgba(0,0,60,0.07); }
    body.light .stat-label { color: #5566aa; }
    /* Accordions */
    body.light .accordion { box-shadow: 0 4px 12px rgba(0,0,60,0.07); }
    body.light .accordion-header { background: linear-gradient(135deg, #dde2ff, #e8ecff); color: var(--text); }
    body.light .accordion-header:hover { background: linear-gradient(135deg, #ccd4ff, #d8deff); }
    /* Tables */
    body.light th { background: #e8ebff; color: var(--accent); }
    body.light .bw-history td, body.light .bw-history th { border-top-color: rgba(0,0,80,0.12); }
    /* Exercise/notes text */
    body.light .exercise-title { color: #1a4488; }
    body.light .notes { color: #4455aa; }
    /* Vol cards */
    body.light .vol-card { box-shadow: 0 2px 6px rgba(0,0,60,0.07); }
    body.light .vol-card-label { color: #6677aa; }
    /* Section blocks */
    body.light .section-block { box-shadow: 0 4px 12px rgba(0,0,60,0.07); }
    /* Supplement pills */
    body.light .supplement-pill { background: #eef1ff; color: #2233aa; }
    body.light .supplement-pill:hover { background: var(--hover); color: var(--accent); }
    /* Subsection labels */
    body.light .subsection-label { color: #5566aa; }
    /* Bloodwork */
    body.light .bw-nav-btn { color: #5566aa; }
    body.light .bw-nav-btn.active { color: #fff; }
    body.light .bw-marker-name { color: #5566aa; }
    body.light .bw-unit { color: #6677aa; }
    body.light .bw-ref { color: #6677aa; }
    body.light .bw-note { color: #7788aa; }
    body.light .bw-hist-btn { color: #6677aa; }
    body.light .bw-history th { color: #6677aa; }
    body.light .bw-no-data { color: #9090bb; }
    /* Workout inner nav */
    body.light .wk-sub-btn { color: #5566aa; }
    body.light .wk-sub-btn.active { color: #fff; }
    /* Cat filter nav */
    body.light .wh-cat-btn { color: #5566aa; }
    body.light .wh-cat-btn.active { background: rgba(0,120,180,0.1); }
    /* Calendar */
    body.light .wh-cal-hcell { color: #6677aa; }
    body.light .wh-cal-day { background: #e8eaf5; border-color: #d0d8ee; }
    body.light .wh-cal-day.workout { background: #ffffff; }
    body.light .wh-cal-day.active { background: #eef1ff; }
    body.light .wh-cal-daynum { color: #334499; }
    body.light .wh-cal-month-label { color: #6677aa; }
    body.light .wh-month-sep { border-bottom-color: rgba(0,120,180,0.2); }
    body.light .wh-cal-cmeta { color: #8899bb; }
    body.light .wh-cal-detail {
      background: rgba(0,100,200,0.03); border-color: rgba(0,120,200,0.25);
    }
    body.light .wh-detail-title { color: var(--accent); }
    body.light .wh-ex-toggle { border-top-color: rgba(0,0,80,0.1); }
    body.light .wh-ex-toggle:not(.no-toggle):hover { background: rgba(0,0,80,0.03); }
    body.light .wh-ex-name-lbl { color: #1a2060; }
    body.light .wh-ex-toggle-arrow { color: #8899bb; }
    body.light .wh-set-row { border-top-color: rgba(0,0,80,0.08); }
    body.light .wh-set-wt { color: #334488; }
    body.light .wh-set-reps { color: #5566aa; }
    /* Progress charts */
    body.light .wh-ex-card { box-shadow: 0 2px 8px rgba(0,0,60,0.07); }
    body.light .wh-ex-name { color: #1a2060; }
    body.light .wh-ex-trend { color: #4455aa; }
    body.light .wh-date-lbl { color: #8899bb; }
    body.light .wh-stat-lbl { color: #8899bb; }
    body.light .wh-hist-summary { color: #8899bb; }
    body.light .wh-hist-tbl th { color: #8899bb; border-bottom-color: var(--border); }
    body.light .wh-hist-tbl td { color: #4455aa; border-top-color: rgba(0,0,80,0.1); }
    body.light .wh-hist-tbl td:first-child { color: #1a2060; }
    /* Tooltip */
    body.light #wh-tooltip {
      background: #fff; border-color: var(--accent);
      color: #1a1a3a; box-shadow: 0 4px 16px rgba(0,0,80,0.12);
    }
    /* Empty state */
    body.light .empty-state { color: #9090bb; }

    /* ══ Nord targeted overrides ══ */
    [data-theme="nord"] .accordion-header { background: linear-gradient(135deg, #1e2a38, #21303f); }
    [data-theme="nord"] .accordion-header:hover { background: linear-gradient(135deg, #253444, #2c3d50); }
    [data-theme="nord"] th { background: #1e2a38; }
    [data-theme="nord"] .wh-cal-day { background: #111820; border-color: #1d2733; }
    [data-theme="nord"] .wh-cal-day.active { background: #1a2535; }
    [data-theme="nord"] .wh-cat-btn.active { background: rgba(136,192,208,0.12); }

    /* ══ Ember targeted overrides ══ */
    [data-theme="ember"] .accordion-header { background: linear-gradient(135deg, #1c1a14, #242018); }
    [data-theme="ember"] .accordion-header:hover { background: linear-gradient(135deg, #25221c, #2e2920); }
    [data-theme="ember"] th { background: #1c1a14; }
    [data-theme="ember"] .wh-cal-day { background: #100f0d; border-color: #201c10; }
    [data-theme="ember"] .wh-cal-day.active { background: #1a1710; }
    [data-theme="ember"] .wh-cat-btn.active { background: rgba(232,168,56,0.12); }
    [data-theme="ember"] .wh-month-sep { border-bottom-color: rgba(232,168,56,0.2); }

    /* ══ Mocha targeted overrides ══ */
    [data-theme="mocha"] .accordion-header { background: linear-gradient(135deg, #181825, #1e1e2e); }
    [data-theme="mocha"] .accordion-header:hover { background: linear-gradient(135deg, #1e1e2e, #252535); }
    [data-theme="mocha"] th { background: #181825; }
    [data-theme="mocha"] .wh-cal-day { background: #11111b; border-color: #1e1e2e; }
    [data-theme="mocha"] .wh-cal-day.active { background: #181825; }
    [data-theme="mocha"] .wh-cat-btn.active { background: rgba(203,166,247,0.12); }
    [data-theme="mocha"] .wh-month-sep { border-bottom-color: rgba(203,166,247,0.2); }

    /* ── Hevy Sync Button ── */
    #hevy-sync-btn {
      position: fixed; top: 14px; left: 18px; z-index: 1000;
      background: var(--card); border: 1px solid var(--border);
      color: var(--text); border-radius: 20px;
      padding: 7px 14px; font-size: 0.82rem; cursor: pointer;
      display: flex; align-items: center; gap: 6px;
      transition: border-color 0.2s;
    }
    #hevy-sync-btn:hover  { border-color: var(--accent); }
    #hevy-sync-btn.syncing { opacity: 0.7; cursor: wait; }
    #hevy-sync-btn.success { border-color: #4caf50; color: #4caf50; }
    #hevy-sync-btn.error   { border-color: #f44336; color: #f44336; }

    /* ── Fitbit Sync Button ── */
    #fitbit-sync-btn {
      position: fixed; top: 56px; left: 18px; z-index: 1000;
      background: var(--card); border: 1px solid var(--border);
      color: var(--text); border-radius: 20px;
      padding: 7px 14px; font-size: 0.8rem; cursor: pointer;
      transition: border-color 0.2s;
    }
    #fitbit-sync-btn:hover     { border-color: #00b0ff; }
    #fitbit-sync-btn.syncing   { opacity: 0.7; cursor: wait; }
    #fitbit-sync-btn.connected { border-color: #00b0ff; color: #00b0ff; }
    #fitbit-sync-btn.success   { border-color: #4caf50; color: #4caf50; }
    #fitbit-sync-btn.error     { border-color: #f44336; color: #f44336; }

    /* ── API Key Modal ── */
    #hevy-key-modal {
      display: none; position: fixed; inset: 0; z-index: 2000;
      background: rgba(0,0,0,0.7); align-items: center; justify-content: center;
    }
    #hevy-key-modal.open { display: flex; }
    #hevy-key-box {
      background: var(--card); border: 1px solid var(--border);
      border-radius: 12px; padding: 28px 24px; width: min(90vw, 380px);
    }
    #hevy-key-box h3 { margin: 0 0 12px; font-size: 1rem; color: var(--accent); }
    #hevy-key-box p  { margin: 0 0 16px; font-size: 0.85rem; color: var(--muted); }
    #hevy-key-input {
      width: 100%; box-sizing: border-box;
      background: var(--bg); border: 1px solid var(--border);
      color: var(--text); border-radius: 8px;
      padding: 10px 12px; font-size: 0.9rem; margin-bottom: 14px;
    }
    .hevy-key-btns { display: flex; gap: 10px; justify-content: flex-end; }
    .hevy-key-cancel { background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 8px; padding: 8px 16px; cursor: pointer; }
    .hevy-key-save   { background: var(--accent); border: none; color: #000; border-radius: 8px; padding: 8px 16px; font-weight: 600; cursor: pointer; }

    /* ══════════════════════ WORKOUT LOGGER ══════════════════════ */

    /* Picker */
    .wl-picker { padding: 20px 0; }
    .wl-picker-title { text-align: center; color: var(--accent); font-size: 1.1rem; margin-bottom: 20px; font-weight: 700; }
    .wl-routine-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 500px; margin: 0 auto; }
    .wl-routine-btn {
      background: var(--card); border: 1px solid var(--border); border-radius: 12px;
      padding: 22px 16px; cursor: pointer; text-align: center;
      transition: background 0.2s, border-color 0.2s;
    }
    .wl-routine-btn:hover { background: var(--hover); border-color: var(--accent); }
    .wl-routine-name { color: var(--accent); font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; }
    .wl-routine-count { color: #a0a0ff; font-size: 0.78rem; }

    /* Session header — sticky */
    .wl-session-header {
      position: sticky; top: 0; z-index: 10; background: var(--bg);
      display: flex; justify-content: space-between; align-items: center;
      padding: 12px 0 10px; margin-bottom: 14px;
      border-bottom: 1px solid var(--border);
    }
    .wl-session-name    { color: var(--accent); font-size: 1.05rem; font-weight: 700; }
    .wl-session-elapsed { color: #a0a0ff; font-size: 0.82rem; margin-top: 3px; }
    .wl-finish-btn {
      background: var(--accent); color: #000; border: none;
      border-radius: 20px; padding: 8px 20px; font-weight: 700; font-size: 0.9rem; cursor: pointer;
    }
    .wl-finish-btn:disabled { opacity: 0.5; cursor: wait; }

    /* Exercise card */
    .wl-exercise-card {
      background: rgba(255,255,255,0.04); backdrop-filter: blur(6px);
      border: 1px solid var(--border); border-radius: 12px;
      padding: 14px; margin-bottom: 12px;
    }
    .wl-ex-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
    .wl-ex-name { color: var(--text); font-weight: 600; font-size: 0.92rem; flex: 1; line-height: 1.35; }
    .wl-ex-rep-range { color: #a0a0ff; font-size: 0.75rem; white-space: nowrap; margin-top: 2px; flex-shrink: 0; }

    /* Warm-up cues (collapsible) */
    .wl-warm-details { margin-bottom: 8px; }
    .wl-warm-details summary { cursor: pointer; color: #a0a0ff; font-size: 0.78rem; padding: 3px 0; list-style: none; user-select: none; }
    .wl-warm-details summary::before { content: '▶ '; font-size: 0.6rem; }
    .wl-warm-details[open] summary::before { content: '▼ '; }
    .wl-warm-text {
      color: #8888aa; font-size: 0.76rem; line-height: 1.55;
      padding: 7px 10px; background: rgba(0,0,0,0.25); border-radius: 6px; margin-top: 4px;
    }

    /* Sets table */
    .wl-sets-table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
    .wl-sets-table th {
      text-align: center; color: #a0a0ff; font-size: 0.68rem; font-weight: 600;
      padding: 3px 3px 5px; text-transform: uppercase; letter-spacing: 0.04em;
    }
    .wl-col-set  { width: 22px; }
    .wl-col-last { width: 68px; }
    .wl-col-log  { width: 36px; }
    .wl-set-row td { padding: 4px 3px; text-align: center; vertical-align: middle; }
    .wl-set-row .wl-col-set  { color: #a0a0ff; font-size: 0.78rem; }
    .wl-set-row .wl-col-last { color: #6666aa; font-size: 0.72rem; }
    .wl-weight-input, .wl-reps-input {
      background: var(--bg); border: 1px solid var(--border); color: var(--text);
      border-radius: 6px; padding: 5px 3px; font-size: 1rem; text-align: center;
      width: 58px; -moz-appearance: textfield;
    }
    .wl-reps-input { width: 46px; }
    .wl-weight-input:focus, .wl-reps-input:focus { outline: none; border-color: var(--accent); }
    .wl-weight-input::-webkit-inner-spin-button,
    .wl-weight-input::-webkit-outer-spin-button,
    .wl-reps-input::-webkit-inner-spin-button,
    .wl-reps-input::-webkit-outer-spin-button  { -webkit-appearance: none; }
    .wl-log-btn {
      background: transparent; border: 1.5px solid var(--border); color: #a0a0ff;
      border-radius: 50%; width: 32px; height: 32px; cursor: pointer;
      font-size: 0.9rem; line-height: 1; padding: 0;
      transition: background 0.12s, border-color 0.12s, color 0.12s;
    }
    .wl-log-btn:active { background: var(--accent); color: #000; border-color: var(--accent); }
    .wl-set-row.logged td          { }
    .wl-set-row.logged .wl-col-set { color: #a0a0ff; }
    .wl-logged-val   { color: #b8b8cc; font-size: 0.88rem; }
    .wl-logged-check { color: var(--success); font-size: 1rem; }

    /* Add-set button */
    .wl-add-set-btn {
      background: none; border: 1px dashed var(--border); color: #a0a0ff;
      border-radius: 8px; padding: 5px 12px; cursor: pointer; font-size: 0.8rem;
      margin-bottom: 8px; width: 100%; transition: border-color 0.2s, color 0.2s;
    }
    .wl-add-set-btn:hover { border-color: var(--accent); color: var(--accent); }

    /* Exercise note */
    .wl-ex-note {
      color: #6868a0; font-size: 0.73rem; line-height: 1.55;
      border-top: 1px solid rgba(255,255,255,0.06); padding-top: 7px; margin-top: 4px;
    }

    /* Rest timer bar — fixed bottom */
    .wl-rest-bar {
      position: fixed; bottom: 0; left: 0; right: 0; z-index: 500;
      background: var(--card); border-top: 1px solid var(--border); padding: 10px 16px;
    }
    .wl-rest-bar.hidden { display: none; }
    .wl-rest-inner { display: flex; align-items: center; gap: 12px; max-width: 560px; margin: 0 auto; }
    .wl-rest-label { color: #a0a0ff; font-size: 0.78rem; flex-shrink: 0; }
    .wl-rest-time  { color: var(--accent); font-size: 1.1rem; font-weight: 700; min-width: 38px; }
    .wl-rest-track { flex: 1; height: 5px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; }
    .wl-rest-fill  { height: 100%; background: var(--accent); border-radius: 3px; transition: width 1s linear; }
    .wl-rest-skip  {
      background: none; border: 1px solid var(--border); color: #a0a0ff;
      border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: 0.76rem; flex-shrink: 0;
    }

    /* Resume prompt */
    .wl-resume {
      max-width: 420px; margin: 40px auto;
      background: var(--card); border: 1px solid var(--border);
      border-radius: 16px; padding: 28px 24px; text-align: center;
    }
    .wl-resume-title { color: var(--accent); font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; }
    .wl-resume-info  { color: #a0a0ff; font-size: 0.88rem; margin-bottom: 22px; }
    .wl-resume-btns  { display: flex; gap: 12px; justify-content: center; }

    /* Completion screen */
    .wl-completion { max-width: 420px; margin: 32px auto; text-align: center; }
    .wl-completion-icon  { font-size: 2.8rem; margin-bottom: 10px; }
    .wl-completion-title { color: var(--accent); font-size: 1.35rem; font-weight: 700; margin-bottom: 20px; }
    .wl-completion-stats { display: flex; gap: 20px; justify-content: center; margin-bottom: 18px; }
    .wl-cstat       { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 22px; }
    .wl-cstat-val   { color: var(--accent); font-size: 1.8rem; font-weight: 700; }
    .wl-cstat-label { color: #a0a0ff; font-size: 0.78rem; }

    /* PR list */
    .wl-pr-list {
      background: rgba(0,212,255,0.05); border: 1px solid rgba(0,212,255,0.2);
      border-radius: 12px; padding: 14px 16px; text-align: left;
      max-width: 380px; margin: 0 auto;
    }
    .wl-pr-title { color: var(--accent); font-weight: 700; margin-bottom: 10px; font-size: 0.92rem; }
    .wl-pr-row   { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
    .wl-pr-row:last-child { border-bottom: none; }
    .wl-pr-ex    { color: var(--text); font-size: 0.8rem; }
    .wl-pr-val   { color: var(--success); font-size: 0.8rem; font-weight: 600; }

    /* Shared buttons */
    .wl-btn-primary {
      background: var(--accent); color: #000; border: none;
      border-radius: 20px; padding: 10px 26px; font-weight: 700; font-size: 0.95rem; cursor: pointer;
    }
    .wl-btn-ghost {
      background: none; border: 1px solid var(--border); color: #a0a0ff;
      border-radius: 20px; padding: 10px 26px; font-size: 0.95rem; cursor: pointer;
    }

    /* Loading / error states */
    .wl-loading { text-align: center; color: #a0a0ff; padding: 48px 20px; font-size: 0.92rem; }
    .wl-error   { text-align: center; color: #f44336;  padding: 48px 20px; font-size: 0.92rem; }

    /* Extra bottom padding so rest bar doesn't overlap last card */
    #tab-log { padding-bottom: 72px; }

/* ── PDF Bloodwork Import ── */
#bw-pdf-panel {
  margin-bottom: 1.25rem;
  padding: .85rem 1rem;
  background: rgba(120,80,255,.04);
  border: 1px solid rgba(120,80,255,.15);
  border-radius: 10px;
}
#bw-pdf-preview { margin-top: .9rem; overflow-x: auto; }
#bw-pdf-preview table { width: 100%; border-collapse: collapse; font-size: .78rem; }
#bw-pdf-preview th {
  color: #6080aa; font-size: .68rem; font-weight: 700; text-transform: uppercase;
  padding: 4px 6px; border-bottom: 1px solid rgba(51,51,102,.5); text-align: left; white-space: nowrap;
}
#bw-pdf-preview td { padding: 3px 4px; border-bottom: 1px solid rgba(51,51,102,.25); }
#bw-pdf-preview input, #bw-pdf-preview select {
  width: 100%; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: 4px; color: #eee; padding: 2px 5px; font-size: .76rem; font-family: inherit;
}
#bw-pdf-preview input[type=number] { width: 72px; }
.bw-pdf-confirm-row { display: flex; align-items: center; gap: .75rem; margin-top: .75rem; flex-wrap: wrap; }
#bw-pdf-confirm-btn {
  padding: .38rem 1.1rem; border: none; border-radius: 7px;
  background: rgba(120,80,255,.2); color: #b088ff; font-weight: 700; font-size: .82rem; cursor: pointer;
}
#bw-pdf-confirm-btn:hover { background: rgba(120,80,255,.35); }
#bw-pdf-confirm-btn:disabled { opacity: .5; cursor: wait; }
#bw-pdf-status { font-size: .78rem; }

/* ── Log Workout picker sections ── */
.wl-picker-section {
  margin-bottom: 18px;
}
.wl-picker-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7080a0;
  margin: 0 0 8px 2px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(80,100,140,0.25);
}
.wl-picker-section.ai .wl-picker-section-title { color: #00d4ff; border-color: rgba(0,212,255,0.25); }
.wl-picker-section.mev4 .wl-picker-section-title { color: #78ffa0; border-color: rgba(120,255,160,0.25); }
.wl-routine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.wl-ai-catchup-btn {
  grid-column: 1 / -1;
}


/* Phase H: bottom tab bar up to small tablets */
@media (max-width: 700px) {
  .tab-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 9500;
    display: flex; flex-wrap: nowrap; gap: 0; margin: 0;
    background: rgba(15, 15, 26, 0.97); backdrop-filter: blur(10px);
    border-top: 1px solid #333366;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 20px rgba(0,0,0,0.45);
  }
  .tab-btn {
    flex: 1 1 0; padding: 10px 6px; font-size: 0.75rem; text-align: center;
    border-radius: 8px; min-width: 0;
  }
  body { padding-bottom: 72px; }
  body.wl-gym-light .tab-nav {
    background: rgba(255,255,255,0.97); border-top-color: #c8d0e0;
  }
  body.wl-gym-light .tab-btn { color: #445; }
  body.wl-gym-light .tab-btn.active { color: #0088aa; background: rgba(0,160,200,0.12); }
}


/* Phase K — PWA bottom nav polish */
@media (max-width: 700px) {
  .tab-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 9500;
    display: flex; flex-wrap: nowrap; gap: 4px; margin: 0;
    background: rgba(12, 14, 24, 0.96); backdrop-filter: blur(14px);
    border-top: 1px solid rgba(80, 90, 130, 0.45);
    padding: 6px 6px calc(8px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -6px 24px rgba(0,0,0,0.45);
  }
  .tab-btn {
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; padding: 8px 4px 6px;
    border: none; border-radius: 12px;
    background: transparent; color: #7a849e;
    font-size: 0.68rem; font-weight: 600;
  }
  .tab-btn .tab-ico { font-size: 1.2rem; line-height: 1; }
  .tab-btn .tab-lbl { font-size: 0.68rem; letter-spacing: 0.01em; }
  .tab-btn.active {
    color: #00d4ff;
    background: rgba(0, 212, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(0, 212, 255, 0.25);
  }
  body { padding-bottom: 78px; }
  h1 { font-size: 1.2rem; margin-bottom: 4px; }
  .subtitle { display: none; }
}

@media (display-mode: standalone) {
  body { padding-top: env(safe-area-inset-top, 0px); }
  h1 { font-size: 1.1rem; }
  .subtitle { display: none; }
}

.wl-bo-tag{font-size:0.65rem;opacity:0.75;margin-left:3px;padding:1px 4px;border-radius:4px;background:rgba(255,180,80,.18);color:#f0c080;font-weight:700;vertical-align:middle}
.wl-ex-rep-range{font-variant-numeric:tabular-nums}
