/* ============================================================
   MasterLife Together — design tokens & base styles
   ============================================================ */

:root {
  /* color tokens — light theme (default) */
  --bg: #faf6f0;            /* warm cream */
  --surface: #ffffff;
  --surface-2: #f4ede0;     /* tinted surface */
  --text: #2a2828;
  --text-soft: #5a5550;
  --text-muted: #8a8580;
  --border: #e6dccc;
  --border-soft: #f0e8db;

  --primary: #c8654e;       /* coral, from the Disciple's Cross artwork */
  --primary-soft: #e8a294;
  --primary-bg: #fbe9e3;    /* very light coral tint */

  --accent: #1d3d3a;        /* deep teal, from the book logo text */
  --accent-soft: #3d5e5b;
  --brand: #1d3d3a;         /* alias for the logo brand color */

  --success: #5a8a5a;
  --warm: #d4a84b;

  --shadow-sm: 0 1px 2px rgba(50, 30, 20, 0.04);
  --shadow-md: 0 2px 8px rgba(50, 30, 20, 0.06);
  --shadow-lg: 0 6px 24px rgba(50, 30, 20, 0.08);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* type */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
}

[data-theme="dark"] {
  --bg: #0d1820;
  --surface: #15232e;
  --surface-2: #1c2c38;
  --text: #f0ece4;
  --text-soft: #c5beb2;
  --text-muted: #8a8580;
  --border: #2a3d4d;
  --border-soft: #1c2c38;

  --primary: #e8927c;
  --primary-soft: #d47860;
  --primary-bg: #2d1f1a;

  --accent: #9bc5be;        /* light teal for dark mode */
  --accent-soft: #6fa097;
  --brand: #9bc5be;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 6px 24px rgba(0, 0, 0, 0.4);
}

/* ============================================================
   reset & base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  min-height: 100dvh;            /* iOS Safari: stable height that excludes the dynamic URL bar */
  background: var(--bg);
  color: var(--text);
  transition: background 0.2s ease, color 0.2s ease;
  overscroll-behavior-y: contain; /* don't show the OS rubber-band background on pull */
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   layout
   ============================================================ */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 18px 80px;
}

.container-narrow { max-width: 560px; }

/* ============================================================
   top bar
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border-soft);
  /* Use env() so notched iPhones in landscape don't slide content under the camera */
  padding: max(12px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 12px max(18px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#coupleNames {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 38vw;
}

.topbar-couple {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.topbar-couple .avatars {
  display: inline-flex;
  align-items: center;
}
.topbar-couple .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  border: 2px solid var(--surface);
  box-shadow: var(--shadow-sm);
}
.topbar-couple .avatar + .avatar { margin-left: -10px; }

.topbar-actions { display: flex; gap: 4px; align-items: center; }

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  transition: background 0.15s ease, color 0.15s ease;
}
.theme-toggle:hover { background: var(--surface-2); color: var(--text); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: inline; }
[data-theme="dark"] .theme-toggle .moon { display: none; }

/* ============================================================
   typography helpers
   ============================================================ */
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--primary);
}

