:root {
  --bg: #0D0D0F;
  --surface: #16161A;
  --card: #1E1E24;
  --border: #2A2A34;
  --accent: #6C63FF;
  --accent-dim: #3D3880;
  --mint: #00E5A0;
  --warn: #FF6B6B;
  --text: #F0EFFE;
  --text-mid: #9896B0;
  --text-dim: #4A4860;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}

/* ══════════════════════════════════════════════════════════════
   V1 DESIGN LANGUAGE — scoped to #screen-overview and #screen-home
   only. Deliberately NOT merged into :root yet: the plan is to
   refine each remaining core screen against this language first,
   then promote these values into the global tokens as the final
   step of the refinement phase — not the first. Every other screen
   continues reading the original :root values above, unchanged,
   until it receives its own refinement pass.
   ══════════════════════════════════════════════════════════════ */
#screen-overview, #screen-home {
  --dl-bg: #0D0C0C;
  --dl-text: #F5F3F0;
  --dl-text-mid: #8B8894;
  --dl-text-dim: #454249;
  --dl-hairline: rgba(255,255,255,0.05);
  --dl-brass: rgba(201,168,106,0.5);
  --dl-border: rgba(255,255,255,0.1);
  background: var(--dl-bg);
  color: var(--dl-text);
}
/* Shared component classes (.statusbar, .right-slot, .btn-secondary) are
   used as-is by every other screen and are left untouched globally. These
   three rules only override the specific color-related properties of
   those classes when they appear inside the two scoped screens above, so
   they read from the same --dl-* palette instead of the global tokens. */
#screen-overview .statusbar, #screen-home .statusbar {
  background: rgba(13,12,12,0.85);
  border-bottom-color: var(--dl-border);
}
#screen-overview .right-slot, #screen-home .right-slot {
  color: var(--dl-text-mid);
}
#screen-overview .btn-secondary, #screen-home .btn-secondary {
  background: transparent;
  color: var(--dl-text);
  border-color: var(--dl-border);
}

/* ══════════════════════════════════════════════════════════════
   V1 DESIGN LANGUAGE — CORE TRAINING LOOP ADDENDUM
   Approved per Design System doc. Scoped to the five screen ids
   below only (Rest lives inside #screen-exercise, not a separate
   id). Same --dl-* palette as Home/Overview/Program, plus the
   additions this loop specifically needs: raised surfaces for rows
   the bookend screens never had, and a narrower semantic scope for
   the existing --mint green (confirmed completion only — no longer
   used for training notes anywhere in this scope).
   Untouched by this addendum: Home, Overview, Program, History,
   Progress, Settings — all continue reading their existing rules.
   ══════════════════════════════════════════════════════════════ */
#screen-prepare, #screen-exercise, #screen-ex-complete, #screen-reflect, #screen-wo-complete {
  --dl-bg: #0D0C0C;
  --dl-text: #F5F3F0;
  --dl-text-mid: #8B8894;
  --dl-text-dim: #454249;
  --dl-hairline: rgba(255,255,255,0.05);
  --dl-brass: rgba(201,168,106,0.5);
  --dl-border: rgba(255,255,255,0.1);
  --dl-surface: #161412;
  --dl-surface-active: #1C1916;
  --dl-accent-ring: rgba(108,99,255,0.45);
  background: var(--dl-bg);
  color: var(--dl-text);
}
#screen-prepare .statusbar, #screen-exercise .statusbar {
  background: rgba(13,12,12,0.85);
  border-bottom-color: var(--dl-border);
}
#screen-prepare .right-slot, #screen-exercise .right-slot {
  color: var(--dl-text-mid);
}
#screen-prepare .btn-secondary, #screen-exercise .btn-secondary {
  background: transparent;
  color: var(--dl-text);
  border-color: var(--dl-border);
}
/* Radius consolidation (10px), scoped only — the global .btn stays 13px
   everywhere outside this addendum, including Home/Overview/Program,
   since promoting that change globally is explicitly a later step. */
