/* ========================================
   TOKENS
   ======================================== */
:root {
  --bg:           #f8f6f1;
  --bg-elevated:  #efece5;
  --bg-subtle:    #f2efe8;
  --border:       #d6d3cd;
  --border-faint: #e2dfda;
  --text:         #1c1917;
  --text-muted:   #78716c;
  --text-faint:   #8a847e;
  --text-on-accent: #fff;
  --accent:       #9a3412;
  --accent-hover: #7c2d12;
  --accent-light: rgba(154, 52, 18, 0.07);
  --success:      #166534;
  --success-bg:   rgba(22, 101, 52, 0.08);

  --font-display: 'Source Serif 4', Georgia, serif;
  --font-body:    'Source Sans 3', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  height: 100%;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

::selection { background: var(--accent); color: #fff; }
button { cursor: pointer; font-family: inherit; }
input { font-family: inherit; }

/* ========================================
   APP SHELL
   ======================================== */
#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

/* ========================================
   TOP HEADER
   ======================================== */
.app-header {
  flex-shrink: 0;
  padding: 12px 24px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-faint);
  background: var(--bg);
  z-index: 10;
}

.app-logo {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.app-logo span { color: var(--accent); }

.app-header-right {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  position: relative;
}

/* ========================================
   SCREEN CONTAINER
   ======================================== */
.screens {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  transform: translateX(40px);
  pointer-events: none;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
  padding: 0 24px;
}

.screen.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.screen.exit-left {
  opacity: 0;
  transform: translateX(-40px);
}

/* ========================================
   BOTTOM NAV
   ======================================== */
.bottom-nav {
  flex-shrink: 0;
  display: flex;
  border-top: 1px solid var(--border-faint);
  background: var(--bg);
  padding-bottom: var(--safe-b);
  z-index: 10;
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 0 8px;
  background: none;
  border: none;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.2s;
  position: relative;
}

.nav-tab::before {
  content: '';
  position: absolute;
  top: 0;
  left: 24%;
  right: 24%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.3s var(--ease);
}

.nav-tab.active { color: var(--accent); }
.nav-tab.active::before { transform: scaleX(1); }
.nav-tab.locked { opacity: 0.35; pointer-events: none; }

.nav-tab svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ========================================
   INTAKE SCREEN
   ======================================== */
.intake-flow { padding: 32px 0 120px; }

.welcome-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 55dvh;
  padding: 40px 0 32px;
  transition: opacity 0.5s var(--ease), max-height 0.6s var(--ease), padding 0.5s var(--ease), margin 0.4s var(--ease);
  overflow: hidden;
}

.welcome-hero.collapsed {
  min-height: 0;
  max-height: 0;
  padding: 0;
  opacity: 0;
  margin: 0;
}

.welcome-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 16px;
}

.welcome-headline {
  font-family: var(--font-display);
  font-size: clamp(28px, 7vw, 38px);
  font-weight: 400;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 16px;
}

.welcome-headline em {
  font-style: italic;
  color: var(--accent);
}

.welcome-body {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 340px;
  margin-bottom: 32px;
}

.welcome-stats {
  display: flex;
  gap: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-faint);
  margin-bottom: 32px;
}

.welcome-stat { display: flex; flex-direction: column; }
.welcome-stat-value { font-family: var(--font-mono); font-size: 17px; font-weight: 500; color: var(--text); }
.welcome-stat-label { font-size: 12px; color: var(--text-faint); }

.btn-begin {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  padding: 16px 36px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  transition: background 0.2s, transform 0.1s;
  align-self: flex-start;
}

.btn-begin:active { transform: scale(0.97); }

/* Active plan card */
.welcome-active-plan {
  border: 1.5px solid var(--accent);
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 20px;
  background: var(--accent-light);
  cursor: pointer;
  transition: transform 0.1s;
  width: 100%;
  text-align: left;
  color: var(--text);
  font-family: var(--font-body);
}

