/* ==============================================================
   Flexecution Web — Design System
   ============================================================== */

:root {
  /* Brand */
  --fire: #ff5500;
  --fire-light: #ff8040;
  --fire-dark: #d04400;
  --amber: #ffaa00;
  --amber-light: #ffcc44;

  /* Surfaces */
  --bg: #0a0a0a;
  --panel: #141414;
  --panel-2: #1a1a1a;
  --panel-3: #222;
  --border: #242424;
  --border-strong: #333;

  /* Text */
  --text: #e8e8e8;
  --text-dim: #999;
  --text-dimmer: #666;
  --text-faint: #444;

  /* Status */
  --green: #4ade80;
  --green-bg: rgba(74, 222, 128, 0.10);
  --red: #ff5566;
  --red-bg: rgba(255, 85, 102, 0.10);
  --blue: #5fa8ff;
  --purple: #b888ff;

  /* Accent variants — match iOS WorkoutType colors */
  --type-strength: #5fa8ff;
  --type-cardio: #ff5566;
  --type-flexibility: #4ade80;
  --type-custom: #b888ff;

  /* Fonts */
  --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', system-ui, sans-serif;
  --mono: 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;

  /* Layout */
  --sidebar-w: 240px;
  --topbar-h: 56px;
  --content-max: 1100px;

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-fire: 0 4px 14px rgba(255, 85, 0, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
input, textarea, select { outline: none; }
a { color: inherit; text-decoration: none; }

/* ==============================================================
   Buttons
   ============================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
  user-select: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

.btn-primary {
  background: linear-gradient(135deg, var(--fire) 0%, var(--fire-dark) 100%);
  color: white;
}
.btn-primary:hover { box-shadow: var(--shadow-fire); }

.btn-secondary {
  background: var(--panel-2);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--panel-3); border-color: var(--border-strong); }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
}
.btn-ghost:hover { background: var(--panel-2); color: var(--text); }

.btn-danger {
  background: rgba(255, 85, 102, 0.1);
  color: var(--red);
  border-color: rgba(255, 85, 102, 0.3);
}
.btn-danger:hover { background: rgba(255, 85, 102, 0.2); }

.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-lg { padding: 14px 24px; font-size: 1rem; }
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--r-md);
}

/* ==============================================================
   Form inputs
   ============================================================== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 0.72rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}
.input, .textarea, .select {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.15s, background 0.15s;
  width: 100%;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: rgba(255, 85, 0, 0.5);
  background: var(--panel);
}
.textarea { resize: vertical; min-height: 80px; line-height: 1.5; font-family: var(--sans); }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.input-num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ==============================================================
   Badges
   ============================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-fire { background: rgba(255, 85, 0, 0.12); color: var(--fire-light); border-color: rgba(255, 85, 0, 0.3); }
.badge-amber { background: rgba(255, 170, 0, 0.10); color: var(--amber); border-color: rgba(255, 170, 0, 0.3); }
.badge-green { background: var(--green-bg); color: var(--green); border-color: rgba(74, 222, 128, 0.3); }
.badge-red { background: var(--red-bg); color: var(--red); border-color: rgba(255, 85, 102, 0.3); }
.badge-blue { background: rgba(95, 168, 255, 0.10); color: var(--blue); border-color: rgba(95, 168, 255, 0.3); }
.badge-purple { background: rgba(184, 136, 255, 0.10); color: var(--purple); border-color: rgba(184, 136, 255, 0.3); }
.badge-muted { background: var(--panel-2); color: var(--text-dim); border-color: var(--border); }

/* ==============================================================
   Cards / surfaces
   ============================================================== */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.card-pad { padding: 20px; }
.card-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.card-title { font-size: 1rem; font-weight: 600; }

.card-clickable { cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.card-clickable:hover { border-color: var(--border-strong); background: var(--panel-2); }

/* ==============================================================
   Layout
   ============================================================== */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #080808;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand {
  padding: 20px 18px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-brand .logo {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--amber), var(--fire));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #0a0a0a;
  font-size: 0.95rem;
}
.sidebar-brand .name {
  font-weight: 700;
  font-size: 1rem;
  background: linear-gradient(135deg, var(--amber), var(--fire));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.3px;
}
.sidebar-nav { padding: 12px 8px; flex: 1; overflow-y: auto; }
.sidebar-nav .nav-section-label {
  font-size: 0.65rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 14px 12px 6px;
  font-weight: 600;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  color: var(--text-dim);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  margin-bottom: 1px;
}
.nav-item:hover { color: var(--text); background: var(--panel); }
.nav-item.active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(255,85,0,0.12), rgba(255,170,0,0.04));
  border: 1px solid rgba(255, 85, 0, 0.18);
  padding: 8px 11px;
}
.nav-item .icon { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85; }

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--border);
}
.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  background: var(--panel);
  border: 1px solid var(--border);
}
.user-pill .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--fire), var(--amber));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: #0a0a0a;
  flex-shrink: 0;
}
.user-pill .info { min-width: 0; flex: 1; }
.user-pill .info .name { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-pill .info .sub { font-size: 0.7rem; color: var(--text-dimmer); }

/* Main area */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  backdrop-filter: blur(10px);
}
.topbar .crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 0.9rem;
  flex: 1;
  min-width: 0;
}
.topbar .crumbs .sep { opacity: 0.4; }
.topbar .crumbs .current { color: var(--text); font-weight: 600; }

.content {
  flex: 1;
  padding: 28px 32px 60px;
  max-width: var(--content-max);
  margin: 0 auto;
  width: 100%;
}

/* ==============================================================
   Page headers
   ============================================================== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header h1 {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.page-header .sub {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-top: 4px;
}
.page-actions { display: flex; gap: 8px; }

/* Section headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 24px 0 12px;
  gap: 12px;
}
.section-header h2 {
  font-size: 0.78rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}

/* ==============================================================
   Stats grid
   ============================================================== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
}
.stat .label {
  font-size: 0.7rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}
.stat .value {
  font-size: 1.7rem;
  font-weight: 700;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.stat .value .unit { font-size: 0.85rem; color: var(--text-dim); font-weight: 500; margin-left: 4px; }
.stat .delta { font-size: 0.78rem; color: var(--text-dim); margin-top: 2px; }
.stat .delta.up { color: var(--green); }
.stat .delta.down { color: var(--red); }

/* ==============================================================
   Workout card / list
   ============================================================== */