.section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 36px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 6vw, 38px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text);
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(22px, 4.5vw, 28px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

p { color: var(--text-soft); line-height: 1.65; }

.lead {
  font-size: 18px;
  color: var(--text-soft);
  line-height: 1.55;
}

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

/* ============================================================
   cards
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.card-hero {
  background: linear-gradient(135deg, var(--primary-bg) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-md);
}

.story-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 22px;
}

.story-card .ref {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.story-card .title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}

.story-card .body {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-soft);
}

.story-card .body p + p { margin-top: 10px; }

.verse-card {
  background: var(--primary-bg);
  border: 1px solid var(--primary-soft);
  border-radius: var(--radius-md);
  padding: 24px 22px;
  text-align: center;
}

.verse-card .text {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.55;
  color: var(--text);
  font-style: italic;
  margin-bottom: 12px;
}

.verse-card .ref {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 1px;
}

.prayer-card {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 22px;
  text-align: center;
}

.prayer-card .text {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  font-style: italic;
}

/* ============================================================
   buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 15px;
  transition: transform 0.1s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { background: var(--primary-soft); text-decoration: none; }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface-2); text-decoration: none; }

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

.btn-lg {
  padding: 18px 28px;
  font-size: 17px;
}

.btn-block { display: flex; width: 100%; }

/* ============================================================
   media player block
   ============================================================ */
.media-block {
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  background: var(--surface-2);
}
.video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.audio-player {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-top: 1px solid var(--border-soft);
}
.audio-player audio { flex: 1; height: 38px; }

/* ============================================================
   journey list (sidebar of weeks)
   ============================================================ */
.journey-section {
  margin-top: 8px;
}

.journey-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 14px 4px 8px;
}

.journey-week {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: background 0.12s ease;
}
.journey-week:hover { background: var(--surface-2); text-decoration: none; }

.journey-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-muted);
}
.journey-week.done .journey-dot {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.journey-week.current .journey-dot {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.journey-week.locked { opacity: 0.5; }

.journey-week-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.journey-week-meta {
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================================
   journey progress strip (12-week dots)
   ============================================================ */
.journey-strip {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  margin-top: 18px;
  flex-wrap: wrap;
}
.journey-pill {
  flex: 0 0 auto;
  width: 28px;
  height: 12px;
  border-radius: 6px;
  background: var(--border);
  transition: background 0.25s ease, transform 0.15s ease;
  position: relative;
}
/* Invisible padding extends the touch target without changing the visual.
   12 + 16*2 = 44px tall hit area; meets the Apple HIG min. */
.journey-pill::before {
  content: '';
  position: absolute;
  inset: -16px -3px;
}
.journey-pill.done { background: var(--primary); }
.journey-pill.current {
  background: var(--primary);
  transform: scaleY(1.35);
  box-shadow: 0 0 0 3px var(--primary-bg);
}

.journey-summary {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}
.journey-summary strong { color: var(--text); font-weight: 600; }

/* ============================================================
   Disciple's Cross SVG
   ============================================================ */
.disciples-cross {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

.disciples-cross .arm,
.disciples-cross .arm-center {
  fill: var(--primary-bg);
  transition: fill 0.6s ease;
}
.disciples-cross .arm.lit,
.disciples-cross .arm-center.lit {
  fill: var(--primary);
}

.disciples-cross .ring-body,
.disciples-cross .ring-soul,
.disciples-cross .ring-spirit {
  stroke: var(--primary-soft);
  opacity: 0.45;
  transition: stroke 0.6s ease, opacity 0.6s ease;
}
.disciples-cross .ring-body.lit,
.disciples-cross .ring-soul.lit,
.disciples-cross .ring-spirit.lit {
  stroke: var(--primary);
  opacity: 1;
}

.disciples-cross .lbl-arm {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  fill: var(--text-soft);
  letter-spacing: 0.5px;
}

.disciples-cross .lbl-inner {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  fill: var(--text);
  letter-spacing: 0.8px;
}

.disciples-cross .lbl-inner-sm {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  fill: var(--text);
  letter-spacing: 0.6px;
}

/* ============================================================
   day flow specific
   ============================================================ */
.both-here {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.both-here-label {
  font-size: 14px;
  color: var(--text-soft);
}

.both-here-buttons { display: flex; gap: 8px; }

.both-btn {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text-soft);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s ease;
}
.both-btn.checked {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.both-btn.checked::before { content: "✓ "; }

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 14px;
  position: relative;
  transition: all 0.2s ease;
}
.step-card.done {
  background: var(--surface-2);
  border-color: var(--border-soft);
}
.step-card.done .step-body { opacity: 0.65; }

.step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.step-card.done .step-num { background: var(--success); }
.step-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.step-body {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-soft);
}
.step-body p + p { margin-top: 10px; }

.step-confirm {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

/* ============================================================
   story feature (top of day flow)
   ============================================================ */
.story-feature {
  background: linear-gradient(160deg, var(--primary-bg) 0%, var(--surface) 100%);
  border: 1px solid var(--primary-soft);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  box-shadow: var(--shadow-md);
  margin-bottom: 18px;
}

.story-feature .feat-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 8px;
}

.story-feature .feat-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 4px;
}

.story-feature .feat-ref {
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.story-feature .feat-audio {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-soft);
}
.story-feature .feat-audio audio { flex: 1; height: 36px; }

.story-feature .feat-toggle {
  display: block;
  margin-top: 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  background: transparent;
  padding: 8px 0;
  text-align: center;
  width: 100%;
}

.story-feature .feat-text {
  display: none;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--primary-soft);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
}
.story-feature.expanded .feat-text { display: block; }
.story-feature .feat-text p + p { margin-top: 10px; }

/* ============================================================
   "who we told" widget
   ============================================================ */
.told-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.told-widget .told-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.told-widget .told-heading {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.told-widget .told-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-bg);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.told-widget .told-help {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

.told-list {
  list-style: none;
  margin: 0 0 12px;
}
.told-item {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--border-soft);
}
.told-item:first-child { border-top: 0; }
.told-item .told-info { flex: 1; }
.told-item .told-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.told-item .told-date { font-size: 12px; color: var(--text-muted); }
.told-item .told-notes {
  font-size: 14px;
  color: var(--text-soft);
  margin-top: 4px;
  font-style: italic;
}
.told-item textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;            /* iOS won't auto-zoom inputs that are already ≥16px */
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 4px;
  resize: vertical;
  min-height: 60px;
}
.told-item .told-actions { display: flex; flex-direction: column; gap: 6px; }
.told-item .told-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.told-item .told-icon-btn:hover { background: var(--surface-2); color: var(--text); }

