/* ═══════════════════════════════════════════════════════════
   CarWash Assistant — Mobile-first Design System
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-elevated: #273346;
  --bg-input: #162032;
  --border: #334155;
  --border-light: #1e3a5f;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent: #3b82f6;
  --accent-dark: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.25);

  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #38bdf8;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.3);

  --tap-target: 52px;
  --navbar-h: 60px;
  --bottom-nav-h: 68px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ── Navbar ──────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--navbar-h);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-icon { font-size: 1.5rem; }
.brand-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.navbar-actions { display: flex; align-items: center; gap: 4px; }
.nav-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.nav-icon-btn svg { width: 22px; height: 22px; }
.nav-icon-btn:hover, .nav-icon-btn:focus {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.nav-icon-btn.nav-admin { color: var(--warning); }
.nav-text-btn {
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.15s;
}
.nav-text-btn:hover { background: var(--accent-dark); color: #fff; }

/* ── Main content ────────────────────────────────────────── */
.main-content {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 16px 120px;
  min-height: calc(100dvh - var(--navbar-h));
}

/* ── Bottom Nav ──────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: calc(var(--bottom-nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item svg { width: 22px; height: 22px; }
.bottom-nav-item.active { color: var(--accent); }
.bottom-nav-item:active { opacity: 0.7; }

/* ── Flash messages ──────────────────────────────────────── */
.flash-container {
  max-width: 600px;
  margin: 12px auto 0;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.flash {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  animation: slideDown 0.2s ease;
}
.flash-success { background: rgba(34, 197, 94, 0.15); color: var(--success); border: 1px solid rgba(34,197,94,0.3); }
.flash-error   { background: rgba(239, 68, 68, 0.15);  color: var(--danger);  border: 1px solid rgba(239,68,68,0.3); }
.flash-info    { background: rgba(56, 189, 248, 0.15); color: var(--info);    border: 1px solid rgba(56,189,248,0.3); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
}
.card-sm { padding: 14px 16px; }
.card-lg { padding: 24px; border-radius: var(--radius-lg); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap-target);
  padding: 0 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-primary:active { transform: scale(0.98); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #16a34a; }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover  { background: #dc2626; }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-elevated); color: var(--text-primary); }
.btn-lg { min-height: 60px; font-size: 1.1rem; border-radius: var(--radius-lg); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 0.85rem; border-radius: var(--radius-sm); }
.btn svg { width: 20px; height: 20px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-control {
  width: 100%;
  min-height: var(--tap-target);
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { min-height: 100px; resize: vertical; }
select.form-control { cursor: pointer; }

/* ── Choice Cards (wizard) ───────────────────────────────── */
.choice-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}
.choice-grid-2 { grid-template-columns: 1fr 1fr; }
.choice-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.choice-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 90px;
  padding: 16px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.choice-card:hover { border-color: var(--accent); background: var(--bg-elevated); }
.choice-card.selected {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.12);
  box-shadow: 0 0 0 1px var(--accent);
}
.choice-card .choice-icon { font-size: 2rem; }
.choice-card .choice-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}
.choice-card .choice-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Checkboxes as choice cards */
.checkbox-card input[type="checkbox"] { display: none; }
.checkbox-card input:checked + .choice-card {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.12);
}

/* ── Progress bar ────────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 20px;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 9999px;
  transition: width 0.4s ease;
}

/* ── Step Card ───────────────────────────────────────────── */
.step-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.step-header {
  background: var(--accent);
  padding: 20px 20px 24px;
}
.step-num {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.7);
  margin-bottom: 6px;
}
.step-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}
.step-body { background: var(--bg-card); padding: 20px; }
.step-description {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.step-tips {
  background: rgba(59, 130, 246, 0.1);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  font-size: 0.9rem;
  color: var(--info);
  margin-bottom: 20px;
}
.step-tips strong { display: block; margin-bottom: 4px; }

/* Product recommendation in step */
.step-product {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}
.step-product-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.step-product-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.step-product-brand {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.badge-premium {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 8px;
}

/* ── Timer ───────────────────────────────────────────────── */
.timer-display {
  text-align: center;
  padding: 24px;
}
.timer-clock {
  font-size: 4rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 16px;
}
.timer-clock.running { color: var(--success); }
.timer-clock.done { color: var(--warning); }
.timer-controls { display: flex; gap: 12px; justify-content: center; }

/* ── Page header ─────────────────────────────────────────── */
.page-header { padding: 24px 0 16px; }
.page-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}
.page-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── List items ──────────────────────────────────────────── */
.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--text-primary);
  transition: background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.list-item:hover { background: var(--bg-elevated); border-color: var(--accent); }