#screen-prepare .btn, #screen-exercise .btn, #screen-ex-complete .btn, #screen-reflect .btn, #screen-wo-complete .btn {
  border-radius: 10px;
}
/* Raised rows: warm-up list, set rows, progress track — warm-neutral,
   not the old system's cool #1E1E24/#2A2A34. */
#screen-prepare .card, #screen-exercise .card {
  background: var(--dl-surface);
  border-color: var(--dl-border);
}
#screen-exercise .prog-track { background: var(--dl-hairline); }
#screen-exercise .set-input {
  background: var(--dl-bg);
  border-color: var(--dl-border);
  color: var(--dl-text);
}
/* Active-set focus ring — the one purple touch on Exercise. */
#screen-exercise .set-row-active {
  background: var(--dl-surface-active);
  border: 1px solid var(--dl-accent-ring);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.08);
}
/* Coaching Note (programmed voice, previous session) — brass rule,
   replacing the old purple-tinted box. Matches Home/Overview's
   Today's Briefing treatment exactly. */
#screen-exercise .coaching-note {
  padding: 12px 0 12px 14px;
  border-left: 1px solid var(--dl-brass);
  background: none;
  border-radius: 0;
}
#screen-exercise .coaching-note .coaching-lbl { color: var(--dl-text-dim); }
#screen-exercise .coaching-note .coaching-body { color: var(--dl-text); }
/* Athlete voice (training notes) — a register, not a color. Italic,
   neutral hairline, never brass or mint. */
#screen-exercise .note-btn, #screen-ex-complete .note-btn {
  border-color: var(--dl-border);
}
#screen-exercise .note-btn.has-note, #screen-ex-complete .note-btn.has-note { color: var(--dl-text); }
#screen-exercise .note-btn.empty, #screen-ex-complete .note-btn.empty { color: var(--dl-text-dim); }
#screen-exercise textarea#ex-note-input {
  background: var(--dl-surface);
  border-color: var(--dl-border);
  color: var(--dl-text);
}
#screen-exercise textarea#ex-note-input::placeholder,
#screen-reflect #reflect-note-input::placeholder {
  color: var(--dl-text-dim);
  font-style: italic;
}
/* exc-note-ta's editor is appended to document.body (see exCompleteNote()),
   not inside #screen-ex-complete, so it structurally cannot read the scoped
   --dl-* custom properties above — literal values only, matching them by hand. */
textarea#exc-note-ta {
  background: #161412;
  border-color: rgba(255,255,255,0.1);
  color: #F5F3F0;
}
textarea#exc-note-ta::placeholder {
  color: #454249;
  font-style: italic;
}
/* Rest timer — container goes neutral; the ring itself stays purple. */
#screen-exercise .timer-container {
  background: var(--dl-surface);
  border-color: var(--dl-border);
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  height: 100%;
}

#app {
  max-width: 430px;
  min-height: 100svh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* ── Screens ── */
.screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(90px + var(--safe-bot));
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), opacity 0.35s cubic-bezier(0.4,0,0.2,1);
}
.screen::-webkit-scrollbar { display: none; }
.screen.active  { transform: translateX(0);    opacity: 1; pointer-events: all; z-index: 1; }
.screen.slide-right { transform: translateX(100%); opacity: 0; pointer-events: none; z-index: 0; }
.screen.slide-left  { transform: translateX(-100%); opacity: 0; pointer-events: none; z-index: 0; }
.screen.hidden  { display: none; }

/* ── Front Door ── */
/* Override .screen scroll behaviour — front door uses full-height flex layout */
#screen-auth.frontdoor {
  overflow-y: hidden;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