.workout-list { display: flex; flex-direction: column; gap: 8px; }
.workout-row {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.workout-row:hover { border-color: var(--border-strong); background: var(--panel-2); }
.workout-row .icon-bubble {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--panel-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.workout-row.t-strength .icon-bubble { background: rgba(95, 168, 255, 0.15); color: var(--type-strength); }
.workout-row.t-cardio .icon-bubble { background: rgba(255, 85, 102, 0.15); color: var(--type-cardio); }
.workout-row.t-flexibility .icon-bubble { background: rgba(74, 222, 128, 0.15); color: var(--type-flexibility); }
.workout-row.t-custom .icon-bubble { background: rgba(184, 136, 255, 0.15); color: var(--type-custom); }
.workout-row .meta { min-width: 0; }
.workout-row .meta .name { font-weight: 600; font-size: 0.98rem; }
.workout-row .meta .sub {
  color: var(--text-dim);
  font-size: 0.82rem;
  margin-top: 2px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.workout-row .meta .sub > span:not(:last-child)::after {
  content: '·';
  margin-left: 10px;
  opacity: 0.5;
}
.workout-row .right { text-align: right; color: var(--text-dim); font-size: 0.85rem; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }

/* ==============================================================
   Workout detail / editor
   ============================================================== */
.workout-detail { display: flex; flex-direction: column; gap: 16px; }
.exercise-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.exercise-card-header {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
}
.exercise-card-header .ex-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--panel-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.exercise-card-header .ex-meta { flex: 1; min-width: 0; }
.exercise-card-header .ex-meta .name { font-weight: 600; font-size: 1rem; }
.exercise-card-header .ex-meta .type { font-size: 0.76rem; color: var(--text-dim); margin-top: 1px; }
.exercise-card-header .ex-actions { display: flex; gap: 4px; }

.set-grid {
  display: grid;
  align-items: center;
  gap: 6px 8px;
  padding: 12px 18px;
  font-size: 0.92rem;
}
.set-grid.viewing { grid-template-columns: 32px 1fr 32px; }
.set-grid.editing { grid-template-columns: 32px 1fr auto auto auto auto auto; }
.set-grid .header-row {
  font-size: 0.65rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dimmer);
  font-weight: 600;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.set-grid .col-num { text-align: center; color: var(--text-dim); font-family: var(--mono); }
.set-grid .col-val { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.set-grid .col-check { text-align: center; }
.set-grid .check-toggle {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-size: 0.85rem;
}
.set-grid .check-toggle:hover { border-color: var(--text-dim); }
.set-grid .check-toggle.checked {
  background: var(--green-bg);
  border-color: var(--green);
  color: var(--green);
}

/* Base mini-input — used in set editor, program builder, calendar, etc. */
.input-mini {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.input-mini:focus { border-color: rgba(255, 85, 0, 0.5); }
.input-mini::placeholder { color: var(--text-dimmer); }

/* Native select gets the same dark treatment + custom chevron */
select.input-mini {
  font-family: var(--sans);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 22px;
  cursor: pointer;
}

/* Set editor: numeric inputs right-aligned, fixed width */
.set-grid .input-mini {
  text-align: right;
  width: 70px;
}
.set-grid select.input-mini {
  text-align: left;
  width: 100%;
}

.exercise-card-footer {
  padding: 8px 16px;
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--border);
}

/* Add exercise / set buttons */
.add-stub {
  border: 1.5px dashed var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  text-align: center;
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  font-weight: 500;
  font-size: 0.92rem;
}
.add-stub:hover {
  border-color: var(--fire);
  color: var(--fire-light);
  background: rgba(255, 85, 0, 0.04);
}

/* ==============================================================
   Empty states
   ============================================================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}
.empty-state .em-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 14px;
}
.empty-state h3 { color: var(--text); font-size: 1.1rem; font-weight: 600; margin-bottom: 4px; }
.empty-state p { font-size: 0.9rem; margin-bottom: 18px; }

/* ==============================================================
   Modals
   ============================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.15s;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalUp 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  box-shadow: var(--shadow-md);
}
.modal-lg { max-width: 720px; }
.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h2 { font-size: 1.05rem; font-weight: 600; }
.modal-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--panel-2);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalUp {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==============================================================
   Exercise picker
   ============================================================== */
.picker-search {
  position: sticky;
  top: 0;
  background: var(--panel);
  padding: 0 0 12px;
  margin-bottom: 8px;
  z-index: 2;
}
.picker-section { margin-bottom: 14px; }
.picker-section h4 {
  font-size: 0.7rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 6px;
  padding: 0 4px;
}
.picker-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 0.12s;
}
.picker-row:hover { background: var(--panel-2); }
.picker-row .pi { font-size: 1.1rem; opacity: 0.8; width: 22px; text-align: center; }
.picker-row .pn { flex: 1; font-size: 0.92rem; }
.picker-row .pt { font-size: 0.72rem; color: var(--text-dim); }

/* ==============================================================
   Toast
   ============================================================== */
.toast-region {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 10px 16px;
  font-size: 0.88rem;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.18s ease-out;
}
.toast-success { border-color: rgba(74, 222, 128, 0.4); }
.toast-error { border-color: rgba(255, 85, 102, 0.4); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ==============================================================
   Landing / sign-in
   ============================================================== */
.landing {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 85, 0, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255, 170, 0, 0.05) 0%, transparent 40%),
    var(--bg);
}
.landing-card {
  width: 100%;
  max-width: 440px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 36px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.landing-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--amber), var(--fire));
}
.landing-card .big-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  background: linear-gradient(135deg, var(--amber), var(--fire));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #0a0a0a;
  font-size: 1.6rem;
  box-shadow: 0 8px 30px rgba(255, 85, 0, 0.3);
}
.landing-card h1 {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--amber), var(--fire));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}
.landing-card .lead { color: var(--text-dim); font-size: 0.95rem; margin-bottom: 28px; }

