/* ==========================================================================
   MindCrack — Components
   ========================================================================== */

/* ── ICONS ── */
.icon { width: 18px; height: 18px; display: block; flex-shrink: 0; }
.icon-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(12,3,3,0.55);
  color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.icon-btn:hover, .icon-btn:focus-visible { color: var(--text); border-color: var(--border-hover); background: rgba(155,28,28,0.18); }
.icon-btn .icon { width: 16px; height: 16px; }

/* ── CANDLE ── */
.candle-scene {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}
.halo {
  position: absolute;
  width: clamp(160px, 50vw, 240px);
  height: clamp(160px, 50vw, 240px);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(155,28,28,0.16) 0%, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -60%);
  filter: blur(22px);
  animation: haloPulse var(--dur-slow) ease-in-out infinite;
  pointer-events: none;
  transition: background 0.8s var(--ease);
}
body.phase-return .halo { background: radial-gradient(ellipse, rgba(217,154,63,0.20) 0%, transparent 70%); }

/* SVG session-progress ring, concentric with the halo */
.progress-ring {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -60%) rotate(-90deg);
  width: clamp(150px, 47vw, 226px);
  height: clamp(150px, 47vw, 226px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}
.progress-ring.visible { opacity: 1; }
.progress-ring circle {
  fill: none;
  stroke-width: 1.5;
}
.progress-ring .ring-track { stroke: rgba(155,28,28,0.14); }
.progress-ring .ring-fill {
  stroke: var(--ember);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.9s linear, stroke 0.8s var(--ease);
  filter: drop-shadow(0 0 4px rgba(217,79,43,0.6));
}
body.phase-return .progress-ring .ring-fill { stroke: var(--return); filter: drop-shadow(0 0 4px rgba(217,154,63,0.6)); }