.told-add {
  display: flex;
  gap: 8px;
}
.told-add input {
  flex: 1;
  font-family: var(--font-body);
  font-size: 16px;            /* ≥16px so iOS doesn't auto-zoom on focus */
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 12px 16px;
  min-width: 0;
}
.told-add input:focus {
  outline: none;
  border-color: var(--primary-soft);
}
.told-add button {
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}
.told-add button:hover { background: var(--primary-soft); }

/* ============================================================
   step engine (guided day-flow sequence)
   ============================================================ */
.step-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.step-header {
  padding: max(12px, env(safe-area-inset-top)) 18px 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
}
.step-header .step-back-link {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}
.step-header .step-back-link:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.step-header .step-back-link.hidden { visibility: hidden; }
.step-header .step-meta {
  flex: 1;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.step-header .step-meta .step-couple { display: block; color: var(--brand); margin-top: 2px; font-weight: 700; font-family: var(--font-display); letter-spacing: 0; text-transform: none; font-size: 13px; }

.step-progress {
  display: flex;
  gap: 5px;
  justify-content: center;
  padding: 6px 18px 0;
}
.step-progress-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.25s ease, transform 0.15s ease;
}
.step-progress-dot.done { background: var(--accent); }
.step-progress-dot.current { background: var(--primary); transform: scale(1.4); }

.step-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 24px 20px 140px;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

.step-view { animation: step-in 0.25s ease-out both; }
@keyframes step-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.step-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 8px;
}
.step-h {
  font-family: var(--font-display);
  font-size: clamp(26px, 5vw, 34px);
  font-weight: 700;
  line-height: 1.18;
  color: var(--text);
  margin-bottom: 12px;
}
.step-sub {
  font-size: 16px;
  color: var(--text-soft);
  line-height: 1.55;
  margin-bottom: 20px;
}