.siwa-btn {
  width: 100%;
  background: white;
  color: black;
  border-radius: 10px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s;
}
.siwa-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(255,255,255,0.15); }
.siwa-btn .apple-mark { font-size: 1.2rem; line-height: 1; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--text-dimmer);
  font-size: 0.78rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.demo-btn {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  border-radius: 10px;
  padding: 11px 18px;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
}
.demo-btn:hover { color: var(--text); border-color: var(--text-dim); background: var(--panel-2); }
/* Promoted to primary CTA on the public demo build (no iCloud sign-in path). */
.demo-btn.primary {
  background: linear-gradient(135deg, var(--fire) 0%, var(--fire-dark) 100%);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}
.demo-btn.primary:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--fire-light) 0%, var(--fire) 100%);
  box-shadow: var(--shadow-fire);
}

.landing-foot {
  margin-top: 26px;
  font-size: 0.78rem;
  color: var(--text-dimmer);
  line-height: 1.6;
}
.landing-foot a { color: var(--fire-light); }

/* ==============================================================
   Bottom tabs (mobile)
   ============================================================== */
.bottom-tabs {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(8, 8, 8, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  z-index: 50;
  justify-content: space-around;
}
.bottom-tabs .tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  color: var(--text-dim);
  font-size: 0.7rem;
  border-radius: 8px;
  flex: 1;
  cursor: pointer;
}
.bottom-tabs .tab.active { color: var(--fire-light); }
.bottom-tabs .tab .icon { width: 22px; height: 22px; }

/* ==============================================================
   Responsive
   ============================================================== */
@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .bottom-tabs { display: flex; }
  .content { padding: 20px 16px 100px; }
  .topbar { padding: 0 16px; }
  .page-header h1 { font-size: 1.5rem; }
}

/* Phone-specific tightening */
@media (max-width: 600px) {
  /* Page header: stack actions below title */
  .page-header { flex-direction: column; align-items: stretch; gap: 12px; }
  .page-actions { flex-wrap: wrap; }
  .page-actions .btn { flex: 1 1 auto; min-width: 0; }

  /* Workout-row stays horizontal but tighter */
  .workout-row { padding: 12px 14px; gap: 12px; }
  .workout-row .meta .sub { font-size: 0.78rem; gap: 8px; }
  .workout-row .right { font-size: 0.78rem; }

  /* Cards: less padding */
  .card-pad { padding: 16px; }
  .card-header { padding: 14px 16px; }

  /* Stats: smaller */
  .stat { padding: 12px 14px; }
  .stat .value { font-size: 1.3rem; }
  .stats { gap: 8px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }

  /* Editor set grid: scroll horizontally instead of squeezing */
  .set-grid {
    overflow-x: auto;
    /* Force inputs to keep readable size on phone */
  }
  .set-grid.editing .input-mini { width: 64px; }
  .exercise-card-header { padding: 12px 14px; }
  .exercise-card-footer { padding: 8px 12px; }

  /* Modal: full-screen-ish on phone */
  .modal { max-height: calc(100vh - 32px); border-radius: 14px; }
  .modal-header { padding: 14px 16px; }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 12px 16px; }

  /* Topbar smaller crumbs */
  .topbar .crumbs { font-size: 0.82rem; }
  .topbar .crumbs .current { font-size: 0.85rem; }

  /* Section headers smaller */
  .section-header { margin: 18px 0 10px; }

  /* Empty state more compact */
  .empty-state { padding: 36px 16px; }

  /* Builder sections smaller padding */
  .builder-section-body { padding: 14px; }
  .day-toggles { gap: 4px; }
  .day-toggle { padding: 8px 2px; font-size: 0.75rem; }
  .prog-row { grid-template-columns: 1fr 130px 80px; gap: 6px; padding: 8px 10px; }
}

/* iOS safe-area insets — when installed as PWA */
@supports (padding: max(0px)) {
  .bottom-tabs { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .topbar { padding-top: env(safe-area-inset-top); height: calc(var(--topbar-h) + env(safe-area-inset-top)); }
  body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
}

/* ==============================================================
   Utilities
   ============================================================== */
.row { display: flex; gap: 12px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 12px; }
.gap-sm { gap: 8px !important; }
.gap-lg { gap: 20px !important; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.text-dim { color: var(--text-dim); }
.text-dimmer { color: var(--text-dimmer); }
.text-fire { color: var(--fire-light); }
.text-amber { color: var(--amber); }
.text-green { color: var(--green); }
.text-mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.78rem; }
.text-lg { font-size: 1.1rem; }
.text-bold { font-weight: 600; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ==============================================================
   Active workout mode
   ============================================================== */
.active-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.active-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 14px;
  border-bottom: 1px solid var(--border);
}
.active-header .active-title { flex: 1; min-width: 0; text-align: center; }
.active-header .active-title .name {
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.active-header .active-title .sub {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.active-nav {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 4px 0 12px;
}
.active-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--panel-2);
  border: 1.5px solid var(--border-strong);
  cursor: pointer;
  padding: 0;
  transition: all 0.15s;
}
.active-dot:hover { border-color: var(--text-dim); }
.active-dot.on {
  background: var(--fire);
  border-color: var(--fire);
  transform: scale(1.2);
}
.active-dot.done {
  background: var(--green);
  border-color: var(--green);
}
.active-dot.on.done {
  background: var(--green);
  border-color: var(--fire);
  box-shadow: 0 0 0 2px rgba(255, 85, 0, 0.3);
}

.active-exercise {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.active-ex-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(255,85,0,0.06), transparent);
}
.active-ex-head .idx-pill {
  display: flex;
  align-items: baseline;
  gap: 2px;
  padding: 6px 11px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  font-family: var(--mono);
}
.active-ex-head .idx-pill .cur { font-size: 1.2rem; font-weight: 700; color: var(--fire-light); }
.active-ex-head .idx-pill .tot { font-size: 0.85rem; color: var(--text-dim); }
.active-ex-head .name { font-size: 1.35rem; font-weight: 700; line-height: 1.15; }
.active-ex-head .type {
  font-size: 0.78rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 4px;
  font-weight: 600;
}
.active-ex-head .big-ex-emoji { font-size: 2rem; opacity: 0.85; }

