/* ===========================================================================
   TrueBody — Design System
   The only gym app that tells you the truth.
   Sleek black/white with light-blue backsplash. Medical-grade honest.
   =========================================================================== */

:root {
  --ink:        #0A0A0A;
  --ink-soft:   #2A2A2A;
  --ink-mute:   #6B7280;
  --paper:      #FFFFFF;
  --fog:        #EEF4FB;  /* the "light blueish back splash" Thierry asked for */
  --mist:       #DCE7F3;
  --line:       #E5EBF2;
  --electric:   #3A86FF;
  --electric-2: #1E5FE6;
  --verdict:    #111827;
  --rare:       #7C3AED;
  --ok:         #10B981;
  --warn:       #F59E0B;
  --danger:     #EF4444;
  --radius:     14px;
  --radius-lg:  20px;
  --radius-pill: 999px;
  --shadow-sm:  0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md:  0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg:  0 24px 60px rgba(15, 23, 42, 0.12);
  --font-head:  'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:  'JetBrains Mono', 'SF Mono', Consolas, monospace;
  --max:        1200px;
  --gap:        24px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-soft);
  background: var(--fog);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
h1, h2, h3, h4, h5 {
  font-family: var(--font-head);
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 16px;
  font-weight: 700;
}
h1 { font-size: clamp(34px, 7vw, 88px); letter-spacing: -0.035em; hyphens: auto; word-break: break-word; }
h2 { font-size: clamp(28px, 4.5vw, 52px); letter-spacing: -0.028em; }
h3 { font-size: clamp(22px, 2.8vw, 32px); }
h4 { font-size: 18px; }
p  { margin: 0 0 16px; }
a  { color: var(--electric); text-decoration: none; }
a:hover { color: var(--electric-2); }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font: inherit; color: var(--ink); }
img, svg { display: block; max-width: 100%; }

/* ----------- Layout ----------- */
.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.tb-section { padding: 96px 0; }
@media (max-width: 768px) { .tb-section { padding: 64px 0; } }

/* ----------- Page loader ----------- */
.tb-loader {
  position: fixed; inset: 0; background: var(--paper); z-index: 9999;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  transition: opacity 0.4s ease;
}
.tb-loader.is-done { opacity: 0; pointer-events: none; }
.tb-loader-logo {
  font-family: var(--font-head); font-weight: 700;
  font-size: 28px; letter-spacing: -0.03em;
  color: var(--ink); margin-bottom: 20px;
}
.tb-loader-logo span { color: var(--electric); }
.tb-loader-bar { width: 180px; height: 3px; background: var(--mist); border-radius: 2px; overflow: hidden; }
.tb-loader-fill {
  width: 0%; height: 100%; background: var(--electric);
  animation: tbFill 1.2s ease forwards;
}
@keyframes tbFill { to { width: 100%; } }

/* ----------- Top nav ----------- */
.tb-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(238, 244, 251, 0.88);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.tb-nav-inner {
  max-width: var(--max); margin: 0 auto;
  padding: 16px 24px;
  padding-top: calc(16px + env(safe-area-inset-top));
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.tb-brand {
  font-family: var(--font-head); font-weight: 700;
  font-size: 22px; letter-spacing: -0.03em; color: var(--ink);
}
.tb-brand span { color: var(--electric); }
.tb-nav-links { display: flex; gap: 24px; align-items: center; }
.tb-nav-links a { color: var(--ink-soft); font-weight: 500; font-size: 15px; }
.tb-nav-links a:hover { color: var(--ink); }
@media (max-width: 720px) {
  /* Hide the full desktop link set, keep only the primary CTA visible */
  .tb-nav-links > a:not(.btn) { display: none; }
  .tb-nav-links { gap: 0; }
  .tb-nav-links .btn { padding: 10px 18px; font-size: 14px; min-height: 40px; }
}
/* Bottom tab bar — always accessible on mobile */
.tb-tabbar { display: none; }
@media (max-width: 720px) {
  .tb-tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 99;
    background: var(--paper); border-top: 1px solid var(--line);
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .tb-tab {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 10px; min-width: 64px; min-height: 48px;
    font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--ink-mute);
  }
  .tb-tab.is-active { color: var(--electric); }
  .tb-tab svg { width: 22px; height: 22px; stroke-width: 2; stroke: currentColor; fill: none; }
  main, .tb-footer { padding-bottom: 80px; }
}