#screen-auth.frontdoor .frontdoor-inner {
  height: 100svh;
  flex: none;
}
.frontdoor {
  position: absolute;
  inset: 0;
  display: flex; flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 0 36px;
  background: #0A0A0C;
  overflow: hidden;
}
.frontdoor-glow {
  position: absolute;
  top: 35%; left: 50%;
  width: 520px; height: 520px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(107,63,160,0.14) 0%, rgba(107,63,160,0.04) 45%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  animation: frontdoorGlowIn 2s ease-out 0.2s forwards;
}
@keyframes frontdoorGlowIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.frontdoor-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex; flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  height: 100svh;
  padding-top: 105px;
  box-sizing: border-box;
}
.frontdoor-headline {
  display: flex; flex-direction: column;
  gap: 0;
  flex: 1;
  justify-content: center;
  width: 100%;
  padding-left: 20px;
}
.frontdoor-headline span {
  font-family: 'Inter', -apple-system, sans-serif;
  font-weight: 800;
  font-size: 42px;
  line-height: 1.15;
  letter-spacing: -0.04em;
  color: #FFFFFF;
  opacity: 0;
  transform: translateY(10px);
  animation: fdLineFadeIn 0.7s ease forwards;
}
.frontdoor-headline span:nth-child(1) { animation-delay: 0.42s; }
.frontdoor-headline span:nth-child(2) { animation-delay: 0.56s; }
.frontdoor-headline span:nth-child(3) { animation-delay: 0.70s; }
.frontdoor-headline-final {
  margin-top: 22px;
  font-size: 30px !important;
  letter-spacing: -0.02em !important;
  font-weight: 800 !important;
  font-style: normal !important;
  color: #FFFFFF !important;
  opacity: 0;
  transform: translateY(10px);
  animation: fdLineFadeIn 0.7s ease 0.84s forwards;
}
@keyframes fdLineFadeIn {
  to { opacity: 1; transform: translateY(0); }
}
.frontdoor-cta {
  width: 100%;
  padding: 19px 0;
  border: none;
  border-radius: 16px;
  background: #6B3FA0;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 4px 40px rgba(107,63,160,0.28);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  opacity: 0;
  animation: fdLineFadeIn 0.7s ease 1.1s forwards;
}
.frontdoor-cta:active { transform: scale(0.984); }
.frontdoor-signin-link {
  margin-top: 13px;
  background: none; border: none;
  color: rgba(255,255,255,0.35);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  cursor: pointer;
  padding: 8px;
  transition: color 0.15s ease;
  opacity: 0;
  animation: fdLineFadeIn 0.7s ease 1.28s forwards;
}
.frontdoor-form-wrap {
  width: 100%;
  margin-top: 0;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.frontdoor-form-wrap.hidden { display: none; }
.frontdoor-form-wrap.visible { opacity: 1; transform: translateY(0); }
#auth-tabs { display: none; }
.frontdoor-form-title {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  text-align: left;
  margin-bottom: 28px;
}
#frontdoor-form-wrap #auth-form { text-align: left; }
#frontdoor-form-wrap .field { margin-bottom: 20px; }
#frontdoor-form-wrap .field:last-of-type { margin-bottom: 32px; }
#frontdoor-form-wrap #signup-name-field.hidden { display: none; }
#frontdoor-form-wrap .input-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(240,239,254,0.28);
  margin-bottom: 8px;
}
#frontdoor-form-wrap .input {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  border-radius: 0;
  padding: 12px 4px;
  font-size: 16px;
  transition: border-color 0.2s;
}
#frontdoor-form-wrap .input:focus {
  border-bottom-color: rgba(108,99,255,0.55);
  background: transparent;
}
#frontdoor-form-wrap .input::placeholder { color: rgba(240,239,254,0.18); }
#frontdoor-form-wrap #auth-submit-btn {
  width: 100%;
  border-radius: 12px;
  padding: 15px 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: rgba(108,99,255,0.55);
  border: 1px solid rgba(108,99,255,0.35);
  box-shadow: none;
  color: rgba(255,255,255,0.9);
  margin-top: 4px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}
#frontdoor-form-wrap #auth-submit-btn:active { transform: translateY(1px); }
#frontdoor-form-wrap #auth-error { color: var(--warn); }