.active-sets {
  display: flex;
  flex-direction: column;
}
.active-set {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.active-set:last-child { border-bottom: none; }
.active-set.done {
  background: rgba(74, 222, 128, 0.04);
}
.active-set .sn {
  font-family: var(--mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-dimmer);
  text-align: center;
}
.active-set .fields {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.big-input {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 90px;
}
.big-input .lbl {
  font-size: 0.65rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}
.big-input .inp {
  background: var(--panel-2);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 1.3rem;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text);
  width: 100%;
  text-align: center;
  outline: none;
  transition: border-color 0.15s;
}
.big-input .inp:focus { border-color: var(--fire); }
.big-static {
  flex: 1;
  min-width: 60px;
  padding: 14px 12px;
  background: var(--panel-2);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 1px;
}
.big-check {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 2.5px solid var(--border-strong);
  background: var(--panel-2);
  font-size: 1.6rem;
  color: var(--text-dimmer);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.big-check:hover { border-color: var(--text-dim); color: var(--text); }
.big-check.done {
  background: var(--green);
  border-color: var(--green);
  color: #0a0a0a;
  font-weight: 800;
  transform: scale(1.05);
}

.active-foot {
  padding: 16px 18px;
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--border);
  background: var(--panel-2);
}

/* Rest timer overlay */
.rest-overlay {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  pointer-events: none;
}
.rest-overlay.hidden { display: none; }
.rest-card {
  pointer-events: auto;
  background: var(--panel);
  border: 1px solid rgba(255, 85, 0, 0.4);
  border-radius: var(--r-xl);
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.6);
  animation: restPulse 0.3s ease-out;
}
.rest-card .rest-label {
  font-size: 0.7rem;
  letter-spacing: 2px;
  color: var(--fire-light);
  font-weight: 700;
}
.rest-card .rest-time {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  min-width: 90px;
}
@keyframes restPulse {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@media (max-width: 600px) {
  .active-set { padding: 12px 14px; gap: 10px; }
  .active-ex-head { padding: 14px 16px; }
  .big-check { width: 48px; height: 48px; font-size: 1.4rem; }
  .big-input .inp { font-size: 1.1rem; padding: 10px 10px; }
  .rest-card { padding: 10px 16px; }
  .rest-card .rest-time { font-size: 1.5rem; min-width: 70px; }
}

/* ==============================================================
   PR celebration
   ============================================================== */
.pr-celebration {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 0 4px;
}
.pr-burst {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 55%, rgba(255, 85, 0, 0.45), rgba(255, 170, 0, 0.18) 60%, transparent 80%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  position: relative;
  animation: prBurstIn 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
.pr-burst::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(255, 85, 0, 0.45);
  animation: prRing 1.4s ease-out infinite;
}
.pr-flame {
  color: #ff5500;
  filter: drop-shadow(0 0 12px rgba(255, 85, 0, 0.7));
  animation: prFlamePulse 1.4s ease-in-out infinite;
}
@keyframes prBurstIn {
  from { opacity: 0; transform: scale(0.4); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes prRing {
  0%   { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.5); opacity: 0; }
}
@keyframes prFlamePulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}

.pr-celebration .pr-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--amber), var(--fire));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 14px;
}
.pr-celebration .pr-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.pr-celebration .pr-row {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}
.pr-celebration .pr-ex {
  font-weight: 700;
  font-size: 0.95rem;
}
.pr-celebration .pr-vals {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.85rem;
}
.pr-celebration .pr-wr { color: var(--text); font-weight: 600; }
.pr-celebration .pr-e1rm { color: var(--text-dim); }
.pr-celebration .pr-delta {
  margin-left: auto;
  color: var(--green);
  font-weight: 600;
  font-family: var(--mono);
}

/* ==============================================================
   Today hero (Dashboard)
   ============================================================== */
.today-hero {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--fire);
  border-radius: var(--r-xl);
  padding: 18px 20px;
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.today-hero.next-up { background: linear-gradient(135deg, rgba(255, 170, 0, 0.04), var(--panel)); }
.today-hero.empty { background: var(--panel-2); border-style: dashed; opacity: 0.95; }
.today-hero .th-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 2px;
  color: var(--fire-light);
  font-weight: 700;
}
.today-hero.empty .th-eyebrow { color: var(--text-dimmer); }
.today-hero.next-up .th-eyebrow { color: var(--amber); }
.today-hero .th-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.today-hero .th-name {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.2;
}
.today-hero .th-meta {
  font-size: 0.88rem;
  margin-top: 4px;
}
.today-hero .th-meta a { text-decoration: none; }
.today-hero .th-meta a:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .today-hero { padding: 16px; }
  .today-hero .th-name { font-size: 1.15rem; }
  .today-hero .th-row > .row { width: 100%; }
}

/* ==============================================================
   Onboarding (empty-state) cards
   ============================================================== */