.welcome-active-plan:active { transform: scale(0.98); }
.welcome-active-label { font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.welcome-active-title { font-family: var(--font-display); font-size: 19px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.welcome-active-meta { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.welcome-active-progress { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.welcome-active-bar { flex: 1; height: 3px; background: var(--border-faint); border-radius: 2px; overflow: hidden; }
.welcome-active-bar-fill { height: 100%; background: var(--accent); border-radius: 2px; }
.welcome-active-pct { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); flex-shrink: 0; }

.welcome-or { text-align: center; font-size: 13px; color: var(--text-faint); margin: 16px 0; }

/* Intake steps */
.intake-step {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.6s var(--ease), opacity 0.5s var(--ease), margin 0.4s var(--ease);
  margin-bottom: 0;
}

.intake-step.visible { max-height: 600px; opacity: 1; margin-bottom: 36px; }
.intake-step.answered { opacity: 0.55; max-height: 200px; margin-bottom: 24px; }
.intake-step.answered:active { opacity: 0.75; }
.intake-step.answered .coach-text { font-size: 16px; }
.intake-step.answered .options { display: none; }
.intake-step.answered .inspired-grid { display: none; }
.intake-step.answered .date-row { display: none; }
.intake-step.answered .text-input-row { display: none; }
.intake-step.answered .lifts-card { display: none; }
.intake-step.answered .answer-echo { display: block; }
.intake-step.answered .strong-import-area { display: none; }

.answer-echo {
  display: none;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  margin-top: -12px;
  cursor: pointer;
}

.answer-echo::after {
  content: ' \00b7 change';
  font-weight: 400;
  color: var(--text-faint);
  font-size: 12px;
}

.coach-text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(18px, 4.5vw, 21px);
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 20px;
  transition: font-size 0.3s var(--ease);
}

.coach-text strong { font-weight: 600; font-style: normal; }
.coach-text-follow { margin-top: -8px; }

/* Options / Chips */
.options { display: flex; flex-wrap: wrap; gap: 10px; }

.option-chip {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  padding: 12px 20px;
  min-height: 48px;
  display: flex;
  align-items: center;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  transition: all 0.15s;
}

.option-chip:active { transform: scale(0.97); }
.option-chip.selected { border-color: var(--accent); background: var(--accent-light); color: var(--accent); }
.options.compact { gap: 10px; }
.options.compact .option-chip { width: 56px; justify-content: center; padding: 12px; }

/* Date input */
.date-row { display: flex; align-items: center; gap: 14px; }

.date-input {
  font-family: var(--font-body);
  font-size: 16px;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: none;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  min-height: 48px;
}

.date-input:focus { border-color: var(--accent); }
.date-badge { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--accent); letter-spacing: 0.02em; white-space: nowrap; }

/* Text input */
.text-input-row { display: flex; gap: 10px; margin-top: 10px; }

.text-input {
  flex: 1;
  font-family: var(--font-body);
  font-size: 15px;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: none;
  color: var(--text);
  outline: none;
  min-height: 48px;
  transition: border-color 0.2s;
}

.text-input:focus { border-color: var(--accent); }
.text-input::placeholder { color: var(--text-faint); }

/* Lifts card */
.lifts-card { border: 1px solid var(--border-faint); border-radius: 4px; padding: 16px 20px; margin: 16px 0; background: var(--bg-subtle); }
.lifts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
.lift-item { display: flex; flex-direction: column; }
.lift-name { font-size: 13px; color: var(--text-muted); line-height: 1.3; }
.lift-value { font-family: var(--font-mono); font-size: 17px; font-weight: 500; color: var(--text); }

/* Summary + Generate */
.intake-summary { border-top: 1px solid var(--border-faint); padding-top: 28px; margin-top: 8px; }
.summary-label { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 16px; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; margin-bottom: 28px; }
.summary-item { font-size: 14px; color: var(--text-muted); }
.summary-item strong { display: block; font-weight: 500; color: var(--text); font-size: 15px; }

.btn-generate {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 16px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  transition: background 0.2s, transform 0.1s;
}

.btn-generate:active { transform: scale(0.98); }
.btn-generate:hover { background: var(--accent-hover); }
.btn-generate:disabled { opacity: 0.6; cursor: not-allowed; }

.load-bar { height: 2px; background: var(--border-faint); border-radius: 1px; margin-top: 20px; overflow: hidden; opacity: 0; transition: opacity 0.2s; }
.load-bar.active { opacity: 1; }
.load-bar-fill { height: 100%; width: 0; background: var(--accent); border-radius: 1px; transition: width 30s cubic-bezier(0.1, 0.4, 0.2, 1); }
.load-bar.active .load-bar-fill { width: 95%; }

/* Generating state */
.generating-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 0 16px;
}

.generating-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.generating-pulse {
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  animation: gen-pulse 1.8s ease-in-out infinite;
}

@keyframes gen-pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; box-shadow: 0 0 0 0 rgba(154, 52, 18, 0.3); }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 0 12px rgba(154, 52, 18, 0); }
}

.generating-message {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-muted);
  text-align: center;
  transition: opacity 0.2s;
  min-height: 1.4em;
}

.generating-message.fade { opacity: 0; }

.generating-error-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 16px;
}

.generating-error-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.generating-error-detail {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #dc2626;
  line-height: 1.5;
  text-align: center;
  max-width: 320px;
  word-break: break-word;
}

/* Inspired-by cards */
.inspired-grid { display: flex; flex-direction: column; gap: 8px; }

.inspired-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: none;
  text-align: left;
  min-height: 48px;
  transition: all 0.15s;
  width: 100%;
}

