/* ═══ SHOWING UP — STYLES ═══ */

/* ── Variables ── */
:root {
  --bg: #0f0e0d;
  --surface: #1a1816;
  --surface-hover: #222019;
  --gold: #c8a96e;
  --gold-dim: rgba(200, 169, 110, 0.3);
  --gold-glow: rgba(200, 169, 110, 0.15);
  --text: #e8e0d4;
  --text-muted: #8a8279;
  --text-dim: #5c564e;
  --border: #2e2b28;
  --danger: #c45c5c;
  --font-display: 'Playfair Display', serif;
  --font-body: 'DM Sans', sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --nav-height: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) 0 env(safe-area-inset-left, 0);
}

/* ── Header ── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 8px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}
.app-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.01em;
}
.settings-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 10px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
}
.settings-btn:hover { color: var(--gold); background: var(--gold-glow); }
.settings-btn:active { transform: scale(0.97); }

/* ── Desktop Tabs ── */
.desktop-tabs {
  display: none;
  padding: 0 20px;
  gap: 4px;
  border-bottom: 1px solid var(--border);
}
.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  min-height: 44px;
}
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-btn:hover:not(.active) { color: var(--text); }

/* ── Content Area ── */
.content {
  padding: 8px 16px 80px;
  max-width: 600px;
  margin: 0 auto;
  -webkit-overflow-scrolling: touch;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── Cards ── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 4px;
}
.card-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

/* ── Mood Selector ── */
.field-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}
.mood-row {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}
.mood-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 4px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.1s;
  min-height: 44px;
}
.mood-btn:active { transform: scale(0.97); }
.mood-btn.selected {
  border-color: var(--gold);
  background: var(--gold-glow);
}
.mood-emoji { font-size: 1.4rem; }
.mood-label { font-size: 0.65rem; color: var(--text-muted); }

/* ── Intensity Slider ── */
.intensity-section { margin-bottom: 24px; }
.intensity-val { color: var(--gold); font-weight: 500; }
.intensity-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
  margin: 8px 0 4px;
}
.intensity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  background: var(--gold);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}
.intensity-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: var(--gold);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}
.intensity-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* ── Questions ── */
.questions { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 12px;
  resize: vertical;
  transition: border-color 0.2s;
  line-height: 1.5;
}
textarea:focus { outline: none; border-color: var(--gold); }
textarea::placeholder { color: var(--text-dim); font-style: italic; }

/* ── Intention ── */
.intention-section { margin-bottom: 20px; }

/* ── Save Button ── */
.save-btn {
  width: 100%;
  background: var(--gold);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}
.save-btn:hover { opacity: 0.9; }
.save-btn:active { transform: scale(0.97); }
.save-confirm {
  text-align: center;
  color: var(--gold);
  font-size: 0.85rem;
  margin-top: 8px;
  opacity: 0;
  transition: opacity 0.3s;
}
.save-confirm.show { opacity: 1; }

