/* ---------------------------------------------------------
   Power of Positivity — Design Tokens
--------------------------------------------------------- */
:root {
  /* Colors */
  --color-bg: #F6EFE3;            /* rich warm cream / sand background */
  --color-card: #FFFBF4;          /* warm off-white card, lifts off the page */
  --color-card-alt: #F2E8D7;      /* deeper sand, for featured / contrast cards */
  --color-accent: #9E7738;        /* deep warm gold accent */
  --color-accent-soft: #D8BE8E;   /* lighter gold, for subtle fills */
  --color-text: #332C23;          /* warm near-black for body text */
  --color-text-muted: #7D705E;    /* muted warm grey-brown */
  --color-border: #E8DCC6;        /* faint warm border */
  --color-white: #FFFFFF;

  /* Typography */
  --font-heading: 'Cormorant Garamond', serif;
  --font-body: 'Jost', sans-serif;

  /* Radii */
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 12px;

  /* Shadows (soft, diffused, warm-toned) */
  --shadow-soft: 0 2px 12px rgba(110, 80, 40, 0.06);
  --shadow-card: 0 1px 2px rgba(110, 80, 40, 0.04), 0 12px 32px -10px rgba(110, 80, 40, 0.16);
  --shadow-button: 0 6px 18px -8px rgba(120, 85, 35, 0.55);

  /* Motion */
  --ease-calm: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* Layout */
  --max-width: 430px;
  --nav-height: 76px;
  --space-xs: 6px;
  --space-sm: 12px;
  --space-md: 20px;
  --space-lg: 28px;
  --space-xl: 40px;
}

/* ---------------------------------------------------------
   Reset
--------------------------------------------------------- */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* Long unbroken text (e.g. a pasted link) wraps instead of running off-screen */
  overflow-wrap: anywhere;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.005em;
  margin: 0;
  color: var(--color-text);
}

p {
  margin: 0;
}

button {
  font-family: var(--font-body);
  border: none;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

img {
  max-width: 100%;
  display: block;
}

/* ---------------------------------------------------------
   App shell — mobile-first, centered on desktop
--------------------------------------------------------- */
.app-shell {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  background: var(--color-bg);
  box-shadow: var(--shadow-soft);
}

/* On wider screens, give the illusion of a phone frame */
@media (min-width: 480px) {
  body {
    background: #EAE0CE;
  }
  .app-shell {
    margin-top: var(--space-lg);
    margin-bottom: var(--space-lg);
    min-height: calc(100vh - 2 * var(--space-lg));
    border-radius: var(--radius-lg);
    overflow: hidden;
  }
}

/* ---------------------------------------------------------
   Screen root — where screens get injected
--------------------------------------------------------- */
.screen-root {
  padding: var(--space-md) var(--space-md) calc(var(--nav-height) + var(--space-md));
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------------------------------------------------------
   Shared card component (for future screens)
--------------------------------------------------------- */
.card {
  background: var(--color-card);
  border: 1px solid rgba(232, 220, 198, 0.55);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-card);
  transition: transform 0.35s var(--ease-calm), box-shadow 0.35s var(--ease-calm);
}

/* ---------------------------------------------------------
   Bottom navigation
--------------------------------------------------------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: var(--max-width);
  margin: 0 auto;
  height: var(--nav-height);
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--color-text-muted);
  transition: color 0.2s ease;
  padding: var(--space-xs) 0;
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
}

.nav-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.nav-item.is-active {
  color: var(--color-accent);
}

/* ---------------------------------------------------------
   Utility text styles (available to future screens)
--------------------------------------------------------- */
.eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent);
}

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

/* ---------------------------------------------------------
   Home / Today screen
--------------------------------------------------------- */

.home-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  padding-top: var(--space-xs);
  position: relative;
  isolation: isolate;
}

/* Soft warm atmosphere behind the greeting: bleeds to the screen
   edges and fades out before the first card. */
.home-header::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: calc(-1 * var(--space-md));
  left: calc(-1 * var(--space-md));
  right: calc(-1 * var(--space-md));
  bottom: calc(-1 * var(--space-lg));
  pointer-events: none;
  background:
    radial-gradient(90% 80% at 85% 0%, rgba(216, 190, 142, 0.28) 0%, rgba(216, 190, 142, 0) 70%),
    linear-gradient(180deg, rgba(232, 208, 164, 0.32) 0%, rgba(240, 224, 196, 0.16) 55%, rgba(246, 239, 227, 0) 100%);
}

.home-greeting {
  font-size: 26px;
  line-height: 1.2;
}

.home-subtitle {
  margin-top: 6px;
  font-size: 14px;
}

.home-progress {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.avatar-btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.avatar-btn:active {
  transform: scale(0.94);
}

.avatar-btn svg {
  width: 20px;
  height: 20px;
}

.avatar-initial {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 600;
  color: var(--color-accent);
}

/* Shared card spacing rhythm */
.screen-root .card + .card {
  margin-top: var(--space-md);
}

.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

/* Mindset card */
.mindset-card {
  background: var(--color-card-alt);
  text-align: center;
  padding: var(--space-lg) var(--space-md);
}

.mindset-statement {
  margin-top: var(--space-sm);
  font-family: var(--font-heading);
  font-size: 22px;
  font-style: italic;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text);
}

/* Goal card */
.goal-card {
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.goal-card:active {
  transform: scale(0.99);
}

.goal-chevron {
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
  display: flex;
}

.goal-chevron svg {
  width: 100%;
  height: 100%;
}

.goal-title {
  margin-top: 10px;
  font-size: 20px;
}

.progress-track {
  margin-top: var(--space-sm);
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--color-border);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--color-accent);
  transition: width 0.4s ease;
}

.progress-percent {
  margin-top: var(--space-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-accent);
}

.goal-target {
  margin-top: var(--space-sm);
  font-size: 13px;
}

.goal-empty-prompt {
  margin-top: 8px;
  font-size: 16px;
  font-family: var(--font-heading);
  font-weight: 600;
}

.btn-primary {
  margin-top: var(--space-md);
  width: 100%;
  padding: 14px var(--space-md);
  border-radius: var(--radius-sm);
  background: var(--color-accent);
  color: var(--color-white);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  box-shadow: var(--shadow-button);
  transition: transform 0.3s var(--ease-calm), box-shadow 0.3s var(--ease-calm), opacity 0.3s var(--ease-calm), filter 0.3s var(--ease-calm);
}

.btn-primary:active {
  transform: scale(0.98);
  opacity: 0.94;
  box-shadow: 0 3px 10px -6px rgba(120, 85, 35, 0.5);
}

/* Action card */
.action-card {
  border: 1px solid var(--color-accent-soft);
}

.action-row {
  margin-top: 10px;
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}

.action-check {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--color-accent-soft);
  background: var(--color-white);
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.action-check svg {
  width: 16px;
  height: 16px;
}

