/* Sarge Trainer — Gym Slate Design System */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* The hidden attribute must ALWAYS win. Any component that sets display
   (flex/grid/block) silently defeats plain [hidden] — the standing gotcha
   that broke the auth pages, then the archived toggle and roster search
   (blind QA 2026-06-11: .client-card/.archived-list display:flex ate
   card.hidden). One global rule ends the class of bug. */
[hidden] { display: none !important; }

/* No rubber-band overscroll, round 2 (AI + Settings still pulled): the
   BODY was the page scroller, and elastic pull on a body can't be fully
   tamed. Lock html/body entirely; #app becomes the only scroll surface
   (overscroll contained there). Fixed chrome (nav/keypad/snackbar/banner)
   is viewport-anchored and unaffected. */
html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg-canvas);
}
body { padding-top: env(safe-area-inset-top, 0); }

:root {
  /* ── Surface hierarchy — light "warm paper" ──── */
  --bg-canvas: #F4F2EE;
  --bg-card: #FFFFFF;
  --bg-raised: #F4F2EF;

  /* ── Borders (ink at low alpha) ──────────────── */
  --border: rgba(24, 22, 18, .12);
  --border-subtle: rgba(24, 22, 18, .08);

  /* ── Text (ink on paper) ─────────────────────── */
  --text: #191815;
  --text-secondary: rgba(25, 24, 20, .70);
  --text-muted: rgba(25, 24, 20, .55);

  /* ── Brand / Actions — coral ─────────────────── */
  --accent: #007880;
  --accent-hover: #00626A;
  --accent-subtle: rgba(0, 120, 128, .12);

  /* ── Semantic (green is success now, NOT brand) ── */
  --success: #16A34A;
  --warning: #F59E0B;
  --danger: #EF4444;
  --danger-subtle: rgba(239, 68, 68, .12);

  /* ── Warn (injuries/restrictions surfaces — locked in injuries mock) ── */
  --warn: #B45309;
  --warn-fg: #7C3A06;
  --warn-bg: rgba(180, 83, 9, .08);
  --warn-bg-strong: rgba(180, 83, 9, .14);

  /* ── Status ──────────────────────────────────── */
  --blue: #3B82F6;

  /* ── Spacing & Shape ─────────────────────────── */
  --radius: 6px;
  --radius-lg: 10px;
}

/* ── Dark theme override (scaffold — no toggle wired yet; set
      [data-theme="dark"] on <html> later to activate) ─────────── */
[data-theme="dark"] {
  --bg-canvas: #0E0F11;
  --bg-card: #16181B;
  --bg-raised: #1D2025;
  --border: rgba(255, 255, 255, .10);
  --border-subtle: rgba(255, 255, 255, .06);
  --text: #F3F5F7;
  --text-secondary: rgba(243, 245, 247, .70);
  --text-muted: rgba(243, 245, 247, .55);
  --accent: #14959C;
  --accent-hover: #3CB6BD;
  --accent-subtle: rgba(0, 160, 168, .18);
  --success: #16A34A;
  --blue: #3B82F6;
  --warn: #F59E0B;
  --warn-fg: #FBBF24;
  --warn-bg: rgba(245, 158, 11, .12);
  --warn-bg-strong: rgba(245, 158, 11, .18);
}

html, body {
  height: 100%;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-canvas);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}

#app {
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
  padding: 12px 14px 80px;
  max-width: 480px;
  margin: 0 auto;
}

/* ── Typography ─────────────────────────────────── */
h1 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; font-weight: 600; }

label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ── Buttons ────────────────────────────────────── */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: var(--on-accent, #fff);
  transition: background 0.15s, transform 0.1s;
}

button:hover { background: var(--accent-hover); }
button:active { transform: scale(0.97); }
button:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-small {
  padding: 5px 10px;
  font-size: 0.8rem;
}

/* ── Forms ──────────────────────────────────────── */
input, select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--text);
  font-size: 0.93rem;
  transition: border-color 0.15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-subtle);
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
}

/* ── Login ──────────────────────────────────────── */
.login-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  gap: 24px;
}

.login-screen h1 {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 300px;
}

.login-form button[type="submit"] {
  width: 100%;
  margin-top: 4px;
}

.login-tabs {
  display: flex;
  gap: 0;
  width: 100%;
  max-width: 300px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.login-tab {
  flex: 1;
  padding: 7px 0;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-raised);
  color: var(--text-muted);
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.15s;
}

.login-tab:hover { background: var(--bg-card); }
.login-tab:active { transform: none; }