.step-body-text {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
}
.step-body-text p + p { margin-top: 12px; }

.step-narrative {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 20px 22px;
  margin-top: 16px;
}
.step-narrative p + p { margin-top: 10px; }

.step-audio {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.step-audio audio { flex: 1; height: 38px; min-width: 0; }

.step-tell-card {
  background: var(--primary-bg);
  border: 1px solid var(--primary-soft);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  margin-top: 8px;
}
.step-tell-card .turn {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 6px;
}
.step-tell-card .turn-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.step-prayer-box {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  text-align: center;
  margin-top: 16px;
}
.step-prayer-box .text {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.7;
  font-style: italic;
  color: var(--text);
}

.step-godgave-input {
  width: 100%;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-top: 8px;
  transition: border-color 0.15s ease;
  resize: none;
  min-height: 72px;
}
.step-godgave-input:focus { outline: none; border-color: var(--primary); }
.step-godgave-prior {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.step-listen-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-bg);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  margin-bottom: 10px;
}
.step-listen-btn:active { transform: scale(0.97); }

/* told form: name + outcome radios + memory */
.told-form { margin-top: 8px; }
.told-form input[type="text"], .told-form textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 12px;
}
.told-form textarea { resize: none; min-height: 60px; }
.told-form input:focus, .told-form textarea:focus { outline: none; border-color: var(--primary); }

.outcome-options { display: grid; grid-template-columns: 1fr; gap: 6px; margin-bottom: 12px; }
.outcome-options label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 15px;
  color: var(--text);
  transition: background 0.12s ease, border-color 0.12s ease;
}
.outcome-options label:has(input:checked),
.outcome-options label.checked {
  background: var(--primary-bg);
  border-color: var(--primary-soft);
}
.outcome-options input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.told-saved {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.told-saved .name { font-weight: 600; color: var(--text); }
.told-saved .outcome {
  display: inline-block;
  margin-left: 6px;
  font-size: 12px;
  color: var(--primary);
  background: var(--primary-bg);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}
.told-saved .memory {
  margin-top: 6px;
  color: var(--text-soft);
  font-style: italic;
  font-size: 14px;
}

.step-done-card {
  text-align: center;
  background: var(--primary-bg);
  border: 1px solid var(--primary-soft);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
}
.step-done-card .glyph { font-size: 44px; line-height: 1; margin-bottom: 8px; }
.step-done-card .next-hint {
  margin-top: 14px;
  font-size: 14px;
  color: var(--text-soft);
}

.step-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  border-top: 1px solid var(--border-soft);
  padding: 14px 18px max(14px, env(safe-area-inset-bottom)) 18px;
  display: flex;
  gap: 10px;
  z-index: 20;
}
.step-nav .step-forward {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 24px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 16px;
  box-shadow: var(--shadow-md);
  transition: transform 0.08s ease;
}
.step-nav .step-forward:active { transform: scale(0.985); }
.step-nav .step-forward.ghost {
  background: transparent;
  color: var(--text-muted);
  font-weight: 500;
  box-shadow: none;
}

.step-skip {
  display: block;
  margin-top: 16px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  background: transparent;
  width: 100%;
  padding: 8px;
}
.step-skip:hover { color: var(--text-soft); }

/* ============================================================
   day card (week page summary view)
   ============================================================ */
.day-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 10px;
  color: var(--text);
  transition: all 0.15s ease;
}
.day-card:hover {
  border-color: var(--primary-soft);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.day-card.locked { opacity: 0.5; pointer-events: none; }

.day-card-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.day-card-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.day-card.done .day-card-num {
  background: var(--success);
  color: #fff;
}
.day-card.current .day-card-num {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 4px var(--primary-bg);
}
.day-card-text { flex: 1; }
.day-card-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.day-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-top: 2px;
}
.day-card-arrow { color: var(--text-muted); font-size: 18px; }