.action-check:active {
  transform: scale(0.9);
}

.action-card.is-done .action-check {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-white);
}

.action-text {
  flex: 1;
}

.action-title {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  transition: color 0.2s ease;
}

.action-card.is-done .action-title {
  color: var(--color-text-muted);
}

.action-help {
  margin-top: 4px;
  font-size: 13px;
}

.action-status {
  margin-top: var(--space-sm);
  min-height: 16px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-accent);
}

/* Affirmation card — tap to flip.
   Both faces share one grid cell, so the card is as tall as
   the taller face and nothing jumps when it turns. */
.affirmation-flip {
  margin-top: var(--space-md);
  perspective: 1200px;
}

.affirmation-flip-inner {
  display: grid;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: center;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 1.1s cubic-bezier(0.45, 0.05, 0.25, 1);
  -webkit-tap-highlight-color: transparent;
}

.affirmation-flip.is-flipped .affirmation-flip-inner {
  transform: rotateY(180deg);
}

.affirmation-flip-inner:focus-visible {
  outline: 2px solid var(--color-accent-soft);
  outline-offset: 4px;
  border-radius: var(--radius-md);
}

.affirmation-face {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 168px;
  padding: var(--space-lg) var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid rgba(216, 190, 142, 0.45);
  box-shadow: var(--shadow-card);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.affirmation-face--front {
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 251, 244, 0.9) 0%, rgba(255, 251, 244, 0) 70%),
    linear-gradient(165deg, #FBF3E4 0%, #F1E2C6 100%);
}

.affirmation-face--back {
  background: var(--color-card);
  transform: rotateY(180deg);
}

.affirmation-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  background: rgba(255, 251, 244, 0.75);
  border: 1px solid rgba(216, 190, 142, 0.5);
}

.affirmation-icon svg {
  width: 20px;
  height: 20px;
}

.affirmation-hint {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.affirmation-face--front .affirmation-hint {
  animation: affirmation-breathe 3.6s ease-in-out infinite;
}

@keyframes affirmation-breathe {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}

.affirmation-statement {
  max-width: 15em;
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: 0.005em;
  text-wrap: balance;
  color: var(--color-text);
  transition: opacity 0.35s var(--ease-calm), transform 0.35s var(--ease-calm);
}

.affirmation-statement.is-changing {
  opacity: 0;
  transform: translateY(4px);
}

/* "New affirmation" sits under the card and only appears once it
   has turned over (visibility keeps it out of the tab order). */
.affirmation-new-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: var(--space-sm) auto 0;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--color-accent);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease-calm), visibility 0s linear 0.4s;
}

.affirmation-new-btn svg {
  width: 16px;
  height: 16px;
}

.affirmation-new-btn:active {
  opacity: 0.7;
}

.affirmation-new-btn:focus-visible {
  outline: 2px solid var(--color-accent-soft);
  outline-offset: 2px;
}

.affirmation-flip.is-flipped .affirmation-new-btn {
  opacity: 1;
  visibility: visible;
  /* waits for the card to finish turning */
  transition: opacity 0.5s var(--ease-calm) 0.7s, visibility 0s;
}

/* Reduced motion: no 3D turn — the faces simply swap. */
@media (prefers-reduced-motion: reduce) {
  .affirmation-flip-inner,
  .affirmation-flip.is-flipped .affirmation-flip-inner {
    transition: none;
    transform: none;
  }
  .affirmation-face--back {
    transform: none;
    visibility: hidden;
  }
  .affirmation-flip.is-flipped .affirmation-face--front {
    visibility: hidden;
  }
  .affirmation-flip.is-flipped .affirmation-face--back {
    visibility: visible;
  }
  .affirmation-face--front .affirmation-hint {
    animation: none;
  }
  .affirmation-statement,
  .affirmation-new-btn,
  .affirmation-flip.is-flipped .affirmation-new-btn {
    transition: none;
  }
}

/* "What's next" — one gentle next step under the greeting.
   Becomes a quiet completion note once today's practice is done. */
.next-step-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  width: 100%;
  padding: 18px 22px;
  text-align: left;
  color: inherit;
  font: inherit;
  border: 1px solid rgba(216, 190, 142, 0.6);
}

.next-step-card:active {
  transform: scale(0.985);
  box-shadow: var(--shadow-soft);
}

.next-step-card:focus-visible {
  outline: 2px solid var(--color-accent-soft);
  outline-offset: 3px;
}

.next-step-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.next-step-label {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text);
}

.next-step-arrow {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  background: rgba(216, 190, 142, 0.18);
  transition: transform 0.4s var(--ease-calm);
}

.next-step-arrow svg {
  width: 18px;
  height: 18px;
}

@media (hover: hover) {
  .next-step-card:hover .next-step-arrow {
    transform: translateX(3px);
  }
}

.next-step-card--complete {
  display: block;
  text-align: center;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255, 251, 244, 0.9) 0%, rgba(255, 251, 244, 0) 70%),
    linear-gradient(165deg, #FBF3E4 0%, #F1E2C6 100%);
}

.next-step-note {
  display: block;
  margin-top: 2px;
  font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
  .next-step-arrow,
  .next-step-card:hover .next-step-arrow {
    transition: none;
    transform: none;
  }
}

/* ---------------------------------------------------------
   Affirmation repetition (shared/affirmation.js)
   Used as Today's hero card and as the guided day's first part.
--------------------------------------------------------- */

.repeat {
  position: relative;
  isolation: isolate;
  text-align: center;
}

/* Soft halo that blooms behind the words on each repetition. */
.repeat::after {
  content: '';
  position: absolute;
  z-index: -1;
  top: 10%;
  left: 50%;
  width: 280px;
  height: 180px;
  margin-left: -140px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(232, 200, 140, 0.55), rgba(232, 200, 140, 0));
  opacity: 0;
  pointer-events: none;
}

.repeat.is-pulsing::after {
  animation: repeat-halo 1.4s var(--ease-calm);
}

.repeat.is-pulsing .repeat-statement {
  animation: repeat-glow 1.4s var(--ease-calm);
}

@keyframes repeat-halo {
  0%   { opacity: 0; transform: scale(0.85); }
  30%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.08); }
}

@keyframes repeat-glow {
  0%   { text-shadow: 0 0 0 rgba(201, 160, 90, 0); }
  30%  { text-shadow: 0 0 22px rgba(201, 160, 90, 0.55); }
  100% { text-shadow: 0 0 0 rgba(201, 160, 90, 0); }
}

.repeat-statement {
  max-width: 14em;
  margin: 14px auto 0;
  font-family: var(--font-heading);
  font-size: 31px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.005em;
  text-wrap: balance;
  color: var(--color-text);
  transition: opacity 0.35s var(--ease-calm), transform 0.35s var(--ease-calm);
}