.login-tab.active {
  background: var(--accent);
  color: var(--on-accent, #fff);
}

.login-divider {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 300px;
  margin: 12px 0 4px;
  gap: 12px;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.login-divider span {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.demo-btn {
  width: 100%;
  max-width: 300px;
  padding: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.15s;
}
.demo-btn:hover {
  background: var(--accent);
  color: var(--on-accent, #fff);
}
.demo-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.demo-hint {
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

.password-wrap {
  position: relative;
  width: 100%;
}

.password-wrap input {
  padding-right: 40px;
}

.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.pw-toggle:hover { color: var(--text-secondary); background: transparent; }
.pw-toggle:active { transform: translateY(-50%); }

/* ── Dashboard / App Header ────────────────────── */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 0 6px;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 32px 16px;
  font-size: 0.9rem;
}

/* ── Client List (borderless rows) ──────────────── */
.client-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.client-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.12s;
}

.client-card:last-child {
  border-bottom: none;
}

.client-card:hover {
  background: var(--bg-card);
}

/* ── Roster richness (lived-in mock B) ─────────── */
.roster-count {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 1px;
}
.roster-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 8px 11px;
  margin-bottom: 10px;
  color: var(--text-muted);
}
.roster-search svg { width: 15px; height: 15px; flex: 0 0 auto; }
.roster-search input {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 0.9rem;
}
.roster-search input:focus { box-shadow: none; }
.client-card-mid {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.client-card-mid .client-name { flex: none; } /* mid owns the flexing now */
.client-last {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.checkin-chip {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-subtle);
  border-radius: 999px;
  padding: 2px 7px;
  margin-left: 5px;
  vertical-align: 1px;
}

.client-card-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.client-name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.client-next {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.client-card-meta {
  text-align: right;
  flex-shrink: 0;
}

.client-balance {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.balance-low {
  color: var(--warning);
  font-weight: 600;
}

/* ── Initials Avatar ───────────────────────────── */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* ── Progress Bar (mini) ───────────────────────── */
.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  width: 48px;
  margin-top: 3px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ── Status Dot ────────────────────────────────── */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.completed { background: var(--success); }
.status-dot.pending { background: var(--text-muted); }
.status-dot.low-bal { background: var(--warning); vertical-align: middle; margin-left: 4px; }

/* ── Detail Screen ─────────────────────────────── */
.detail-screen {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-row {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.detail-row:empty {
  display: none;
}

.detail-section {
  margin-top: 6px;
}

.detail-section strong {
  display: block;
  margin-bottom: 3px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-section p {
  font-size: 0.9rem;
}

/* ── Package Cards ─────────────────────────────── */
.package-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-top: 4px;
}

.package-card.past {
  opacity: 0.45;
}

/* ── Exercise demo media (free-exercise-db photo pairs) ───────── */
.exercise-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: #fff;          /* fdb photos are white-background */
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.exdemo-chip {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  padding: 8px 12px;
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}
.exdemo-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0, 0, 0, .72);
  display: flex; align-items: center; justify-content: center;
}
.exdemo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  width: calc(100% - 32px);
  max-width: 420px;
  text-align: center;
}
.exdemo-card h3 { margin: 0 0 10px; }
.exdemo-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.exdemo-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  background: #fff;
}
/* The crossfade IS the animation: hold each position, ease between. */
.exdemo-b { animation: exdemo-fade 2.8s ease-in-out infinite; }
@keyframes exdemo-fade {
  0%, 45% { opacity: 0; }
  50%, 95% { opacity: 1; }
  100% { opacity: 0; }
}
.exdemo-hint { margin: 10px 0 0; font-size: 0.8rem; color: var(--text-muted); }

/* Zero sessions left — the card itself raises the renewal flag. */
.package-card.pkg-empty {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, .10);
  font-weight: 700;
}
.package-card.pkg-empty > span:first-child { color: #f59e0b; }

.pkg-length {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* ── Forms (screens + stacks) ──────────────────── */
.form-screen {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.form-stack[hidden] {
  display: none;
}

.form-stack button[type="submit"] {
  margin-top: 2px;
}

/* ── Button Variants ───────────────────────────── */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-secondary);
  background: var(--bg-raised);
}

/* Calendar entry on Today — Sarge: ghost-on-canvas was "white on white".
   Accent-filled so the calendar reads as a first-class destination. */
.btn-calendar {
  background: var(--accent);
  color: #fff;
  border: none;
  font-weight: 700;
  padding: 7px 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.btn-calendar:hover { background: var(--accent); filter: brightness(1.08); color: #fff; }

/* ── Session List ──────────────────────────────── */
.session-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.session-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.12s;
}

.session-card:last-child {
  border-bottom: none;
}

.session-card:hover {
  background: var(--bg-card);
}

.session-card-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.session-date {
  font-weight: 600;
  font-size: 0.9rem;
}

.session-duration {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.session-status {
  font-size: 0.75rem;
  font-weight: 600;
}

.session-completed .session-status {
  color: var(--success);
}

.session-pending .session-status {
  color: var(--text-muted);
}

/* ── Session Detail ───────────────────────────── */
.session-detail-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.session-toggle-section {
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Toggle switch */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.95rem;
}

.toggle-label input[type="checkbox"] {
  width: 44px;
  height: 24px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
  padding: 0;
  border: none;
}

.toggle-label input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-label input[type="checkbox"]:checked {
  background: var(--success);
}

.toggle-label input[type="checkbox"]:checked::after {
  transform: translateX(20px);
}

/* ── Completion micro-interaction ──────────────── */
@keyframes check-pulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

.toggle-label input[type="checkbox"]:checked {
  animation: check-pulse 0.4s ease-out;
}

.session-toggle-section.just-completed {
  border-color: var(--success);
  transition: border-color 0.6s ease;
}

.session-actions {
  display: flex;
  gap: 6px;
}

/* ── Button — Full Width ──────────────────────── */
.btn-full {
  width: 100%;
  padding: 10px;
  font-size: 0.93rem;
}

/* ── Button — Danger ──────────────────────────── */
.btn-danger {
  background: var(--danger-subtle);
  color: var(--danger);
  border: 1px solid transparent;
}

.btn-danger:hover {
  background: var(--danger);
  color: white;
}

/* ── Bottom Nav ────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(52px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bg-card);
  border-top: 2px solid var(--accent);
  box-shadow: 0 -3px 14px rgba(24, 22, 18, .10);
  display: flex;
  justify-content: center;
  z-index: 100;
}

.bottom-nav-inner {
  display: flex;
  max-width: 480px;
  width: 100%;
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 0;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s;
  border-radius: 0;
}

.nav-tab:hover {
  color: var(--text-secondary);
  background: transparent;
}

.nav-tab:active { transform: none; }

.nav-tab.active {
  color: var(--accent);
  background: var(--accent-subtle);
  border-radius: 10px;
  font-weight: 700;
}

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

/* Per-tab signature colors (Sarge: "bolder and pronounced… I would love
   color to make it pop"). Icons carry their color always; the active tab
   goes full-strength with a tinted pill. Order matches app.html:
   Today / Clients / Time / AI / Settings. */
.nav-tab:nth-child(1) svg { stroke: var(--accent); }
.nav-tab:nth-child(2) svg { stroke: #3b82f6; }
.nav-tab:nth-child(3) svg { stroke: #f59e0b; }
.nav-tab:nth-child(4) svg { stroke: #a855f7; }
.nav-tab:nth-child(5) svg { stroke: #94a3b8; }
.nav-tab.active:nth-child(1) { color: var(--accent); background: var(--accent-subtle); }
.nav-tab.active:nth-child(2) { color: #3b82f6; background: rgba(59, 130, 246, .14); }
.nav-tab.active:nth-child(3) { color: #f59e0b; background: rgba(245, 158, 11, .14); }
.nav-tab.active:nth-child(4) { color: #a855f7; background: rgba(168, 85, 247, .14); }
.nav-tab.active:nth-child(5) { color: #94a3b8; background: rgba(148, 163, 184, .16); }

/* ── Search Input ─────────────────────────────── */
.search-input {
  padding: 8px 11px;
  font-size: 0.9rem;
}

/* ── Category Chips ──────────────────────────── */
.chip-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-raised);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}

.chip:hover {
  background: var(--bg-card);
  border-color: var(--text-muted);
}

.chip.active {
  background: var(--accent-subtle);
  color: var(--accent);
  border-color: var(--accent);
}

/* ── Category dropdown (exercise picker) ─────── */
.category-select {
  width: auto;
  min-width: 110px;
  /* Cap the select so its widest option ("Functional / Strongman / …") can't
     inflate it and crush the flex:1 search input beside it on phone widths.
     The closed select clips long labels; the opened list still shows them full. */
  max-width: 42%;
  padding-right: 8px;
  font-size: 0.82rem;
}

/* ── Exercise List ───────────────────────────── */
.exercise-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Picker visual pass (polish lane — Sarge: "looks UGLY"): rows live on a
   card surface with real padding; type rides as a color-coded chip. */
.exercise-list {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.exercise-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.12s;
}

.exercise-row:last-child { border-bottom: none; }
.exercise-row:hover { background: var(--bg-raised); }
.exercise-row:active { background: var(--accent-subtle); }

.type-chip {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 3px 9px;
  border-radius: 999px;
  flex-shrink: 0;
  white-space: nowrap;
}
.type-chip.type-w { background: var(--accent-subtle); color: var(--accent); }
.type-chip.type-t { background: rgba(59, 130, 246, .12); color: var(--blue); }
.type-chip.type-r { background: var(--bg-raised); color: var(--text-secondary); }

.exercise-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  padding: 14px 14px 6px;
  background: var(--bg-card);
}

.exercise-row-main {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.exercise-name {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exercise-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* One-tap exercise remove on the session screen — quiet ×, danger on hover */
.ex-remove {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  margin-left: 6px;
  font-size: 1.05rem;
  line-height: 1;
  background: transparent;
  color: var(--text-muted);
  border-radius: 50%;
}
.ex-remove:hover { background: var(--danger-subtle); color: var(--danger); }

.badge-custom {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--accent-subtle);
  color: var(--accent);
  flex-shrink: 0;
}

/* (old .exercise-section-label rule superseded by the picker visual pass
   above — removed to keep one source of truth) */

/* ── Set Logging ─────────────────────────────── */
.sets-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.set-row {
  position: relative;            /* clip track for the swipe-to-delete face */
  overflow: hidden;
  border-radius: var(--radius);
}

.set-row.set-saved .set-row-face {
  border-color: var(--border-subtle);
}

/* Saved-row fade lives on the face's CHILDREN, not the face: the face's opaque
   background is what masks the red swipe-to-delete underlay behind it. Face-level
   opacity let the underlay bleed through every saved row's right edge. */
.set-row.set-saved .set-row-face > * {
  opacity: 0.85;
}

.set-row:not(.set-saved) .set-row-face {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-subtle);
}

.set-number {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 22px;
  flex-shrink: 0;
}

.set-fields {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.set-field {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.set-field input {
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.set-saved .set-field input {
  background: transparent;
  border-color: transparent;
}

.set-field input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
  font-style: italic;
}

.set-unit {
  font-size: 0.7rem;
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 20px;
}

.set-check {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: var(--bg-raised);
  color: var(--text-muted);
  border: 2px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: all 0.2s;
}

.set-check:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.set-check.saved {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

@keyframes set-check-pulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

.set-check.just-checked {
  animation: set-check-pulse 0.5s ease-out;
}

/* ── Utility ───────────────────────────────────── */
.text-muted {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.text-secondary {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ── Error ──────────────────────────────────────── */
.error {
  color: var(--danger);
  font-size: 0.85rem;
  text-align: center;
}

/* ── Workout History ──────────────────────────── */
.history-session {
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

.history-session:last-child { border-bottom: none; }

.history-session-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  cursor: pointer;
}

.history-date {
  font-weight: 600;
  font-size: 0.9rem;
}

.history-duration {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.history-exercises {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.history-exercise {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 8px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background 0.12s;
}

.history-exercise:hover { background: var(--bg-card); }

.history-exercise-name {
  font-size: 0.82rem;
  color: var(--text);
}

.history-exercise-summary {
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Chat thread */
.ai-thread {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 50vh;
  min-height: 60px;
}

.ai-msg {
  max-width: 88%;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.ai-msg span { display: block; }

/* Chat bubble polish (batch2 — Sarge: needs better bubbles) */
.ai-msg {
  max-width: 86%;
  padding: 10px 14px;
  line-height: 1.5;
  box-shadow: 0 1px 4px rgba(24, 22, 18, .08);
}

.ai-msg-user {
  align-self: flex-end;
  background: var(--accent);
  color: var(--on-accent, #fff);
  border-radius: 16px 16px 4px 16px;
}

.ai-msg-assistant {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text);
  border-radius: 16px 16px 16px 4px;
}


.ai-thinking {
  color: var(--accent);
  font-style: italic;
  font-size: 0.88rem;
}

.ai-response-text {
  font-size: 0.88rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.ai-error {
  color: var(--danger);
  font-size: 0.85rem;
}

/* ── AI Tab (inline screen, not overlay) ──────── */
.ai-tab-screen {
  display: flex;
  flex-direction: column;
  /* Third strike on scroll-math (100% of #app still cut off on real
     phones — gesture bars change the nav's true height). FIXED layout
     ends it: pinned from the top to exactly the nav's top edge,
     safe-areas included. No assumptions, no overflow. */
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  bottom: calc(52px + env(safe-area-inset-bottom, 0px));
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-canvas);
  z-index: 10;
}

.ai-tab-screen .app-header { flex-shrink: 0; }

/* Context bar — compact single row */
.ai-context-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  min-height: 36px;
}

.ai-context-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-context-text strong {
  color: var(--text);
}

.ai-picker-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 0.8rem;
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.ai-picker-btn:hover {
  border-color: var(--accent);
}

.ai-clear-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 1.1rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.ai-clear-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.ai-clear-btn[hidden],
.ai-picker-btn[hidden],
.ai-picker-dropdown[hidden] { display: none !important; }

/* Picker dropdown */
.ai-picker-dropdown {
  padding: 4px 16px 8px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  max-height: 180px;
  overflow-y: auto;
}

.ai-picker-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text);
  font-size: 0.88rem;
  padding: 10px 4px;
  cursor: pointer;
}

.ai-picker-item:last-child { border-bottom: none; }
.ai-picker-item:hover { color: var(--accent); }

.ai-picker-loading,
.ai-picker-empty {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 4px 0;
}

.ai-tab-screen .ai-thread {
  flex: 1;
  overflow-y: auto;
  max-height: none;
}

.ai-tab-input {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
}

.ai-tab-input .ai-input {
  flex: 1;
  resize: none;
  min-height: 36px;
  max-height: 80px;
  font-size: 0.88rem;
}

.ai-tab-input .ai-send {
  width: auto;
  padding: 8px 16px;
  flex-shrink: 0;
}

/* ── Settings ─────────────────────────────────── */
.settings-body {
  padding: 0 16px 80px;
}

.settings-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.settings-section h2 {
  margin: 0 0 12px;
  font-size: 0.95rem;
}

.settings-row {
  margin-bottom: 10px;
}

.settings-row label {
  display: block;
  margin-bottom: 4px;
}

.settings-hint {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 0 0 12px;
  line-height: 1.4;
}

.settings-msg {
  font-size: 0.82rem;
  margin: 8px 0 0;
  padding: 6px 10px;
  border-radius: var(--radius);
}

.settings-msg.success {
  color: var(--success);
  background: rgba(22, 163, 74, 0.1);
}

.settings-msg.error {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.settings-version {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin: 16px 0 0;
}

/* ── Confirm Modal ────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.15s ease, visibility 0s linear 0s;
}

/* visibility (delayed past the fade) removes the hidden modal from the
   accessibility tree, tab order, and innerText — opacity alone left phantom
   modal content reachable by keyboard/screen readers on every screen. */
.modal-overlay.modal-hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0s linear 0.15s;
}

.modal-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px 20px 20px;
  margin-bottom: 0;
}

@media (min-width: 481px) {
  .modal-overlay { align-items: center; }
  .modal-card {
    border-radius: var(--radius-lg);
    margin-bottom: 0;
  }
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
}

.modal-body {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0 0 20px;
}

.modal-body[hidden] { display: none; }

.modal-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  margin: 0 0 16px;
  box-sizing: border-box;
}

.modal-input[hidden] { display: none; }

.modal-input:focus {
  outline: none;
  border-color: var(--accent);
}

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

.modal-btn {
  flex: 1;
  padding: 10px;
  font-size: 0.93rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}

.modal-cancel {
  background: var(--bg-raised);
  color: var(--text-secondary);
}

.modal-cancel:hover {
  background: var(--border);
  color: var(--text);
}

.modal-confirm {
  background: var(--accent);
  color: var(--on-accent, #fff);
}

.modal-confirm:hover {
  background: var(--accent-hover);
}

.modal-destructive {
  background: var(--danger);
  color: white;
}

.modal-destructive:hover {
  background: #dc2626;
}

/* ── Interval Timer config (shared by the Time tab) ──────────── */
/* ── Config View ── */
.timer-config {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.timer-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.timer-input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timer-input-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.timer-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
}

.timer-step-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 1rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-step-btn:hover {
  background: var(--border);
}

.timer-stepper input {
  width: 56px;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  padding: 4px 2px;
}

.timer-step-unit {
  font-size: 0.72rem;
  color: var(--text-muted);
  min-width: 18px;
}

.timer-start-btn {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  font-weight: 700;
  background: var(--accent);
  color: var(--on-accent, #fff);
  border: none;
  border-radius: var(--radius);
}

.timer-start-btn:hover { background: var(--accent-hover); }

/* ── Presets ── */
.timer-presets-section {
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}

.timer-presets-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.timer-presets-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.timer-save-btn {
  padding: 4px 10px;
  font-size: 0.75rem;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.timer-save-btn:hover { background: var(--accent-subtle); }

.timer-presets-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timer-presets-loading,
.timer-presets-empty {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  padding: 8px 0;
}

.timer-preset-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.timer-preset-load {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  cursor: pointer;
  min-width: 0;
}

.timer-preset-load:hover {
  border-color: var(--accent);
  background: var(--bg-raised);
}

.timer-preset-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timer-preset-summary {
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 8px;
}

.timer-preset-del {
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 1rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.timer-preset-del:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-subtle);
}

/* ── Active View (shared by the Time tab run view) ── */
.timer-phase-label {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.timer-display {
  font-size: 4.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.timer-round-label {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.timer-controls {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.timer-ctrl-btn {
  padding: 10px 24px;
  font-size: 0.93rem;
  font-weight: 600;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent, #fff);
  border: none;
}

.timer-ctrl-btn:hover { background: var(--accent-hover); }

.timer-ctrl-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.timer-ctrl-ghost:hover {
  color: var(--text);
  border-color: var(--text-secondary);
  background: var(--bg-raised);
}

.timer-wakelock-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
}

/* ── Debug (remove later) ──────────────────────── */
.debug-info {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 8px;
}

/* ── Time Tab (Stopwatch / Timer / Intervals) ──── */
.time-mode-switch {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 20px;
}

.time-mode-tab {
  flex: 1;
  padding: 9px 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: calc(var(--radius) - 4px);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.time-mode-tab.active {
  background: var(--accent);
  color: var(--on-accent, #fff);
}

.time-mode-tab:not(.active):hover {
  color: var(--text);
  background: var(--bg-raised);
}

/* Stopwatch */
.sw-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.sw-display {
  color: var(--text);
  margin: 20px 0 4px;
  text-align: center;
}

.sw-laps {
  width: 100%;
  margin-top: 12px;
}

.sw-lap-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  padding: 9px 4px;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
}

.sw-lap-head {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.sw-lap-n { color: var(--text-secondary); }
.sw-lap-split { color: var(--text); text-align: center; }
.sw-lap-total { color: var(--text-secondary); text-align: right; }

/* ── Time Bridge — inline capture timer (step 2) ────────── */
.bridge-timer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -2px 0 8px;
  padding: 8px 10px;
  background: var(--bg-raised);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
}

.bridge-display {
  margin-right: auto;
  font-variant-numeric: tabular-nums;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 56px;
}

/* ── PWA update prompt — dismissible bottom refresh banner ────────── */
.pwa-update-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 60px;            /* clear the 52px bottom nav with an 8px gap */
  z-index: 250;            /* above bottom-nav (100), below modals (300) */
  max-width: 456px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-raised);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.pwa-update-icon {
  flex-shrink: 0;
  font-size: 1.2rem;
  color: var(--accent);
}

.pwa-update-text {
  display: flex;
  flex-direction: column;
  margin-right: auto;
  line-height: 1.25;
}

.pwa-update-text strong { color: var(--text); font-size: 0.95rem; }
.pwa-update-text span { color: var(--text-secondary); font-size: 0.8rem; }

.pwa-update-refresh {
  flex-shrink: 0;
  padding: 7px 14px;
  font-size: 0.9rem;
}

.pwa-update-dismiss {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 1.2rem;
  line-height: 1;
  background: transparent;
  color: var(--text-muted);
}

.pwa-update-dismiss:hover { background: transparent; color: var(--text-secondary); }

/* ── Restriction callout (client card) — the flag the eye catches first ── */
.restriction-callout {
  position: relative;
  background: var(--warn-bg-strong);
  border-radius: var(--radius-lg);
  padding: 13px 15px 14px 16px;
  margin-bottom: 12px;
  overflow: hidden;
}
.restriction-callout::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--warn);
}
.restriction-callout .rc-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
}
.restriction-callout .rc-ico { color: var(--warn); font-size: 0.95rem; line-height: 1; }
.restriction-callout .rc-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--warn-fg);
}
.restriction-callout .rc-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
  font-weight: 500;
}

/* ── Injury strip (log-sets header) — glanceable, tap to expand ── */
.injury-strip {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  background: var(--warn-bg);
  border-radius: var(--radius-lg);
  padding: 10px 12px 10px 13px;
  margin: 0 0 12px;
  cursor: pointer;
  user-select: none;
}
.injury-strip::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--warn);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.injury-strip .is-ico { color: var(--warn); font-size: 0.875rem; line-height: 1.35; flex: 0 0 auto; }
.injury-strip .is-body { flex: 1; min-width: 0; }
.injury-strip .is-line {
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--warn-fg);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.injury-strip .is-full {
  display: none;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text);
  font-weight: 500;
  margin-top: 2px;
  /* The strip is a glanceable warning, not an essay surface: cap the expanded
     height so a long note can't shove the set rows off-screen mid-session.
     The full note always lives on the client card. */
  max-height: 30vh;
  overflow-y: auto;
}
.injury-strip .is-chev {
  flex: 0 0 auto;
  color: var(--warn);
  font-size: 0.75rem;
  line-height: 1.5;
  transition: transform .2s ease;
  align-self: center;
}
.injury-strip.expanded { background: var(--warn-bg-strong); }
.injury-strip.expanded .is-line { display: none; }
.injury-strip.expanded .is-full { display: block; }
.injury-strip.expanded .is-chev { transform: rotate(180deg); }

/* ── Sandbox identity (html.sbx — set by the hostname gate in app.html) ── */
.sbx-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 400;            /* above everything incl. modals — you must always know */
  height: 16px;
  background: #B45309;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .35em;
  text-align: center;
  line-height: 16px;
  pointer-events: none;     /* never eats a tap */
}
html.sbx #app { padding-top: 26px; }            /* content clears the banner */
html.sbx .app-header { top: 16px; }             /* sticky headers stick below it */

/* ── QA companion (#qa, hidden surface) ─────────── */
.qa-sub { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.45; margin-bottom: 8px; }
.qa-progress { font-size: 0.78rem; font-weight: 700; color: var(--accent); margin-bottom: 10px; }
.qa-step {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 12px 13px;
  margin-bottom: 9px;
}
.qa-lane { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); margin-bottom: 3px; }
.qa-text { font-size: 0.88rem; line-height: 1.45; margin-bottom: 9px; }
.qa-go { margin-bottom: 9px; }
.qa-pf { display: flex; gap: 8px; margin-bottom: 8px; }
.qa-pf button {
  flex: 1;
  padding: 11px;
  background: var(--bg-raised);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  font-weight: 700;
}
.qa-pf .qa-pass.on { background: var(--success); border-color: var(--success); color: #fff; }
.qa-pf .qa-fail.on { background: var(--danger); border-color: var(--danger); color: #fff; }
.qa-note { font-size: 0.85rem; }
.qa-screen .btn-full { margin-top: 4px; width: 100%; }
.qa-screen .app-header h1 { font-size: 1.1rem; }

/* Floating return pill — body-appended, survives route swaps */
.qa-pill {
  position: fixed;
  right: 12px;
  bottom: 64px;            /* above the 52px tab bar */
  z-index: 260;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

/* ── iOS install hint — dismissible bottom banner (same shell as the
      PWA update banner; own classes so the two can evolve apart) ──── */
.ios-install-hint {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 60px;            /* clear the 52px bottom nav with an 8px gap */
  z-index: 250;            /* above bottom-nav (100), below modals (300) */
  max-width: 456px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-raised);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.ios-install-share {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.ios-install-text {
  display: flex;
  flex-direction: column;
  margin-right: auto;
  line-height: 1.25;
}

.ios-install-text strong { color: var(--text); font-size: 0.95rem; }
.ios-install-text span { color: var(--text-secondary); font-size: 0.8rem; }

.ios-install-dismiss {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 1.2rem;
  line-height: 1;
  background: transparent;
  color: var(--text-muted);
}

.ios-install-dismiss:hover { background: transparent; color: var(--text-secondary); }

/* ── Interval Circuit config (Simple | Circuit) ────────────────── */
.iv-mode-toggle {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.iv-mode-btn {
  flex: 1;
  padding: 7px 0;
  font-size: 0.85rem;
  font-weight: 600;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: calc(var(--radius) - 2px);
}

.iv-mode-btn.iv-mode-active { background: var(--accent); color: var(--on-accent, #fff); }

.iv-stations {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.iv-station-row {
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.iv-station-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.iv-station-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent, #fff);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.iv-station-label {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  padding: 6px 8px;
}

.iv-station-del {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
  background: transparent;
  color: var(--text-muted);
  border: none;
}

.iv-station-del:hover:not(:disabled) { background: transparent; color: var(--text); }
.iv-station-del:disabled { opacity: 0.3; }

.iv-station-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.iv-station-fields .timer-stepper input { width: 100%; }

.iv-add-station {
  width: 100%;
  padding: 9px;
  font-size: 0.85rem;
  font-weight: 600;
  background: transparent;
  color: var(--accent);
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
}

.iv-add-station:hover { background: var(--accent-subtle); }

.iv-shared {
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}

/* ── Interval Circuit run view ─────────────────────────────────── */
.iv-run-station {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 2px;
}

.iv-dots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.iv-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: transform 0.15s ease, background 0.15s ease;
}

.iv-dot.done { background: var(--accent); opacity: 0.45; }
.iv-dot.current { background: var(--accent); transform: scale(1.35); }

/* ── Empty Clients — quick-capture first-run ───────────────────── */
.qadd {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 2px;
}

.qadd-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.qadd-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
}

.qadd-help {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text);
  background: var(--accent-subtle);
  border-radius: var(--radius);
  padding: 8px 10px;
}

.qadd-or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.qadd-or::before,
.qadd-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.qadd-ai { width: 100%; }

/* ── Archived clients (archive / restore) ───────── */
.archived-section {
  margin-top: 18px;
}

.archived-toggle {
  width: 100%;
}

.archived-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 8px;
}

.archived-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border-subtle);
}

.archived-row:last-child {
  border-bottom: none;
}

.archived-name {
  font-size: 0.9rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

/* Quiet archive action on client detail */
.detail-archive {
  margin-top: 4px;
}

.archive-btn {
  color: var(--text-muted);
}

/* ── Today home (stats + sessions + quick actions) ─── */
.today-date {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: -4px 0 16px;
}

.today-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 22px;
}

/* Stat cards are <button> shortcuts — every property the generic button rule
   sets must be re-overridden here so they keep the quiet card look. */
.today-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 12px 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.12s, transform 0.1s;
}
.today-stat:hover { background: var(--bg-card); border-color: var(--accent); }
.today-stat:active { transform: scale(0.98); }

.today-stat-num {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.today-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

.today-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.today-sessions {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 22px;
}

/* Session rows are <button>; override base.css's coral button styling. */
.today-session-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 4px;
  background: transparent;
  color: var(--text);
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.today-session-row:last-child { border-bottom: none; }
.today-session-row:hover { background: var(--bg-card); }

.today-session-time {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 64px;
}

.today-session-client {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.95rem;
}

.today-session-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 38%;
}

.today-chip {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}

.today-chip.done {
  background: rgba(59, 130, 246, 0.12);
  color: var(--blue);
}

.today-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 12px 4px;
}

/* ── Today first-run welcome (no clients yet) ─────── */
.today-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 8px 8px;
}
.today-welcome .tw-mark {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: var(--accent-subtle);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  color: var(--accent);
}
.today-welcome .tw-mark svg { width: 30px; height: 30px; }
.today-welcome h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: 7px;
}
.today-welcome p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 250px;
  margin-bottom: 20px;
}
.today-welcome button + button { margin-top: 9px; }

.today-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ============================================================
   Appearance card — accent color picker (color-picker commit 2/3)
   APPEND-ONLY component styles. No :root token edits — the picker
   writes --accent / --accent-hover / --accent-subtle / --on-accent
   on documentElement at runtime (see appearance.js).
   ============================================================ */
.appearance-sw {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.appearance-swatch {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.12s;
}

.appearance-swatch:hover { transform: scale(1.08); }

.appearance-swatch[aria-pressed="true"] {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--text);
}

.appearance-custom {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.appearance-sqfield {
  position: relative;
  width: 100%;
  max-width: 280px;
  height: 150px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: crosshair;
  touch-action: none;
  background:
    linear-gradient(to top, #000, transparent),
    linear-gradient(to right, #fff, transparent),
    hsl(var(--pk-hue, 184), 100%, 50%);
}

.appearance-sqthumb {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .45);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.appearance-hue {
  width: 100%;
  max-width: 280px;
  height: 14px;
  border-radius: 7px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  touch-action: none;
  background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
}

.appearance-hue::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(0, 0, 0, .45);
  cursor: pointer;
}

.appearance-hue::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(0, 0, 0, .45);
  cursor: pointer;
}

.appearance-hexrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 280px;
}

.appearance-hex {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

/* ============================================================
   Set row swipe-to-delete + undo snackbar (set-edit-delete C2)
   APPEND-ONLY. The visual row moved from .set-row to .set-row-face
   (the sliding element); .set-row is now the clip track. Delete
   action sits behind the face and is revealed by sliding it left.
   ============================================================ */
.set-row-face {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  position: relative;            /* paints above the Delete action behind it */
  transform: translateX(0);
  transition: transform 0.18s ease, border-color 0.3s;
  touch-action: pan-y;           /* vertical scroll native; horizontal = JS swipe */
  will-change: transform;
}

.set-row.swiping .set-row-face { transition: none; }   /* follow the finger 1:1 */

.set-row-delete {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 88px;
  border: none;
  border-radius: var(--radius);
  background: var(--danger);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.set-row-delete:hover { background: var(--danger); }   /* override generic button:hover accent */

.set-row.removing {
  transition: max-height 0.2s ease, opacity 0.2s ease, margin 0.2s ease;
}

/* Undo snackbar — dark pill, theme-independent */
.snackbar {
  position: fixed;
  left: 50%;
  bottom: 76px;                  /* above the bottom tab nav */
  transform: translateX(-50%) translateY(12px);
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 92%;
  padding: 11px 18px;
  background: #23201c;
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .28);
  font-size: 0.88rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 1000;
}

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

.snackbar-action {
  background: transparent;
  border: none;
  padding: 0;
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.88rem;
}
.snackbar-action:hover { background: transparent; }    /* override generic button:hover accent */

/* C3: smooth the saved↔unsaved field flatten when an edit drops .set-saved */
.set-field input { transition: background-color 0.18s ease, border-color 0.18s ease; }

/* ============================================================
   Consent / identity surfaces (Phase 2 lane 3) — APPEND-ONLY.
   Shared by the AI-tab gate (M1), add-client capture (M2) and
   client-screen consent rows (M3). Token-driven: follows the
   active theme; signed-off structure from consent-mock frames.
   ============================================================ */
.ai-gate-loading {
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.consent-body { padding: 16px; }

.legal-flag {
  display: inline-block;
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 3px 8px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.consent-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px;
}
.consent-card h2 {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.consent-card p {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text);
}
.consent-card p + p { margin-top: 8px; }

.consent-sec-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin: 14px 0 6px;
}

.consent-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 10px;
}

.consent-body .btn-full + .btn-full { margin-top: 9px; }

.consent-stepper { display: flex; gap: 6px; margin-bottom: 12px; }
.consent-stepper i {
  height: 3px;
  flex: 1;
  border-radius: 999px;
  background: var(--border-subtle);
}
.consent-stepper i.on { background: var(--accent); }

.consent-chip {
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 4px 10px;
  flex-shrink: 0;
}
.consent-chip.granted { background: rgba(59, 130, 246, 0.12); color: var(--blue); }
.consent-chip.capture { background: var(--accent-subtle); color: var(--accent); }
.consent-chip.anon { background: var(--bg-raised); color: var(--text-muted); }

.consent-staterow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

/* Settings → Legal links (C4) */
.settings-legal-link {
  display: block;
  padding: 9px 0;
  color: var(--text);
  font-size: 0.92rem;
  text-decoration: none;
  border-bottom: 1px solid var(--border-subtle);
}
.settings-legal-link:last-of-type { border-bottom: none; }
.settings-legal-link:hover { color: var(--accent); }

/* Links inside consent cards (gate → privacy/terms) */
.consent-card a { color: var(--accent); }

/* ── iOS install hint (P6) — small dismissible pointer above the nav ── */
.ios-hint {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 64px;                /* clears the 52px bottom nav */
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 20px rgba(24, 22, 18, .14);
  font-size: 0.85rem;
  color: var(--text);
}
.ios-hint svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--accent); }
.ios-hint span { flex: 1; line-height: 1.4; }
.ios-hint button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
}
.ios-hint button:hover { background: transparent; color: var(--text); }

/* Inline per-row save error (P8 — zero-rep block) */
.set-row-error {
  font-size: 0.78rem;
  color: var(--danger);
  padding: 4px 10px 6px;
}

/* ── Plan import (I4) ─────────────────────────── */
/* J3: the import CTA must POP (Sarge x2: hard to find) — accent-tinted
   card with a real border and weight, distinct from every other button. */
.import-cta {
  background: var(--accent-subtle) !important;
  color: var(--accent) !important;
  border: 1.5px solid var(--accent) !important;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  padding: 13px;
}
.import-cta:hover { background: var(--accent) !important; color: var(--on-accent, #fff) !important; }
.import-body { padding: 16px; }
.import-sub { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; margin: 8px 0 10px; }
.import-body textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-raised);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  padding: 10px;
  resize: vertical;
}
.import-review-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 8px; }
.import-pills { display: flex; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.import-pill { font-size: 0.7rem; font-weight: 700; border-radius: 999px; padding: 4px 10px; }
.import-pill.ok { background: rgba(59, 130, 246, .12); color: var(--blue); }
.import-pill.flag { background: var(--accent-subtle); color: var(--accent); }
.import-day-title { font-size: 0.8rem; font-weight: 700; margin: 14px 0 4px; }
.import-ex-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.import-ex-row.flagged { background: var(--accent-subtle); border-radius: 8px; padding: 9px 8px; }
.import-ex-main { flex: 1; min-width: 0; }
.import-ex-name { font-size: 0.9rem; font-weight: 600; }
.import-ex-row.flagged .import-ex-name { color: var(--accent); }
.import-ex-detail { font-size: 0.76rem; color: var(--text-secondary); }
.import-conf { font-size: 0.64rem; font-weight: 700; border-radius: 999px; padding: 2px 7px; flex-shrink: 0; }
.import-conf.exact { background: rgba(59, 130, 246, .12); color: var(--blue); }
.import-conf.fuzzy { background: var(--bg-raised); color: var(--text-secondary); }
.import-ex-row select {
  max-width: 130px;
  font-size: 0.75rem;
  padding: 5px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
}
.import-done { text-align: center; padding: 28px 8px; }
.import-done h2 { font-size: 1.15rem; margin-bottom: 8px; }
.import-done p { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 16px; }

/* Plan target hint on imported set rows (display-only) */
.set-target-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 2px 10px 4px;
}

/* ── Check-in cadence selector (P7, frame b) ──── */
.cadence-sub { font-size: 0.78rem; color: var(--text-secondary); margin: 2px 0 10px; line-height: 1.5; }
.cadence-seg {
  display: flex;
  background: var(--bg-raised);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}
.cadence-seg button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 0;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}
.cadence-seg button.on {
  background: var(--bg-card);
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(24, 22, 18, .10);
}
.cadence-seg button:hover { background: var(--bg-card); }

/* ── Calendar (batch2 v2) — CONTRAST-FIRST (Sarge: white buttons on a
   white background with dim fonts — look at it). The grid lives on ONE
   card with a real border + shadow; cells are clearly bounded; numbers
   are full-ink and bold; today gets an accent ring; selected is solid
   accent. Verified by screenshot before shipping. ── */
.calendar-screen .app-header h1 { font-size: 1.05rem; }

.cal-toggle {
  display: flex;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
  margin-bottom: 12px;
}
.cal-toggle button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px 0;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
}
.cal-toggle button.on {
  background: var(--accent);
  color: var(--on-accent, #fff);
  box-shadow: 0 1px 6px rgba(24, 22, 18, .18);
}

.cal-strip, .cal-month {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 14px;
  box-shadow: 0 2px 10px rgba(24, 22, 18, .07);
}
.cal-month { margin-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; border-top: none; }
.cal-month-dows {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 14px 14px 0 0;
  padding: 8px 10px 2px;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text);
}