.list-item-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: var(--bg-elevated);
  flex-shrink: 0;
}
.list-item-body { flex: 1; min-width: 0; }
.list-item-title { font-weight: 600; margin-bottom: 2px; }
.list-item-sub { font-size: 0.85rem; color: var(--text-muted); }
.list-item-chevron { color: var(--text-muted); flex-shrink: 0; }
.list-item-chevron svg { width: 18px; height: 18px; }

/* ── Step summary (overview) ─────────────────────────────── */
.step-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: background 0.15s;
}
.step-summary.done { opacity: 0.5; }
.step-summary.current { border-color: var(--accent); background: rgba(59,130,246,0.08); }
.step-summary-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}
.step-summary.done .step-summary-num { background: var(--success); color: #fff; }
.step-summary.current .step-summary-num { background: var(--accent); color: #fff; }
.step-summary-text {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 500;
}
.step-summary-product { font-size: 0.8rem; color: var(--text-muted); }

/* ── Missing product card ────────────────────────────────── */
.missing-product-card {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
}
.missing-product-title { font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.missing-product-sub { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 12px; }
.buy-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

/* ── Tags / chips ────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.chip-accent { background: rgba(59,130,246,0.15); color: var(--accent); border-color: rgba(59,130,246,0.3); }
.chip-success { background: rgba(34,197,94,0.15); color: var(--success); border-color: rgba(34,197,94,0.3); }

/* ── Section header ──────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.section-link { font-size: 0.85rem; color: var(--accent); font-weight: 600; }

/* ── Stat cards ──────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.stat-value { font-size: 2rem; font-weight: 800; color: var(--accent); line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 40px 0 32px;
}
.hero-icon { font-size: 4rem; margin-bottom: 16px; }
.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 12px;
}
.hero-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 320px;
  margin: 0 auto 28px;
}

/* ── Wizard ──────────────────────────────────────────────── */
.wizard-step { display: none; }
.wizard-step.active { display: block; }
.wizard-question {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.wizard-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.wizard-nav {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.wizard-nav .btn { flex: 1; }
.step-indicators {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 28px;
}
.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.2s;
}
.step-dot.active { background: var(--accent); width: 24px; border-radius: 4px; }
.step-dot.done { background: var(--success); }

/* ── Complete screen ─────────────────────────────────────── */
.complete-screen { text-align: center; padding: 40px 0; }
.complete-icon { font-size: 5rem; margin-bottom: 20px; }
.complete-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.complete-subtitle { font-size: 1rem; color: var(--text-secondary); margin-bottom: 32px; }

/* ── Product toggle ──────────────────────────────────────── */
.product-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.product-row:last-child { border-bottom: none; }
.product-row-info { flex: 1; min-width: 0; }
.product-row-name { font-weight: 600; font-size: 0.95rem; }
.product-row-brand { font-size: 0.8rem; color: var(--text-muted); }
.toggle-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.toggle-btn.add { background: rgba(59,130,246,0.15); color: var(--accent); }
.toggle-btn.add:hover { background: var(--accent); color: #fff; }
.toggle-btn.remove { background: rgba(34,197,94,0.15); color: var(--success); }
.toggle-btn.remove:hover { background: rgba(239,68,68,0.15); color: var(--danger); }
.toggle-btn svg { width: 20px; height: 20px; }

/* ── Admin table ─────────────────────────────────────────── */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th, .admin-table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); }
.admin-table th { color: var(--text-muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }
.admin-table tr:hover td { background: var(--bg-elevated); }

/* ── Utilities ───────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-accent { color: var(--accent); }
.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; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ── Animations ──────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.animate-in { animation: fadeIn 0.25s ease both; }
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { box-shadow: 0 0 0 8px transparent; }
}
.pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 360px) {
  .hero-title { font-size: 1.8rem; }
  .wizard-question { font-size: 1.15rem; }
  .choice-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 640px) {
  .main-content { padding: 0 24px 120px; }
  .navbar { padding: 0 24px; }
}

/* ═══════════════════════════════════════════════════════════
   Session – animations, timer, rinse banner
   ═══════════════════════════════════════════════════════════ */

/* ── Session header ──────────────────────────────────── */
.session-header { padding: 14px 0 12px; }

/* ── Step card entrance ──────────────────────────────── */
@keyframes stepEnter {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.step-card-enter { animation: stepEnter 0.35s cubic-bezier(0.22,1,0.36,1) both; }

/* ── Rinse header variant ────────────────────────────── */
.step-header-rinse {
  background: linear-gradient(135deg, #0369a1, #0ea5e9);
}
.rinse-subtitle {
  margin-top: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.01em;
}

/* ── Collapsible tips ────────────────────────────────── */
.step-tips-details {
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.step-tips-summary {
  list-style: none;
  padding: 11px 14px;
  background: rgba(59,130,246,0.1);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--info);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.step-tips-summary::after { content: '▾'; font-size: 0.8rem; }
.step-tips-details[open] .step-tips-summary::after { content: '▴'; }
.step-tips-body {
  padding: 10px 14px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  background: rgba(59,130,246,0.06);
  border-left: 3px solid var(--accent);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

/* ── Product row inside step ─────────────────────────── */
.step-product { margin-bottom: 14px; }
.step-product-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}
.dwell-badge {
  flex-shrink: 0;
  padding: 5px 12px;
  background: rgba(245,158,11,0.15);
  color: var(--warning);
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

/* ── Timer ───────────────────────────────────────────── */
.timer-section {
  text-align: center;
  padding: 16px 0 18px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.timer-clock {
  font-size: 4.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--text-primary);
  margin-bottom: 14px;
  transition: color 0.3s;
}

/* Running: subtle heartbeat */
@keyframes timerPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.025); }
}
.timer-clock.running {
  color: var(--success);
  animation: timerPulse 1s ease-in-out infinite;
}

/* Urgent (<30 s): faster orange pulse */
@keyframes timerUrgent {
  0%, 100% { transform: scale(1);    opacity: 1; }
  50%       { transform: scale(1.04); opacity: 0.8; }
}
.timer-clock.urgent {
  color: var(--warning);
  animation: timerUrgent 0.6s ease-in-out infinite;
}

/* Done */
.timer-clock.done { color: var(--success); animation: none; }

.timer-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.timer-start-btn { min-width: 110px; }

/* ── Rinse banner ────────────────────────────────────── */
@keyframes rinsePop {
  0%   { transform: scale(0.85); opacity: 0; }
  70%  { transform: scale(1.04); }
  100% { transform: scale(1);    opacity: 1; }
}
@keyframes rinsePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(14,165,233,0.5); }
  50%       { box-shadow: 0 0 0 12px rgba(14,165,233,0); }
}
.rinse-banner {
  background: linear-gradient(135deg, #0369a1, #0ea5e9);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin-bottom: 16px;
}
.rinse-banner-enter {
  animation: rinsePop 0.45s cubic-bezier(0.22,1,0.36,1) both,
             rinsePulse 1.5s ease-in-out 0.45s infinite;
}
.rinse-banner-icon { font-size: 2.8rem; margin-bottom: 6px; }
.rinse-banner-text {
  font-size: 1.9rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.rinse-banner-sub {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.8);
}

/* ── Action buttons ──────────────────────────────────── */
.step-actions {
  display: flex;
  gap: 10px;
  padding-top: 4px;
}
.btn-done {
  flex: 2;
  font-size: 1.1rem;
  min-height: 58px;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
/* Idle shimmer to draw attention */
@keyframes doneShimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
.btn-done {
  background: linear-gradient(
    90deg,
    var(--success) 0%,
    #4ade80 50%,
    var(--success) 100%
  );
  background-size: 200% auto;
  animation: doneShimmer 3s linear infinite;
  color: #fff;
  border: none;
}
.btn-done:active { transform: scale(0.96); }

/* Press animation */
@keyframes donePress {
  0%   { transform: scale(1); }
  40%  { transform: scale(0.94); }
  70%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}
.btn-done-animate { animation: donePress 0.34s ease both !important; }

.btn-skip {
  flex: 1;
  min-height: 58px;
  border-radius: var(--radius);
}

/* ── Step summary stagger ────────────────────────────── */
@keyframes stepRowEnter {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: none; }
}
.step-summary-item {
  animation: stepRowEnter 0.3s ease both;
  animation-delay: calc(var(--i) * 0.04s);
}

/* Completion flash */
@keyframes stepComplete {
  0%   { background: var(--bg-card); }
  40%  { background: rgba(34,197,94,0.25); }
  100% { background: var(--bg-card); opacity: 0.5; }
}
.step-summary-completing {
  animation: stepComplete 0.35s ease forwards;
}

/* ── Wizard choice cards – entrance stagger ──────────── */
@keyframes cardPop {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.choice-grid .choice-card {
  animation: cardPop 0.3s cubic-bezier(0.22,1,0.36,1) both;
}
.choice-grid .choice-card:nth-child(1) { animation-delay: 0.04s; }
.choice-grid .choice-card:nth-child(2) { animation-delay: 0.08s; }
.choice-grid .choice-card:nth-child(3) { animation-delay: 0.12s; }
.choice-grid .choice-card:nth-child(4) { animation-delay: 0.16s; }
.choice-grid .choice-card:nth-child(5) { animation-delay: 0.20s; }

/* ── List item entrance ──────────────────────────────── */
@keyframes listSlide {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.list-item {
  animation: listSlide 0.28s ease both;
}
.list-item:nth-child(1) { animation-delay: 0.04s; }
.list-item:nth-child(2) { animation-delay: 0.08s; }
.list-item:nth-child(3) { animation-delay: 0.12s; }
.list-item:nth-child(4) { animation-delay: 0.16s; }

/* ── Hero button extra pulse ─────────────────────────── */
@keyframes heroPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59,130,246,0.5); }
  60%       { box-shadow: 0 0 0 14px rgba(59,130,246,0); }
}
.pulse-glow { animation: heroPulse 2.2s ease-in-out infinite; }

/* ── Page content entrance ───────────────────────────── */
@keyframes pageFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.main-content > * {
  animation: pageFadeUp 0.3s ease both;
}
.main-content > *:nth-child(1) { animation-delay: 0.0s; }
.main-content > *:nth-child(2) { animation-delay: 0.05s; }
.main-content > *:nth-child(3) { animation-delay: 0.10s; }
.main-content > *:nth-child(4) { animation-delay: 0.15s; }

/* ── Flash messages slide ────────────────────────────── */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: none; }
}

/* ── done-card entrance ──────────────────────────────── */
@keyframes doneCardPop {
  0%   { transform: scale(0.9); opacity: 0; }
  70%  { transform: scale(1.03); }
  100% { transform: scale(1); opacity: 1; }
}
.done-card { animation: doneCardPop 0.4s cubic-bezier(0.22,1,0.36,1) both !important; }

/* ── Ad layout ───────────────────────────────────────────────────────────── */

/* Neutral wrapper for any ad unit */
.ad-slot {
  text-align: center;
  overflow: hidden;
  line-height: 0; /* collapse whitespace around ad iframe */
}

/* Content-top: small top margin */
.ad-content-top {
  margin: 8px 0 12px;
}

/* Content-bottom: space above the footer area */
.ad-content-bottom {
  margin: 20px 0 12px;
  padding: 0 0 8px;
  border-top: 1px solid var(--border);
}

/* Mobile-bottom: shown on mobile, extra room above bottom nav */
.ad-mobile-bottom {
  margin: 8px 0 0;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

/* Extra padding on body when mobile ad is visible so nothing gets hidden */
body.has-mobile-ad .main-content {
  padding-bottom: 170px; /* 120px standard + ~50px for ad */
}

/* Sticky mobile banner: fixed just above the bottom nav */
.ad-mobile-sticky {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + var(--safe-bottom));
  left: 0;
  right: 0;
  z-index: 95;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 4px 0;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Extra bottom padding so content isn't hidden behind sticky banner */
body.has-mobile-sticky-ad .main-content {
  padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 80px);
}

/* Sidebar: hidden on mobile, revealed by grid on desktop */
.ad-sidebar {
  display: none;
}

/* ── Desktop layout: two-column grid ≥ 1024px ────────────────────────── */
@media (min-width: 1024px) {
  .app-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 600px) 300px;
    gap: 0 28px;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px;
    align-items: start;
  }

  /* app-col-main stays as a normal block in its grid cell */
  .app-col-main .main-content {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
    margin: 0;
  }

  .app-col-main .flash-container {
    max-width: 100%;
    padding: 0;
  }

  /* Sidebar: sticky, scrolls with page but stays visible */
  .ad-sidebar {
    display: block;
    position: sticky;
    top: calc(var(--navbar-h) + 16px);
    padding-top: 12px;
    min-height: 100px;
  }

  /* Mobile-only ads: hidden on desktop */
  .ad-mobile-bottom,
  .ad-mobile-sticky {
    display: none;
  }

  /* Reset mobile-ad padding overrides on desktop */
  body.has-mobile-ad .main-content,
  body.has-mobile-sticky-ad .main-content {
    padding-bottom: 40px;
  }
}