/* ── Tools Section ── */
.tool-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
}
.tool-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  min-height: 44px;
  transition: background 0.2s;
}
.tool-header::-webkit-details-marker { display: none; }
.tool-header:hover { background: var(--gold-glow); }
.tool-icon { font-size: 1.1rem; }
.tool-body { padding: 0 16px 16px; }
.tool-desc { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 12px; line-height: 1.5; }
.tool-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tool-steps li {
  font-size: 0.88rem;
  line-height: 1.5;
  padding-left: 8px;
  border-left: 2px solid var(--gold-dim);
}
.tool-steps li strong { color: var(--gold); }
.distortion-list { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.distortion-tag {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.repair-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.repair-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.repair-card strong { color: var(--gold); font-size: 0.85rem; display: block; margin-bottom: 4px; }
.repair-card p { color: var(--text-muted); font-size: 0.8rem; font-style: italic; line-height: 1.4; }

/* ── History ── */
.sparkline-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}
.sparkline-label { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }
.sparkline { width: 100%; height: 40px; }
.sparkline polyline {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sparkline circle { fill: var(--gold); }
.search-box { margin-bottom: 16px; }
.search-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 10px 12px;
  transition: border-color 0.2s;
}
.search-input:focus { outline: none; border-color: var(--gold); }
.search-input::placeholder { color: var(--text-dim); }
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-week {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--gold);
  margin: 12px 0 6px;
  font-weight: 600;
}
.history-week:first-child { margin-top: 0; }
.history-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.1s;
  min-height: 44px;
}
.history-entry:hover { border-color: var(--gold-dim); }
.history-entry:active { transform: scale(0.99); }
.entry-mood { font-size: 1.3rem; }
.entry-info { flex: 1; min-width: 0; }
.entry-date { font-size: 0.8rem; color: var(--text-muted); }
.entry-preview {
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.entry-intensity {
  font-size: 0.75rem;
  color: var(--text-dim);
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 10px;
}
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ── Bottom Sheet Modal ── */
.bottom-sheet {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-end;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.bottom-sheet.open { pointer-events: auto; opacity: 1; }
.bottom-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
}
.bottom-sheet-content {
  position: relative;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  padding: 24px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(24px + var(--safe-bottom));
  transform: translateY(100%);
  transition: transform 0.3s ease;
}
.bottom-sheet.open .bottom-sheet-content { transform: translateY(0); }
.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.sheet-date { font-family: var(--font-display); color: var(--gold); font-size: 1rem; }
.sheet-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sheet-mood { font-size: 1.5rem; margin-bottom: 16px; }
.sheet-question { margin-bottom: 14px; }
.sheet-question label {
  display: block;
  font-size: 0.8rem;
  color: var(--gold);
  margin-bottom: 4px;
  font-weight: 500;
}
.sheet-question p { font-size: 0.9rem; line-height: 1.5; color: var(--text); }
.sheet-intention {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.sheet-intention label { display: block; font-size: 0.8rem; color: var(--gold); margin-bottom: 4px; font-weight: 500; }
.sheet-intention p { font-size: 0.9rem; font-style: italic; color: var(--text-muted); }

/* ── Settings Panel ── */
.settings-panel {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: var(--bg);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 48px 24px 80px;
}
.settings-panel.open { transform: translateX(0); }
.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}
.settings-header h2 { font-family: var(--font-display); color: var(--gold); font-size: 1.2rem; }
.settings-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  cursor: pointer;
  padding: 4px 8px;
  min-width: 44px;
  min-height: 44px;
}
.settings-group { margin-bottom: 28px; }
.settings-group h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 12px;
}
.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
}
.settings-row label { font-size: 0.9rem; color: var(--text-muted); }
.toggle {
  width: 44px;
  height: 24px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.toggle:checked { background: var(--gold); }
.toggle:checked::after { transform: translateX(20px); background: var(--bg); }
.time-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  padding: 6px 10px;
  font-size: 0.9rem;
}
.settings-action {
  display: block;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 12px;
  cursor: pointer;
  margin-bottom: 8px;
  text-align: left;
  min-height: 44px;
  transition: border-color 0.2s;
}
.settings-action:hover { border-color: var(--gold-dim); }
.settings-action.danger { color: var(--danger); border-color: var(--danger); }
.settings-action.danger:hover { background: rgba(196, 92, 92, 0.1); }
.about-text { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 8px; }
.about-text.muted { color: var(--text-dim); font-size: 0.8rem; }