/* ============================================================
   empty / loading states
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.empty-state h2 { font-size: 20px; margin-bottom: 8px; color: var(--text-soft); }
.empty-state p { font-size: 15px; }

.loading {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   landing page
   ============================================================ */
.landing-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: max(14px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 14px max(20px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid transparent;
}

.brand {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--brand);
}

.brand-logo-sm {
  display: block;
  height: 36px;
  width: auto;
}

.brand-logo-hero {
  display: block;
  max-width: min(520px, 88vw);
  width: 100%;
  height: auto;
  margin: 0 auto;
}

.brand-logo-md {
  display: block;
  max-width: 280px;
  width: 100%;
  height: auto;
  margin: 4px auto 0;
}

/* Dark mode: invert dark-teal text/lines so they read as light teal,
   and hue-rotate back so the colored figure fills stay roughly themselves. */
[data-theme="dark"] .brand-logo-sm,
[data-theme="dark"] .brand-logo-md,
[data-theme="dark"] .brand-logo-hero {
  filter: invert(0.92) hue-rotate(180deg);
}

.landing-hero {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 24px;
  text-align: center;
}

.landing-hero .hero-cross {
  margin-bottom: 24px;
}

.landing-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 7vw, 52px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--text);
}

.landing-hero h1 .accent { color: var(--primary); }

.landing-hero .hero-sub {
  font-size: clamp(17px, 2.2vw, 20px);
  color: var(--text-soft);
  line-height: 1.5;
  margin-top: 18px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.landing-hero .hero-ctas {
  margin-top: 28px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.google-btn:hover { background: var(--surface-2); text-decoration: none; box-shadow: var(--shadow-md); }
.google-btn svg { width: 18px; height: 18px; }

.landing-byline {
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.landing-section {
  max-width: 760px;
  margin: 60px auto 0;
  padding: 0 20px;
}
.landing-section h2 {
  font-family: var(--font-display);
  font-size: clamp(22px, 3.5vw, 28px);
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.01em;
}
.landing-section .section-lead {
  text-align: center;
  font-size: 17px;
  color: var(--text-soft);
  line-height: 1.6;
  max-width: 580px;
  margin: 12px auto 0;
}

.parts-grid {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.part-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}
.part-card .part-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--primary);
}
.part-card .part-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-top: 4px;
  line-height: 1.3;
}
.part-card .part-weeks {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.stories-list {
  margin-top: 24px;
  display: grid;
  gap: 8px;
}
.story-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
}
.story-row .story-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}
.story-row .story-info { min-width: 0; }
.story-row .story-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.story-row .story-theme {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 1px;
}
.story-row .story-ref {
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 600;
  white-space: nowrap;
}

.section-divider {
  max-width: 760px;
  margin: 60px auto 0;
  padding: 0 20px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--primary);
  position: relative;
}
.section-divider span {
  background: var(--bg);
  padding: 0 14px;
  position: relative;
  z-index: 1;
}
.section-divider::before {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  top: 50%;
  height: 1px;
  background: var(--border);
  z-index: 0;
}

.landing-footer {
  max-width: 760px;
  margin: 80px auto 40px;
  padding: 0 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ============================================================
   toast (non-blocking notifications, replaces alert())
   ============================================================ */
.toast-stack {
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  padding: 0 16px;
}
.toast {
  pointer-events: auto;
  max-width: 90vw;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius-pill);
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.2s ease-out both;
}
.toast.toast-error { background: var(--primary); color: #fff; }
.toast.toast-success { background: var(--success); color: #fff; }
.toast.toast-hide { animation: toast-out 0.2s ease-in both; }
@keyframes toast-in {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes toast-out {
  from { transform: translateY(0); opacity: 1; }
  to   { transform: translateY(20px); opacity: 0; }
}

/* ============================================================
   utility
   ============================================================ */
.row { display: flex; gap: 12px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 12px; }
.between { justify-content: space-between; }
.center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