.cal-day, .cal-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 0 5px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  color: var(--text);
  min-height: 40px;
}
.cal-cell.blank { background: transparent; border: none; cursor: default; }
.cal-day .cal-dow { font-size: 0.64rem; font-weight: 800; text-transform: uppercase; color: var(--text); opacity: .75; }
.cal-day .cal-num, .cal-cell .cal-num { font-size: 1rem; font-weight: 800; color: var(--text); }
.cal-day.today, .cal-cell.today { border: 2px solid var(--accent); }
.cal-day.today .cal-num, .cal-cell.today .cal-num { color: var(--accent); }
.cal-day.on, .cal-cell.on { background: var(--accent); border-color: var(--accent); }
.cal-day.on .cal-num, .cal-day.on .cal-dow, .cal-cell.on .cal-num { color: var(--on-accent, #fff); }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.cal-day.on .cal-dot, .cal-cell.on .cal-dot { background: var(--on-accent, #fff); }

.cal-day-head {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
  margin-bottom: 6px;
}
.cal-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.cal-session {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-weight: 500;
  box-shadow: 0 1px 6px rgba(24, 22, 18, .06);
}
.cal-session.done { border-left-color: var(--blue); }
.cal-session:hover { border-color: var(--accent); background: var(--bg-card); }
.cal-session .cal-time { font-size: 0.85rem; font-weight: 800; min-width: 64px; color: var(--text); }
.cal-session.done .cal-time { color: var(--blue); }
.cal-session .cal-client { flex: 1; font-size: 0.97rem; font-weight: 700; }
.cal-session .cal-meta { font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); }
.cal-session .cal-meta b { color: var(--blue); }
.cal-pick-label { font-size: 0.85rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }

/* Settings tabs (batch2 — Sarge: one long ugly scroll) */
/* Settings sidebar (Sarge: "maybe just a sidebar" — his order: Style /
   Data / Legal / Account / Help / Tour). Rail left, panels right. */
.settings-layout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.settings-side {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 0 96px;
  position: sticky;
  top: 8px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 5px;
}
.settings-side button {
  border: none;
  background: transparent;
  padding: 10px 8px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
}
.settings-side button.on {
  background: var(--accent);
  color: var(--on-accent, #fff);
  box-shadow: 0 1px 6px rgba(24, 22, 18, .18);
}
.settings-layout .settings-body { flex: 1; min-width: 0; }

/* Help panel */
.help-item { margin-bottom: 14px; }
.help-item h3 { font-size: 0.9rem; margin: 0 0 3px; color: var(--accent); }
.help-item p { font-size: 0.85rem; color: var(--text-secondary); margin: 0; line-height: 1.45; }

/* What's-new sheet */
.wn-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0, 0, 0, .55);
  display: flex; align-items: flex-end; justify-content: center;
}
.wn-sheet {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  width: 100%; max-width: 480px;
  max-height: 78vh; overflow-y: auto;
}
.wn-sheet h2 { margin: 0 0 12px; }
.wn-item { margin-bottom: 12px; }
.wn-item h3 { font-size: 0.92rem; margin: 0 0 2px; color: var(--accent); }
.wn-item p { font-size: 0.85rem; color: var(--text-secondary); margin: 0; line-height: 1.45; }
.wn-close { margin-top: 6px; }