.onboard-explainer {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(255, 85, 0, 0.06), transparent 70%);
  border: 1px solid rgba(255, 85, 0, 0.18);
  border-radius: var(--r-lg);
  margin-bottom: 18px;
}
.onboard-explainer .oe-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 85, 0, 0.16);
  color: var(--fire-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.onboard-explainer .oe-icon svg { width: 22px; height: 22px; }
.onboard-explainer .oe-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.onboard-explainer .oe-body { color: var(--text-dim); font-size: 0.9rem; line-height: 1.5; }

.onboard-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.onboard-option {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.onboard-option:hover {
  border-color: var(--fire);
  transform: translateY(-2px);
}
.onboard-option .oo-step {
  font-size: 0.65rem;
  letter-spacing: 1.5px;
  color: var(--fire-light);
  font-weight: 700;
  margin-bottom: 4px;
}
.onboard-option .oo-title { font-size: 1rem; font-weight: 700; line-height: 1.2; }
.onboard-option .oo-body { color: var(--text-dim); font-size: 0.85rem; line-height: 1.45; }

/* ==============================================================
   Quick-progression dialog summary
   ============================================================== */
.quick-summary {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(255, 85, 0, 0.08), transparent);
  border: 1px solid rgba(255, 85, 0, 0.25);
  border-radius: var(--r-md);
}
.quick-summary .qs-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 100px;
}
.quick-summary .qs-num {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.quick-summary .qs-lbl {
  font-size: 0.7rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}

/* ==============================================================
   Tour / walkthrough
   ============================================================== */
.tour-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}
.tour-dim {
  position: fixed;
  background: rgba(0, 0, 0, 0.62);
  pointer-events: auto;
  transition: opacity 0.15s;
}
.tour-dim.full { inset: 0; }
.tour-ring {
  position: fixed;
  pointer-events: none;
  border: 2px solid var(--fire);
  border-radius: 10px;
  box-shadow:
    0 0 0 4px rgba(255, 85, 0, 0.18),
    0 0 32px rgba(255, 85, 0, 0.4);
  animation: tourRingPulse 1.6s ease-in-out infinite;
}
@keyframes tourRingPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255, 85, 0, 0.18), 0 0 32px rgba(255, 85, 0, 0.4); }
  50%      { box-shadow: 0 0 0 8px rgba(255, 85, 0, 0.10), 0 0 44px rgba(255, 85, 0, 0.55); }
}

.tour-card {
  position: fixed;
  z-index: 220;
  width: min(420px, calc(100vw - 24px));
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 18px 20px 14px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6);
  animation: tourCardIn 0.18s ease-out;
}
@keyframes tourCardIn {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.tour-card .tc-step {
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--fire-light);
  font-weight: 700;
  margin-bottom: 6px;
}
.tour-card .tc-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.tour-card .tc-body {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 14px;
}
.tour-card .tc-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==============================================================
   Welcome card (Dashboard, first-timer)
   ============================================================== */
.welcome-card {
  display: flex;
  align-items: stretch;
  gap: 18px;
  background: linear-gradient(135deg, rgba(255, 85, 0, 0.10), rgba(255, 170, 0, 0.04) 70%);
  border: 1px solid rgba(255, 85, 0, 0.3);
  border-radius: var(--r-xl);
  padding: 22px 24px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.welcome-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 50%, rgba(255, 85, 0, 0.12), transparent 60%);
  pointer-events: none;
}
.welcome-card .welcome-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 2px;
  color: var(--fire-light);
  font-weight: 700;
  margin-bottom: 4px;
}
.welcome-card .welcome-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 6px;
  background: linear-gradient(135deg, var(--amber), var(--fire));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.welcome-card .welcome-body {
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.5;
  max-width: 560px;
}
.welcome-card .welcome-art {
  width: 90px;
  flex-shrink: 0;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 85, 0, 0.4), transparent 70%),
    repeating-linear-gradient(135deg, transparent 0 8px, rgba(255, 85, 0, 0.08) 8px 9px);
  border-radius: var(--r-lg);
  position: relative;
}
.welcome-card .welcome-art::after {
  content: '?';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  font-weight: 800;
  color: rgba(255, 85, 0, 0.6);
}

@media (max-width: 600px) {
  .welcome-card { padding: 18px; flex-direction: column; }
  .welcome-card .welcome-art { display: none; }
  .welcome-card .welcome-title { font-size: 1.1rem; }
}

/* ==============================================================
   Voice modal / mic button
   ============================================================== */
.voice-fab {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--fire), var(--amber));
  color: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 85, 0, 0.4);
  z-index: 40;
  transition: transform 0.15s, box-shadow 0.15s;
  border: none;
}
.voice-fab:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 10px 28px rgba(255, 85, 0, 0.55); }
.voice-fab svg { width: 24px; height: 24px; }
.voice-fab.listening { animation: micPulse 1.2s infinite; }
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 85, 0, 0.55); }
  50% { box-shadow: 0 0 0 18px rgba(255, 85, 0, 0); }
}
@media (max-width: 880px) {
  .voice-fab { bottom: 80px; right: 18px; }
}

.voice-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.voice-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.voice-status.listening { border-color: rgba(255, 85, 0, 0.5); }
.voice-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-dimmer);
  flex-shrink: 0;
}
.voice-status.listening .voice-pulse {
  background: var(--fire);
  animation: dotPulse 1s ease-in-out infinite;
}
@keyframes dotPulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: 0.5; } }

.voice-transcript {
  min-height: 64px;
  padding: 14px 16px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 1.05rem;
  line-height: 1.4;
}
.voice-transcript.empty { color: var(--text-dimmer); font-style: italic; font-size: 0.92rem; }
.voice-transcript .interim { color: var(--text-dim); font-style: italic; }

.voice-history {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 4px;
}
.voice-event {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 0.85rem;
}
.voice-event.success { border-color: rgba(74, 222, 128, 0.3); }
.voice-event.fail { border-color: rgba(255, 85, 102, 0.3); }
.voice-event .ic { font-size: 0.95rem; flex-shrink: 0; }
.voice-event .said { color: var(--text-dim); font-style: italic; }
.voice-event .did { color: var(--text); }

.voice-help {
  font-size: 0.8rem;
  color: var(--text-dim);
  padding: 12px 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.voice-help h4 { color: var(--text); font-size: 0.85rem; margin-bottom: 6px; font-weight: 600; }
.voice-help code { color: var(--fire-light); font-family: var(--mono); font-size: 0.78rem; }
.voice-help ul { list-style: none; padding: 0; }
.voice-help li { padding: 3px 0; }

/* ==============================================================
   Program builder
   ============================================================== */
.builder-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 16px;
  overflow: hidden;
}
.builder-section-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel-2);
}
.builder-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--fire);
  color: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
  flex-shrink: 0;
}
.builder-section-header h3 { font-size: 1rem; font-weight: 600; }
.builder-section-body { padding: 18px; }