/* A fine gold hairline above the words, like a page ornament. */
.repeat-statement::before {
  content: '';
  display: block;
  width: 36px;
  height: 1px;
  margin: 0 auto 16px;
  background: linear-gradient(90deg, rgba(158, 119, 56, 0), rgba(158, 119, 56, 0.7), rgba(158, 119, 56, 0));
}

/* "I am" set apart in soft gold, so the rest reads as the promise. */
.affirm-lead {
  color: var(--color-accent);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.repeat-statement.is-changing {
  opacity: 0;
  transform: translateY(4px);
}

.repeat-guide {
  margin-top: 10px;
  font-size: 13px;
}

.repeat-dots {
  margin-top: var(--space-md);
  display: flex;
  justify-content: center;
  gap: 10px;
}

.repeat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--color-accent-soft);
  transition: background-color 0.5s var(--ease-calm), border-color 0.5s var(--ease-calm), transform 0.5s var(--ease-calm);
}

.repeat-dot.is-filled {
  background: var(--color-accent);
  border-color: var(--color-accent);
  transform: scale(1.1);
}

.repeat-count {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.repeat-btn {
  margin-top: var(--space-sm);
}

/* Done: the Repeat controls give way to a soft confirmation. */
.repeat-done,
.repeat.is-complete .repeat-active {
  display: none;
}

.repeat.is-complete .repeat-done {
  display: block;
  animation: repeat-done-in 0.7s var(--ease-calm) both;
}

@keyframes repeat-done-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.repeat-done-text {
  margin-top: var(--space-md);
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 19px;
  color: var(--color-accent);
  outline: none;
}

/* Today's hero: the screen's focal point — warmer, larger, lifted. */
.repeat-hero {
  overflow: hidden;
  padding: var(--space-xl) var(--space-md) var(--space-lg);
  border: 1px solid rgba(216, 190, 142, 0.65);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 251, 244, 0.95) 0%, rgba(255, 251, 244, 0) 65%),
    linear-gradient(170deg, #F8EBD3 0%, #EFD8B0 100%);
  box-shadow: 0 1px 2px rgba(110, 80, 40, 0.05), 0 18px 40px -14px rgba(140, 100, 40, 0.38);
}

.repeat-hero .repeat-guide {
  color: #6F6250;
}

/* Below the main practice, the supporting cards sit a step quieter. */
.home-section-label {
  margin: var(--space-xl) 0 var(--space-sm);
  padding-left: 4px;
  color: var(--color-text-muted);
}

.home-section-label ~ .mindset-card {
  padding: var(--space-md);
  background: var(--color-card);
}

.home-section-label ~ .mindset-card .mindset-statement {
  font-size: 20px;
}

@media (prefers-reduced-motion: reduce) {
  .repeat.is-pulsing::after,
  .repeat.is-pulsing .repeat-statement,
  .repeat.is-complete .repeat-done {
    animation: none;
  }
  .repeat-statement,
  .repeat-dot {
    transition: none;
  }
}

/* ---------------------------------------------------------
   Guided day (screens/day-flow.js)
   Its parts reuse the ritual step card (.practice-step-card);
   these add the Morning / Evening progress dots, the habit
   checklist, and the slide between parts.
--------------------------------------------------------- */

.day-flow {
  padding-top: var(--space-sm);
}

.day-flow-progress {
  position: relative;
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  margin: 0 0 var(--space-md);
}

.day-flow-phase {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.day-flow-phase-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.day-flow-phase.is-current .day-flow-phase-label {
  color: var(--color-accent);
  font-weight: 600;
}

.day-flow-dots {
  display: flex;
  gap: 8px;
}

.day-flow-progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border);
  transition: background-color 0.4s var(--ease-calm), box-shadow 0.4s var(--ease-calm);
}

.day-flow-progress-dot.is-done {
  background: var(--color-accent-soft);
}

.day-flow-progress-dot.is-current {
  background: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(216, 190, 142, 0.35);
}

/* Inside a ritual scene the dots sit above the sliding card. */
.ritual-scene > .day-flow-progress {
  z-index: 1;
}

.ritual-scene--night .day-flow-phase-label {
  color: rgba(245, 241, 232, 0.6);
}

.ritual-scene--night .day-flow-phase.is-current .day-flow-phase-label {
  color: #F5F1E8;
}

.ritual-scene--night .day-flow-progress-dot {
  background: rgba(255, 255, 255, 0.25);
}

.ritual-scene--night .day-flow-progress-dot.is-done {
  background: rgba(217, 195, 156, 0.6);
}

.ritual-scene--night .day-flow-progress-dot.is-current {
  background: #D9C39C;
  box-shadow: 0 0 0 3px rgba(217, 195, 156, 0.2);
}

.day-flow-affirm .repeat {
  margin-top: var(--space-sm);
}

/* Slide between parts — same motion as ritual steps. */
.day-flow-stage {
  animation: ritual-step-in 0.6s var(--ease-calm) both;
}

.day-flow-stage--back {
  animation-name: ritual-step-in-back;
}

.day-flow-stage.is-leaving-forward {
  animation: ritual-step-out 0.32s cubic-bezier(0.4, 0, 0.6, 1) both;
}

.day-flow-stage.is-leaving-back {
  animation: ritual-step-out-back 0.32s cubic-bezier(0.4, 0, 0.6, 1) both;
}

/* Habits checklist */
.day-flow-habits {
  margin-top: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.day-flow-habit {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.6);
  color: inherit;
  font: inherit;
  text-align: left;
}

.day-flow-habit .habit-check {
  margin-top: 0;
}

.day-flow-habit-name {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  transition: color 0.3s var(--ease-calm);
}

.day-flow-habit.is-done .day-flow-habit-name {
  color: var(--color-text-muted);
}

.day-flow-habit:focus-visible {
  outline: 2px solid var(--color-accent-soft);
  outline-offset: 2px;
}

.day-flow-complete {
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255, 251, 244, 0.9) 0%, rgba(255, 251, 244, 0) 70%),
    linear-gradient(165deg, #FBF3E4 0%, #F1E2C6 100%);
}

@media (prefers-reduced-motion: reduce) {
  .day-flow-stage,
  .day-flow-stage.is-leaving-forward,
  .day-flow-stage.is-leaving-back {
    animation: none;
  }
  .day-flow-progress-dot,
  .day-flow-habit-name {
    transition: none;
  }
}

/* ---------------------------------------------------------
   Scripting -> Visualization ("Your Own Words")
--------------------------------------------------------- */

.rewire-scripting-visualize {
  display: block;
  margin: var(--space-sm) auto 0;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-accent);
}

/* The user's own script reads larger and centered — it's theirs. */
.mindset-player-script--own {
  text-align: center;
}

.mindset-player-script--own .mindset-player-step {
  font-family: var(--font-heading);
  font-size: 21px;
  line-height: 1.6;
  color: #FBF7F0;
}