.holder {
  width: clamp(55px, 13vw, 95px);
  aspect-ratio: 3/9;
  position: relative;
}
.holder *, .holder *::before, .holder *::after {
  position: absolute; content: "";
}
.candle {
  bottom: 0; width: 100%; height: 74%;
  border-radius: 50% / 10%;
  background: linear-gradient(165deg, #b01010 0%, #8c0b0b 18%, #6a0808 38%, #420404 62%, #1a0101 85%, #0a0000 100%);
  box-shadow: inset 3px 0 10px rgba(200,60,60,0.12), inset -3px 0 6px rgba(0,0,0,0.5), 0 0 18px rgba(120,10,10,0.3);
  transition: background 0.8s var(--ease), box-shadow 0.8s var(--ease);
}
body.phase-return .candle {
  background: linear-gradient(165deg, #b8791f 0%, #8c5c0b 18%, #6a4408 38%, #422b04 62%, #1a1101 85%, #0a0600 100%);
  box-shadow: inset 3px 0 10px rgba(220,160,60,0.12), inset -3px 0 6px rgba(0,0,0,0.5), 0 0 18px rgba(180,120,10,0.3);
}
.candle::before {
  width: 100%; height: 11%; border-radius: 50%;
  background: radial-gradient(ellipse at 40% 40%, #c42020, #7a0a0a 50%, #a01010 80%);
}
.candle::after {
  width: 14%; height: 20%; left: 18%; top: 9%;
  border-radius: 0 0 50% 50%;
  background: linear-gradient(#a01010, #600808);
  opacity: 0.5;
}
.thread {
  width: 3.5%; height: 13%; top: -8%; left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(#9a6030, #1a0a00, #000);
  border-radius: 2px;
}
.flame-wrap {
  position: absolute;
  width: 100%; bottom: 100%; left: 0;
  display: flex;
  justify-content: center;
  transform-origin: 50% 100%;
}
.flame-glow {
  position: absolute;
  bottom: -8px; left: 50%;
  transform: translateX(-50%);
  width: clamp(36px, 9vw, 62px);
  height: clamp(70px, 20vw, 140px);
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 60%, rgba(220,100,0,0.25), transparent 72%);
  filter: blur(14px);
  animation: glowPulse 3s ease-in-out infinite;
  pointer-events: none;
}
.flame {
  width: clamp(11px, 2.8vw, 19px);
  height: clamp(50px, 13vw, 94px);
  border-radius: 50% 50% 18% 18%;
  background: linear-gradient(to bottom, #fff 0%, #fff8e0 8%, #ffdd44 22%, #ff8800 52%, #cc2200 82%, transparent 100%);
  transform-origin: 50% 100%;
  animation: moveFlame 2.8s ease-in-out infinite, sizeFlame 4.2s ease-in-out infinite;
  position: relative;
  filter: drop-shadow(0 0 5px rgba(255,100,0,0.7));
}
.flame::before {
  position: absolute; content: '';
  width: 44%; height: 52%; left: 50%;
  transform: translateX(-50%);
  bottom: 12%; border-radius: 50%;
  background: rgba(255,255,220,0.88);
  filter: blur(2px);
}
.flame::after {
  position: absolute; content: '';
  width: 100%; height: 100%;
  border-radius: 50% 50% 18% 18%;
  box-shadow: 0 0 18px 3px rgba(255,90,0,0.45), 0 -12px 10px rgba(255,160,0,0.5);
}

/* ── TIMER ── */
.timer-block {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; margin-bottom: 18px;
}
.timer-label {
  font-size: 8px; letter-spacing: 0.5em;
  color: var(--text-muted); text-transform: uppercase;
}
#timer {
  font-family: 'Nosifer', cursive;
  font-size: clamp(20px, 6.5vw, 32px);
  letter-spacing: 6px;
  color: #e8d4b8;
  text-shadow: 0 0 8px rgba(255,220,180,0.7), 0 0 22px rgba(200,100,50,0.35);
  animation: timerFlicker 4s infinite, timerGlitch 6s infinite;
  user-select: none;
}
body.reduced-motion #timer { animation: none; }

/* ── CONFIG PANEL ── */
.config-panel {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 16px;
  background: rgba(12,3,3,0.65);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.config-row {
  display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
}
.config-label {
  font-size: 9px; letter-spacing: 0.4em;
  color: var(--text-dim); text-transform: uppercase; flex-shrink: 0;
}
.config-control { display: flex; align-items: center; gap: 8px; }

/* Duration presets — informed by trataka practice guidance: short defaults,
   with the option to go long only via deliberate manual entry. See
   docs/RESEARCH.md, "Session length". */
.preset-chips {
  display: flex; gap: 6px; flex-wrap: wrap; width: 100%;
}
.preset-chip {
  flex: 1; min-width: 34px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 10px; letter-spacing: 0.05em;
  padding: 7px 0;
  transition: all 0.15s;
}
.preset-chip:hover { border-color: var(--border-hover); color: var(--text); }
.preset-chip.active {
  background: rgba(155,28,28,0.28);
  border-color: var(--ember);
  color: #fff;
}
.duration-note {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
  display: none;
}
.duration-note.visible { display: block; }

/* Stepper */
.stepper {
  display: flex; align-items: center;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.stepper button {
  background: transparent; border: none;
  color: var(--text-dim); width: 28px; height: 30px;
  cursor: pointer; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s; flex-shrink: 0;
}
.stepper button:hover { background: rgba(155,28,28,0.3); color: var(--text); }
.stepper input {
  background: transparent; border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  color: var(--text); font-family: 'Josefin Sans', sans-serif;
  font-size: 13px; font-weight: 300;
  width: 42px; height: 30px; text-align: center; outline: none;
  -moz-appearance: textfield;
}
.stepper input::-webkit-inner-spin-button,
.stepper input::-webkit-outer-spin-button { display: none; }
.config-unit {
  font-size: 8px; letter-spacing: 0.3em;
  color: var(--text-muted); text-transform: uppercase;
}

/* Vol row */
.vol-row { gap: 12px; }
#volBar {
  flex: 1; height: 2px;
  background: rgba(155,28,28,0.12); border-radius: 2px; overflow: hidden;
}
#volFill {
  height: 100%; width: 0%;
  background: linear-gradient(to right, var(--deep-crimson), var(--ember), var(--gold));
  border-radius: 2px; transition: width 0.05s ease;
}
.vol-mic-status {
  font-size: 8px; letter-spacing: 0.3em;
  color: var(--text-muted); text-transform: uppercase; white-space: nowrap;
}
.vol-mic-status.active {
  color: var(--ember);
  animation: statusPulse 1.2s ease-in-out infinite;
}

/* Echo depth segmented control */
.echo-depth-row { gap: 8px; }
.segmented {
  display: flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.segmented button {
  background: transparent; border: none; color: var(--text-dim);
  font-size: 9px; letter-spacing: 0.08em; padding: 7px 10px;
  border-right: 1px solid var(--border);
  transition: background 0.15s, color 0.15s;
}
.segmented button:last-child { border-right: none; }
.segmented button:hover { color: var(--text); }
.segmented button.active { background: rgba(155,28,28,0.28); color: #fff; }

/* ── CONTROLS ── */
.controls-row {
  display: flex; align-items: center;
  gap: 12px; width: 100%;
  justify-content: center; margin-bottom: 14px;
}
.btn-primary {
  flex: 1; max-width: 112px; height: 44px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Josefin Sans', sans-serif;
  font-size: 9px; font-weight: 400;
  letter-spacing: 0.4em; text-transform: uppercase;
  cursor: pointer; position: relative; overflow: hidden;
  transition: border-color 0.25s, color 0.25s, box-shadow 0.25s;
}
.btn-primary::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--deep-crimson), rgba(155,28,28,0.4));
  opacity: 0; transition: opacity 0.25s;
}
.btn-primary:hover::before, .btn-primary:focus-visible::before { opacity: 1; }
.btn-primary:hover, .btn-primary:focus-visible { border-color: var(--border-hover); color: #fff; box-shadow: 0 0 18px rgba(155,28,28,0.3); }
.btn-primary span { position: relative; z-index: 1; }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-primary:disabled:hover::before { opacity: 0; }

#micBtn {
  width: 54px; height: 54px; flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 0 12px rgba(155,28,28,0.2), inset 0 0 10px rgba(0,0,0,0.4);
  animation: micBreath var(--dur-slow) ease-in-out infinite;
  position: relative;
}
#micBtn .icon { width: 20px; height: 20px; }
#micBtn::before {
  content: ''; position: absolute; inset: -5px;
  border-radius: 50%; border: 1px solid transparent;
  transition: border-color 0.3s;
}
#micBtn.active::before {
  border-color: rgba(217,79,43,0.45);
  animation: ringRotate 3s linear infinite;
}
#micBtn.active {
  background: rgba(120,15,15,0.85);
  border-color: var(--ember);
  animation: micPulse 0.8s ease-in-out infinite;
  color: #fff;
}
#micBtn:disabled { opacity: 0.4; cursor: not-allowed; animation: none; }

