/* ===================================================================
   ForgeAI — Premium Design System v2
   Matte black · Neon lime · Glassmorphism · 2026 Edition
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700&family=Inter:wght@400;500;600;700&family=Teko:wght@400;500;600;700&display=swap');

:root {
  /* ── Matte dark palette ─────────────────────────────────────────── */
  --bg:           #0C0C0F;
  --bg-elev:      #131318;
  --bg-elev-2:    #1A1A22;
  --line:         rgba(255,255,255,0.08);
  --line-strong:  rgba(255,255,255,0.14);
  --text:         #EEEEF2;
  --text-dim:     #A2A2B8;
  --text-faint:   #6A6A80;

  /* ── Neon lime signature ────────────────────────────────────────── */
  --accent:       #AAEE00;   /* primary lime green */
  --accent-hot:   #BBFF1A;   /* bright hover lime */
  --accent-rgb:   170,238,0; /* r,g,b — for rgba(var(--accent-rgb),opacity) */
  --brass:        #F5C430;   /* gold — PRs & milestones */
  --good:         #4ADE80;   /* success */
  --warn:         #FB923C;   /* warning orange */
  --bad:          #FF6B6B;   /* error red */

  /* ── Shape ──────────────────────────────────────────────────────── */
  --grid:       8px;
  --radius:     12px;
  --radius-lg:  18px;
  --radius-xl:  28px;
  --radius-btn: 14px;

  /* ── Shadows ────────────────────────────────────────────────────── */
  --shadow-1:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 2px 8px rgba(0,0,0,0.5),
    0 8px 32px rgba(0,0,0,0.25);
  --shadow-2:
    0 24px 80px rgba(0,0,0,0.7),
    0 8px 32px rgba(0,0,0,0.5);

  /* ── Glows ──────────────────────────────────────────────────────── */
  --glow-accent: 0 0 0 3px rgba(var(--accent-rgb),0.25);
  --glow-brass:  0 0 0 3px rgba(245,196,48,0.22);
  --glow-btn:    0 0 28px rgba(var(--accent-rgb),0.28), 0 4px 12px rgba(0,0,0,0.4);

  --border-subtle: rgba(255,255,255,0.07);
  color-scheme: dark;
}

/* ══════════════════════════════════════════════════════════════
   Light mode — html[data-color-scheme="light"]
   ══════════════════════════════════════════════════════════════ */
html[data-color-scheme="light"] {
  --bg:            #E9E9EF;
  --bg-elev:       #F4F4FA;
  --bg-elev-2:     #E2E2E9;
  --line:          rgba(0,0,0,0.16);
  --line-strong:   rgba(0,0,0,0.24);
  --text:          #141416;
  --text-dim:      #44444C;
  --text-faint:    #78787E;
  --border-subtle: rgba(0,0,0,0.18);
  --shadow-1:
    0 1px 0 rgba(255,255,255,0.7) inset,
    0 2px 8px rgba(0,0,0,0.06),
    0 8px 32px rgba(0,0,0,0.04);
  --shadow-2:
    0 24px 80px rgba(0,0,0,0.12),
    0 8px 32px rgba(0,0,0,0.08);
  color-scheme: light;
}

html[data-color-scheme="light"] body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 900px 600px at 78% -8%, rgba(var(--accent-rgb),0.05), transparent 58%),
    radial-gradient(ellipse 700px 500px at -8% 105%, rgba(var(--accent-rgb),0.03), transparent 58%);
  /* Subpixel rendering sharpens text on light backgrounds */
  -webkit-font-smoothing: subpixel-antialiased;
  -moz-osx-font-smoothing: auto;
}