/* Guided tour — spotlight cutout + floating card */
.tour-overlay { position: fixed; inset: 0; z-index: 300; }
.tour-spot {
  position: fixed;
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .62);
  border: 2px solid var(--accent);
  transition: all .25s ease;
  pointer-events: none;
}
.tour-card {
  position: fixed;
  left: 16px; right: 16px;
  max-width: 440px; margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
}
.tour-card h3 { margin: 0 0 4px; color: var(--accent); }
.tour-card p { margin: 0 0 10px; font-size: 0.88rem; color: var(--text-secondary); line-height: 1.45; }
.tour-btns { display: flex; align-items: center; justify-content: space-between; }
.tour-count { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; }
.tour-skip {
  background: transparent; border: none; color: var(--text-muted);
  font-size: 0.85rem; font-weight: 600; cursor: pointer; padding: 8px 10px;
}
.tour-next {
  background: var(--accent); color: var(--on-accent, #fff);
  border: none; border-radius: 9px; padding: 8px 18px;
  font-weight: 700; cursor: pointer;
}

/* AI voice picker (batch2) */
.voice-list { display: flex; flex-direction: column; gap: 6px; }
.voice-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  color: var(--text);
}
.voice-row.on { border: 2px solid var(--accent); background: var(--accent-subtle); }
.voice-row .voice-name { font-size: 0.9rem; font-weight: 700; }
.voice-row.on .voice-name { color: var(--accent); }
.voice-row .voice-sub { font-size: 0.72rem; color: var(--text-secondary); }