/* ── ORNAMENT ── */
.ornament {
  display: flex; align-items: center;
  gap: 10px; margin: 6px 0; width: 100%;
}
.ornament-line { flex: 1; height: 1px; background: var(--border); }
.ornament-diamond {
  width: 5px; height: 5px;
  border: 1px solid var(--gold-dim);
  transform: rotate(45deg); flex-shrink: 0;
}

/* ── VOICE ECHO ── */
.voice-echo {
  width: 100%; border: 1px solid transparent;
  border-radius: var(--radius); padding: 12px 16px;
  text-align: center; opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.4s;
  min-height: 52px;
}
.voice-echo.visible {
  opacity: 1; transform: translateY(0);
  border-color: var(--border);
  background: rgba(12,3,3,0.5);
}
.echo-label {
  font-size: 7px; letter-spacing: 0.5em;
  color: var(--text-muted); text-transform: uppercase; margin-bottom: 6px;
}
.echo-wave {
  display: flex; align-items: flex-end;
  justify-content: center; gap: 3px; height: 20px;
}
.wave-bar {
  width: 3px; border-radius: 2px;
  background: var(--ember); opacity: 0; transition: opacity 0.3s;
}
.voice-echo.visible .wave-bar {
  opacity: 1; animation: waveAnim 1.2s ease-in-out infinite;
}
.wave-bar:nth-child(1) { height: 35%; animation-delay: 0s; }
.wave-bar:nth-child(2) { height: 65%; animation-delay: 0.1s; }
.wave-bar:nth-child(3) { height: 92%; animation-delay: 0.2s; }
.wave-bar:nth-child(4) { height: 70%; animation-delay: 0.15s; }
.wave-bar:nth-child(5) { height: 40%; animation-delay: 0.05s; }