/* ----------- Buttons ----------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: var(--radius-pill);
  font-family: var(--font-head); font-weight: 600; font-size: 15px;
  min-height: 48px; /* ≥44px tap target */
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--ink); color: var(--paper);
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { background: var(--electric); color: var(--paper); box-shadow: 0 10px 30px rgba(58, 134, 255, 0.35); }
.btn-secondary {
  background: var(--paper); color: var(--ink); border: 1px solid var(--line);
}
.btn-secondary:hover { border-color: var(--ink); }
.btn-ghost {
  color: var(--ink); padding: 10px 18px; min-height: 40px;
}
.btn-ghost:hover { background: var(--mist); border-radius: var(--radius-pill); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ----------- Hero ----------- */
.tb-hero {
  padding: 120px 0 80px; position: relative; overflow: hidden;
}
.tb-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(60% 60% at 70% 30%, rgba(58, 134, 255, 0.08), transparent 70%);
  pointer-events: none;
}
.tb-hero-inner { position: relative; max-width: 980px; }
.tb-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px; border-radius: var(--radius-pill);
  background: var(--paper); border: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 13px; color: var(--ink-soft);
  margin-bottom: 28px;
}
.tb-eyebrow::before { content: ''; width: 6px; height: 6px; border-radius: 999px; background: var(--ok); }
.tb-headline { max-width: 18ch; }
.tb-headline em { font-style: normal; color: var(--electric); }
.tb-lede { font-size: clamp(17px, 2.1vw, 22px); color: var(--ink-soft); max-width: 56ch; margin: 28px 0 40px; line-height: 1.55; }
.tb-hero-ctas { display: flex; gap: 16px; flex-wrap: wrap; }
.tb-hero-stats { display: flex; gap: 40px; margin-top: 72px; flex-wrap: wrap; }
.tb-stat { font-family: var(--font-head); }
.tb-stat-num { font-size: 40px; font-weight: 700; color: var(--ink); letter-spacing: -0.03em; font-family: var(--font-mono); }
.tb-stat-label { font-size: 13px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px; }

/* ----------- Manifesto & content sections ----------- */
.tb-section-head { max-width: 820px; margin-bottom: 48px; }
.tb-kicker {
  font-family: var(--font-mono); font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--electric);
  margin-bottom: 16px;
}

.tb-card {
  background: var(--paper); border-radius: var(--radius-lg);
  padding: 32px; border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.tb-card-lg { padding: 48px; }
.tb-grid { display: grid; gap: var(--gap); }
.tb-grid-3 { grid-template-columns: repeat(3, 1fr); }
.tb-grid-2 { grid-template-columns: repeat(2, 1fr); }
.tb-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 880px) { .tb-grid-3, .tb-grid-4 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .tb-grid-2 { grid-template-columns: 1fr; } }

.tb-lie {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 20px 24px; border-radius: var(--radius);
  background: var(--fog); border: 1px solid var(--line);
}
.tb-lie-kill { color: var(--ink); font-weight: 700; font-family: var(--font-mono); font-size: 12px; min-width: 54px; letter-spacing: 0.1em; padding: 4px 10px; background: var(--mist); border-radius: 6px; align-self: flex-start; text-align: center; }
.tb-lie-truth { color: var(--ink); font-weight: 600; }

/* ----------- Wizard ----------- */
.tb-wizard {
  max-width: 680px; margin: 0 auto; padding: 48px 32px;
  background: var(--paper); border-radius: var(--radius-lg);
  border: 1px solid var(--line); box-shadow: var(--shadow-md);
}
.tb-steps { display: flex; gap: 8px; margin-bottom: 32px; }
.tb-step-bar { flex: 1; height: 4px; border-radius: 4px; background: var(--mist); transition: background 0.3s ease; }
.tb-step-bar.is-done { background: var(--ink); }
.tb-step-bar.is-active { background: var(--electric); }
.tb-wizard-kicker { font-family: var(--font-mono); font-size: 13px; color: var(--ink-mute); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 8px; }
.tb-wizard-q { font-family: var(--font-head); font-size: 30px; font-weight: 700; color: var(--ink); line-height: 1.15; margin-bottom: 24px; letter-spacing: -0.025em; }
.tb-wizard-help { color: var(--ink-mute); margin-bottom: 24px; font-size: 15px; }