/* ── Notification Prompt ── */
.notification-prompt {
  position: fixed;
  bottom: 80px;
  left: 16px;
  right: 16px;
  background: var(--surface);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: none;
  align-items: center;
  gap: 12px;
  z-index: 200;
  font-size: 0.88rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.notification-prompt.visible { display: flex; animation: slideUp 0.3s ease; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.notification-prompt span { flex: 1; }
.notif-btn-yes {
  background: var(--gold);
  color: var(--bg);
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.notif-btn-no {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.82rem;
  padding: 8px;
  white-space: nowrap;
}

/* ── Install Banner ── */
#install-banner {
  position: fixed;
  bottom: 80px;
  left: 16px;
  right: 16px;
  background: var(--surface);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 200;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
#install-banner.visible { transform: translateY(0); opacity: 1; }
.install-icon { font-size: 1.5rem; }
.install-text { flex: 1; }
.install-text strong { display: block; font-size: 0.88rem; color: var(--text); margin-bottom: 2px; }
.install-text span { font-size: 0.8rem; color: var(--text-muted); }
.install-btn-yes {
  background: var(--gold);
  color: var(--bg);
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.install-btn-no {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 8px;
}
#ios-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--gold);
  padding: 14px 16px 20px;
  z-index: 200;
  transform: translateY(100%);
  opacity: 0;
  transition: all 0.3s ease;
  padding-bottom: calc(20px + var(--safe-bottom));
}
#ios-install-banner.visible { transform: translateY(0); opacity: 1; }
.ios-install-content { display: flex; align-items: center; gap: 12px; }
.ios-icon { width: 40px; height: 40px; border-radius: 10px; }
.ios-install-content div { flex: 1; }
.ios-install-content strong { display: block; font-size: 0.88rem; color: var(--text); margin-bottom: 2px; }
.ios-install-content span { font-size: 0.8rem; color: var(--text-muted); }
.share-icon { display: inline-block; border: 1px solid var(--text-muted); border-radius: 4px; padding: 1px 4px; font-size: 0.75rem; }
#iosInstallDismiss {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 8px;
  min-width: 44px;
  min-height: 44px;
}
.ios-arrow { text-align: center; color: var(--gold); font-size: 1.2rem; margin-top: 4px; }

/* ── Bottom Navigation ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 6px 0;
  padding-bottom: calc(6px + var(--safe-bottom));
  z-index: 150;
  transition: transform 0.2s;
}
.bottom-nav.hidden { transform: translateY(100%); }
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 4px;
  min-height: 44px;
  position: relative;
  transition: color 0.2s;
}
.nav-btn.active { color: var(--gold); }
.nav-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.2s;
}
.nav-btn.active .nav-dot { background: var(--gold); }
.nav-icon { font-size: 1.2rem; }
.nav-label { font-size: 0.65rem; font-weight: 500; }

/* ── Desktop: top tabs instead of bottom nav ── */
@media (min-width: 769px) {
  .desktop-tabs { display: flex; }
  .bottom-nav { display: none; }
  .content { padding-bottom: 40px; }
  .repair-grid { grid-template-columns: 1fr 1fr 1fr; }
  .guided-grid { grid-template-columns: 1fr 1fr; }
}

/* ═══════════════════════════════════════════════ */
/*  NEW UI: guided tools, post-save, modals, etc.   */
/* ═══════════════════════════════════════════════ */

/* ── Quick check-in button ── */
.quick-checkin-btn {
  width: 100%;
  padding: 10px 16px;
  margin-top: 10px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.quick-checkin-btn:hover { color: var(--gold); border-color: var(--gold-dim); }

/* ── Post-save tailored message area ── */
.post-save-area {
  margin-top: 16px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
}
.post-save-area.visible {
  max-height: 260px;
  opacity: 1;
}
.post-save-inner {
  background: var(--surface);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.post-save-text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}
.post-save-link {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 12px;
  background: var(--gold-glow);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}
.post-save-link:hover { background: var(--gold-dim); }

/* ── Guided tools grid (Tools tab) ── */
.guided-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}
.guided-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font-family: var(--font-body);
}
.guided-card:hover {
  border-color: var(--gold-dim);
  background: var(--surface-hover);
}
.guided-icon { font-size: 1.5rem; margin-bottom: 4px; }
.guided-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--gold);
  margin-bottom: 2px;
}
.guided-desc { font-size: 0.8rem; color: var(--text-muted); }