.inspired-card:active { transform: scale(0.98); }
.inspired-card.selected { border-color: var(--accent); background: var(--accent-light); }
.inspired-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-elevated); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--text-muted); }
.inspired-card.selected .inspired-avatar { background: rgba(154, 52, 18, 0.12); color: var(--accent); }
.inspired-info { flex: 1; min-width: 0; }
.inspired-name { font-size: 15px; font-weight: 500; color: var(--text); line-height: 1.3; }
.inspired-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

/* Strong import */
.strong-import-area {
  border: 2px dashed var(--border);
  border-radius: 4px;
  padding: 32px 24px;
  text-align: center;
  transition: border-color 0.2s;
  cursor: pointer;
  margin-bottom: 16px;
}

.strong-import-area:active { border-color: var(--accent); }
.strong-import-area p { font-size: 14px; color: var(--text-muted); margin-top: 8px; }
.strong-import-area .label { font-size: 15px; font-weight: 500; color: var(--text); }

.strong-import-file { display: none; }

/* ========================================
   PLAN SCREEN
   ======================================== */
.plan-content { padding: 28px 0 120px; }
.plan-header { margin-bottom: 36px; }
.plan-event { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 6px; }
.plan-countdown { font-family: var(--font-display); font-size: clamp(28px, 7vw, 36px); font-weight: 400; line-height: 1.15; color: var(--text); margin-bottom: 6px; }
.plan-sub { font-size: 15px; color: var(--text-muted); }

/* Week calendar strip */
.week-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 28px; padding: 16px 0; border-bottom: 1px solid var(--border-faint); }
.week-cal-day { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.week-cal-label { font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-faint); }
.week-cal-dot { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--text-faint); border: 1px solid transparent; }
.week-cal-dot.training { background: var(--accent-light); color: var(--accent); border-color: rgba(154, 52, 18, 0.15); }
.week-cal-dot.today { background: var(--accent); color: #fff; border-color: var(--accent); }
.week-cal-dot.rest { color: var(--border); }
.week-cal-dot.completed { background: var(--success-bg); color: var(--success); border-color: rgba(22, 101, 52, 0.15); }
.week-cal-type { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.02em; color: var(--text-faint); max-width: 44px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; height: 12px; }
.week-cal-type.has-session { color: var(--text-muted); }

/* Block sections */
.block-section { border-top: 1px solid var(--border-faint); }
.block-section:last-of-type { border-bottom: 1px solid var(--border-faint); }

.block-header { width: 100%; display: grid; grid-template-columns: 32px 1fr auto; align-items: start; gap: 0 12px; padding: 20px 0; background: none; border: none; text-align: left; color: var(--text); }
.block-num { font-family: var(--font-display); font-size: 20px; font-weight: 400; color: var(--border); line-height: 1.3; }
.block-name { font-family: var(--font-display); font-size: 17px; font-weight: 600; line-height: 1.3; }
.block-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); letter-spacing: 0.02em; margin-top: 2px; }
.block-note { font-size: 13px; font-style: italic; color: var(--text-muted); line-height: 1.5; margin-top: 4px; max-height: 0; overflow: hidden; transition: max-height 0.4s var(--ease), opacity 0.3s; opacity: 0; }
.block-section.open .block-note { max-height: 80px; opacity: 1; }
.block-toggle { font-family: var(--font-mono); font-size: 14px; color: var(--text-faint); transition: transform 0.3s var(--ease); padding-top: 2px; }
.block-section.open .block-toggle { transform: rotate(45deg); }

.block-weeks { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.4s var(--ease); }
.block-section.open .block-weeks { grid-template-rows: 1fr; }
.block-weeks-inner { overflow: hidden; }

/* Weeks inside blocks */
.week-inside { padding: 0 0 0 44px; }
.week-inside-header { width: 100%; display: flex; align-items: center; gap: 8px; padding: 14px 0; background: none; border: none; border-top: 1px solid var(--border-faint); text-align: left; color: var(--text); cursor: pointer; font-family: inherit; }
.week-inside-name { font-size: 14px; font-weight: 500; color: var(--text); flex: 1; }
.week-inside-rir { font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--accent); letter-spacing: 0.02em; }
.week-inside-count { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); min-width: 20px; text-align: right; }
.week-inside-toggle { font-size: 16px; color: var(--text-faint); transition: transform 0.2s var(--ease); line-height: 1; }
.week-inside.open .week-inside-toggle { transform: rotate(90deg); }
.week-inside-note { font-size: 12px; font-style: italic; color: var(--text-muted); line-height: 1.5; padding: 0 0 8px; max-height: 0; overflow: hidden; opacity: 0; transition: max-height 0.3s var(--ease), opacity 0.3s, padding 0.3s; }
.week-inside.open .week-inside-note { max-height: 60px; opacity: 1; padding: 0 0 12px; }
.week-inside-sessions { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.3s var(--ease); }
.week-inside.open .week-inside-sessions { grid-template-rows: 1fr; }
.week-inside-sessions-inner { overflow: hidden; }