.mindset-player-write-btn {
  margin-top: var(--space-lg);
  padding: 12px 22px;
  border-radius: 999px;
  background: rgba(217, 195, 156, 0.9);
  color: #14123B;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.mindset-player-script-link {
  margin-top: var(--space-lg);
  padding: 8px 14px;
  font-size: 13px;
  color: rgba(245, 241, 232, 0.7);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------------------------------------------------------
   Goals screen
--------------------------------------------------------- */

.goals-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  padding-top: var(--space-xs);
}

.goals-title {
  font-size: 32px;
}

.goals-add-btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  transition: transform 0.15s ease;
}

.goals-add-btn:active {
  transform: scale(0.94);
}

.goals-add-btn svg {
  width: 20px;
  height: 20px;
}

.goals-tabs {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.goals-tab {
  padding: var(--space-sm) 2px calc(var(--space-sm) - 1px);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.goals-tab.is-active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.goal-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.goal-list-card {
  cursor: pointer;
  transition: transform 0.15s ease;
}

.goal-list-card:active {
  transform: scale(0.99);
}

.goal-list-title {
  font-size: 19px;
}

.goal-list-card .progress-track {
  margin-top: var(--space-sm);
}

.goals-add-cta {
  margin-top: var(--space-lg);
}

/* Placeholder overlay (used for add-goal and goal-detail stubs) */

.goal-overlay {
  position: fixed;
  inset: 0;
  max-width: var(--max-width);
  margin: 0 auto;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.goal-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(58, 52, 44, 0.35);
}

.goal-overlay-card {
  position: relative;
  width: 100%;
  max-width: 320px;
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-md) var(--space-md);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.goal-overlay-close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}

.goal-overlay-close svg {
  width: 16px;
  height: 16px;
}

.goal-overlay-title {
  margin-top: 8px;
  font-size: 20px;
}

.goal-overlay-message {
  margin-top: var(--space-sm);
  font-size: 14px;
  line-height: 1.5;
}

/* ---------------------------------------------------------
   Habits screen
--------------------------------------------------------- */

.habits-title {
  font-size: 32px;
  padding-top: var(--space-xs);
  margin-bottom: var(--space-md);
}

.habits-tabs {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.habits-tab {
  padding: var(--space-sm) 2px calc(var(--space-sm) - 1px);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.habits-tab.is-active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.habits-section-label {
  display: block;
  margin-bottom: var(--space-sm);
}

.habits-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.habit-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
}

.habit-check {
  flex-shrink: 0;
  margin-top: 2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--color-accent-soft);
  background: var(--color-white);
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.habit-check svg {
  width: 16px;
  height: 16px;
}

.habit-check:active {
  transform: scale(0.9);
}

.habit-check.is-done {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-white);
}

.habit-info {
  flex: 1;
}

.habit-name {
  font-size: 16px;
  font-weight: 500;
}

/* 30-day cycle tracker */

.habit-tracker {
  margin-top: 8px;
}

.habit-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.habit-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-border);
}

.habit-dot.is-filled {
  background: var(--color-accent);
}

.habit-tracker-label {
  margin-top: 6px;
  font-size: 12px;
}

.habit-tracker-celebration {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 16px;
  color: var(--color-accent);
}

.habit-tracker-best {
  margin-top: 4px;
  font-size: 12px;
}

/* "How I'll do it" plan */

.habit-plan {
  margin-top: var(--space-sm);
}

.habit-plan-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.habit-plan-line,
.habit-plan-prompt {
  display: block;
  margin-top: 4px;
  width: 100%;
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
}

.habit-plan-line {
  color: var(--color-text);
}

.habit-plan-prompt {
  color: var(--color-accent);
  font-weight: 500;
}

.habit-plan-textarea {
  display: block;
  margin-top: 6px;
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  padding: var(--space-sm);
  font-family: var(--font-body);
  font-size: 16px; /* 16px+ stops iPhone zooming in on tap */
  line-height: 1.5;
  color: var(--color-text);
  resize: vertical;
}

.habit-plan-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.habit-plan-save-btn {
  margin-top: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  background: var(--color-accent);
  color: var(--color-white);
  font-size: 13px;
  font-weight: 500;
}

.habit-add-row {
  margin-top: var(--space-md);
  display: flex;
  gap: 8px;
}

.habit-add-input {
  flex: 1;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-card);
  padding: 11px var(--space-sm);
  font-family: var(--font-body);
  font-size: 16px; /* 16px+ stops iPhone zooming in on tap */
  color: var(--color-text);
}

.habit-add-input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.habit-add-btn {
  flex-shrink: 0;
  width: 46px;
  border-radius: var(--radius-sm);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  color: var(--color-accent);
  font-size: 20px;
  line-height: 1;
}

.habits-quote-card {
  margin-top: var(--space-lg);
  background: transparent;
  border: 1px solid var(--color-border);
  box-shadow: none;
  text-align: center;
}

.habits-quote {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
}

/* ---------------------------------------------------------
   Rewire screen
--------------------------------------------------------- */

.rewire-title {
  font-size: 32px;
  padding-top: var(--space-xs);
  margin-bottom: 4px;
}

.rewire-subtitle {
  font-size: 14px;
  margin-bottom: var(--space-lg);
}

.rewire-category-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.rewire-category-card {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.rewire-category-card:active {
  transform: scale(0.99);
}

.rewire-category-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--color-card-alt);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.rewire-category-icon svg {
  width: 20px;
  height: 20px;
}

.rewire-category-info {
  flex: 1;
}

.rewire-category-title {
  font-size: 16px;
  font-weight: 500;
}

.rewire-category-subtitle {
  margin-top: 3px;
  font-size: 13px;
}

.rewire-coming-soon-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--color-accent-soft);
  color: var(--color-accent);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 2px;
  white-space: nowrap;
}

.rewire-category-chevron {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
}

.rewire-category-chevron svg {
  width: 100%;
  height: 100%;
}

.rewire-back {
  display: inline-block;
  margin-bottom: var(--space-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-accent);
}

.rewire-coming-soon-card {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
}

.rewire-coming-soon-title {
  margin-top: 8px;
  font-size: 22px;
}

.rewire-coming-soon-message {
  margin-top: 8px;
}

.rewire-scripting-card {
  padding: var(--space-lg) var(--space-md);
}