.day-toggles {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.day-toggle {
  padding: 10px 4px;
  border-radius: var(--r-md);
  background: var(--panel-2);
  border: 1px solid var(--border);
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-dim);
  transition: all 0.12s;
  user-select: none;
}
.day-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.day-toggle.on {
  background: linear-gradient(135deg, rgba(255, 85, 0, 0.18), rgba(255, 170, 0, 0.06));
  border-color: var(--fire);
  color: var(--fire-light);
}

.duration-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.duration-pill {
  padding: 8px 14px;
  border-radius: 20px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 500;
  transition: all 0.12s;
}
.duration-pill:hover { color: var(--text); border-color: var(--border-strong); }
.duration-pill.on { background: rgba(255, 85, 0, 0.12); border-color: var(--fire); color: var(--fire-light); }

.prog-row {
  display: grid;
  grid-template-columns: 1fr 160px 100px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.prog-row:last-child { border-bottom: none; }
.prog-row .ex-name { font-size: 0.92rem; }
.prog-row .ex-name .sub { font-size: 0.75rem; color: var(--text-dim); margin-top: 2px; }
.prog-row .input-mini { width: 90px; }

.preview-week {
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 0.86rem;
}
.preview-week:last-child { border-bottom: none; }
.preview-week .wk-num {
  font-family: var(--mono);
  color: var(--text-dim);
  font-size: 0.78rem;
  width: 60px;
  flex-shrink: 0;
}
.preview-week .wk-days { flex: 1; display: flex; gap: 6px; flex-wrap: wrap; }
.preview-week .wk-pill {
  padding: 3px 8px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.76rem;
  color: var(--text-dim);
}
.preview-week.deload .wk-pill { color: var(--amber); border-color: rgba(255, 170, 0, 0.3); }

/* Planned workout row */
.workout-row.planned { opacity: 0.85; border-style: dashed; }
.workout-row.planned .icon-bubble { opacity: 0.7; }

/* ==============================================================
   Coaching cards
   ============================================================== */
.coach-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}
.coach-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--panel);
}
.coach-card.kind-lagging {
  border-color: rgba(255, 170, 0, 0.4);
  background: linear-gradient(135deg, rgba(255, 170, 0, 0.08), var(--panel));
}
.coach-card.kind-ahead {
  border-color: rgba(74, 222, 128, 0.4);
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.08), var(--panel));
}
.coach-card .coach-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.coach-card.kind-lagging .coach-icon { background: rgba(255, 170, 0, 0.18); color: var(--amber); }
.coach-card.kind-ahead .coach-icon { background: rgba(74, 222, 128, 0.18); color: var(--green); }
.coach-card .coach-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.coach-card .coach-body {
  color: var(--text-dim);
  font-size: 0.86rem;
  line-height: 1.45;
  margin-bottom: 10px;
}
.coach-card .coach-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ==============================================================
   Goal cards
   ============================================================== */
.goal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.goal-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-left: 4px solid var(--amber);
}
.goal-card.status-achieved { border-left-color: var(--green); }
.goal-card.status-expired { border-left-color: var(--text-dimmer); opacity: 0.75; }
.goal-card .gc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.goal-card .gc-name { font-size: 1rem; font-weight: 700; }
.goal-card .gc-target { color: var(--text-dim); font-size: 0.82rem; margin-top: 2px; }
.goal-card .gc-pct { font-size: 1.4rem; font-weight: 800; color: var(--amber); }
.goal-card.status-achieved .gc-pct { color: var(--green); }
.goal-card .gc-bar {
  height: 6px;
  background: var(--panel-2);
  border-radius: 3px;
  overflow: hidden;
}
.goal-card .gc-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--amber), var(--fire));
  border-radius: 3px;
}
.goal-card.status-achieved .gc-bar-fill {
  background: var(--green);
}
.goal-card .gc-caption { font-size: 0.85rem; color: var(--text-dim); }
.goal-card .gc-actions { display: flex; gap: 6px; }