/* Session items */
.session-item { display: flex; align-items: center; gap: 12px; padding: 14px 0 14px 8px; border-top: 1px solid var(--border-faint); border-left: none; border-right: none; border-bottom: none; cursor: pointer; transition: background 0.15s; width: 100%; background: none; text-align: left; color: var(--text); font-family: var(--font-body); font-size: 16px; }
.session-item:active { background: var(--accent-light); }
.session-day { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--text-faint); width: 32px; flex-shrink: 0; text-transform: uppercase; }
.session-name { flex: 1; font-size: 15px; font-weight: 500; color: var(--text); }
.session-count { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); }
.session-item.is-today { background: var(--accent-light); margin: 0 -24px; padding-left: 76px; padding-right: 24px; }
.session-item.is-today .session-day { color: var(--accent); }
.session-item.done { opacity: 0.6; }
.today-tag { font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); padding: 3px 8px; border: 1px solid var(--accent); border-radius: 2px; }
.session-done-label { color: var(--success); }

/* Plan CTA */
.plan-cta { position: sticky; bottom: 0; padding: 16px 0 24px; background: linear-gradient(to top, var(--bg) 60%, transparent); }
.btn-start { width: 100%; font-family: var(--font-body); font-size: 16px; font-weight: 600; padding: 16px; background: var(--accent); color: #fff; border: none; border-radius: 4px; transition: background 0.2s, transform 0.1s; }
.btn-start:active { transform: scale(0.98); }
.btn-regenerate { width: 100%; margin-top: 8px; font-family: var(--font-body); font-size: 14px; font-weight: 500; padding: 12px; background: none; border: 1px solid var(--border); border-radius: 4px; color: var(--text-muted); transition: all 0.15s; }
.btn-regenerate:active { border-color: var(--accent); color: var(--accent); }

/* ========================================
   SESSION SCREEN
   ======================================== */
#sessionScreen { padding: 0; display: flex; flex-direction: column; }
#sessionScreen.active { display: flex; }

.session-top { flex-shrink: 0; padding: 16px 24px 12px; }
.session-label { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 8px; }
.session-progress-bar { height: 2px; background: var(--border-faint); border-radius: 1px; }
.session-progress-fill { height: 100%; background: var(--accent); border-radius: 1px; transition: width 0.4s var(--ease); }

.exercise-viewport { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 0 24px; position: relative; overflow: hidden; touch-action: pan-y; }
.exercise-card { text-align: center; transition: opacity 0.3s var(--ease), transform 0.3s var(--ease); }
.exercise-card.swipe-left { opacity: 0; transform: translateX(-60px); }
.exercise-card.swipe-right { opacity: 0; transform: translateX(60px); }

.exercise-name { font-family: var(--font-display); font-size: clamp(22px, 6vw, 28px); font-weight: 600; line-height: 1.25; color: var(--text); margin-bottom: 16px; }
.exercise-target { font-family: var(--font-mono); font-size: clamp(36px, 10vw, 48px); font-weight: 400; color: var(--text); line-height: 1.1; margin-bottom: 8px; letter-spacing: -0.02em; }
.exercise-rir { font-family: var(--font-mono); font-size: 14px; font-weight: 500; color: var(--accent); margin-bottom: 6px; letter-spacing: 0.02em; }
.rir-badge { display: inline-block; font-family: var(--font-mono); font-size: 10px; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); padding: 2px 6px; border-radius: 4px; letter-spacing: 0.03em; vertical-align: middle; margin-left: 4px; }
.exercise-notes { font-size: 14px; color: var(--text-muted); margin-bottom: 12px; }

/* Coach note */
.exercise-coach-note-toggle { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-faint); background: none; border: none; padding: 10px 0; min-height: 44px; margin-bottom: 8px; transition: color 0.15s; }
.exercise-coach-note-toggle:active { color: var(--accent); }
.exercise-coach-note-toggle svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 1.5; transition: transform 0.2s var(--ease); }
.exercise-coach-note-toggle.open svg { transform: rotate(90deg); }
.exercise-coach-note { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.3s var(--ease); margin-bottom: 8px; }
.exercise-coach-note.open { grid-template-rows: 1fr; }
.exercise-coach-note-inner { overflow: hidden; }
.exercise-coach-note-text { font-size: 13px; font-style: italic; line-height: 1.55; color: var(--text-muted); padding: 8px 12px; background: var(--bg-subtle); border-radius: 4px; border-left: 2px solid var(--accent); margin-bottom: 8px; -webkit-user-select: text; user-select: text; }

/* Set pills */
.set-pills { display: flex; justify-content: center; gap: 8px; margin-bottom: 8px; }
.set-pill { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--border); background: none; transition: all 0.2s; }
.set-pill.done { background: var(--accent); border-color: var(--accent); }
.set-pill.current { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }

/* Swap */
.swap-actions-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }
.swap-btn { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 500; color: var(--text-faint); padding: 8px 14px; background: none; border: 1px solid var(--border-faint); border-radius: 4px; transition: all 0.15s; margin-top: 4px; }
.swap-btn:active { border-color: var(--accent); color: var(--accent); }
.swap-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.swap-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.3s var(--ease); margin-top: 8px; }
.swap-panel.open { grid-template-rows: 1fr; }
.swap-panel-inner { overflow: hidden; }
.swap-options { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.swap-option { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border: 1px solid var(--border-faint); border-radius: 4px; background: none; text-align: left; transition: all 0.15s; min-height: 48px; }
.swap-option:active { border-color: var(--accent); background: var(--accent-light); }
.swap-option-name { font-size: 15px; font-weight: 500; color: var(--text); }
.swap-option-why { font-size: 12px; color: var(--text-faint); margin-top: 1px; }
.swap-option-arrow { font-family: var(--font-mono); font-size: 14px; color: var(--text-faint); flex-shrink: 0; }

/* Deviation */
.deviation-link { display: block; text-align: center; font-size: 13px; color: var(--text-faint); padding: 8px; background: none; border: none; transition: color 0.2s; margin-top: 4px; }
.deviation-link:active { color: var(--accent); }
.deviation-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.3s var(--ease); margin-top: 4px; }
.deviation-panel.open { grid-template-rows: 1fr; }
.deviation-inner { overflow: hidden; }
.deviation-options { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 8px 0; }
.deviation-chip { font-size: 13px; font-weight: 500; padding: 8px 14px; border: 1px solid var(--border); border-radius: 4px; background: none; color: var(--text-muted); transition: all 0.15s; min-height: 44px; display: flex; align-items: center; }
.deviation-chip:active { border-color: var(--accent); color: var(--accent); }
.deviation-text { width: 100%; font-family: var(--font-body); font-size: 14px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 4px; background: none; color: var(--text); outline: none; margin-top: 6px; resize: none; height: 40px; }
.deviation-text:focus { border-color: var(--accent); }

/* Exercise nav */
.exercise-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: none; border: none; color: var(--text-faint); transition: color 0.2s; z-index: 2; }
.exercise-nav:active { color: var(--accent); }
.exercise-nav.prev { left: 0; }
.exercise-nav.next { right: 0; }
.exercise-nav.hidden { visibility: hidden; }
.exercise-nav svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.5; }

/* Session bottom */
.session-bottom { flex-shrink: 0; padding: 12px 24px; padding-bottom: calc(12px + var(--safe-b)); }
.btn-done { width: 100%; font-family: var(--font-body); font-size: 16px; font-weight: 600; padding: 16px; min-height: 56px; background: var(--accent); color: #fff; border: none; border-radius: 4px; transition: background 0.2s, transform 0.1s; }
.btn-done:active { transform: scale(0.97); }
.btn-done:disabled { opacity: 0.5; }
.btn-done.completed { background: var(--success); }

/* Rest timer */
.rest-overlay { position: absolute; inset: 0; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 5; opacity: 0; pointer-events: none; transition: opacity 0.3s var(--ease); }
.rest-overlay.active { opacity: 1; pointer-events: auto; }
.rest-ring { width: 160px; height: 160px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: conic-gradient(var(--accent) calc(var(--progress, 0) * 360deg), var(--border-faint) calc(var(--progress, 0) * 360deg)); margin-bottom: 24px; position: relative; }
.rest-ring-inner { width: 140px; height: 140px; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.rest-time { font-family: var(--font-mono); font-size: 42px; font-weight: 400; color: var(--text); letter-spacing: -0.02em; }
.rest-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 20px; }
.btn-skip { font-size: 14px; color: var(--text-faint); background: none; border: none; padding: 12px 24px; transition: color 0.2s; }
.btn-skip:active { color: var(--accent); }

/* Session complete */
.complete-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--success-bg); display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.complete-icon svg { width: 24px; height: 24px; stroke: var(--success); fill: none; stroke-width: 2; }
.complete-title { font-family: var(--font-display); font-size: 24px; font-weight: 400; margin-bottom: 8px; }
.complete-sub { font-size: 15px; color: var(--text-muted); margin-bottom: 8px; }
.complete-duration { font-family: var(--font-mono); font-size: 14px; color: var(--accent); letter-spacing: 0.02em; margin-bottom: 28px; }

.session-summary { padding: 24px 0 40px; text-align: left; }
.session-summary-header { text-align: center; margin-bottom: 28px; }
.session-summary-list { display: flex; flex-direction: column; }
.summary-exercise { display: flex; justify-content: space-between; align-items: baseline; padding: 11px 0; border-top: 1px solid var(--border-faint); }
.summary-exercise:last-child { border-bottom: 1px solid var(--border-faint); }
.summary-ex-name { font-size: 14px; font-weight: 500; color: var(--text); }
.summary-ex-detail { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); text-align: right; }
.summary-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; text-align: center; }