.rewire-scripting-intro {
  margin-top: 8px;
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 17px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.rewire-scripting-textarea {
  margin-top: var(--space-md);
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  padding: var(--space-sm);
  font-family: var(--font-body);
  font-size: 16px; /* 16px+ stops iPhone zooming in on tap */
  line-height: 1.6;
  color: var(--color-text);
  resize: vertical;
}

.rewire-scripting-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.rewire-scripting-card .btn-primary {
  margin-top: var(--space-md);
}

.rewire-scripting-saved {
  margin-top: var(--space-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-accent);
  text-align: center;
}

.mindset-section-label {
  display: block;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

/* ---------------------------------------------------------
   Mindset — Visualization tab (list)
--------------------------------------------------------- */

.mindset-viz-heading {
  font-family: var(--font-heading);
  font-size: 17px;
  font-style: italic;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

.mindset-viz-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.mindset-viz-card {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.mindset-viz-card:active {
  transform: scale(0.99);
}

.mindset-viz-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--color-card-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.mindset-viz-info {
  flex: 1;
}

.mindset-viz-title {
  font-size: 16px;
  font-weight: 500;
}

.mindset-viz-subtitle {
  margin-top: 3px;
  font-size: 13px;
}

.mindset-viz-duration {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
}

/* ---------------------------------------------------------
   Mindset — Visualization player (full-screen, galaxy theme)
--------------------------------------------------------- */

.mindset-player {
  position: fixed;
  inset: 0;
  max-width: var(--max-width);
  margin: 0 auto;
  z-index: 300;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.9) 0 1px, transparent 1px) 0 0 / 130px 130px,
    radial-gradient(circle at 68% 55%, rgba(255, 255, 255, 0.7) 0 1px, transparent 1px) 10px 20px / 170px 170px,
    radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.55) 0 1px, transparent 1px) 5px 5px / 95px 95px,
    radial-gradient(ellipse at 25% 15%, rgba(140, 110, 220, 0.35), transparent 60%),
    radial-gradient(ellipse at 80% 70%, rgba(70, 120, 190, 0.3), transparent 55%),
    linear-gradient(160deg, #0a0e2a 0%, #14123b 45%, #1e1547 75%, #241653 100%);
}

.mindset-player-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.mindset-player-inner {
  position: relative;
  height: 100%;
  overflow-y: auto;
  padding: var(--space-lg) var(--space-md) var(--space-xl);
  color: #F5F1E8;
}

.mindset-player-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #F5F1E8;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.mindset-player-back svg {
  width: 16px;
  height: 16px;
}

.mindset-player-content {
  margin-top: var(--space-lg);
  text-align: center;
}

.mindset-player-icon {
  font-size: 36px;
}

.mindset-player-title {
  margin-top: var(--space-sm);
  font-family: var(--font-heading);
  font-size: 28px;
  color: #FBF7F0;
}

.mindset-player-duration {
  margin-top: 6px;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(245, 241, 232, 0.6);
}

.mindset-player-intro {
  margin-top: var(--space-lg);
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 18px;
  line-height: 1.6;
  color: rgba(245, 241, 232, 0.92);
}

.mindset-player-script {
  margin-top: var(--space-lg);
  text-align: left;
}

.mindset-player-step {
  font-size: 16px;
  line-height: 1.75;
  color: rgba(245, 241, 232, 0.88);
  margin-top: var(--space-lg);
}

.mindset-player-step:first-child {
  margin-top: 0;
}

.mindset-player-closing {
  margin-top: var(--space-lg);
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 17px;
  color: #D9C39C;
}

.mindset-player-music {
  margin-top: var(--space-lg);
  text-align: center;
}

.mindset-music-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(245, 241, 232, 0.85);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.mindset-music-toggle svg {
  width: 17px;
  height: 17px;
}

.mindset-music-toggle.is-on {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #FBF7F0;
}

.mindset-music-hint {
  margin-top: var(--space-sm);
  max-width: 260px;
  margin-left: auto;
  margin-right: auto;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(245, 241, 232, 0.45);
}

/* ---------------------------------------------------------
   Journey screen
--------------------------------------------------------- */

.journey-title {
  font-size: 32px;
  padding-top: var(--space-xs);
  margin-bottom: var(--space-md);
}

.journey-tabs {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.journey-tab {
  padding: var(--space-sm) 2px calc(var(--space-sm) - 1px);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.journey-tab.is-active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.journey-week-card {
  background: var(--color-card-alt);
}

.journey-range {
  font-size: 13px;
}

.journey-stats-row {
  margin-top: var(--space-md);
  display: flex;
  gap: var(--space-sm);
}

.journey-stat {
  flex: 1;
  text-align: center;
  padding: var(--space-sm) 4px;
  border-radius: var(--radius-sm);
  background: var(--color-bg);
}

.journey-stat-value {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 600;
  color: var(--color-accent);
}

.journey-stat-label {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.3;
}

.journey-wins-list {
  margin-top: var(--space-sm);
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.journey-win-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 14px;
  line-height: 1.5;
}

.journey-win-check {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
}

.journey-win-check svg {
  width: 13px;
  height: 13px;
}

.journey-lesson {
  margin-top: 8px;
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 18px;
  line-height: 1.5;
  color: var(--color-text);
}

.journey-progress-btn {
  margin-top: var(--space-lg);
}

/* Placeholder overlay (used for "View Full Progress" stub) */

.journey-overlay {
  position: fixed;
  inset: 0;
  max-width: var(--max-width);
  margin: 0 auto;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.journey-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(58, 52, 44, 0.35);
}

.journey-overlay-card {
  position: relative;
  width: 100%;
  max-width: 320px;
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-md) var(--space-md);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.journey-overlay-close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}

.journey-overlay-close svg {
  width: 16px;
  height: 16px;
}

.journey-overlay-title {
  margin-top: 8px;
  font-size: 20px;
}

.journey-overlay-message {
  margin-top: var(--space-sm);
  font-size: 14px;
  line-height: 1.5;
}

/* ---------------------------------------------------------
   Practice screen
--------------------------------------------------------- */

.practice-title {
  font-size: 32px;
  padding-top: var(--space-xs);
  margin-bottom: 4px;
}

.practice-subtitle {
  font-size: 14px;
  margin-bottom: var(--space-lg);
}

.practice-option-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.practice-option-card {
  cursor: pointer;
  transition: transform 0.15s ease;
}

.practice-option-card:active {
  transform: scale(0.99);
}

.practice-option-title {
  margin-top: 8px;
  font-size: 21px;
}

.practice-option-subtitle {
  margin-top: 4px;
  font-size: 14px;
}

.practice-option-duration {
  margin-top: 6px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.practice-done-badge {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
}

.practice-done-badge svg {
  width: 12px;
  height: 12px;
}

.practice-step-card {
  position: relative;
  text-align: center;
  padding: var(--space-xl) var(--space-md) var(--space-lg);
}

.practice-close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}

.practice-close svg {
  width: 16px;
  height: 16px;
}

.practice-step-title {
  font-size: 26px;
}

.practice-step-duration {
  margin-top: 4px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.practice-step-intro {
  margin-top: var(--space-md);
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 18px;
  line-height: 1.5;
}

.practice-step-progress {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.practice-step-icon {
  margin-top: var(--space-sm);
  font-size: 30px;
}

.practice-step-heading {
  margin-top: 8px;
  font-size: 22px;
}

.practice-step-inputs {
  margin-top: var(--space-md);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.practice-step-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
}

.practice-textarea {
  margin-top: 6px;
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  padding: var(--space-sm);
  font-family: var(--font-body);
  font-size: 16px; /* 16px+ stops iPhone zooming in on tap */
  color: var(--color-text);
  resize: vertical;
}

.practice-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.practice-step-caption {
  margin-top: var(--space-md);
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.practice-step-affirmation {
  margin-top: var(--space-sm);
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 19px;
  color: var(--color-text);
}

.practice-step-completion {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 20px;
  line-height: 1.6;
}

.practice-step-card .btn-primary {
  margin-top: var(--space-lg);
}

/* Option cards hint at each ritual's time of day */
.practice-option-card--morning {
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 214, 150, 0.55), transparent 55%),
    linear-gradient(150deg, #FCEBD2 0%, #F8DDC4 55%, #F6E9D6 100%);
}

.practice-option-card--night {
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.8) 0 1px, transparent 1px) 0 0 / 60px 60px,
    radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0.55) 0 1px, transparent 1px) 12px 8px / 85px 85px,
    radial-gradient(ellipse at 85% 20%, rgba(140, 110, 220, 0.35), transparent 60%),
    linear-gradient(160deg, #0e1233 0%, #17143f 60%, #221650 100%);
}