/* ── COUNTDOWN ── */
#countdown {
  position: fixed; inset: 0;
  display: none; align-items: center; justify-content: center;
  flex-direction: column; gap: 14px;
  background: rgba(2,0,0,0.9); backdrop-filter: blur(10px);
  z-index: 50;
}
.countdown-label {
  font-size: 9px; letter-spacing: 0.6em;
  color: var(--text-dim); text-transform: uppercase;
}
#countdownNum {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(56px, 18vw, 100px);
  color: var(--text);
  text-shadow: 0 0 30px var(--glow-red), 0 0 80px rgba(155,28,28,0.3);
  animation: countPop 0.4s ease-out; line-height: 1;
}
.countdown-breath {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  opacity: 0;
  animation: breathCueFade 3s ease-in-out forwards;
  min-height: 1.4em;
}

/* ── TOAST / NOTICE ── */
.toast-stack {
  position: fixed;
  left: 50%; bottom: 22px;
  transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px;
  z-index: 40;
  width: min(340px, 92vw);
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: rgba(10,4,3,0.92);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--text);
  box-shadow: var(--panel-shadow);
  opacity: 0; transform: translateY(6px);
  animation: toastIn 0.35s var(--ease-out) forwards, toastOut 0.4s ease-in forwards var(--toast-life, 4.2s);
}
.toast .icon { width: 15px; height: 15px; color: var(--gold); flex-shrink: 0; }
.toast.toast-warn { border-color: var(--danger); }
.toast.toast-warn .icon { color: var(--danger); }

/* ── OVERLAY / MODAL BASE ── */
.overlay {
  position: fixed; inset: 0;
  display: none; flex-direction: column;
  background: rgba(2,0,0,0.94); backdrop-filter: blur(12px);
  z-index: 60;
  overflow-y: auto;
}
.overlay.open { display: flex; }
.overlay-inner {
  width: 100%; max-width: 420px;
  margin: 0 auto;
  min-height: 100%;
  display: flex; flex-direction: column;
  padding: 22px 22px 32px;
}
.overlay-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; flex-shrink: 0;
}
.overlay-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 15px; letter-spacing: 0.22em;
  color: var(--text); text-transform: uppercase;
}
.overlay-body { flex: 1; display: flex; flex-direction: column; gap: 16px; }

/* Consent gate sits above everything else, and cannot be dismissed by
   clicking outside — entry requires a deliberate choice either way. */