/* Ritual -> form transition */
.frontdoor-headline {
  transition: transform 0.5s cubic-bezier(0.4,0,0.2,1), opacity 0.5s ease;
}
.frontdoor-cta,
.frontdoor-signin-link {
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.35s ease, height 0.35s ease;
}
.frontdoor-inner.form-active .frontdoor-headline {
  transform: translateY(-16px);
  opacity: 0.45;
}
.frontdoor-inner.form-active .frontdoor-cta,
.frontdoor-inner.form-active .frontdoor-signin-link {
  opacity: 0;
  pointer-events: none;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  height: 0;
  overflow: hidden;
}
.frontdoor-inner.form-active .frontdoor-actions {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}


/* ── Status bar ── */
.statusbar {
  position: sticky; top: 0; z-index: 50;
  padding: calc(var(--safe-top) + 12px) 20px 12px;
  background: rgba(13,13,15,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(42,42,52,0.5);
}
.back-btn {
  display: flex; align-items: center; gap: 5px;
  color: var(--accent); font-size: 15px; font-weight: 500;
  background: none; border: none; cursor: pointer; padding: 4px 0;
  font-family: 'Inter', sans-serif;
}
.screen-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 17px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase;
}
.right-slot { min-width: 60px; text-align: right; font-size: 12px; color: var(--text-mid); }

/* ── Typography ── */
.display { font-family: 'Barlow Condensed', sans-serif; }

/* ── Cards ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
}

/* ── Buttons ── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 16px;
  border-radius: 13px; border: none; cursor: pointer;
  font-family: 'Inter', sans-serif; font-size: 16px; font-weight: 600;
  transition: transform 0.1s, opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary  { background: var(--accent); color: #fff; }
.btn-secondary{ background: var(--card); color: var(--text); border: 1px solid var(--border); }
.btn-ghost    { background: transparent; color: var(--text-mid); }
.btn-mint     { background: var(--mint); color: #0D0D0F; font-weight: 700; }
.btn-danger   { background: rgba(255,107,107,0.15); color: var(--warn); border: 1px solid rgba(255,107,107,0.3); }
.btn-sm { padding: 10px 16px; font-size: 14px; border-radius: 10px; }

/* ── Inputs ── */
.input {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}
.input:focus { outline: none; border-color: var(--accent); }
.input::placeholder { color: var(--text-dim); }
#reflect-note-input::placeholder { color: rgba(138,138,154,0.38); font-style: italic; }
.input-label {
  font-size: 12px; font-weight: 600; color: var(--text-mid);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 7px;
}

/* ── Set inputs ── */
.set-input {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 11px 8px;
  color: var(--text);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px; font-weight: 700;
  text-align: center;
  width: 100%;
  -webkit-appearance: none;
  transition: border-color 0.15s;
}
.set-input:focus { outline: none; border-color: var(--accent); }
.set-input.ghost { color: var(--text-dim); border-color: transparent; background: transparent; font-size: 18px; }
.set-input:disabled { opacity: 0.4; }

/* ── Badge ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase;
}
.badge-accent { background: var(--accent-dim); color: var(--accent); }
.badge-mint   { background: rgba(0,229,160,0.12); color: var(--mint); }
.badge-dim    { background: var(--border); color: var(--text-mid); }

/* ── Progress bar ── */
.prog-track { height: 4px; background: var(--border); border-radius: 999px; overflow: hidden; }
.prog-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--mint));
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}

/* ── Section label ── */
.sec-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-dim);
  margin-bottom: 10px;
}