.practice-option-card--night .eyebrow,
.practice-option-card--night .practice-option-title {
  color: #FBF7F0;
}

.practice-option-card--night .text-muted {
  color: rgba(245, 241, 232, 0.7);
}

/* ---------------------------------------------------------
   Practice — ritual scenes (sunrise / starry night)
   Bleeds past .screen-root's padding so the atmosphere fills
   the whole screen above the bottom nav.
--------------------------------------------------------- */

.ritual-scene {
  position: relative;
  overflow: hidden;
  margin: calc(-1 * var(--space-md)) calc(-1 * var(--space-md)) calc(-1 * (var(--nav-height) + var(--space-md)));
  padding: var(--space-xl) var(--space-md) calc(var(--nav-height) + var(--space-xl));
  min-height: 100vh;
  min-height: 100dvh;
}

.ritual-scene-content {
  position: relative;
  z-index: 1;
  animation: ritual-step-in 0.6s var(--ease-calm) both;
}

/* Back slides the previous step in from the left. */
.ritual-scene-content--back {
  animation-name: ritual-step-in-back;
}

/* Continue / Back: the current step drifts out first
   (practice.js waits STEP_LEAVE_MS before showing the next). */
.ritual-scene-content.is-leaving-forward {
  animation: ritual-step-out 0.32s cubic-bezier(0.4, 0, 0.6, 1) both;
}

.ritual-scene-content.is-leaving-back {
  animation: ritual-step-out-back 0.32s cubic-bezier(0.4, 0, 0.6, 1) both;
}

@keyframes ritual-step-in {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: none; }
}

@keyframes ritual-step-in-back {
  from { opacity: 0; transform: translateX(-28px); }
  to   { opacity: 1; transform: none; }
}

@keyframes ritual-step-out {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateX(-28px); }
}

@keyframes ritual-step-out-back {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateX(28px); }
}

.ritual-scene .practice-step-card {
  box-shadow: none;
  border-radius: var(--radius-lg);
}

/* Morning — soft dawn light */
.ritual-scene--morning {
  background: linear-gradient(180deg, #F9D9A8 0%, #F7CDB0 30%, #FAE3CC 62%, #FBF3E6 100%);
}

.ritual-sun {
  position: absolute;
  top: -90px;
  left: 50%;
  width: 260px;
  height: 260px;
  margin-left: -130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 240, 200, 0.95) 0%, rgba(255, 214, 150, 0.55) 40%, transparent 70%);
  animation: ritual-sun-glow 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes ritual-sun-glow {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.06); }
}

.ritual-scene--morning .practice-step-card {
  background: rgba(255, 250, 242, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.ritual-scene--morning .practice-textarea {
  background: rgba(255, 255, 255, 0.75);
}

/* Night — deep starry galaxy (same palette as the visualization player) */
.ritual-scene--night {
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.9) 0 1px, transparent 1px) 0 0 / 130px 130px,
    radial-gradient(circle at 68% 55%, rgba(255, 255, 255, 0.7) 0 1px, transparent 1px) 10px 20px / 170px 170px,
    radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.55) 0 1px, transparent 1px) 5px 5px / 95px 95px,
    radial-gradient(ellipse at 25% 15%, rgba(140, 110, 220, 0.35), transparent 60%),
    radial-gradient(ellipse at 80% 70%, rgba(70, 120, 190, 0.3), transparent 55%),
    linear-gradient(160deg, #0a0e2a 0%, #14123b 45%, #1e1547 75%, #241653 100%);
  color: #F5F1E8;
  padding-top: 96px; /* leaves the moon its own space above the card */
}

.ritual-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ritual-star {
  position: absolute;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
  opacity: 0.25;
  animation: ritual-twinkle 4s ease-in-out infinite;
}

@keyframes ritual-twinkle {
  0%, 100% { opacity: 0.25; }
  50%      { opacity: 1; }
}

.ritual-moon {
  position: absolute;
  top: 22px;
  right: 26px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, #FFFBEF 0%, #F3E9CF 55%, #DCCFAE 100%);
  box-shadow: 0 0 22px 6px rgba(245, 233, 200, 0.35), 0 0 60px 18px rgba(170, 150, 230, 0.18);
  animation: ritual-moon-glow 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes ritual-moon-glow {
  0%, 100% { box-shadow: 0 0 22px 6px rgba(245, 233, 200, 0.3), 0 0 60px 18px rgba(170, 150, 230, 0.15); }
  50%      { box-shadow: 0 0 28px 9px rgba(245, 233, 200, 0.45), 0 0 70px 22px rgba(170, 150, 230, 0.22); }
}

.ritual-scene--night .practice-step-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.ritual-scene--night h2,
.ritual-scene--night .practice-step-intro,
.ritual-scene--night .practice-step-affirmation,
.ritual-scene--night .practice-step-completion {
  color: #FBF7F0;
}

.ritual-scene--night .text-muted,
.ritual-scene--night .practice-step-label,
.ritual-scene--night .practice-close {
  color: rgba(245, 241, 232, 0.65);
}

.ritual-scene--night .practice-step-caption {
  color: rgba(245, 241, 232, 0.72);
  font-style: italic;
}

.ritual-scene--night .practice-textarea {
  background: rgba(10, 14, 42, 0.45);
  border-color: rgba(255, 255, 255, 0.18);
  color: #F5F1E8;
}

.ritual-scene--night .practice-textarea:focus {
  border-color: #D9C39C;
}

.ritual-scene--night .btn-primary {
  background: rgba(217, 195, 156, 0.9);
  color: #14123B;
}

.practice-step-affirmation--hero {
  margin-top: var(--space-lg);
  font-size: 23px;
  line-height: 1.5;
}

.ritual-scene--night .practice-step-affirmation--hero {
  text-shadow: 0 0 18px rgba(217, 195, 156, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  .ritual-scene-content,
  .ritual-scene-content.is-leaving-forward,
  .ritual-scene-content.is-leaving-back,
  .ritual-sun,
  .ritual-star,
  .ritual-moon {
    animation: none;
  }
}

/* ---------------------------------------------------------
   Onboarding
--------------------------------------------------------- */

.onboarding-overlay {
  position: fixed;
  inset: 0;
  max-width: var(--max-width);
  margin: 0 auto;
  z-index: 400;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg) var(--space-md);
  overflow-y: auto;
}

.onboarding-content {
  width: 100%;
  max-width: 360px;
  text-align: center;
}

.onboarding-question {
  margin-top: 8px;
  font-size: 24px;
  line-height: 1.35;
}

.onboarding-hint {
  margin-top: 6px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.onboarding-text-input {
  margin-top: var(--space-lg);
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-card);
  padding: 13px var(--space-md);
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-text);
  text-align: center;
}