/* ── Cards (light) ── */
html[data-color-scheme="light"] .card {
  background: linear-gradient(160deg, #F4F4FA 0%, #EAEAF0 100%);
  border-color: rgba(0,0,0,0.18);
  box-shadow: 0 4px 24px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.05);
}
html[data-color-scheme="light"] .card--accent {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, #F4F4FA) 0%, #EEEEF4 60%);
}
html[data-color-scheme="light"] .card--brass {
  background: linear-gradient(180deg, rgba(245,196,48,0.10) 0%, #EEEEF4 60%);
}
html[data-color-scheme="light"] .card--warn {
  background: linear-gradient(180deg, rgba(251,146,60,0.08) 0%, #EEEEF4 60%);
}
html[data-color-scheme="light"] .card--good {
  background: linear-gradient(180deg, rgba(74,222,128,0.08) 0%, #EEEEF4 60%);
}

/* ── Forms (light) ── */
html[data-color-scheme="light"] input,
html[data-color-scheme="light"] select,
html[data-color-scheme="light"] textarea {
  background: #F4F4FA;
  border-color: rgba(0,0,0,0.22);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.04);
}
html[data-color-scheme="light"] select,
html[data-color-scheme="light"] select:focus { background-color: #F4F4FA; }
html[data-color-scheme="light"] option { background: #F4F4FA; color: #1C1C1E; }
html[data-color-scheme="light"] option:checked { background: #EAEAF0; color: #1C1C1E; }

/* ── Topbar (light) ── */
html[data-color-scheme="light"] .topbar {
  background: rgba(233,233,239,0.94);
  border-bottom-color: rgba(0,0,0,0.18);
}

/* ── Bottom nav (light) ── */
html[data-color-scheme="light"] .bottom-nav {
  background: rgba(233,233,239,0.96);
  border-top-color: rgba(0,0,0,0.18);
}

/* ── Sidebar (light) ── */
html[data-color-scheme="light"] .sidebar {
  background: rgba(233,233,239,0.98);
  border-right-color: rgba(0,0,0,0.18);
}
html[data-color-scheme="light"] .sidebar-header {
  border-bottom-color: rgba(0,0,0,0.14);
}
html[data-color-scheme="light"] .sidebar-backdrop {
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
html[data-color-scheme="light"] .sidebar-links a,
html[data-color-scheme="light"] .sidebar-footer a { color: var(--text-dim); }
html[data-color-scheme="light"] .sidebar-links a:hover,
html[data-color-scheme="light"] .sidebar-footer a:hover {
  background: rgba(0,0,0,0.05);
  color: var(--text);
}
html[data-color-scheme="light"] .sidebar-footer {
  border-top-color: rgba(0,0,0,0.14);
}

/* ── Exercise blocks (light) ── */
html[data-color-scheme="light"] .exercise-block {
  background: linear-gradient(160deg, rgba(0,0,0,0.015) 0%, #F4F4FA 100%);
  border-color: rgba(0,0,0,0.20);
  box-shadow: var(--shadow-1), -4px 0 20px rgba(var(--accent-rgb), 0.08);
}
html[data-color-scheme="light"] .exercise-head {
  background: linear-gradient(180deg, rgba(0,0,0,0.025), rgba(0,0,0,0.01));
  border-bottom-color: rgba(0,0,0,0.14);
}
html[data-color-scheme="light"] .suggested { background: rgba(0,0,0,0.025); }

/* ── Hub tabs (light) ── */
html[data-color-scheme="light"] .hub-tabs {
  background: linear-gradient(180deg, #F4F4FA 0%, #EEEEF4 100%);
  border-color: rgba(0,0,0,0.20);
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}
html[data-color-scheme="light"] .hub-tab:hover { background: rgba(0,0,0,0.04); }

/* ── Banners (light) ── */
html[data-color-scheme="light"] .banner { background: #F4F4FA; }
html[data-color-scheme="light"] .banner--warn {
  background: linear-gradient(90deg, rgba(251,146,60,0.08), #F4F4FA 60%);
}
html[data-color-scheme="light"] .banner--good {
  background: linear-gradient(90deg, rgba(74,222,128,0.08), #F4F4FA 60%);
}

/* ── Auth card (light) ── */
html[data-color-scheme="light"] .auth-card {
  background: transparent;
}

/* ── Info modal (light) ── */
html[data-color-scheme="light"] .info-modal {
  background: rgba(233,233,239,0.98);
  border-color: rgba(0,0,0,0.18);
  border-top-color: rgba(0,0,0,0.24);
}
html[data-color-scheme="light"] .info-modal::before { background: rgba(0,0,0,0.15); }

/* ── Toast (light) ── */
html[data-color-scheme="light"] .forge-toast {
  background: rgba(244,244,250,0.97);
  border-color: rgba(0,0,0,0.20);
}

/* ── Tags (light) ── */
html[data-color-scheme="light"] .tag {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.18);
}

/* ── RPE / misc panels (light) ── */
html[data-color-scheme="light"] .rpe-calc-panel {
  background: #F4F4FA;
  border-color: rgba(0,0,0,0.20);
}
html[data-color-scheme="light"] .muscle-tooltip {
  background: #F4F4FA;
  border-color: rgba(0,0,0,0.20);
}

/* ── Dashboard muscle figure (light) — remove dark invert ── */
html[data-color-scheme="light"] .figure-img {
  filter: brightness(0.85);
}

/* ── HR divider (light) ── */
html[data-color-scheme="light"] hr { border-top-color: rgba(0,0,0,0.08); }

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

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(ellipse 900px 600px at 78% -8%, rgba(var(--accent-rgb),0.055), transparent 58%),
    radial-gradient(ellipse 700px 500px at -8% 105%, rgba(var(--accent-rgb),0.032), transparent 58%);
  background-attachment: fixed;
}

/* ── Typography ─────────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
h1 { font-size: 2.4rem; line-height: 0.95; font-weight: 900; text-wrap: balance; }
h2 { font-size: 1.6rem; line-height: 1.15; }
h3 { font-size: 1.15rem; font-weight: 700; }

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--text-dim);
}

.num, .mono {
  font-family: 'JetBrains Mono', monospace;
  font-feature-settings: "tnum";
}

.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }

a { color: var(--accent-hot); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}

/* ── Layout primitives ──────────────────────────────────────────── */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px calc(80px + env(safe-area-inset-bottom, 0px));
}
.container--narrow { max-width: 640px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 720px) {
  /* ── Grids ── */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

  /* ── Container ── */
  .container { padding: 20px 14px calc(84px + env(safe-area-inset-bottom, 0px)); }

  /* ── Typography ── */
  h1 { font-size: 2.1rem; letter-spacing: -0.025em; }
  h2 { font-size: 1.8rem; }
  h3 { font-size: 1.25rem; }
  .eyebrow { font-size: 12px; }
  .muted, .faint { font-size: 15px; }

  /* ── Cards ── */
  .card { padding: 20px 16px; border-radius: var(--radius-lg); }
  .card-title { font-size: 13px; margin-bottom: 12px; }
  .card-big { font-size: 3.2rem; }

  /* ── Forms ── */
  label { font-size: 12px; letter-spacing: 0.12em; }
  input, select, textarea { min-height: 54px; font-size: 16px; padding: 14px 16px; }
  .field-row { grid-template-columns: 1fr; }

  /* ── Buttons ── */
  .btn { min-height: 54px; font-size: 14px; padding: 14px 24px; }
  .btn--small { min-height: 42px; font-size: 12px; padding: 10px 16px; }

  /* ── Tables ── */
  table { font-size: 14px; }
  th { font-size: 11px; letter-spacing: 0.12em; }
  td, th { padding: 12px 10px; }

  /* ── Tags / pills ── */
  .tag { font-size: 12px; padding: 5px 12px; }

  /* ── Banners ── */
  .banner-title { font-size: 1.1rem; }
  .banner-msg { font-size: 14px; }
  .banner { padding: 16px; }

  /* ── Topbar ── */
  .topbar-brand-icon { height: 30px; }
  .topbar-brand-svg  { height: 37px; max-width: 197px; }
  .topbar-brand-text { font-size: 1.72rem; }
  .topbar-icon-btn { width: 42px; height: 42px; }
  .topbar-icon-btn svg { width: 24px; height: 24px; }
  .profile-avatar { width: 40px; height: 40px; font-size: 15px; }

  /* ── Sidebar ── */
  .hamburger-btn { display: flex; }
  .nav { display: none; }
  .topbar-inner { display: none; }
  .sidebar-links a, .sidebar-footer a { font-size: 15px; padding: 14px 16px; }

  /* ── Bottom nav ── */
  .bottom-nav-tab { min-height: 64px; padding: 12px 4px 10px; font-size: 11px; gap: 5px; }
  .bottom-nav-tab svg { width: 26px; height: 26px; }

  /* ── Exercise blocks ── */
  .exercise-head { padding: 16px; }
  .exercise-head h3 { font-size: 1.2rem; }
  .exercise-meta { font-size: 13px; }
  .suggested { font-size: 12px; padding: 12px 16px; }

  /* ── Hub tabs ── */
  .hub-tabs { padding: 6px; }
  .hub-tab { font-size: 12px; padding: 10px 8px; }

  /* ── Charts ── */
  .chart-wrap { height: 240px; }
}

/* ── Header ─────────────────────────────────────────────────────── */
.topbar {
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(12,12,15,0.92);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  position: sticky; top: 0; z-index: 50;
}
.topbar-brand-bar {
  display: flex;
  align-items: center;
  padding: 8px 20px;
}
.topbar-ghost {
  width: 34px;
  flex-shrink: 0;
}
.topbar-brand-name {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
}
.topbar-brand-icon {
  height: 36px;
  width: auto;
  flex-shrink: 0;
}
.topbar-brand-svg {
  height: 42px;
  width: auto;
  max-width: 237px;
}
.topbar-brand-text {
  font-family: 'Teko', sans-serif; font-size: 2.0625rem; font-weight: 600;
  letter-spacing: 0.04em; color: var(--accent); line-height: 1;
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 4px 20px;
  display: flex; align-items: center;
}
.brand {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
  display: flex; align-items: center; gap: 10px;
}
.brand-logo {
  height: 34px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
.brand small {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.nav {
  display: flex; gap: 4px;
}
.nav a {
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: var(--radius);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 0.15s, background 0.15s;
}
.nav a:hover { color: var(--text); background: var(--bg-elev-2); text-decoration: none; }
.nav a.active { color: var(--accent-hot); }
.nav a.active::after {
  content: ''; display: block; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hot));
  margin-top: 4px; border-radius: 2px;
  box-shadow: 0 0 10px rgba(var(--accent-rgb),0.5);
}

/* ── Cards ──────────────────────────────────────────────────────── */
.card {
  background: linear-gradient(160deg, var(--bg-elev) 0%, var(--bg) 100%);
  border: none;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.55), 0 4px 16px rgba(0,0,0,0.3);
}
.card--accent {
  border-left: 3px solid var(--accent);
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 10%, #141a22) 0%, #0d1117 60%);
}
.card--brass {
  border-left: 3px solid var(--brass);
  background: linear-gradient(160deg, rgba(245,196,48,0.10) 0%, #0d1117 60%);
}
.card--warn {
  border-left: 3px solid var(--warn);
  background: linear-gradient(160deg, rgba(251,146,60,0.09) 0%, #0d1117 60%);
}
.card--good {
  border-left: 3px solid var(--good);
  background: linear-gradient(160deg, rgba(74,222,128,0.09) 0%, #0d1117 60%);
}
.card-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.card-big {
  font-family: 'Outfit', sans-serif;
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1;
  color: var(--text);
  text-shadow: 0 2px 16px rgba(0,0,0,0.4);
  letter-spacing: -0.03em;
}
.card-big .unit {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-left: 6px;
  letter-spacing: 0;
}

/* ── Forms ──────────────────────────────────────────────────────── */
label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
input, select, textarea {
  width: 100%;
  background: var(--bg-elev-2);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 12px 14px;
  font: inherit;
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  outline: none;
  transition: border-color 120ms, box-shadow 120ms;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
  min-height: 48px;
}
select {
  appearance: none;
  -webkit-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='%2388889A' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}
option {
  background: #1A1A22;
  color: #EEEEF2;
}
option:checked {
  background: #2a2a38;
  color: #BBFF1A;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,0.04);
  box-shadow: var(--glow-accent), inset 0 1px 3px rgba(0,0,0,0.15);
}
select:focus {
  background-color: var(--bg-elev-2);
}
.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center; justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent-hot) 0%, var(--accent) 100%);
  color: #0C0C0F;
  border: 0;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 12px 20px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 140ms cubic-bezier(0.2,0,0,1), box-shadow 140ms, filter 140ms;
  min-height: 48px;
  touch-action: manipulation;
  box-shadow: var(--glow-btn);
}
.btn:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 0 36px rgba(var(--accent-rgb),0.4), 0 8px 24px rgba(0,0,0,0.4);
}
.btn:active { transform: translateY(1px); box-shadow: none; filter: brightness(0.96); }
.btn:focus-visible { box-shadow: var(--glow-accent); }
.btn--ghost {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: none;
}
.btn--ghost:hover {
  background: rgba(255,255,255,0.10);
  border-color: var(--accent);
  color: var(--accent-hot);
  transform: translateY(-1px);
  box-shadow: none;
}
.btn--brass {
  background: linear-gradient(135deg, #FFD966 0%, var(--brass) 100%);
  color: #0C0C0F;
  box-shadow: 0 0 22px rgba(245,196,48,0.22);
}
.btn--brass:hover {
  filter: brightness(1.06);
  box-shadow: 0 0 32px rgba(245,196,48,0.36);
}
.btn--small { padding: 8px 14px; font-size: 11px; min-height: 36px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; filter: none; }

/* ── Tables ─────────────────────────────────────────────────────── */
table {
  width: 100%; border-collapse: collapse;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}
th, td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
th {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 500;
}

/* ── Pills / tags / banners ─────────────────────────────────────── */
.tag {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-dim);
}
.tag--accent { background: rgba(var(--accent-rgb),0.12); color: var(--accent-hot); border-color: rgba(var(--accent-rgb),0.3); }
.tag--brass  { background: rgba(245,196,48,0.12); color: var(--brass); border-color: rgba(245,196,48,0.3); }
.tag--good   { background: rgba(74,222,128,0.12); color: var(--good); border-color: rgba(74,222,128,0.3); }
.tag--warn   { background: rgba(251,146,60,0.12); color: var(--warn); border-color: rgba(251,146,60,0.3); }

.banner {
  display: flex; gap: 14px;
  padding: 14px 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--bg-elev);
  border-left: 4px solid var(--accent);
  margin-bottom: 12px;
}
.banner--warn { border-left-color: var(--warn); background: linear-gradient(90deg, rgba(251,146,60,0.06) 0%, var(--bg-elev) 60%); }
.banner--good { border-left-color: var(--good); background: linear-gradient(90deg, rgba(74,222,128,0.06) 0%, var(--bg-elev) 60%); }
.banner-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 2px;
}
.banner-msg { font-size: 13px; color: var(--text-dim); }

/* ── Auth pages ─────────────────────────────────────────────────── */
.auth-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  place-items: center;
  padding: 20px 20px;
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 40px);
  background-image: radial-gradient(ellipse 80% 50% at 50% 60%, rgba(var(--accent-rgb),0.055), transparent 70%);
}
.auth-card {
  width: 100%; max-width: 420px;
  background: transparent;
  border: none;
  border-radius: 22px;
  padding: 24px 32px;
}
.auth-card h1 { margin-bottom: 6px; }
.auth-card .lede { color: var(--text-dim); margin-bottom: 28px; font-size: 14px; }

.error {
  color: var(--bad);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  margin-top: 6px;
  min-height: 14px;
}

/* ── Workout logger ─────────────────────────────────────────────── */
.exercise-block {
  background: linear-gradient(160deg, rgba(255,255,255,0.04) 0%, rgba(19,19,24,0.97) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-left: 3px solid rgba(var(--accent-rgb), 0.6);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-1), -4px 0 20px rgba(var(--accent-rgb), 0.15);
}
.exercise-head {
  padding: 14px 16px;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  border-bottom: 1px solid var(--line);
}
.exercise-head h3 {
  font-size: 1.05rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.exercise-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-align: right;
}
.exercise-meta strong { color: var(--text); font-weight: 500; }
.set-row {
  display: grid;
  grid-template-columns: 32px 1fr 1fr 80px auto;
  gap: 8px;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}
.set-row:last-child { border-bottom: 0; }
.set-row .set-num {
  color: var(--text-faint);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.set-row input { padding: 7px 8px; font-size: 13px; min-height: unset; }
.suggested {
  background: rgba(255,255,255,0.025);
  padding: 10px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--line);
}
.suggested strong { color: var(--brass); }

/* ── Charts ─────────────────────────────────────────────────────── */
.chart-wrap {
  height: 220px;
  position: relative;
}

/* ── Hub sub-tabs (Health, Progress) ────────────────────────────── */
.hub-tabs {
  display: flex; gap: 4px; margin-bottom: 24px;
  background: linear-gradient(160deg, #141a22 0%, #0d1117 100%);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-lg); padding: 5px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.hub-tab {
  flex: 1; padding: 8px 6px; text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: var(--radius); border: 1px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.hub-tab:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.hub-tab--active { background: rgba(var(--accent-rgb),0.14); color: var(--accent); border-color: rgba(var(--accent-rgb),0.32); font-weight: 700; }

/* ── Topbar icon button (settings, etc.) ────────────────────────── */
.topbar-icon-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.topbar-icon-btn svg { width: 20px; height: 20px; }
.topbar-icon-btn:hover { color: var(--text); background: rgba(255,255,255,0.07); }
.topbar-icon-btn.active { color: var(--accent); }

/* ── Profile avatar (top-left header circle) ─────────────────────── */
.profile-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: #000;
  text-decoration: none;
  flex-shrink: 0;
  letter-spacing: 0.02em;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ── Bottom navigation bar ───────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  background: rgba(12,12,15,0.96);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border-top: 1px solid rgba(255,255,255,0.07);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 4px 8px;
  gap: 4px;
  color: var(--text-dim);
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
  min-height: 56px;
}
.bottom-nav-tab svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.bottom-nav-tab.active { color: var(--accent); }
.bottom-nav-tab--admin { color: var(--accent-hot) !important; }

/* ── Footer ─────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--line);
  padding: 24px 20px;
  padding-bottom: max(24px, env(safe-area-inset-bottom, 24px));
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.1em;
}

/* ── Utility ─────────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mt-40 { margin-top: 40px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; } .mb-32 { margin-bottom: 32px; } .mb-40 { margin-bottom: 40px; }
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* ── Hamburger button ───────────────────────────────────────────── */
.hamburger-btn {
  display: none;
  flex-direction: column; justify-content: center; align-items: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: none; border: none; cursor: pointer;
  padding: 4px; flex-shrink: 0;
  border-radius: var(--radius);
}
.hamburger-btn span {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.hamburger-btn:hover { background: rgba(255,255,255,0.08); }

/* ── Sidebar backdrop ───────────────────────────────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 149;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.sidebar-backdrop.open { display: block; }

/* ── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: -300px; bottom: 0;
  width: 280px;
  background: rgba(12,12,15,0.97);
  backdrop-filter: blur(32px) saturate(1.5);
  -webkit-backdrop-filter: blur(32px) saturate(1.5);
  border-right: 1px solid rgba(255,255,255,0.07);
  z-index: 150;
  display: flex; flex-direction: column;
  transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}
.sidebar.open { left: 0; }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.sidebar-brand {
  font-family: 'Outfit', sans-serif;
  font-weight: 900; font-size: 1.15rem;
  letter-spacing: -0.03em;
}
.sidebar-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 16px; line-height: 1;
  padding: 6px 8px; border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}
.sidebar-close:hover { color: var(--text); background: rgba(255,255,255,0.08); }

.sidebar-links {
  flex: 1;
  padding: 10px 10px;
}
.sidebar-links a,
.sidebar-footer a {
  display: flex; align-items: center;
  padding: 12px 14px;
  font-size: 14px; font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: 0.04em;
  border-left: 3px solid transparent;
  border-radius: 10px;
  margin: 2px 0;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.sidebar-links a:hover,
.sidebar-footer a:hover {
  color: var(--text); background: rgba(255,255,255,0.06);
}
.sidebar-links a.active {
  color: var(--accent-hot);
  border-left-color: var(--accent);
  background: rgba(var(--accent-rgb),0.08);
}
.sidebar-admin { color: var(--accent-hot) !important; }

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 4px 10px max(12px, env(safe-area-inset-bottom));
}
.sidebar-footer a { color: var(--text-faint); font-weight: 500; }

body.sidebar-open { overflow: hidden; }


/* ── Entrance animations ────────────────────────────────────────── */
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rise { animation: rise 350ms cubic-bezier(0.2,0.6,0.2,1) both; }
.rise-stagger > * { animation: rise 400ms cubic-bezier(0.2,0.6,0.2,1) both; }
.rise-stagger > *:nth-child(1) { animation-delay: 40ms; }
.rise-stagger > *:nth-child(2) { animation-delay: 90ms; }
.rise-stagger > *:nth-child(3) { animation-delay: 140ms; }
.rise-stagger > *:nth-child(4) { animation-delay: 190ms; }
.rise-stagger > *:nth-child(5) { animation-delay: 240ms; }
.rise-stagger > *:nth-child(6) { animation-delay: 290ms; }

/* ── Info modal ─────────────────────────────────────────────────── */
.info-icon {
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 0.85rem; padding: 0 0 0 6px;
  vertical-align: middle; line-height: 1; flex-shrink: 0;
}
.info-icon:hover { color: var(--brass); }

.info-modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.80);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0 0 env(safe-area-inset-bottom, 0) 0;
}
.info-modal {
  background: rgba(20,20,28,0.98);
  backdrop-filter: blur(32px) saturate(1.6);
  -webkit-backdrop-filter: blur(32px) saturate(1.6);
  border: 1px solid rgba(255,255,255,0.09);
  border-top: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%; max-width: 540px; max-height: 80vh;
  overflow-y: auto; padding: 24px 20px 40px;
  animation: rise 280ms cubic-bezier(0.2,0.6,0.2,1) both;
  box-shadow: var(--shadow-2);
}
.info-modal::before {
  content: '';
  display: block;
  width: 36px; height: 4px;
  background: rgba(255,255,255,0.18);
  border-radius: 2px;
  margin: 0 auto 20px;
}
.info-modal-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 16px;
}
.info-modal-title {
  font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 1.15rem;
}
.info-modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 18px; padding: 0 2px; line-height: 1;
}
.info-modal-close:hover { color: var(--text); }
.info-section { margin-bottom: 16px; }
.info-section-label {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 6px;
}
.info-section-text { font-size: 13px; color: var(--text-dim); line-height: 1.6; white-space: pre-wrap; }