/* Preview sheet */
.preview-sheet { position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: 0; transition: opacity 0.25s; }
.preview-sheet.open { pointer-events: auto; opacity: 1; }
.preview-backdrop { position: absolute; inset: 0; background: rgba(28, 25, 23, 0.3); }
.preview-content { position: absolute; bottom: 0; left: 0; right: 0; max-width: 480px; margin: 0 auto; background: var(--bg); border-top: 1px solid var(--border); border-radius: 12px 12px 0 0; padding: 24px; padding-bottom: calc(24px + var(--safe-b)); max-height: 70dvh; overflow-y: auto; transform: translateY(100%); transition: transform 0.35s var(--ease); }
.preview-sheet.open .preview-content { transform: translateY(0); }
.preview-handle { width: 32px; height: 4px; border-radius: 2px; background: var(--border); margin: 0 auto 20px; }
.preview-title { font-family: var(--font-display); font-size: 19px; font-weight: 600; margin-bottom: 4px; }
.preview-day { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 20px; }
.preview-exercise { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--border-faint); }
.preview-ex-name { font-size: 15px; font-weight: 500; color: var(--text); }
.preview-ex-detail { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); text-align: right; }
.preview-ex-note { grid-column: 1 / -1; font-size: 13px; line-height: 1.5; color: var(--text-muted); padding: 6px 0 2px; font-style: italic; }
.preview-exercise.has-note { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; }
.completed-badge { padding-top: 16px; text-align: center; font-family: var(--font-mono); font-size: 12px; color: var(--success); letter-spacing: 0.04em; }

.mark-all-done-btn { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); background: none; border: none; padding: 10px 12px; min-height: 44px; letter-spacing: 0.02em; transition: color 0.2s; }
.mark-all-done-btn:active { color: var(--accent); }
.session-top-row { display: flex; justify-content: space-between; align-items: center; }
.session-progress-meta { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.session-progress-count { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }

/* Profile/summary */
.profile-content { padding: 28px 0 120px; }
.profile-section { margin-bottom: 32px; }
.profile-section-label { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 16px; }
.profile-heading { font-family: var(--font-display); font-size: clamp(22px, 5vw, 28px); font-weight: 400; line-height: 1.25; margin-bottom: 8px; }
.profile-sub { font-size: 15px; color: var(--text-muted); line-height: 1.6; margin-bottom: 20px; }
.profile-stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.profile-stat { padding: 14px 16px; border: 1px solid var(--border-faint); border-radius: 4px; }
.profile-stat-value { font-family: var(--font-mono); font-size: 19px; font-weight: 500; color: var(--text); line-height: 1.2; }
.profile-stat-label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.profile-history-item { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--border-faint); }
.profile-history-item:last-child { border-bottom: 1px solid var(--border-faint); }
.profile-history-name { font-size: 15px; font-weight: 500; color: var(--text); }
.profile-history-detail { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); }
.btn-new-program { width: 100%; font-family: var(--font-body); font-size: 15px; font-weight: 600; padding: 14px; background: none; color: var(--accent); border: 1.5px solid var(--accent); border-radius: 4px; transition: all 0.2s; margin-top: 8px; }
.btn-new-program:active { background: var(--accent); color: #fff; }
.profile-divider { border: none; border-top: 1px solid var(--border-faint); margin: 28px 0; }

/* ========================================
   HOME (returning user)
   ======================================== */
.home-content { padding: 0 0 40px; }

.home-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}

/* Greeting */
.home-greeting { padding: 28px 0 0; }

.home-greeting-headline {
  font-family: var(--font-display);
  font-size: clamp(26px, 7vw, 32px);
  font-weight: 400;
  line-height: 1.2;
  color: var(--text);
  margin-top: 4px;
}

.home-greeting-headline em { font-style: italic; color: var(--accent); }

/* Readiness check */
.home-readiness { padding: 24px 0 0; }

.home-readiness-question {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  line-height: 1.4;
  color: var(--text);
  margin-bottom: 16px;
}

.home-readiness-options { display: flex; gap: 10px; }

.home-readiness-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: none;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 72px;
  justify-content: center;
}

.home-readiness-btn:active { transform: scale(0.97); }

.home-readiness-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transition: transform 0.2s var(--ease);
}

.home-readiness-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.15s;
}