.onboarding-text-input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.onboarding-continue {
  margin-top: var(--space-lg);
}

.onboarding-options {
  margin-top: var(--space-lg);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
}

.onboarding-option {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-card);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.onboarding-option.is-selected {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-white);
}

.onboarding-add-row {
  margin-top: var(--space-md);
  display: flex;
  gap: 8px;
}

.onboarding-add-row .onboarding-text-input {
  margin-top: 0;
  text-align: left;
}

.onboarding-add-btn {
  flex-shrink: 0;
  width: 46px;
  border-radius: var(--radius-sm);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  color: var(--color-accent);
  font-size: 20px;
  line-height: 1;
}

.onboarding-welcome-title {
  font-size: 30px;
}

.onboarding-welcome-subtitle {
  margin-top: 8px;
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 18px;
  color: var(--color-text-muted);
}

/* ---------------------------------------------------------
   Profile screen
--------------------------------------------------------- */

.profile-title {
  font-size: 32px;
  padding-top: var(--space-xs);
  margin-bottom: var(--space-md);
}

.profile-identity-card {
  position: relative;
}

.profile-name {
  margin-top: 6px;
  font-size: 24px;
}

.profile-goal {
  margin-top: 6px;
  font-size: 15px;
  color: var(--color-text-muted);
}

.profile-edit-link {
  margin-top: var(--space-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-accent);
}

.profile-stats-row {
  margin-top: var(--space-md);
  display: flex;
  gap: var(--space-sm);
}

.profile-stat {
  flex: 1;
  text-align: center;
  padding: var(--space-sm) 4px;
  border-radius: var(--radius-sm);
  background: var(--color-bg);
}

.profile-stat-value {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 600;
  color: var(--color-accent);
}

.profile-stat-label {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.3;
}

.profile-reminder-row {
  margin-top: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.profile-reminder-row:first-of-type {
  margin-top: var(--space-sm);
}

.profile-reminder-label {
  font-size: 14px;
}

.profile-time-input {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 16px; /* 16px+ stops iPhone zooming in on tap */
  color: var(--color-text);
}

.profile-time-input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.profile-reset-btn {
  margin-top: var(--space-md);
  width: 100%;
  padding: 13px var(--space-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-align: center;
}

.profile-field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
}

/* Onboarding's chips, left-aligned inside the Edit Profile card */
.profile-chip-options {
  margin-top: var(--space-sm);
  justify-content: flex-start;
}

.profile-text-input {
  margin-top: 6px;
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  padding: var(--space-sm);
  font-family: var(--font-body);
  font-size: 16px; /* 16px+ stops iPhone zooming in on tap */
  color: var(--color-text);
}

.profile-text-input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.profile-edit-actions {
  margin-top: var(--space-lg);
  display: flex;
  gap: var(--space-sm);
}

.profile-cancel-btn {
  flex: 1;
  padding: 13px var(--space-md);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}

.profile-edit-actions .btn-primary {
  flex: 1;
  margin-top: 0;
}

.profile-confirm-message {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.profile-reset-confirm-btn {
  flex: 1;
  padding: 13px var(--space-md);
  border-radius: var(--radius-sm);
  background: var(--color-text);
  color: var(--color-white);
  font-size: 14px;
  font-weight: 500;
}

/* ---------------------------------------------------------
   Habits — Weekly tab
--------------------------------------------------------- */

.habit-week-grid-card {
  overflow-x: hidden;
}

.habit-week-grid {
  margin-top: var(--space-sm);
  display: grid;
  grid-template-columns: minmax(72px, 1.4fr) repeat(7, 1fr);
  row-gap: 10px;
  column-gap: 2px;
  align-items: center;
}

.habit-week-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 20px;
}

.habit-week-day-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted);
}

.habit-week-name {
  justify-content: flex-start;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 4px;
}

.habit-week-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-accent);
}

.habit-week-rates {
  margin-top: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.habit-week-rate-name {
  font-size: 14px;
  font-weight: 500;
}

.habit-week-rate-value {
  font-size: 13px;
}

.habit-week-rate-track {
  margin-top: 6px;
  height: 6px;
}

.habit-week-wins-card {
  background: var(--color-card-alt);
}

.habit-week-wins-text {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.6;
}

.habit-week-wins-text strong {
  color: var(--color-accent);
  font-weight: 600;
}

.habit-week-reflection-prompt {
  margin-top: 8px;
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 16px;
  color: var(--color-text-muted);
}

.habit-week-reflection-textarea {
  margin-top: var(--space-md);
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  padding: var(--space-sm);
  font-family: var(--font-body);
  font-size: 16px; /* 16px+ stops iPhone zooming in on tap */
  line-height: 1.5;
  color: var(--color-text);
  resize: vertical;
}

.habit-week-reflection-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.habit-week-reflection-saved {
  margin-top: var(--space-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-accent);
  text-align: center;
}

/* ---------------------------------------------------------
   Habits — All tab (management)
--------------------------------------------------------- */
.habit-all-subtitle {
  margin-top: 4px;
  font-size: 13px;
}

.habit-all-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-sm);
}

.habit-all-meta {
  margin-top: 4px;
  font-size: 12px;
}

.habit-all-plan {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text);
}

.habit-all-plan.is-empty {
  color: var(--color-text-muted);
  font-style: italic;
}

.habit-all-actions {
  display: flex;
  gap: var(--space-md);
}

.habit-all-edit-btn,
.habit-all-remove-btn {
  font-size: 13px;
  font-weight: 500;
}