.tb-choices { display: grid; gap: 10px; }
.tb-choice {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; min-height: 56px;
  background: var(--paper); border: 1.5px solid var(--line);
  border-radius: var(--radius);
  text-align: left; width: 100%;
  transition: border-color 0.15s ease, background 0.15s ease;
  font-family: var(--font-body);
  color: var(--ink);
  font-weight: 500;
  font-size: 15px;
}
.tb-choice:hover { border-color: var(--ink); }
.tb-choice.is-selected { border-color: var(--electric); background: rgba(58, 134, 255, 0.06); }
.tb-choice-dot {
  width: 18px; height: 18px; border-radius: 999px;
  border: 1.5px solid var(--line); flex-shrink: 0;
  position: relative;
}
.tb-choice.is-selected .tb-choice-dot { border-color: var(--electric); }
.tb-choice.is-selected .tb-choice-dot::after {
  content: ''; position: absolute; inset: 3px;
  border-radius: 999px; background: var(--electric);
}

.tb-field { margin-bottom: 18px; }
.tb-field label {
  display: block; font-family: var(--font-head); font-weight: 600;
  font-size: 14px; color: var(--ink); margin-bottom: 6px;
}
.tb-field input, .tb-field select {
  width: 100%; padding: 14px 16px; min-height: 48px;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--paper); color: var(--ink);
  font-size: 16px; /* 16px avoids iOS zoom on focus */
  transition: border-color 0.15s ease;
}
.tb-field input:focus, .tb-field select:focus { outline: none; border-color: var(--electric); }
.tb-field-row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 480px) { .tb-field-row { grid-template-columns: 1fr; } }

.tb-wizard-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 32px; }

/* ----------- Verdict ----------- */
.tb-verdict { display: grid; gap: 32px; grid-template-columns: 2fr 1fr; }
@media (max-width: 880px) { .tb-verdict { grid-template-columns: 1fr; } }

.tb-verdict-card {
  background: var(--verdict); color: var(--paper);
  border-radius: var(--radius-lg);
  padding: 48px; position: relative; overflow: hidden;
}
.tb-verdict-card::before {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 220px; height: 220px; border-radius: 999px;
  background: radial-gradient(circle, rgba(58, 134, 255, 0.35), transparent 70%);
  pointer-events: none;
}
.tb-verdict-kicker {
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.12em;
  text-transform: uppercase; color: rgba(255, 255, 255, 0.55); margin-bottom: 18px;
}
.tb-verdict-goal { font-family: var(--font-head); font-size: 20px; opacity: 0.9; margin-bottom: 10px; font-weight: 500; }
.tb-verdict-num {
  font-family: var(--font-mono); font-weight: 700;
  font-size: clamp(56px, 13vw, 160px);
  line-height: 1; letter-spacing: -0.04em; color: var(--paper);
  margin: 12px 0;
  overflow-wrap: break-word; font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) {
  .tb-verdict-card { padding: 32px 20px; }
}
.tb-verdict-unit { font-family: var(--font-head); font-size: 22px; opacity: 0.8; font-weight: 500; }
.tb-verdict-honest { margin-top: 24px; font-size: 14px; opacity: 0.7; max-width: 44ch; line-height: 1.6; }

.tb-bands { display: grid; gap: 10px; margin-top: 40px; }
.tb-band {
  display: grid; grid-template-columns: 80px 1fr auto; align-items: center;
  gap: 16px; padding: 14px 18px; border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08);
}
.tb-band-label { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.65; }
.tb-band-track { position: relative; height: 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.tb-band-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--electric); border-radius: 4px; transition: width 0.6s ease; }
.tb-band-fill.is-mid { background: rgba(58, 134, 255, 0.55); }
.tb-band-fill.is-low { background: rgba(58, 134, 255, 0.25); }
.tb-band-val { font-family: var(--font-mono); font-size: 14px; font-weight: 600; }