#consentOverlay { z-index: 80; }
.consent-lede {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
}
.consent-list {
  display: flex; flex-direction: column; gap: 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: rgba(12,3,3,0.5);
}
.consent-list-title {
  font-size: 9px; letter-spacing: 0.35em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 4px;
}
.consent-item {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 12.5px; line-height: 1.55; color: var(--text);
}
.consent-item .ornament-diamond { margin-top: 6px; }
.consent-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.btn-consent-primary {
  height: 46px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--deep-crimson), rgba(155,28,28,0.55));
  border: 1px solid var(--border-hover);
  color: #fff; font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase;
}
.btn-consent-secondary {
  height: 40px; border-radius: var(--radius);
  background: transparent; border: 1px solid var(--border);
  color: var(--text-dim); font-size: 9px; letter-spacing: 0.25em; text-transform: uppercase;
}
.btn-consent-secondary:hover { color: var(--text); }
.consent-research-toggle {
  text-align: left; background: none; border: none;
  color: var(--text-dim); font-size: 10.5px; letter-spacing: 0.06em;
  text-decoration: underline; text-underline-offset: 3px;
  display: flex; align-items: center; gap: 6px; padding: 2px 0;
}
.consent-research-toggle .icon { width: 12px; height: 12px; transition: transform 0.25s; }
.consent-research-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.consent-research-panel {
  display: none;
  font-size: 11.5px; line-height: 1.6; color: var(--text-dim);
  border-left: 2px solid var(--border); padding-left: 12px;
}
.consent-research-panel.visible { display: block; }
.consent-research-panel p + p { margin-top: 8px; }

/* ── RETURN RITUAL ── */
#returnOverlay .overlay-inner { justify-content: center; }
.return-step {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
  animation: fadeIn 0.5s ease;
}
.return-step.active { display: flex; }
.return-icon {
  width: 52px; height: 52px;
  border: 1px solid var(--return-border); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.return-icon::before {
  content: ''; position: absolute; inset: -9px;
  border-radius: 50%; border: 1px solid rgba(217,154,63,0.14);
}
.return-icon .icon { width: 22px; height: 22px; color: var(--return); }
.return-text {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic; font-weight: 300;
  font-size: clamp(16px, 4.5vw, 19px);
  line-height: 1.6;
  color: var(--return-text);
}
.return-breath-ring {
  width: 64px; height: 64px; border-radius: 50%;
  border: 1px solid var(--return);
  animation: breathRing 5.2s ease-in-out 1;
}
.return-dots { display: flex; gap: 7px; margin-top: 4px; }
.return-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--return-dim); transition: background 0.3s; }
.return-dot.active { background: var(--return); }
.return-skip {
  margin-top: 22px;
  background: none; border: none;
  color: var(--text-muted); font-size: 9px; letter-spacing: 0.25em; text-transform: uppercase;
}
.return-skip:hover { color: var(--text-dim); }

/* Mood picker */
.mood-picker { display: flex; gap: 12px; justify-content: center; }
.mood-btn {
  width: 58px; height: 58px; border-radius: 50%;
  background: transparent; border: 1px solid var(--return-border);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.icon-slot { display: flex; align-items: center; justify-content: center; }
.mood-btn .icon { width: 26px; height: 26px; color: var(--return-dim); transition: color 0.2s; }
.mood-btn:hover { border-color: var(--return); }
.mood-btn.selected { background: rgba(217,154,63,0.16); border-color: var(--return); }
.mood-btn.selected .icon { color: var(--return); }
.mood-caption { font-size: 9px; letter-spacing: 0.15em; color: var(--text-muted); text-align: center; margin-top: 6px; }

.return-note {
  width: 100%; min-height: 74px; resize: vertical;
  background: rgba(12,3,3,0.4);
  border: 1px solid var(--return-border);
  border-radius: var(--radius);
  padding: 11px 13px;
  font-family: 'Josefin Sans', sans-serif; font-size: 13px; font-weight: 300;
  color: var(--return-text);
}
.return-note::placeholder { color: var(--text-muted); }
.return-note-count { font-size: 9px; color: var(--text-muted); text-align: right; margin-top: 4px; }

.return-summary {
  display: flex; flex-direction: column; gap: 4px; align-items: center;
}
.return-summary-time {
  font-family: 'Cinzel Decorative', serif; font-size: 22px;
  color: var(--return-text); letter-spacing: 0.1em;
}
.return-summary-meta { font-size: 10px; letter-spacing: 0.2em; color: var(--text-dim); text-transform: uppercase; }
.btn-return {
  margin-top: 20px; min-width: 160px; height: 46px;
  background: linear-gradient(135deg, var(--return-deep), rgba(217,154,63,0.35));
  border: 1px solid var(--return);
  border-radius: var(--radius);
  color: #fff; font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase;
}
.btn-return-ghost {
  margin-top: 10px; background: none; border: none;
  color: var(--text-dim); font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase;
}

/* ── JOURNAL PANEL ── */
.journal-stats {
  display: flex; gap: 10px;
}
.journal-stat {
  flex: 1; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 10px; text-align: center;
  background: rgba(12,3,3,0.4);
}
.journal-stat-num {
  font-family: 'Cinzel Decorative', serif; font-size: 19px; color: var(--text);
}
.journal-stat-label {
  font-size: 8px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-muted);
  margin-top: 3px;
}
.journal-list { display: flex; flex-direction: column; gap: 10px; }
.journal-entry {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start;
  background: rgba(12,3,3,0.35);
}
.journal-entry .icon { width: 20px; height: 20px; color: var(--text-dim); flex-shrink: 0; margin-top: 2px; }
.journal-entry-main { flex: 1; min-width: 0; }
.journal-entry-top { display: flex; justify-content: space-between; gap: 8px; font-size: 10.5px; color: var(--text-dim); letter-spacing: 0.04em; }
.journal-entry-note { margin-top: 6px; font-size: 12.5px; line-height: 1.5; color: var(--text); font-family: 'Cormorant Garamond', serif; font-style: italic; }
.journal-empty {
  text-align: center; padding: 40px 10px;
  color: var(--text-muted); font-size: 12px; line-height: 1.7;
  font-family: 'Cormorant Garamond', serif; font-style: italic;
}
.journal-clear {
  margin-top: 8px; align-self: center;
  background: none; border: none;
  color: var(--text-muted); font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase;
  display: flex; align-items: center; gap: 6px;
}
.journal-clear:hover { color: var(--danger); }
.journal-clear .icon { width: 12px; height: 12px; }