/* ── Inline "walk through" button in reference tools ── */
.inline-tool-btn {
  margin-top: 10px;
  padding: 6px 12px;
  background: var(--gold-glow);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.inline-tool-btn:hover { background: var(--gold-dim); }

/* ── "Why this works" psychoed details ── */
.why-works {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.why-works summary {
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  padding: 4px 0;
  user-select: none;
}
.why-works summary::-webkit-details-marker { display: none; }
.why-works summary::before {
  content: '?';
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  font-size: 0.7rem;
  border: 1px solid var(--text-dim);
  border-radius: 50%;
  margin-right: 8px;
  color: var(--text-muted);
}
.why-works[open] summary::before { border-color: var(--gold); color: var(--gold); }
.why-body p {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.why-body p:last-child { margin-bottom: 0; }

/* ── Crisis support footer in Tools tab ── */
.tools-support-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.tools-support-footer a {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.tools-support-footer a:hover { color: var(--gold); }

/* ── Pattern mirror (History tab) ── */
.pattern-mirror {
  margin: 12px 0 16px;
  padding: 12px 14px;
  background: var(--surface);
  border-left: 2px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.pattern-text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
}

/* ── Crisis Modal ── */
.crisis-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.crisis-modal.open { pointer-events: auto; opacity: 1; }
.crisis-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.8);
}
.crisis-content {
  position: relative;
  width: min(500px, calc(100% - 32px));
  max-height: 85vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transform: translateY(20px);
  transition: transform 0.25s ease;
}
.crisis-modal.open .crisis-content { transform: translateY(0); }
.crisis-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.crisis-header h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--gold);
  font-weight: 600;
}
.crisis-close {
  background: none; border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  min-width: 40px; min-height: 40px;
}
.crisis-intro {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.crisis-section-header {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin: 14px 0 8px;
  font-weight: 500;
}
.crisis-card {
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}
.crisis-card.crisis-primary {
  border-color: var(--gold-dim);
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
              linear-gradient(to right, var(--gold-dim), transparent) border-box;
}
.crisis-name {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 4px;
}
.crisis-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.4;
}
.crisis-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}
.crisis-action {
  padding: 6px 12px;
  background: var(--gold-glow);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  font-size: 0.8rem;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
}
.crisis-action.crisis-call {
  background: var(--gold);
  color: var(--bg);
  font-weight: 500;
}
.crisis-action.crisis-web { background: transparent; }
.crisis-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ── Tool Modal (guided exercises) ── */
.tool-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.tool-modal.open { pointer-events: auto; opacity: 1; }
.tool-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
}
.tool-modal-content {
  position: relative;
  width: min(500px, calc(100% - 32px));
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transform: translateY(20px);
  transition: transform 0.25s ease;
}
.tool-modal.open .tool-modal-content { transform: translateY(0); }
.tool-modal-close {
  position: absolute;
  top: 10px; right: 10px;
  background: none; border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  width: 40px; height: 40px;
  z-index: 2;
}
.tool-modal-close:hover { color: var(--gold); }
.tool-modal-header {
  padding-right: 40px;
  margin-bottom: 16px;
}
.tool-modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--gold);
  font-weight: 600;
}
.tool-modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Box Breathing animation ── */
.breath-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  padding: 20px 0;
  cursor: pointer;
  user-select: none;
}
.breath-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
  border: 2px solid var(--gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(1.0);
}
.breath-inner {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.4;
}
.breath-label {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text);
  margin-top: 28px;
  letter-spacing: 0.02em;
}
.breath-count {
  font-size: 2rem;
  color: var(--gold);
  margin-top: 12px;
  font-variant-numeric: tabular-nums;
  min-height: 2.5rem;
}

/* ── Grounding (5-4-3-2-1) ── */
.ground-panel { padding: 4px 0; }
.ground-progress {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.ground-prompt {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 14px;
  line-height: 1.4;
}
.ground-input {
  width: 100%;
  min-height: 96px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
}
.ground-input:focus {
  outline: none;
  border-color: var(--gold-dim);
}
.ground-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}
.ground-btn {
  flex: 1;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.ground-btn:hover:not(:disabled) {
  border-color: var(--gold-dim);
  color: var(--gold);
}
.ground-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.ground-next { background: var(--gold-glow); border-color: var(--gold-dim); color: var(--gold); }
.ground-done { text-align: center; padding: 24px 0; }
.ground-done h3 {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 1.3rem;
  margin-bottom: 8px;
}
.ground-done p {
  color: var(--text-muted);
  margin-bottom: 20px;
  font-size: 0.9rem;
}

/* ── STOP walkthrough ── */
.stop-panel {
  text-align: center;
  padding: 20px 0;
}
.stop-letter {
  font-family: var(--font-display);
  font-size: 5rem;
  line-height: 1;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 8px;
}
.stop-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text);
  margin-bottom: 12px;
}
.stop-body {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 340px;
  margin: 0 auto 20px;
}
.stop-countdown {
  font-size: 1.1rem;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  margin-bottom: 16px;
}

/* ── RAIN ── */
.rain-panel { padding: 4px 0; }
.rain-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.rain-letter {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--gold);
  font-weight: 600;
}
.rain-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text);
  flex: 1;
}
.rain-progress {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.rain-prompt {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 12px;
}
.rain-input {
  width: 100%;
  min-height: 110px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
}
.rain-input:focus { outline: none; border-color: var(--gold-dim); }

/* ── Values chips ── */
.values-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}
.value-chip {
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}
.value-chip:hover { border-color: var(--gold-dim); color: var(--text); }
.value-chip.selected {
  background: var(--gold-glow);
  border-color: var(--gold);
  color: var(--gold);
}
.values-custom {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  margin-top: 6px;
}
.values-custom:focus { outline: none; border-color: var(--gold-dim); }
.settings-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: -4px 0 6px;
  line-height: 1.4;
}