.tb-science { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 32px; }
.tb-science h4 { font-family: var(--font-head); margin-bottom: 20px; }
.tb-reason-list, .tb-cite-list { padding: 0; margin: 0; list-style: none; }
.tb-reason-list li {
  padding: 10px 0 10px 26px; position: relative; font-size: 14px; color: var(--ink-soft); border-bottom: 1px solid var(--line);
}
.tb-reason-list li::before { content: '•'; color: var(--electric); position: absolute; left: 8px; top: 10px; font-weight: 700; }
.tb-reason-list li:last-child { border: none; }
.tb-cite-list { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); }
.tb-cite-list li { font-family: var(--font-mono); font-size: 12px; color: var(--ink-mute); padding: 4px 0; }

/* ----------- Body Map ----------- */
.tb-bodymap { display: grid; gap: 40px; grid-template-columns: 1fr 1.2fr; align-items: start; }
@media (max-width: 880px) { .tb-bodymap { grid-template-columns: 1fr; } }

.tb-bodymap-svg { background: var(--paper); border-radius: var(--radius-lg); border: 1px solid var(--line); padding: 24px; aspect-ratio: 3 / 4; display: flex; align-items: center; justify-content: center; }
.tb-bodymap-svg svg { max-height: 560px; width: auto; }

.tb-muscle-region { fill: rgba(58, 134, 255, 0.18); stroke: rgba(58, 134, 255, 0.35); stroke-width: 1; cursor: pointer; transition: fill 0.15s ease, stroke 0.15s ease; }
.tb-muscle-region:hover { fill: rgba(58, 134, 255, 0.45); }
.tb-muscle-region.is-active { fill: rgba(58, 134, 255, 0.75); stroke: var(--electric); stroke-width: 2; }
.tb-muscle-region.is-neglected { fill: rgba(124, 58, 237, 0.22); stroke: rgba(124, 58, 237, 0.4); }
.tb-muscle-region.is-neglected:hover { fill: rgba(124, 58, 237, 0.55); }
.tb-muscle-region.is-neglected.is-active { fill: rgba(124, 58, 237, 0.8); stroke: var(--rare); stroke-width: 2; }

.tb-muscle-list { display: grid; gap: 10px; }
.tb-muscle-pill {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; min-height: 56px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-head); font-weight: 600; font-size: 16px;
  color: var(--ink); text-align: left; width: 100%;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.tb-muscle-pill:hover { border-color: var(--ink); transform: translateX(4px); }
.tb-muscle-pill.is-active { border-color: var(--electric); background: rgba(58, 134, 255, 0.04); }
.tb-muscle-pill .tb-neglected-tag { font-family: var(--font-mono); font-size: 11px; color: #5B21B6; text-transform: uppercase; letter-spacing: 0.1em; padding: 4px 10px; background: rgba(124, 58, 237, 0.12); border-radius: 999px; font-weight: 700; }

/* ----------- Exercise library ----------- */
.tb-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.tb-filter-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.tb-filter-label { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-mute); margin-right: 4px; }