/* ── SETTINGS PANEL ── */
.settings-section { display: flex; flex-direction: column; gap: 14px; }
.settings-section + .settings-section {
  margin-top: 6px; padding-top: 18px; border-top: 1px solid var(--border);
}
.settings-section-title {
  font-size: 9px; letter-spacing: 0.35em; text-transform: uppercase; color: var(--text-muted);
}
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.settings-row-label { font-size: 12.5px; color: var(--text); }
.settings-row-desc { font-size: 10.5px; color: var(--text-dim); margin-top: 2px; line-height: 1.4; }

/* Toggle switch */
.toggle { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.toggle input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.toggle-track {
  position: absolute; inset: 0; border-radius: var(--radius-full);
  background: rgba(94,63,42,0.3); border: 1px solid var(--border);
  transition: background 0.2s, border-color 0.2s;
}
.toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--text-dim);
  transition: transform 0.2s var(--ease), background 0.2s;
}
.toggle input:checked ~ .toggle-track { background: rgba(155,28,28,0.4); border-color: var(--ember); }
.toggle input:checked ~ .toggle-thumb { transform: translateX(18px); background: var(--gold); }
.toggle input:focus-visible ~ .toggle-track { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* Range slider */
.slider {
  width: 120px; accent-color: var(--ember);
  height: 4px; background: transparent;
}

/* About / research capsule inside settings */
.about-text { font-size: 12px; line-height: 1.7; color: var(--text-dim); }
.about-text p + p { margin-top: 10px; }
.about-text strong { color: var(--text); font-weight: 400; }
.about-cite { font-size: 10px; color: var(--text-muted); margin-top: 4px; }

/* ── Small layout helpers used by the config panel and settings rows ── */
.config-row.stack { flex-direction: column; align-items: stretch; gap: 8px; }
.config-control.end { justify-content: flex-end; }

.settings-row-icon {
  width: 16px; height: 16px; flex-shrink: 0; color: var(--text-dim);
}
.settings-row-icon .icon { width: 16px; height: 16px; }
.settings-row-label--grow { flex: 1; }

#returnOverlay .return-step[data-step="note"] { width: 100%; }