/* ── Stat grid ── */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-cell {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px;
}
.stat-val {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 28px; font-weight: 800; color: var(--text); line-height: 1;
}
.stat-val.accent { color: var(--accent); }
.stat-val.mint   { color: var(--mint); }
.stat-lbl { font-size: 11px; color: var(--text-mid); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Set check button ── */
.set-check {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--accent-dim); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.set-check:active { transform: scale(0.88); }
.set-check.done { background: var(--mint); }

/* ── Rest timer ── */
.timer-container {
  text-align: center; padding: 20px;
  background: rgba(108,99,255,0.08);
  border: 1px solid rgba(108,99,255,0.25);
  border-radius: 16px; margin: 14px 0;
}
.timer-ring { position: relative; width: 160px; height: 160px; margin: 0 auto 14px; }
.timer-ring svg { position: absolute; inset: 0; }
.timer-txt {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}

/* ── Toast ── */
#toast {
  position: fixed; bottom: calc(100px + var(--safe-bot)); left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 20px;
  font-size: 14px; font-weight: 500;
  opacity: 0; transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  z-index: 1000; white-space: nowrap;
  pointer-events: none;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.success { border-color: rgba(0,229,160,0.4); color: var(--mint); }
#toast.error   { border-color: rgba(255,107,107,0.4); color: var(--warn); }

/* ── Loading ── */
#loading {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 16px; z-index: 9999;
}
.spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Animations ── */
@keyframes slide-up {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@keyframes pop-in {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.slide-up { animation: slide-up 0.35s cubic-bezier(0.4,0,0.2,1) both; }
.pop-in   { animation: pop-in  0.3s cubic-bezier(0.175,0.885,0.32,1.275) both; }

/* ── Bar chart ── */
.bar-wrap { display: flex; align-items: flex-end; gap: 5px; height: 80px; }
.bar-col  { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.bar { width: 100%; border-radius: 3px 3px 0 0; transition: height 0.5s cubic-bezier(0.4,0,0.2,1); }
.bar-lbl { font-size: 9px; color: var(--text-dim); }

/* ── Heatmap ── */
.heatmap { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 10px; }
.heat-cell { height: 22px; border-radius: 4px; }
.heatmap-wd { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.heat-wd { font-size: 10px; color: var(--text-dim); letter-spacing: 0.06em; text-align: center; }

/* ── Logo mark ── */
.logo-mark {
  display: flex; align-items: center; gap: 10px;
}
.logo-arrow {
  flex-shrink: 0;
}

/* ── Exercise row in overview (legacy, no longer used on Preview) ── */
.ex-overview-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(42,42,52,0.5);
}
.ex-overview-row:last-child { border-bottom: none; }

/* ── Sequence row (Workout Preview — name only, quiet) ── */
.seq-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(42,42,52,0.5);
}
.seq-row:last-child { border-bottom: none; }

/* ── Home page padding ── */
.home-content { padding: calc(var(--safe-top) + 52px) 20px 0; }

/* ── Nav bar ── */
#nav-bar {
  position: fixed; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 430px;
  padding: 12px 20px calc(12px + var(--safe-bot));
  background: rgba(13,13,15,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(42,42,52,0.5);
  display: none;
  z-index: 100;
}
#nav-bar.visible { display: flex; gap: 8px; }
.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer;
  padding: 6px 4px; border-radius: 10px;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
  font-family: 'Inter', sans-serif;
}
.nav-item:active { background: var(--card); }
.nav-item svg { width: 22px; height: 22px; }
.nav-item span { font-size: 10px; font-weight: 500; color: var(--text-dim); }
.nav-item.active svg { stroke: var(--accent); }
.nav-item.active span { color: var(--accent); }

/* ── Divider ── */
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ── Empty state ── */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text-mid);
}
.empty-state .icon { font-size: 40px; margin-bottom: 14px; }
.empty-state h3 { font-family: 'Barlow Condensed', sans-serif; font-size: 22px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.empty-state p  { font-size: 14px; line-height: 1.6; }

/* ── Auth logo ── */
.auth-logo { margin-bottom: 40px; text-align: center; }
.auth-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 36px; font-weight: 800;
  letter-spacing: 0.02em;
}
.auth-sub { font-size: 13px; color: var(--text-mid); margin-top: 6px; letter-spacing: 0.04em; text-transform: uppercase; }