/* Goal-planner math card */
.goal-math {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(255, 85, 0, 0.08), transparent);
  border: 1px solid rgba(255, 85, 0, 0.25);
  border-radius: var(--r-md);
}
.goal-math-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 100px;
}
.goal-math-row .gm-num {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.goal-math-row .gm-lbl {
  font-size: 0.7rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}
.gm-lbl.difficulty {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  width: fit-content;
}
.gm-lbl.diff-low { background: rgba(74, 222, 128, 0.15); color: var(--green); }
.gm-lbl.diff-mid { background: rgba(255, 170, 0, 0.15); color: var(--amber); }
.gm-lbl.diff-hi  { background: rgba(255, 85, 102, 0.15); color: var(--red); }

/* ==============================================================
   Body entries
   ============================================================== */
.body-entry-row {
  display: grid;
  grid-template-columns: 140px 90px 70px 1fr;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  cursor: pointer;
  background: transparent;
  border-left: none;
  border-right: none;
  border-top: none;
  width: 100%;
  text-align: left;
  color: var(--text);
  font: inherit;
}
.body-entry-row:last-child { border-bottom: none; }
.body-entry-row:hover { background: var(--panel-2); }
.body-entry-row .be-date { font-size: 0.86rem; }
.body-entry-row .be-weight { font-weight: 700; font-size: 0.95rem; }
.body-entry-row .be-bf { font-size: 0.82rem; }
.body-entry-row .be-notes {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-style: italic;
}

@media (max-width: 600px) {
  .goal-grid { grid-template-columns: 1fr; }
  .body-entry-row { grid-template-columns: 1fr auto; gap: 6px; padding: 12px 14px; }
  .body-entry-row .be-date { grid-column: 1; grid-row: 1; }
  .body-entry-row .be-weight { grid-column: 2; grid-row: 1; }
  .body-entry-row .be-bf { grid-column: 2; grid-row: 2; text-align: right; }
  .body-entry-row .be-notes { grid-column: 1 / -1; grid-row: 3; }
}

/* ==============================================================
   Program projections (Progress page)
   ============================================================== */
.projection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.projection-card {
  --p-color: var(--fire);
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--p-color);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.projection-card .pc-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.projection-card .pc-name {
  font-size: 1.05rem;
  font-weight: 700;
}
.projection-card .pc-program {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-decoration: none;
  margin-top: 2px;
  display: inline-block;
}
.projection-card .pc-program:hover { color: var(--p-color); }
.projection-card .pc-pct {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--p-color);
  font-variant-numeric: tabular-nums;
}
.projection-card .pc-track {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.projection-card .pc-stop {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  text-align: center;
}
.projection-card .pc-stop.next {
  border-color: rgba(255, 85, 0, 0.4);
  background: linear-gradient(135deg, rgba(255, 85, 0, 0.1), var(--panel-2));
}
.projection-card .pc-stop .lbl {
  font-size: 0.65rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 4px;
}
.projection-card .pc-stop .val {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.projection-card .pc-stop .delta {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 2px;
  font-family: var(--mono);
}
.projection-card .pc-stop .delta.up { color: var(--green); }

.projection-card .pc-bar {
  height: 8px;
  background: var(--panel-2);
  border-radius: 4px;
  overflow: hidden;
}
.projection-card .pc-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease-out;
}
.projection-card .pc-caption {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.4;
}

@media (max-width: 600px) {
  .projection-grid { grid-template-columns: 1fr; }
  .projection-card .pc-track { grid-template-columns: 1fr 1fr 1fr; }
  .projection-card .pc-stop { padding: 8px 6px; }
  .projection-card .pc-stop .val { font-size: 0.95rem; }
}

/* ==============================================================
   Program cards
   ============================================================== */
.program-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.program-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--r-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
  color: var(--text);
  text-decoration: none;
}
.program-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.program-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.program-card .name { font-weight: 700; font-size: 1.02rem; line-height: 1.2; }
.program-card .sub { color: var(--text-dim); font-size: 0.78rem; margin-top: 2px; }
.program-card-foot {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-dim);
}
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--panel-2);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.2s;
}

/* Program detail — week schedule */
.week-row {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.week-row.deload .week-label .wd { color: var(--amber); }
.week-row .week-label {
  width: 90px;
  flex-shrink: 0;
}
.week-row .week-label .wn { font-weight: 700; font-size: 0.92rem; }
.week-row .week-label .wd { font-size: 0.72rem; color: var(--text-dim); }
.week-row .week-days {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.day-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 7px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 64px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--mono);
  transition: border-color 0.15s, background 0.15s;
}
.day-pill:hover { border-color: var(--text-dim); }
.day-pill.done { background: rgba(74, 222, 128, 0.08); border-color: rgba(74, 222, 128, 0.3); }
.day-pill .dn { font-size: 0.66rem; color: var(--text-dim); letter-spacing: 1px; text-transform: uppercase; }
.day-pill .dd { font-size: 0.85rem; font-weight: 600; margin-top: 2px; }
.day-pill .dv { font-size: 0.68rem; color: var(--text-dim); margin-top: 1px; }

/* ==============================================================
   Calendar — month view
   ============================================================== */