.home-readiness-btn.green .home-readiness-dot { background: #166534; }
.home-readiness-btn.yellow .home-readiness-dot { background: #a16207; }
.home-readiness-btn.red .home-readiness-dot { background: #dc2626; }

.home-readiness-btn.green.selected { border-color: #166534; background: rgba(22, 101, 52, 0.08); }
.home-readiness-btn.yellow.selected { border-color: #a16207; background: rgba(161, 98, 7, 0.08); }
.home-readiness-btn.red.selected { border-color: #dc2626; background: rgba(220, 38, 38, 0.06); }

.home-readiness-btn.selected .home-readiness-dot { transform: scale(1.3); }
.home-readiness-btn.green.selected .home-readiness-label { color: #166534; }
.home-readiness-btn.yellow.selected .home-readiness-label { color: #a16207; }
.home-readiness-btn.red.selected .home-readiness-label { color: #dc2626; }

.home-readiness-response {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 4px;
  border-left: 3px solid var(--accent);
  background: var(--bg-subtle);
  font-size: 14px;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.5;
}

.home-readiness.answered .home-readiness-response { margin-top: 0; }

.home-readiness-change {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-faint);
  background: none;
  border: none;
  padding: 8px 0 0;
  cursor: pointer;
  transition: color 0.15s;
}

.home-readiness-change:active { color: var(--accent); }

/* Session card */
.home-session-card {
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  padding: 20px;
  background: var(--accent-light);
  margin: 24px 0 0;
}

.home-session-name {
  font-family: var(--font-display);
  font-size: clamp(22px, 6vw, 26px);
  font-weight: 400;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 4px;
}

.home-session-meta {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.home-session-cta {
  width: 100%;
  margin-top: 4px;
}

/* Exercise preview inside card */
.home-exercise-preview { margin-bottom: 16px; }

.home-exercise-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-top: 1px solid rgba(154, 52, 18, 0.12);
}

.home-exercise-row:last-of-type { border-bottom: 1px solid rgba(154, 52, 18, 0.12); }

.home-exercise-name { font-size: 15px; font-weight: 500; color: var(--text); }
.home-exercise-target { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.home-exercise-more { font-size: 13px; color: var(--text-faint); padding: 8px 0 0; }

/* Coach advisory */
.home-coach-advisory {
  padding: 12px 14px;
  border-radius: 4px;
  background: rgba(161, 98, 7, 0.08);
  border-left: 3px solid #a16207;
  font-size: 14px;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 16px 0 0;
}

.home-coach-advisory.red {
  background: rgba(220, 38, 38, 0.06);
  border-left-color: #dc2626;
}

/* Plan context */
.home-plan-section { padding: 0 0 8px; }
.home-plan-name { font-family: var(--font-display); font-size: 18px; font-weight: 600; line-height: 1.3; color: var(--text); margin-bottom: 2px; }
.home-plan-meta { font-size: 14px; color: var(--text-muted); }

.home-links { display: flex; justify-content: space-between; padding: 16px 0 0; }

.home-link {
  font-size: 14px;
  color: var(--text-faint);
  cursor: pointer;
  transition: color 0.15s;
  background: none;
  border: none;
  font-family: var(--font-body);
}

.home-link:active { color: var(--accent); }

/* Focus & a11y */
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.coach-text,
.exercise-coach-note-text {
  -webkit-user-select: text;
  user-select: text;
}

/* ========================================
   FEEDBACK
   ======================================== */
.feedback-fab {
  position: absolute;
  bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9;
  transition: transform 0.15s, box-shadow 0.15s;
}

.feedback-fab:active { transform: scale(0.93); }
.feedback-fab svg { width: 20px; height: 20px; stroke: var(--text-muted); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.feedback-sheet { position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: 0; transition: opacity 0.25s; }
.feedback-sheet.open { pointer-events: auto; opacity: 1; }
.feedback-backdrop { position: absolute; inset: 0; background: rgba(28, 25, 23, 0.3); }
.feedback-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
  padding: 24px;
  padding-bottom: calc(24px + var(--safe-b));
  max-height: 70dvh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.35s var(--ease);
}

.feedback-sheet.open .feedback-content { transform: translateY(0); }

.feedback-handle { width: 32px; height: 4px; border-radius: 2px; background: var(--border); margin: 0 auto 16px; }

.feedback-context {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  background: var(--bg-subtle);
  padding: 4px 10px;
  border-radius: 3px;
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}

.feedback-textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: none;
  color: var(--text);
  outline: none;
  resize: none;
  min-height: 80px;
  transition: border-color 0.2s;
  -webkit-user-select: text;
  user-select: text;
}

.feedback-textarea:focus { border-color: var(--accent); }
.feedback-textarea::placeholder { color: var(--text-faint); }

.feedback-tags { display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap; }

.feedback-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: none;
  color: var(--text-muted);
  transition: all 0.15s;
  min-height: 36px;
  display: flex;
  align-items: center;
}

.feedback-tag:active { transform: scale(0.97); }
.feedback-tag.selected { border-color: var(--accent); background: var(--accent-light); color: var(--accent); }

.feedback-bottom { display: flex; gap: 10px; margin-top: 14px; }

.feedback-voice-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.feedback-voice-btn svg { width: 18px; height: 18px; stroke: var(--text-muted); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.feedback-voice-btn.recording { background: var(--accent); border-color: var(--accent); animation: voice-pulse 1.5s ease-in-out infinite; }
.feedback-voice-btn.recording svg { stroke: #fff; }

@keyframes voice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(154, 52, 18, 0.3); }
  50% { box-shadow: 0 0 0 8px rgba(154, 52, 18, 0); }
}

.feedback-submit-btn {
  flex: 1;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  padding: 12px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  transition: background 0.2s, transform 0.1s;
}

.feedback-submit-btn:active { transform: scale(0.98); }
.feedback-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.feedback-toast {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-b) + 68px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 4px;
  background: var(--text);
  color: var(--bg);
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 60;
  pointer-events: none;
  white-space: nowrap;
}

.feedback-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

.feedback-nudge-btn {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-faint);
  background: none;
  border: none;
  padding: 12px 0;
  transition: color 0.2s;
}

.feedback-nudge-btn:active { color: var(--accent); }

/* ========================================
   SIGN-IN SCREEN
   ======================================== */
.sign-in {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 55dvh;
  padding: 40px 0 32px;
}

.sign-in-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 16px;
}

.sign-in-headline {
  font-family: var(--font-display);
  font-size: clamp(28px, 7vw, 38px);
  font-weight: 400;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 12px;
}

.sign-in-body {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.sign-in-form { display: flex; flex-direction: column; gap: 12px; }

.sign-in-input {
  font-family: var(--font-body);
  font-size: 16px;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: none;
  color: var(--text);
  outline: none;
  min-height: 48px;
  transition: border-color 0.2s;
}

.sign-in-input:focus { border-color: var(--accent); }
.sign-in-input::placeholder { color: var(--text-faint); }

.sign-in-sent {
  text-align: center;
  padding: 40px 0;
}

.sign-in-sent-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 22px;
}

.sign-in-sent-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.sign-in-sent-detail {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.5;
}

.sign-in-error {
  font-size: 14px;
  color: #dc2626;
  margin-top: -4px;
}

.auth-expired {
  font-size: 14px;
  color: #dc2626;
  margin-bottom: 12px;
}

/* ========================================
   ACCOUNT MENU
   ======================================== */
.account-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px;
  margin: -4px;
  border-radius: 4px;
  transition: background 0.15s;
  -webkit-user-select: none;
  user-select: none;
}

.account-trigger:active { background: var(--bg-elevated); }

.account-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--text-on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
  flex-shrink: 0;
}

.account-chevron {
  width: 10px;
  height: 10px;
  stroke: var(--text-faint);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s var(--ease);
}

.account-trigger.open .account-chevron { transform: rotate(180deg); }

.account-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 220px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 24px rgba(28, 25, 23, 0.08), 0 1px 4px rgba(28, 25, 23, 0.04);
  z-index: 100;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px) scale(0.97);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}