/* AI action proposal card (batch2 — propose/Approve/Reject) */
.ai-action-card { border: 2px solid var(--accent) !important; }
.ai-action-card ul { margin: 6px 0 4px 18px; font-size: 0.86rem; }
.ai-action-note { font-size: 0.74rem; color: var(--text-secondary); }
.ai-action-btns { display: flex; gap: 8px; margin-top: 8px; }
.ai-action-btns button {
  flex: 1; border: none; border-radius: 10px; padding: 9px 0;
  font-weight: 700; font-size: 0.88rem; cursor: pointer;
}
.ai-approve { background: var(--accent); color: var(--on-accent, #fff); }
.ai-reject { background: var(--bg-raised); color: var(--text); border: 1px solid var(--border) !important; }

/* Mic button on the AI input row */
.ai-input-actions { display: flex; gap: 8px; align-items: stretch; }
.ai-mic {
  flex: 0 0 46px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.ai-mic.mic-mode {
  border: 2px solid var(--accent);
  color: var(--accent);
}
.ai-mic.listening {
  background: var(--accent);
  color: var(--on-accent, #fff);
  border-color: var(--accent);
  animation: mic-pulse 1.2s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-subtle); }
  50% { box-shadow: 0 0 0 7px var(--accent-subtle); }
}
.consent-staterow .consent-statetext { flex: 1; min-width: 0; }
.consent-staterow .cs-title { font-size: 0.9rem; font-weight: 600; }
.consent-staterow .cs-sub { font-size: 0.78rem; color: var(--text-secondary); margin-top: 1px; }