.cal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.cal-month {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.cal-dow {
  background: var(--panel-2);
  padding: 8px 6px;
  font-size: 0.68rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  text-align: center;
}
.cal-day {
  background: var(--panel);
  min-height: 92px;
  padding: 6px 8px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background 0.12s;
  position: relative;
}
.cal-day:hover { background: var(--panel-2); }
.cal-day.out { background: #0f0f0f; opacity: 0.55; }
.cal-day.out:hover { opacity: 0.8; }
.cal-day.today {
  outline: 2px solid var(--fire);
  outline-offset: -2px;
  z-index: 1;
}
.cal-day.today .cal-date {
  background: var(--fire);
  color: #0a0a0a;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.cal-date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cal-day.out .cal-date { color: var(--text-dimmer); }
.cal-chips {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.cal-chip {
  --chip-color: var(--fire);
  background: color-mix(in srgb, var(--chip-color) 14%, var(--panel-2));
  border-left: 3px solid var(--chip-color);
  font-size: 0.7rem;
  padding: 2px 5px;
  border-radius: 3px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.cal-chip.planned { opacity: 0.75; font-style: italic; }
.cal-chip.done { background: color-mix(in srgb, var(--chip-color) 26%, var(--panel-2)); font-weight: 600; }
.cal-chip.more { background: var(--panel-3); border-left: none; color: var(--text-dim); font-size: 0.66rem; padding-left: 5px; }

.cal-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text);
  text-decoration: none;
}
.cal-legend-item:hover { color: var(--fire-light); }
.cal-legend-item .swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* ==============================================================
   Calendar — year view
   ============================================================== */
.year-months {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.year-month {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.year-month:hover {
  border-color: var(--fire);
}
.year-month .ym-name {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.year-month .ym-cells {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.year-month .ym-cell {
  aspect-ratio: 1;
  border-radius: 2px;
  background: #1a1a1a;
}
.year-month .ym-cell.pad { background: transparent; }
.year-month .ym-cell.today { outline: 1.5px solid var(--fire); outline-offset: 0; }

@media (max-width: 600px) {
  .cal-day { min-height: 64px; padding: 4px 5px 6px; }
  .cal-chip { font-size: 0.65rem; padding: 1px 4px; }
  .cal-dow { font-size: 0.6rem; padding: 6px 2px; letter-spacing: 1px; }
  .week-row { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 0; }
  .week-row .week-label { width: 100%; }
  .day-pill { min-width: 56px; padding: 6px 8px; }
  .program-grid { grid-template-columns: 1fr; }
}

/* Toggle group (filter pills) */
.toggle-group {
  display: inline-flex;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 3px;
  gap: 2px;
}
.toggle-group .tg-item {
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 0.85rem;
  color: var(--text-dim);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.12s;
  background: transparent;
  border: none;
}
.toggle-group .tg-item:hover { color: var(--text); }
.toggle-group .tg-item.on {
  background: var(--fire);
  color: #0a0a0a;
}

/* PWA install banner — dismissible prompt to install the app */
.install-banner {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 150;
  width: calc(100% - 32px);
  max-width: 520px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
}
.install-banner-msg { flex: 1; font-size: 13px; color: var(--text); line-height: 1.35; }
.install-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }
@media (max-width: 600px) {
  .install-banner { bottom: 76px; } /* clear the mobile tab bar */
}

/* ===== Onboarding: first-run welcome (flow map + sample-data choice) ===== */
.ob-scrim {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,.62); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.ob-modal {
  width: 600px; max-width: 100%;
  background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: var(--r-xl); box-shadow: var(--shadow-md);
  padding: 28px 32px;
}
.ob-modal h2 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.ob-sub { color: var(--text-dim); font-size: 14px; margin: 7px 0 18px; max-width: 440px; }
.ob-dots { display: flex; align-items: center; gap: 7px; margin-bottom: 16px; }
.ob-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); }
.ob-dot.on { background: var(--fire); width: 20px; border-radius: 4px; }
.ob-dots-lbl { margin-left: 6px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-dimmer); font-weight: 700; }
.ob-flowmap { display: flex; align-items: stretch; gap: 0; margin: 4px 0 6px; }
.ob-fm-node { flex: 1; background: var(--panel-2); border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 14px 12px; text-align: center; }
.ob-fm-node.start { border-color: var(--fire-dark); }
.ob-fm-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--panel-3); display: flex; align-items: center; justify-content: center; font-size: 18px; margin: 0 auto 9px; }
.ob-fm-node.start .ob-fm-ico { background: rgba(255,85,0,.18); }
.ob-fm-tt { font-weight: 700; font-size: 13px; }
.ob-fm-bd { font-size: 11px; color: var(--text-dim); margin-top: 3px; line-height: 1.35; }
.ob-fm-tag { display: inline-block; margin-top: 8px; font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; color: var(--text-dim); background: var(--panel-3); border: 1px solid var(--border); border-radius: 5px; padding: 2px 6px; }
.ob-fm-arrow { flex: 0 0 26px; display: flex; align-items: center; justify-content: center; color: var(--fire); font-size: 18px; font-weight: 800; }
.ob-loop { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 12px 0 4px; font-size: 12px; color: var(--text-dim); }
.ob-loop-ic { color: var(--fire); font-size: 15px; font-weight: 800; }
.ob-actions { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.ob-spacer { flex: 1; }
.ob-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ob-choice-card { text-align: left; background: var(--panel-2); border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 16px; cursor: pointer; transition: border-color .12s, transform .12s; }
.ob-choice-card:hover { border-color: var(--fire); transform: translateY(-1px); }
.ob-choice-card.primary { border-color: var(--fire-dark); background: linear-gradient(180deg, rgba(255,85,0,.08), var(--panel-2)); }
.ob-choice-ico { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--panel-3); font-size: 19px; margin-bottom: 11px; }
.ob-choice-card.primary .ob-choice-ico { background: rgba(255,85,0,.16); }
.ob-choice-tt { font-weight: 700; font-size: 14.5px; }
.ob-choice-bd { font-size: 12.5px; color: var(--text-dim); margin-top: 4px; line-height: 1.45; }

/* Samples banner on the dashboard */
.sample-banner { display: flex; align-items: center; gap: 11px; background: var(--panel-2); border: 1px dashed var(--border-strong); border-radius: var(--r-md); padding: 11px 14px; font-size: 13px; color: var(--text-dim); margin-bottom: 18px; }
.sample-tag { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--amber); background: rgba(255,170,0,.12); border-radius: 5px; padding: 3px 8px; flex-shrink: 0; }
.sample-clear { background: transparent; border: none; color: var(--fire); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; font-family: inherit; }

@media (max-width: 600px) {
  .ob-modal { padding: 22px 20px; }
  .ob-flowmap { flex-direction: column; }
  .ob-fm-arrow { flex-basis: 22px; transform: rotate(90deg); }
  .ob-choice { grid-template-columns: 1fr; }
}

/* ===== Plan with AI ===== */
.ai-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.ai-chip { font-size: 12px; background: var(--panel-2); border: 1px solid var(--border-strong); color: var(--text-dim); border-radius: 999px; padding: 5px 11px; cursor: pointer; font-family: inherit; }
.ai-chip:hover { border-color: var(--fire); color: var(--text); }
.ai-busy { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 38px 32px; }
.ai-spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--fire); border-radius: 50%; animation: ai-spin .8s linear infinite; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-modal-lg { width: 600px; }
.ai-preview { max-height: 50vh; overflow-y: auto; margin: 6px 0 4px; padding-right: 4px; }
.ai-warn { background: var(--red-bg); border: 1px solid var(--red); color: var(--text); border-radius: var(--r-md); padding: 9px 12px; font-size: 12.5px; margin-bottom: 12px; }
.ai-meta { display: inline-block; font-size: 11px; color: var(--text-dim); background: var(--panel-2); border: 1px solid var(--border); border-radius: 5px; padding: 2px 8px; margin: 2px 0 6px; }
.ai-block-h { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--fire); font-weight: 700; margin: 14px 0 6px; }
.ai-ex { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 12px; margin-bottom: 7px; }
.ai-ex-n { font-weight: 600; font-size: 13.5px; }
.ai-ex-d { font-size: 12px; color: var(--text-dim); font-family: var(--mono); margin-top: 2px; }
.ai-ex-cue { font-size: 11.5px; color: var(--text-dimmer); margin-top: 3px; font-style: italic; }
.ai-upsell { margin-top: 14px; font-size: 12px; color: var(--text-dim); text-align: center; }
.ai-upsell a { color: var(--fire); cursor: pointer; font-weight: 600; }
.ai-src { font-size: 12px; color: var(--text-dim); margin-bottom: 10px; }
.ai-src a { color: var(--fire); cursor: pointer; font-weight: 600; }