/* Body-fat visual chooser (wizard step 2) */
.tb-bf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.tb-bf-option {
  padding: 14px; border-radius: var(--radius); border: 1.5px solid var(--line);
  background: var(--paper); text-align: center; cursor: pointer; font-family: var(--font-body);
  color: var(--ink); display: flex; flex-direction: column; gap: 6px; min-height: 88px; align-items: center; justify-content: center;
}
.tb-bf-option:hover { border-color: var(--ink); }
.tb-bf-option.is-selected { border-color: var(--electric); background: rgba(58,134,255,0.06); }
.tb-bf-pct { font-family: var(--font-mono); font-size: 20px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.tb-bf-desc { font-size: 12px; color: var(--ink-mute); }

/* Trust chip row on form-check */
.tb-trust { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; justify-content: center; }
.tb-trust-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.85); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.tb-filter {
  padding: 8px 16px; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-pill); font-size: 14px; color: var(--ink-soft);
  cursor: pointer; transition: all 0.15s ease;
}
.tb-filter:hover { border-color: var(--ink); color: var(--ink); }
.tb-filter.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.tb-exercise-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.tb-exercise {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 24px; position: relative; display: flex; flex-direction: column; gap: 12px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.tb-exercise:hover { border-color: var(--ink); transform: translateY(-2px); }
.tb-ex-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tb-ex-title { font-family: var(--font-head); font-weight: 700; font-size: 18px; color: var(--ink); letter-spacing: -0.015em; }
.tb-ex-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tb-chip {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 4px 10px; border-radius: 999px; background: var(--fog); color: var(--ink-soft);
}
.tb-chip.is-rare { background: rgba(124, 58, 237, 0.1); color: var(--rare); font-weight: 700; }
.tb-chip.is-advanced { background: rgba(239, 68, 68, 0.08); color: var(--danger); }
.tb-chip.is-intermediate { background: rgba(245, 158, 11, 0.1); color: var(--warn); }
.tb-chip.is-beginner { background: rgba(16, 185, 129, 0.1); color: var(--ok); }
.tb-ex-muscles { font-size: 13px; color: var(--ink-mute); }
.tb-ex-why { font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.tb-ex-mistake { font-size: 13px; color: var(--ink-mute); padding-top: 12px; border-top: 1px dashed var(--line); }
.tb-ex-mistake strong { color: var(--danger); font-weight: 600; }
.tb-ex-sets { font-family: var(--font-mono); font-size: 13px; color: var(--ink); font-weight: 600; }

/* ----------- Today's Workout ----------- */
.tb-workout-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; flex-wrap: wrap; }
.tb-workout-goal { font-family: var(--font-mono); font-size: 13px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.1em; }
.tb-workout-list { display: grid; gap: 14px; }
.tb-workout-item {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 16px; align-items: center;
  padding: 20px 24px; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.tb-workout-num {
  width: 36px; height: 36px; border-radius: 999px; background: var(--ink); color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 14px;
}
.tb-workout-name { font-family: var(--font-head); font-weight: 700; font-size: 17px; color: var(--ink); }
.tb-workout-meta { font-size: 13px; color: var(--ink-mute); margin-top: 2px; }
.tb-workout-log {
  padding: 10px 16px; border-radius: var(--radius-pill);
  background: var(--fog); color: var(--ink); font-weight: 600; font-size: 13px;
  min-height: 40px;
}
.tb-workout-log:hover { background: var(--ink); color: var(--paper); }
.tb-workout-log.is-logged { background: var(--ok); color: var(--paper); }

/* ----------- Ledger ----------- */
.tb-ledger { display: grid; gap: 18px; }
.tb-ledger-entry {
  display: grid; grid-template-columns: 140px 1fr; gap: 24px;
  padding: 24px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.tb-ledger-date { font-family: var(--font-mono); font-size: 13px; color: var(--ink-mute); letter-spacing: 0.05em; }
.tb-ledger-title { font-family: var(--font-head); font-weight: 700; color: var(--ink); font-size: 16px; margin-bottom: 8px; }
.tb-ledger-body { font-size: 14px; color: var(--ink-soft); line-height: 1.6; }
.tb-ledger-tag { display: inline-block; font-family: var(--font-mono); font-size: 11px; color: var(--electric); text-transform: uppercase; letter-spacing: 0.1em; padding: 3px 10px; background: rgba(58, 134, 255, 0.08); border-radius: 999px; margin-right: 6px; }
@media (max-width: 640px) { .tb-ledger-entry { grid-template-columns: 1fr; } }

/* ----------- Form Check ----------- */
.tb-form-check {
  display: grid; gap: 24px; grid-template-columns: 1fr 340px;
}
@media (max-width: 880px) { .tb-form-check { grid-template-columns: 1fr; } }

.tb-camera-shell {
  position: relative; background: var(--verdict); border-radius: var(--radius-lg); overflow: hidden;
  aspect-ratio: 4 / 3;
  display: flex; align-items: center; justify-content: center;
}
.tb-camera-shell video,
.tb-camera-shell canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.tb-camera-shell video { object-fit: cover; transform: scaleX(-1); }
.tb-camera-shell canvas { pointer-events: none; transform: scaleX(-1); }
.tb-camera-placeholder {
  text-align: center; color: rgba(255, 255, 255, 0.7); padding: 40px;
  font-family: var(--font-head); font-weight: 500;
}
.tb-camera-placeholder h3 { color: var(--paper); margin-bottom: 12px; }

.tb-form-panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; }
.tb-form-row { display: flex; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.tb-form-row:last-child { border: none; }
.tb-form-label { color: var(--ink-mute); }
.tb-form-value { font-family: var(--font-mono); font-weight: 700; color: var(--ink); }
.tb-form-value.is-good { color: var(--ok); }
.tb-form-value.is-warn { color: var(--warn); }
.tb-rep-counter {
  margin-bottom: 20px; padding: 20px; background: var(--fog); border-radius: var(--radius);
  text-align: center;
}
.tb-rep-count { font-family: var(--font-mono); font-weight: 700; font-size: 56px; color: var(--ink); line-height: 1; letter-spacing: -0.03em; }
.tb-rep-label { font-family: var(--font-mono); font-size: 12px; color: var(--ink-mute); letter-spacing: 0.12em; text-transform: uppercase; margin-top: 6px; }

.tb-exercise-picker { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tb-exercise-picker .tb-filter.is-active { background: var(--electric); border-color: var(--electric); }

/* ----------- Pricing panel ----------- */
.tb-pricing { display: grid; gap: 24px; grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) { .tb-pricing { grid-template-columns: 1fr; } }
.tb-tier { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 32px; }
.tb-tier.is-featured { border-color: var(--ink); background: var(--verdict); color: var(--paper); }
.tb-tier.is-featured h3 { color: var(--paper); }
.tb-tier-price { font-family: var(--font-mono); font-size: 48px; font-weight: 700; letter-spacing: -0.03em; margin: 16px 0 8px; }
.tb-tier.is-featured .tb-tier-price { color: var(--paper); }
.tb-tier-caveat { font-size: 13px; color: var(--ink-mute); margin-bottom: 20px; }
.tb-tier.is-featured .tb-tier-caveat { color: rgba(255, 255, 255, 0.6); }
.tb-tier ul { padding: 0; margin: 0 0 24px; list-style: none; }
.tb-tier li { padding: 10px 0 10px 28px; position: relative; font-size: 14px; border-top: 1px dashed var(--line); }
.tb-tier li:first-child { border: none; }
.tb-tier.is-featured li { border-color: rgba(255,255,255,0.12); }
.tb-tier li::before { content: '✓'; position: absolute; left: 0; color: var(--electric); font-weight: 700; }
.tb-tier.is-featured li::before { color: var(--paper); }

/* ----------- Footer ----------- */
.tb-footer {
  padding: 64px 24px 32px; border-top: 1px solid var(--line); background: var(--paper);
  font-size: 14px; color: var(--ink-mute);
}
.tb-footer-inner { max-width: var(--max); margin: 0 auto; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
@media (max-width: 600px) { .tb-footer-inner { flex-direction: column; align-items: flex-start; } .tb-footer-inner > div:last-child { flex-wrap: wrap; } }
.tb-footer-brand { font-family: var(--font-head); font-weight: 700; color: var(--ink); font-size: 18px; letter-spacing: -0.02em; }

/* ----------- View transitions ----------- */
.tb-view { display: none; animation: tbFade 0.35s ease; }
.tb-view.is-active { display: block; }
@keyframes tbFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ----------- Utilities ----------- */
.tb-hide { display: none !important; }
.tb-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Focus ring — accessibility */
:focus-visible { outline: 3px solid var(--electric); outline-offset: 2px; border-radius: 4px; }
button:focus-visible, .btn:focus-visible, .tb-choice:focus-visible, .tb-muscle-pill:focus-visible { outline-offset: 3px; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition: none !important; }
}