/* ── Macro progress bars ────────────────────────────────────────── */
.macro-bars { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.macro-bar-wrap { display: flex; flex-direction: column; gap: 4px; }
.macro-bar-label {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-dim);
}
.macro-bar-track {
  height: 6px; background: var(--line);
  border-radius: 4px; overflow: hidden;
}
.macro-bar-fill {
  height: 100%; border-radius: 4px; transition: width 0.5s cubic-bezier(0.4,0,0.2,1), background 0.3s ease;
  background: linear-gradient(90deg, #22BB55, var(--good));
}
.macro-bar-fill--danger  { background: linear-gradient(90deg, #CC3344, var(--bad)); }
.macro-bar-fill--warn    { background: linear-gradient(90deg, #CC6622, var(--warn)); }
.macro-bar-fill--good    { background: linear-gradient(90deg, #22BB55, var(--good)); }
.macro-bar-fill--over    { background: linear-gradient(90deg, #C8960E, var(--brass)); }

/* ── Water progress bar ─────────────────────────────────────────── */
.water-bar-wrap { margin-bottom: 16px; }
.water-display {
  font-family: 'JetBrains Mono', monospace; font-size: 2rem;
  font-weight: 700; margin-bottom: 4px;
}
.water-bar-track {
  height: 8px; background: var(--line);
  border-radius: 4px; overflow: hidden; margin-bottom: 12px;
}
.water-bar-fill {
  height: 100%; border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1), background 0.3s ease;
}
.water-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.water-btn {
  flex: 1; min-width: 70px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  color: var(--text); border-radius: var(--radius);
  padding: 10px 4px; font-size: 13px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s; touch-action: manipulation;
  min-height: 48px;
}
.water-btn:active { background: rgba(255,255,255,0.1); }

/* ── Muscle volume heatmap ──────────────────────────────────────── */
.muscle-heatmap-wrap { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.muscle-heatmap-wrap svg { max-width: 160px; height: auto; }
.muscle-tooltip {
  margin-top: 12px; padding: 12px 16px;
  background: var(--bg-elev); border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg); font-size: 13px; min-height: 40px;
  box-shadow: var(--shadow-1);
}
.muscle-path { cursor: pointer; transition: opacity 0.15s; }
.muscle-path:hover { opacity: 0.8; }

/* ── Superset bracket ───────────────────────────────────────────── */
.superset-pair {
  border-left: 2px solid var(--brass); padding-left: 8px; margin-left: -10px;
  position: relative;
}
.superset-label {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  letter-spacing: 0.1em; color: var(--brass); margin-bottom: 4px;
}

/* ── AMRAP tag ──────────────────────────────────────────────────── */
.tag--amrap { background: rgba(245,196,48,0.12); color: var(--brass); border-color: rgba(245,196,48,0.3); }

/* ── RPE calculator panel ───────────────────────────────────────── */
.rpe-calc-btn {
  background: none; border: none; cursor: pointer; padding: 0 4px;
  color: var(--text-dim); font-size: 14px;
}
.rpe-calc-btn:hover { color: var(--brass); }
.rpe-calc-panel {
  background: var(--bg-elev); border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius); padding: 14px; margin-top: 8px;
  font-size: 13px; box-shadow: var(--shadow-1);
}
.rpe-calc-panel label { color: var(--text-dim); font-size: 11px; display: block; margin-bottom: 2px; }
.rpe-calc-panel input { width: 70px; min-height: unset; }
.rpe-calc-result {
  font-family: 'JetBrains Mono', monospace; font-size: 1.1rem;
  color: var(--brass); margin: 8px 0;
}

/* ── Offline banners ────────────────────────────────────────────── */
.offline-banner {
  display: none; width: 100%; padding: 10px 16px;
  background: var(--warn); color: #0C0C0F; font-size: 13px;
  text-align: center; position: sticky; top: 0; z-index: 200;
}
.offline-banner--syncing { background: var(--brass); }

/* ── Toast ──────────────────────────────────────────────────────── */
.forge-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: rgba(19,19,24,0.97);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 12px 22px; border-radius: var(--radius-lg);
  font-size: 13px; z-index: 500; animation: rise 250ms ease both;
  box-shadow: var(--shadow-2);
}

/* ── Sleep chart card ───────────────────────────────────────────── */
.sleep-card-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px;
}
.sleep-input-wrap { display: flex; flex-direction: column; gap: 4px; }
.sleep-input-wrap label { font-size: 11px; color: var(--text-dim); }

/* ── Range sliders ──────────────────────────────────────────────── */
input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 5px; border-radius: 3px;
  background: var(--line-strong); outline: none; cursor: pointer;
  min-height: unset; box-shadow: none; padding: 0; border: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5), 0 0 0 3px rgba(var(--accent-rgb),0.2);
  transition: box-shadow 0.15s;
}
input[type=range]::-webkit-slider-thumb:active {
  box-shadow: 0 2px 8px rgba(0,0,0,0.5), var(--glow-accent);
}
input[type=range]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* ══════════════════════════════════════════════════════════════
   Light mode — Dashboard page overrides
   ══════════════════════════════════════════════════════════════ */

/* Card-like surfaces with hardcoded dark gradients */
html[data-color-scheme="light"] .dash-tabs,
html[data-color-scheme="light"] .wk-hero-card,
html[data-color-scheme="light"] .wk-card,
html[data-color-scheme="light"] .wk-kpi-card,
html[data-color-scheme="light"] .today-extra-card {
  background: linear-gradient(180deg, #F4F4FA 0%, #EEEEF4 100%);
  border-color: rgba(0,0,0,0.20);
  box-shadow: 0 2px 16px rgba(0,0,0,0.05), 0 1px 4px rgba(0,0,0,0.04);
}

/* Readiness hero card */
html[data-color-scheme="light"] .rdy-eyebrow,
html[data-color-scheme="light"] .rdy-expand-link,
html[data-color-scheme="light"] .rdy-arc-lbl,
html[data-color-scheme="light"] .rdy-cmp-lbl,
html[data-color-scheme="light"] .rdy-trend.flat,
html[data-color-scheme="light"] .rdy-score-denom,
html[data-color-scheme="light"] .rdy-desc { color: var(--text-dim); }
html[data-color-scheme="light"] .rdy-score-big,
html[data-color-scheme="light"] .rdy-arc-num,
html[data-color-scheme="light"] .rdy-cmp-val { color: var(--text); }
html[data-color-scheme="light"] .rdy-arc-bg { stroke: rgba(0,0,0,0.10); }
html[data-color-scheme="light"] .rdy-tick-major { stroke: rgba(0,0,0,0.30); }
html[data-color-scheme="light"] .rdy-tick-minor { stroke: rgba(0,0,0,0.15); }
html[data-color-scheme="light"] .rdy-compare { border-top-color: rgba(0,0,0,0.08); }

/* Insights bottom sheet */
html[data-color-scheme="light"] .insights-sheet {
  background: linear-gradient(180deg, #F4F4FA 0%, #EEEEF4 100%);
  border-top-color: rgba(0,0,0,0.08);
}
html[data-color-scheme="light"] .insights-handle { background: rgba(0,0,0,0.12); }
html[data-color-scheme="light"] .insights-title { color: var(--text); }
html[data-color-scheme="light"] .insights-close {
  background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.20); color: var(--text-dim);
}
html[data-color-scheme="light"] .insights-close:hover { background: rgba(0,0,0,0.09); }
html[data-color-scheme="light"] .insights-section-lbl,
html[data-color-scheme="light"] .insights-stat-lbl { color: var(--text-dim); }
html[data-color-scheme="light"] .insights-stat-val { color: var(--text); }
html[data-color-scheme="light"] .insights-stat-pill {
  background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.16);
}

/* Recovery image — remove fade-to-card gradient in light mode */
html[data-color-scheme="light"] .rdy-arc-img {
  -webkit-mask-image: none;
  mask-image: none;
  filter: none;
}

/* Today Workout image — remove left/bottom fade in light mode */
html[data-color-scheme="light"] .twc-img-wrap {
  -webkit-mask-image: none;
  -webkit-mask-composite: unset;
  mask-image: none;
  mask-composite: unset;
}

/* Today Workout card */
html[data-color-scheme="light"] .twc-header-meta { color: var(--text-faint); }
html[data-color-scheme="light"] .twc-title { color: var(--text); }
html[data-color-scheme="light"] .twc-meta-item,
html[data-color-scheme="light"] .twc-focus-lbl { color: var(--text-dim); }
html[data-color-scheme="light"] .twc-tag {
  background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.18); color: var(--text-dim);
}
html[data-color-scheme="light"] .twc-menu-btn {
  background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.18); color: var(--text-dim);
}

/* Today extras mini-cards */
html[data-color-scheme="light"] .today-extra-eyebrow,
html[data-color-scheme="light"] .today-extra-sub,
html[data-color-scheme="light"] .today-achieve-sub,
html[data-color-scheme="light"] .today-extra-big .unit { color: var(--text-dim); }
html[data-color-scheme="light"] .today-extra-big,
html[data-color-scheme="light"] .today-achieve-title { color: var(--text); }
html[data-color-scheme="light"] .today-extra-bar-track { background: rgba(0,0,0,0.07); }
html[data-color-scheme="light"] .today-achieve-icon {
  background: color-mix(in srgb, var(--accent) 10%, #F4F4FA);
}

/* All Time panel */
html[data-color-scheme="light"] .at-title,
html[data-color-scheme="light"] #rm-card .at-chart-title,
html[data-color-scheme="light"] .at-pr-set { color: var(--text); }
html[data-color-scheme="light"] #rm-card .lift-pill {
  color: var(--text-dim); border-color: rgba(0,0,0,0.20);
}
html[data-color-scheme="light"] .at-pr-item {
  background: rgba(0,0,0,0.025); border-color: rgba(0,0,0,0.16);
}
html[data-color-scheme="light"] .at-pr-name,
html[data-color-scheme="light"] .at-pr-e1rm { color: var(--text-dim); }

/* This Week tab */
html[data-color-scheme="light"] .wk-hero-eyebrow,
html[data-color-scheme="light"] .wk-hero-delta,
html[data-color-scheme="light"] .wk-card-eyebrow,
html[data-color-scheme="light"] .wk-rotate-hint,
html[data-color-scheme="light"] .wk-lf-item,
html[data-color-scheme="light"] .wk-kpi-lbl,
html[data-color-scheme="light"] .wk-kpi-big .unit,
html[data-color-scheme="light"] .wk-kpi-sub,
html[data-color-scheme="light"] .wk-cal-lbl,
html[data-color-scheme="light"] .wk-chart-sel { color: var(--text-dim); }
html[data-color-scheme="light"] .wk-score-big,
html[data-color-scheme="light"] .wk-kpi-big { color: var(--text); }
html[data-color-scheme="light"] .wk-rotate-hint:hover { color: var(--text); }
html[data-color-scheme="light"] .wk-heatmap-hint { color: var(--text-faint); }
html[data-color-scheme="light"] .wk-ring-bg { fill: #EEEEF4; stroke: rgba(0,0,0,0.08); }
html[data-color-scheme="light"] .wk-view-btn {
  border-color: rgba(0,0,0,0.20); background: rgba(0,0,0,0.04); color: var(--text-dim);
}
html[data-color-scheme="light"] .b3d-view-toggle {
  background: rgba(244,244,250,0.88);
  border-color: rgba(0,0,0,0.16);
}
html[data-color-scheme="light"] .b3d-vt-btn { color: var(--text-faint); }
html[data-color-scheme="light"] .b3d-vt-btn.active { background: rgba(0,0,0,0.08); color: var(--text); }
html[data-color-scheme="light"] .wk-legend-float {
  background: rgba(244,244,250,0.97); border-color: rgba(0,0,0,0.20);
}
html[data-color-scheme="light"] .wk-chart-sel {
  background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.20);
}
html[data-color-scheme="light"] .wk-prog-track { background: rgba(0,0,0,0.07); }
html[data-color-scheme="light"] .wk-dot { background: rgba(0,0,0,0.08); }

/* ══════════════════════════════════════════════════════════════
   Light mode — Goals page overrides
   ══════════════════════════════════════════════════════════════ */
html[data-color-scheme="light"] .goals-header .eyebrow,
html[data-color-scheme="light"] .goals-header p,
html[data-color-scheme="light"] .goals-section-label,
html[data-color-scheme="light"] .goals-section-desc,
html[data-color-scheme="light"] .goal-card__sub,
html[data-color-scheme="light"] .goal-card__now,
html[data-color-scheme="light"] .section-empty,
html[data-color-scheme="light"] .step-label { color: var(--text-dim); }
html[data-color-scheme="light"] .goals-header h1,
html[data-color-scheme="light"] .goal-card__name,
html[data-color-scheme="light"] .goal-card__pct,
html[data-color-scheme="light"] .goal-card__now strong,
html[data-color-scheme="light"] .step-val { color: var(--text); }
html[data-color-scheme="light"] .goal-card__del { color: var(--text-faint); }

html[data-color-scheme="light"] .goals-section {
  background: linear-gradient(160deg, #F4F4FA 0%, #EEEEF4 100%) !important;
  border-color: rgba(0,0,0,0.20) !important;
  border-top-color: rgba(0,0,0,0.24) !important;
  box-shadow: 0 2px 16px rgba(0,0,0,0.05) !important;
}
html[data-color-scheme="light"] .goal-card {
  background: rgba(0,0,0,0.025); border-color: rgba(0,0,0,0.18);
}
html[data-color-scheme="light"] .goal-bar { background: rgba(0,0,0,0.07); }
html[data-color-scheme="light"] .goals-add-btn {
  background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.20); color: var(--text-dim);
}
html[data-color-scheme="light"] .goals-add-btn:hover {
  background: rgba(0,0,0,0.05); color: var(--text);
}
html[data-color-scheme="light"] .add-goal-form {
  background: rgba(0,0,0,0.025); border-color: rgba(0,0,0,0.18);
}
html[data-color-scheme="light"] .stepper { border-color: rgba(0,0,0,0.20); }
html[data-color-scheme="light"] .step-btn {
  background: rgba(0,0,0,0.03); color: var(--text-dim);
}
html[data-color-scheme="light"] .step-btn:active { background: rgba(0,0,0,0.07); }
html[data-color-scheme="light"] .step-val {
  border-left-color: rgba(0,0,0,0.16); border-right-color: rgba(0,0,0,0.16);
}

/* ══════════════════════════════════════════════════════════════
   Light mode — Workout page overrides
   ══════════════════════════════════════════════════════════════ */
html[data-color-scheme="light"] .rest-timer {
  background: rgba(244,244,250,0.97);
  border-color: rgba(0,0,0,0.20);
  border-top-color: rgba(0,0,0,0.26);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
html[data-color-scheme="light"] .rest-timer-btns button {
  border-color: rgba(0,0,0,0.20);
  color: var(--text-dim);
}

/* ══════════════════════════════════════════════════════════════
   Light mode — History page overrides
   ══════════════════════════════════════════════════════════════ */
html[data-color-scheme="light"] .program-header {
  background: linear-gradient(160deg, #F4F4FA 0%, #EEEEF4 100%);
  border-color: rgba(0,0,0,0.20);
  border-top-color: rgba(0,0,0,0.24);
}
html[data-color-scheme="light"] .detail-drawer {
  background: #F4F4FA;
  border-left-color: rgba(0,0,0,0.20);
}

/* ══════════════════════════════════════════════════════════════
   Light mode — Nutrition page overrides
   ══════════════════════════════════════════════════════════════ */
html[data-color-scheme="light"] .macro-tile {
  background: linear-gradient(160deg, #F4F4FA 0%, #EEEEF4 100%);
  border-color: rgba(0,0,0,0.20);
  border-top-color: rgba(0,0,0,0.24);
}
html[data-color-scheme="light"] .macro-tile__val {
  text-shadow: none;
}

/* ══════════════════════════════════════════════════════════════
   Light mode — Program page overrides
   All hardcoded dark gradients / rgba(255,255,255,x) borders
   ══════════════════════════════════════════════════════════════ */

/* Active program summary card */
html[data-color-scheme="light"] .prog-summary-card {
  background: linear-gradient(150deg, #F0F0F8 0%, #E8E8F0 100%);
  border-color: rgba(0,0,0,0.20);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 4px 20px rgba(0,0,0,0.07);
}
html[data-color-scheme="light"] .prog-summary-card::before {
  background: linear-gradient(90deg,transparent,rgba(var(--accent-rgb),0.35),transparent);
}
html[data-color-scheme="light"] .prog-card-header {
  border-bottom-color: rgba(0,0,0,0.16);
}
html[data-color-scheme="light"] .prog-stat:not(:first-child) {
  border-left-color: rgba(0,0,0,0.14);
}
html[data-color-scheme="light"] .prog-phase-row {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.18);
}
html[data-color-scheme="light"] .prog-phase-side + .prog-phase-side {
  border-left-color: rgba(0,0,0,0.14);
}
html[data-color-scheme="light"] .prog-meta-chip {
  border-color: rgba(0,0,0,0.20);
}

/* Week sections */
html[data-color-scheme="light"] .week-section {
  background: linear-gradient(160deg, #F4F4FA 0%, #EEEEF4 100%);
  border-color: rgba(0,0,0,0.20);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
html[data-color-scheme="light"] .week-section--current {
  border-color: color-mix(in srgb, var(--accent) 50%, rgba(0,0,0,0.20));
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 7%, #F4F4FA) 0%, #EEEEF4 100%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 15%, transparent), 0 4px 16px rgba(0,0,0,0.06);
}
html[data-color-scheme="light"] .week-section--deload {
  border-color: rgba(180,140,0,0.40);
  background: linear-gradient(160deg, rgba(245,196,48,0.06) 0%, #EEEEF4 100%);
}
html[data-color-scheme="light"] .week-section-header {
  border-bottom-color: rgba(0,0,0,0.14);
}
html[data-color-scheme="light"] .week-section-header:hover { background: rgba(0,0,0,0.02); }

/* Week day cards */
html[data-color-scheme="light"] .week-day-card {
  background: linear-gradient(160deg, #F4F4FA 0%, #EEEEF4 100%);
  border-color: rgba(0,0,0,0.20);
  border-top-color: rgba(0,0,0,0.24);
}
html[data-color-scheme="light"] .week-ex-item {
  border-bottom-color: rgba(0,0,0,0.10);
}

/* Working weights estimate panel */
html[data-color-scheme="light"] .estimates {
  background: rgba(0,0,0,0.025);
  border-color: rgba(0,0,0,0.20);
}
html[data-color-scheme="light"] .est-lift-row {
  border-bottom-color: rgba(0,0,0,0.10);
}

/* Projections & swap modals */
html[data-color-scheme="light"] .proj-box,
html[data-color-scheme="light"] .swap-box {
  background: linear-gradient(160deg, #F4F4FA 0%, #EEEEF4 100%);
  border-color: rgba(0,0,0,0.20);
  border-top-color: rgba(0,0,0,0.26);
}
html[data-color-scheme="light"] .proj-pr-card,
html[data-color-scheme="light"] .proj-vol-card {
  background: linear-gradient(160deg, #EEEEF4 0%, #E8E8F0 100%);
  border-color: rgba(0,0,0,0.20);
}
html[data-color-scheme="light"] .swap-scope-row {
  border-color: rgba(0,0,0,0.20);
}
html[data-color-scheme="light"] .swap-week-chip {
  border-color: rgba(0,0,0,0.20);
}
html[data-color-scheme="light"] .dow-chip {
  border-color: rgba(0,0,0,0.20);
}

/* Program info modal */
html[data-color-scheme="light"] .proginfo-box {
  background: linear-gradient(160deg, #F4F4FA 0%, #EEEEF4 100%);
  border-color: rgba(0,0,0,0.20);
}
html[data-color-scheme="light"] .proginfo-spinner {
  border-color: rgba(0,0,0,0.14);
  border-top-color: var(--accent);
}