.account-dropdown.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.account-dropdown-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border-faint);
}

.account-dropdown-email {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.01em;
  word-break: break-all;
}

.account-dropdown-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.account-dropdown-items { padding: 6px; }

.account-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 10px;
  background: none;
  border: none;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  text-align: left;
}

.account-menu-item:hover { background: var(--bg-elevated); color: var(--text); }
.account-menu-item:active { background: var(--bg-subtle); }

.account-menu-item svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.account-menu-item.danger { color: var(--accent); }
.account-menu-item.danger:hover { background: var(--accent-light); color: var(--accent-hover); }

.account-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99;
}

/* ========================================
   CONFIRM MODAL
   ======================================== */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.confirm-overlay.open { opacity: 1; pointer-events: auto; }

.confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 25, 23, 0.35);
}

.confirm-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-radius: 14px 14px 0 0;
  padding: 28px 24px;
  padding-bottom: calc(28px + var(--safe-b));
  transform: translateY(100%);
  transition: transform 0.3s var(--ease);
}

.confirm-overlay.open .confirm-card { transform: translateY(0); }

.confirm-handle {
  width: 32px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin: 0 auto 20px;
}

.confirm-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.confirm-body {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.confirm-actions { display: flex; gap: 10px; }

.confirm-btn {
  flex: 1;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  padding: 14px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.confirm-btn:active { transform: scale(0.97); }

.confirm-btn-cancel {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-faint);
}

.confirm-btn-destructive {
  background: #dc2626;
  color: #fff;
}

.confirm-btn-destructive:active { background: #b91c1c; }

/* Desktop border */
@media (min-width: 481px) {
  #app { border-left: 1px solid var(--border-faint); border-right: 1px solid var(--border-faint); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.15s !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