.habit-all-edit-btn {
  color: var(--color-accent);
}

.habit-all-remove-btn {
  color: var(--color-text-muted);
}

.habit-all-edit-form {
  display: flex;
  flex-direction: column;
}

.habit-all-form-error {
  margin-top: var(--space-sm);
  font-size: 13px;
  color: var(--color-text);
}

.habit-all-add-btn {
  margin-top: var(--space-md);
  width: 100%;
  padding: 13px var(--space-md);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-card);
  color: var(--color-accent);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

/* ---------------------------------------------------------
   Global polish layer — shared refinements applied across
   every screen. Visual only: no layout or structure changes.
--------------------------------------------------------- */

/* One clear focal point per screen: the page title */
.home-greeting,
.goals-title,
.habits-title,
.rewire-title,
.journey-title,
.practice-title,
.profile-title {
  font-size: 36px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.home-greeting {
  font-size: 32px;
}

/* Page subtitles sit quietly beneath the title */
.home-subtitle,
.rewire-subtitle,
.practice-subtitle {
  font-size: 15px;
  line-height: 1.55;
}

/* Card-level serif headings — confident but clearly secondary */
.goal-title,
.practice-option-title,
.rewire-coming-soon-title,
.goal-overlay-title,
.journey-overlay-title,
.goal-list-title {
  font-size: 23px;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.practice-step-title,
.onboarding-welcome-title {
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.mindset-statement {
  font-size: 24px;
  line-height: 1.35;
}

/* Calm reading rhythm for supporting text */
.text-muted {
  line-height: 1.6;
}

/* Gentle ease on every tappable element */
button,
[role="button"] {
  transition: transform 0.3s var(--ease-calm), opacity 0.3s var(--ease-calm),
    background-color 0.3s var(--ease-calm), border-color 0.3s var(--ease-calm),
    color 0.3s var(--ease-calm), box-shadow 0.3s var(--ease-calm);
}

.card[role="button"]:active {
  transform: scale(0.985);
  box-shadow: var(--shadow-soft);
}

/* Secondary buttons share the refined primary shape */
.habit-plan-save-btn {
  box-shadow: var(--shadow-button);
  letter-spacing: 0.03em;
}

.habit-all-add-btn,
.profile-cancel-btn,
.profile-reset-confirm-btn {
  letter-spacing: 0.03em;
}

.nav-item.is-active .nav-label {
  font-weight: 600;
}

/* Screen entrance — soft sideways slide + fade, lightly staggered.
   It comes in from the right when moving right along the nav and
   from the left when moving left (.is-entering-back). main.js adds
   .is-entering only when switching screens, so in-place re-renders
   (ticking a habit) don't replay it. */
@keyframes pop-slide-in {
  from { opacity: 0; transform: translateX(var(--pop-enter-x, 16px)); }
  to   { opacity: 1; transform: none; }
}

.screen-root.is-entering-back {
  --pop-enter-x: -16px;
}

.screen-root.is-entering > * {
  animation: pop-slide-in 0.65s var(--ease-calm) backwards;
}

.screen-root.is-entering > *:nth-child(2) { animation-delay: 0.05s; }
.screen-root.is-entering > *:nth-child(3) { animation-delay: 0.1s; }
.screen-root.is-entering > *:nth-child(4) { animation-delay: 0.15s; }
.screen-root.is-entering > *:nth-child(5) { animation-delay: 0.2s; }
.screen-root.is-entering > *:nth-child(n+6) { animation-delay: 0.25s; }

@media (prefers-reduced-motion: reduce) {
  .screen-root.is-entering > * {
    animation: none;
  }
  button,
  [role="button"],
  .card,
  .btn-primary {
    transition: none;
  }
}

/* ---------------------------------------------------------
   Today's Action "Change", goal progress slider, reminder
   note, and Scripting past entries
--------------------------------------------------------- */

.action-card .profile-edit-link {
  margin-top: var(--space-sm);
  flex-shrink: 0;
}

.profile-reminder-note {
  margin-top: 6px;
  font-size: 13px;
}

.profile-percent-value {
  float: right;
  color: var(--color-accent);
}

.profile-range-input {
  margin-top: var(--space-sm);
  width: 100%;
  accent-color: var(--color-accent);
}

.rewire-scripting-entry-date {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rewire-scripting-entry-text {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* ---------------------------------------------------------
   Back buttons, ritual "leave?" prompt, obstacle limit note,
   weekly rates note
--------------------------------------------------------- */

.onboarding-back {
  display: block;
  margin: 0 auto var(--space-sm) 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-accent);
}

.onboarding-hint.is-alert {
  color: var(--color-accent);
  font-weight: 500;
}

.practice-back {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
}

.practice-leave-btn {
  margin-top: var(--space-sm);
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
}

.ritual-scene--night .practice-back,
.ritual-scene--night .practice-leave-btn {
  color: rgba(245, 241, 232, 0.7);
}

.habit-week-rates-note {
  margin-top: 2px;
  font-size: 12px;
}

.profile-calendar-message {
  margin-top: var(--space-sm);
  color: var(--color-accent);
  text-align: center;
}

/* ---------------------------------------------------------
   Law of Attraction moments (shared/loa.js)
   Quiet gold serif lines — completion messages, today's theme,
   the noticing nudge, and streak milestones. Never popups.
--------------------------------------------------------- */

.loa-message {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--color-accent);
  text-wrap: balance;
}

/* Today's Action: the LOA line replaces the old "Completed" label. */
.action-status.loa-message {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.practice-step-loa {
  margin-top: var(--space-md);
}

.ritual-scene--night .loa-message {
  color: #D9C39C;
}

.rewire-scripting-saved + .loa-message,
.habit-week-reflection-saved + .loa-message {
  margin-top: 6px;
  text-align: center;
}

.next-step-card--complete .loa-message {
  margin-top: 6px;
  font-size: 16px;
}

/* Today's manifestation theme, tucked under the greeting. */
.loa-theme {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: -14px 0 var(--space-lg);
}

.loa-theme-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.loa-theme-line {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.4;
  color: #5E5243;
}

/* Signs & synchronicity — a soft closing line at the foot of Today. */
.loa-nudge {
  max-width: 22em;
  margin: var(--space-xl) auto var(--space-sm);
  text-align: center;
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 17px;
  line-height: 1.5;
  color: var(--color-text-muted);
  text-wrap: balance;
}

.loa-nudge-mark {
  margin-right: 6px;
  font-style: normal;
  color: var(--color-accent-soft);
}

/* Streak milestones (3, 7, 21, 30 days). */
.loa-milestone {
  display: block;
  margin-top: 6px;
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 15px;
  line-height: 1.45;
  color: var(--color-accent);
}

.day-flow-habit-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.day-flow-habit-milestone {
  margin-top: 2px;
}

.day-flow-habit-milestone:empty {
  display: none;
}