/* ── AI error box ── */
.ai-error-box {
  margin-top: 12px; padding: 14px;
  background: rgba(255,107,107,0.08);
  border: 1px solid rgba(255,107,107,0.35);
  border-radius: 12px;
  font-size: 12px; font-family: monospace;
  color: var(--warn); word-break: break-all;
  white-space: pre-wrap; line-height: 1.5;
}

/* ── Misc ── */
.px { padding-left: 20px; padding-right: 20px; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.mt20 { margin-top: 20px; }
.mt24 { margin-top: 24px; }
.gap8 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.text-center { text-align: center; }

/* ══════════════════════════════════════════════════════════════
   PROGRAM BLUEPRINT — scoped to a wrapper class, not #screen-program,
   because that screen id hosts multiple sub-flows (View, Edit, AI
   Generator, Importer, Manual Builder, empty-state) sharing one
   #program-content container. Only the View and Edit render output
   wrap themselves in .program-blueprint; Generator/Importer/Builder/
   empty-state deliberately keep reading the original :root tokens
   above — untouched by this refinement, per scope.
   ══════════════════════════════════════════════════════════════ */
.program-blueprint{
  --dl-bg:#0D0C0C;
  --dl-text:#F5F3F0;
  --dl-text-mid:#8B8894;
  --dl-text-dim:#454249;
  --dl-hairline:rgba(255,255,255,0.05);
  --dl-brass:rgba(201,168,106,0.5);
  --dl-border:rgba(255,255,255,0.1);
  color:var(--dl-text);
}

/* -- View: identity -- */
.program-blueprint .prog-identity{padding-top:8px;}
.program-blueprint .prog-name{font-family:'Barlow Condensed',sans-serif;font-weight:800;font-size:32px;line-height:1.05;letter-spacing:-0.01em;color:var(--dl-text);}
.program-blueprint .prog-pos{margin-top:8px;font-size:12.5px;color:var(--dl-text-dim);}

/* -- View: structure -- */
.program-blueprint .prog-sec-label{margin-top:44px;margin-bottom:12px;font-size:10.5px;font-weight:500;letter-spacing:0.11em;text-transform:uppercase;color:var(--dl-text-dim);}
.program-blueprint .prog-days{display:flex;flex-direction:column;}
.program-blueprint .prog-day-row{display:flex;align-items:baseline;gap:14px;width:100%;padding:16px 0;border:none;border-bottom:1px solid var(--dl-hairline);background:none;text-align:left;font-family:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent;}
.program-blueprint .prog-days .prog-day-row:last-child{border-bottom:none;}
.program-blueprint .prog-day-num{font-family:'Barlow Condensed',sans-serif;font-size:15px;font-weight:700;color:rgba(108,99,255,0.5);min-width:14px;flex-shrink:0;}
.program-blueprint .prog-day-main{flex:1;min-width:0;}
.program-blueprint .prog-day-name{font-size:15.5px;font-weight:500;color:var(--dl-text);}
.program-blueprint .prog-day-meta{margin-top:4px;font-size:12px;color:var(--dl-text-dim);}
.program-blueprint .prog-day-meta b{color:var(--dl-text-mid);font-weight:500;}

/* -- View: action tiers -- */
.program-blueprint .prog-util{margin-top:50px;}
.program-blueprint .prog-util-row{display:flex;align-items:center;justify-content:space-between;width:100%;padding:15px 0;border:none;border-top:1px solid var(--dl-hairline);background:none;text-align:left;font-family:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent;}
.program-blueprint .prog-util-row svg{color:var(--dl-text-dim);flex-shrink:0;}
.program-blueprint .prog-util-refine span{font-size:15px;font-weight:500;color:var(--dl-text);}
.program-blueprint .prog-util-block-label{margin-top:40px;margin-bottom:2px;font-size:10px;font-weight:500;letter-spacing:0.1em;text-transform:uppercase;color:var(--dl-text-dim);}
.program-blueprint .prog-util-restart span{font-size:13.5px;font-weight:400;color:var(--dl-text-mid);}

/* -- View: reset tier -- */
.program-blueprint .prog-reset-zone{margin-top:52px;padding-top:18px;border-top:1px solid var(--dl-hairline);}
.program-blueprint .prog-reset-link{display:inline-block;background:none;border:none;padding:0;font-family:inherit;font-size:11.5px;letter-spacing:0.01em;color:rgba(255,107,107,0.55);cursor:pointer;-webkit-tap-highlight-color:transparent;}
.program-blueprint .prog-reset-confirm{margin-top:14px;padding-top:14px;border-top:1px solid var(--dl-hairline);}
.program-blueprint .prog-reset-confirm p{font-size:12px;line-height:1.6;color:var(--dl-text-mid);max-width:280px;}
.program-blueprint .prog-reset-actions{margin-top:14px;display:flex;gap:22px;}
.program-blueprint .prog-reset-actions button{background:none;border:none;padding:0;font-family:inherit;font-size:12.5px;cursor:pointer;-webkit-tap-highlight-color:transparent;}
.program-blueprint .prog-reset-cancel{color:var(--dl-text-mid);}
.program-blueprint .prog-reset-confirm-btn{color:rgba(255,107,107,0.85);font-weight:500;}

/* -- Edit mode -- */
.program-blueprint .edit-eyebrow{display:block;padding-top:6px;font-size:10.5px;letter-spacing:0.1em;text-transform:uppercase;color:var(--dl-text-dim);}
.program-blueprint .edit-day-card{margin-top:26px;padding-top:18px;border-top:1px solid var(--dl-border);}
.program-blueprint .edit-field-label{font-size:9.5px;font-weight:500;letter-spacing:0.09em;text-transform:uppercase;color:var(--dl-text-dim);margin-bottom:7px;}
.program-blueprint .edit-day-name-input{font-family:'Barlow Condensed',sans-serif;font-size:19px;font-weight:700;color:var(--dl-text);border:none;border-bottom:1px solid var(--dl-border);padding-bottom:8px;width:100%;background:none;outline:none;}
.program-blueprint .edit-ex-row{margin-top:16px;padding:13px 14px;background:rgba(255,255,255,0.02);border:1px solid var(--dl-border);border-radius:10px;}
.program-blueprint .edit-ex-name{font-weight:500;font-size:13.5px;background:none;border:none;color:var(--dl-text);width:100%;outline:none;margin-bottom:11px;font-family:inherit;}
.program-blueprint .edit-ex-fields{display:grid;grid-template-columns:1fr 1fr 1fr 1fr;gap:8px;}
.program-blueprint .edit-fl{font-size:9px;color:var(--dl-text-dim);text-transform:uppercase;letter-spacing:0.07em;margin-bottom:4px;}
.program-blueprint .edit-fv{width:100%;font-family:'Barlow Condensed',sans-serif;font-size:15px;font-weight:600;color:var(--dl-text);background:none;border:none;border-bottom:1px solid var(--dl-border);padding-bottom:4px;outline:none;}
.program-blueprint .edit-remove-ex{background:none;border:none;color:rgba(255,107,107,0.75);font-size:16px;cursor:pointer;flex-shrink:0;padding:0 0 0 8px;}
.program-blueprint .edit-move-btn{background:none;border:1px solid var(--dl-border);border-radius:6px;color:var(--dl-text-mid);font-size:12px;padding:3px 8px;cursor:pointer;}
.program-blueprint .edit-add-ex{margin-top:12px;font-size:12.5px;color:var(--accent);background:none;border:none;cursor:pointer;padding:0;font-family:inherit;-webkit-tap-highlight-color:transparent;}

/* -- Program statusbar right-slot Save action (Edit mode only) -- */
#program-right-slot .prog-save-btn{background:none;border:none;padding:0;font-family:inherit;font-size:14px;font-weight:600;color:var(--accent);cursor:pointer;-webkit-tap-highlight-color:transparent;}
