/* Cessa — visuals from Claude Design "Cessa Canonical" (Sept 2026).
   Values (colours, sizes, spacing) are taken straight from the Design file;
   the fixed 390×844 frames are made fluid, and the mock status bar is gone. */

@keyframes cessaHalo { 0%,100% { transform: scale(0.94); opacity: 0.55 } 50% { transform: scale(1.06); opacity: 0.85 } }
@keyframes cessaDriftA { 0%,100% { transform: translate(0,0) rotate(0deg) scale(1) } 27% { transform: translate(2.2px,-2.8px) rotate(0.7deg) scale(1.016) } 54% { transform: translate(-1.4px,-3.4px) rotate(-0.5deg) scale(1.026) } 79% { transform: translate(-2.6px,1.6px) rotate(0.9deg) scale(1.008) } }
@keyframes cessaDriftB { 0%,100% { transform: translate(0,0) rotate(0deg) scale(1) } 23% { transform: translate(-2.8px,2.1px) rotate(-0.8deg) scale(1.014) } 51% { transform: translate(1.2px,3.6px) rotate(0.6deg) scale(1.024) } 76% { transform: translate(2.9px,-1.3px) rotate(-0.4deg) scale(1.006) } }
@keyframes cessaDriftC { 0%,100% { transform: translate(0,0) rotate(0deg) scale(1) } 31% { transform: translate(3.1px,2.4px) rotate(0.6deg) scale(1.022) } 58% { transform: translate(-1.8px,2.9px) rotate(-0.9deg) scale(1.01) } 83% { transform: translate(-2.9px,-2.2px) rotate(0.4deg) scale(1.018) } }
@keyframes cessaRise { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: translateY(0) } }

:root {
  --serif-mark: 'Instrument Serif', Georgia, serif;
  --serif: 'Newsreader', Georgia, serif;
  --sans: 'Hanken Grotesk', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --ink: #2b2d42;
  --ink-read: #26304a;
  --muted: #5b6379;
  --muted-2: #5f6780;
  --body-2: #3f4760;
  --warm-ink: #3d281f;
  --warm-muted: #7a5a4a;
  --warm-body: #6b4d3f;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--sans);
  color: var(--ink);
  background: #fcf1e5;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; color: inherit; -webkit-appearance: none; appearance: none; }
a { color: inherit; }

.preline { white-space: pre-line; }

/* ---------- Backgrounds (cross-faded per screen) ---------- */

#bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.bg-layer { position: absolute; inset: 0; opacity: 0; transition: opacity 600ms ease; }
.bg-warm-entry { background: linear-gradient(180deg,#fcf1e5 0%,#f8e1d2 48%,#f2d8d4 100%); }
.bg-warm       { background: linear-gradient(168deg,#fdf3e6 0%,#f9e6d5 38%,#f4dcd6 70%,#eed6d9 100%); }
.bg-dark       { background: linear-gradient(180deg,#191c2c 0%,#1e2134 52%,#232338 100%); }
.bg-pale       { background: linear-gradient(180deg,#eef4fc 0%,#e8edfa 46%,#ece6f8 100%); }
.bg-pale-read  { background: linear-gradient(180deg,#f0f5fc 0%,#eaeefa 52%,#eee9f8 100%); }
.bg-pale-done  { background: linear-gradient(180deg,#eef4fc 0%,#e6ecfa 50%,#ece5f8 100%); }
.bg-ground     { background: linear-gradient(180deg,#e3eaf9 0%,#dbe0f5 48%,#e1d8f3 100%); }

body[data-ground="warm-entry"] .bg-warm-entry,
body[data-ground="warm"] .bg-warm,
body[data-ground="dark"] .bg-dark,
body[data-ground="pale"] .bg-pale,
body[data-ground="pale-read"] .bg-pale-read,
body[data-ground="pale-done"] .bg-pale-done,
body[data-ground="ground"] .bg-ground { opacity: 1; }

/* ---------- App frame ---------- */

#app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--safe-bottom);
  overflow-x: clip;
}

/* ---------- Header: back · wordmark · start over ---------- */

#app-header {
  flex: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 40px;
  margin-top: calc(var(--safe-top) + 16px);
  padding: 0 18px 0 24px;
  position: relative;
  z-index: 2;
  --hdr-mark: rgba(84,52,38,0.55);
  --hdr-btn-border: rgba(80,54,42,0.14);
  --hdr-btn-bg: rgba(255,255,255,0.55);
  --hdr-btn-bg-hover: rgba(255,255,255,0.95);
  --hdr-btn-ink: #4a3227;
  --hdr-reset: #7a5a4a;
  --hdr-reset-hover: #3d281f;
}

body[data-ground="warm-entry"] #app-header { --hdr-mark: rgba(84,52,38,0.6); }
body[data-ground="dark"] #app-header {
  --hdr-mark: rgba(242,232,216,0.5);
  --hdr-btn-border: rgba(242,232,216,0.16);
  --hdr-btn-bg: rgba(255,255,255,0.05);
  --hdr-btn-bg-hover: rgba(255,255,255,0.12);
  --hdr-btn-ink: #f2e8d8;
  --hdr-reset: rgba(242,232,216,0.6);
  --hdr-reset-hover: #f2e8d8;
}
body[data-ground^="pale"] #app-header,
body[data-ground="ground"] #app-header {
  --hdr-mark: rgba(43,45,66,0.4);
  --hdr-btn-border: rgba(43,45,66,0.1);
  --hdr-btn-bg: rgba(255,255,255,0.6);
  --hdr-btn-ink: #2b2d42;
  --hdr-reset: #5b6379;
  --hdr-reset-hover: #2b2d42;
}
body[data-ground="pale-done"] #app-header { --hdr-mark: rgba(43,45,66,0.5); }

.wordmark {
  grid-column: 2;
  font-family: var(--serif-mark);
  font-size: 19px;
  letter-spacing: 0.44em;
  text-indent: 0.44em;
  color: var(--hdr-mark);
  transition: color 600ms ease;
}

.back-btn {
  grid-column: 1;
  justify-self: start;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--hdr-btn-border);
  background: var(--hdr-btn-bg);
  color: var(--hdr-btn-ink);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.back-btn:hover { background: var(--hdr-btn-bg-hover); }

.startover {
  grid-column: 3;
  justify-self: end;
  height: 36px;
  padding: 0 10px;
  border: none;
  background: none;
  font-size: 13px;
  color: var(--hdr-reset);
  cursor: pointer;
  transition: color 0.2s ease;
}
.startover:hover { color: var(--hdr-reset-hover); }

.back-btn.is-hidden, .startover.is-hidden { visibility: hidden; }

/* ---------- Screens ---------- */

.screen {
  display: none;
  position: relative;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}
.screen.active { display: flex; }

.screen-foot {
  flex: none;
  padding: 20px 28px 38px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.screen-foot-center { gap: 0; }
.breath-note {
  margin: 0 -14px 16px;
  font-size: 12.5px;
  text-wrap: balance;
  line-height: 1.55;
  text-align: center;
  color: rgba(242,232,216,0.62);
}

.kicker {
  font-size: 10.5px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Halos (slow breathing glow behind entry, paywall and mantra) */
.halo {
  position: absolute;
  left: 50%;
  top: 44%;
  width: 520px;
  height: 520px;
  margin: -260px 0 0 -260px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.halo-warm { background: radial-gradient(circle,rgba(255,247,238,0.9) 0%,rgba(255,240,226,0.34) 42%,rgba(255,238,222,0) 68%); animation: cessaHalo 10s ease-in-out infinite; }
.halo-high { top: 36%; }
.halo-cool { top: 46%; background: radial-gradient(circle,rgba(255,255,255,0.9) 0%,rgba(226,234,250,0.42) 40%,rgba(226,234,250,0) 68%); animation: cessaHalo 13s ease-in-out infinite; }

/* ---------- Buttons ---------- */

.btn {
  width: 100%;
  min-height: 56px;
  border: none;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.3;
  padding: 8px 22px;
  text-wrap: balance;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.btn:active { transform: scale(0.988); }

.btn-primary {
  background: linear-gradient(135deg,#9fc4f0,#7ba7e0 52%,#a8a5e8);
  color: #14243d;
  box-shadow: 0 12px 28px rgba(72,104,160,0.24);
}
.btn-primary:hover { box-shadow: 0 16px 34px rgba(72,104,160,0.3); }
.btn-big { font-size: 19px; box-shadow: 0 12px 28px rgba(72,104,160,0.26); }

.btn-warm {
  background: linear-gradient(135deg,#f3b985,#e59468 52%,#dd8f8a);
  color: #3d251c;
  box-shadow: 0 12px 28px rgba(150,86,58,0.26);
}
.btn-warm:hover { box-shadow: 0 16px 34px rgba(150,86,58,0.34); }
.btn-tall { min-height: 58px; }

.btn-warm:disabled {
  background: rgba(122,90,74,0.14);
  color: rgba(61,37,28,0.42);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn-breath {
  width: auto;
  min-height: 52px;
  padding: 0 30px;
  background-color: #f2dcac;
  background-image: linear-gradient(135deg,rgba(255,255,255,0.34) 0%,rgba(255,255,255,0.04) 54%,rgba(35,38,58,0.1) 100%);
  color: #23263a;
  font-size: 15.5px;
  box-shadow: 0 10px 26px rgba(0,0,0,0.34);
  transition: background-color 1100ms ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.btn-breath:hover { box-shadow: 0 14px 32px rgba(0,0,0,0.42); }

.btn-outline {
  min-height: 44px;
  padding: 0 24px;
  width: max-content;
  max-width: 100%;
  border: 1.5px solid rgba(123,167,224,0.55);
  border-radius: 999px;
  background: none;
  font-size: 14.5px;
  color: #4a5a78;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.btn-outline:hover { background: rgba(123,167,224,0.12); border-color: rgba(123,167,224,0.85); }
.btn-outline-warm { border-color: #d9a06f; color: #7a5a4a; white-space: nowrap; }
.btn-outline-warm:hover { background: rgba(217,160,111,0.14); border-color: #c88a54; }
.btn-outline-full { width: 100%; }
.btn-outline:disabled { opacity: 0.55; cursor: default; }

.btn-text {
  background: none;
  border: none;
  padding: 10px 13px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}
.btn-text:hover { color: var(--ink); }

.btn-choice {
  min-height: 64px;
  border: none;
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  box-shadow: inset 0 0 0 1.5px rgba(123,167,224,0.42), 0 6px 20px rgba(84,104,150,0.08);
  font-family: var(--serif);
  font-size: 20px;
  color: var(--ink-read);
  cursor: pointer;
  transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
}
.btn-choice:hover { background: #fff; box-shadow: inset 0 0 0 1.5px rgba(123,167,224,0.8), 0 8px 24px rgba(84,104,150,0.12); }
.btn-choice:active { transform: scale(0.985); }

/* ---------- Paywall ---------- */

.paywall-hero {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px 36px;
  text-align: center;
}
.paywall-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.16;
  color: var(--warm-ink);
  text-wrap: balance;
}
.paywall-sub {
  margin: 16px 0 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--warm-muted);
  max-width: 290px;
  text-wrap: pretty;
}
.paywall-price {
  margin: 26px 0 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #4a3227;
}
.paywall-price-note {
  margin: 6px 0 0;
  max-width: 290px;
  font-size: 15px;
  line-height: 1.55;
  color: #4a3227;
  text-wrap: balance;
}
.paywall-foot {
  position: relative;
  flex: none;
  padding: 0 28px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.agree {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  margin-bottom: 18px;
  text-align: left;
  cursor: pointer;
}
.agree input { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; }
.agree-box {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 7px;
  border: 1.5px solid rgba(74,50,39,0.42);
  background: rgba(255,255,255,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  color: #fcf1e5;
}
.agree input:checked + .agree-box { background: #4a3227; border-color: #4a3227; }
.agree input:checked + .agree-box::after { content: "✓"; }
.agree input:focus-visible + .agree-box { outline: 2px solid #e59468; outline-offset: 2px; }
.agree-text { font-size: 14px; line-height: 1.5; color: #4a3227; }
.agree-text a { color: #4a3227; text-decoration: underline; text-underline-offset: 2px; }

.paywall-fine { margin: 10px 0 0; font-size: 12px; line-height: 1.5; color: var(--warm-muted); }
.paywall-terms-link { margin-top: 4px; font-size: 13px; line-height: 1.5; color: var(--warm-body); text-decoration: underline; text-underline-offset: 2px; }
.paywall-recovery { margin: 14px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--warm-body); }
.paywall-recovery a { color: #4a3227; text-decoration: underline; text-underline-offset: 2px; }
.paywall-rule { width: 100%; height: 1px; background: rgba(84,52,38,0.14); margin: 18px 0 12px; }
.paywall-legal { margin: 0; font-size: 11px; line-height: 1.65; color: var(--warm-muted); }
.paywall-legal a { color: var(--warm-muted); text-decoration: none; }
.paywall-legal a:hover { text-decoration: underline; }

/* ---------- Welcome ---------- */

.welcome-center {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0 40px 56px;
  text-align: center;
}
.welcome-sub {
  margin: 18px 0 0;
  max-width: 268px;
  font-family: system-ui, -apple-system, "SF Pro Text", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: rgb(124,92,76);
  text-wrap: pretty;
}

/* ---------- Triggers ---------- */

.triggers-head { padding: 12px 30px 0; text-align: center; }
.triggers-title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 27px; line-height: 1.2; color: var(--warm-ink); }
.triggers-sub { margin: 7px 0 0; font-size: 14px; line-height: 1.5; color: var(--warm-muted); }

/* Design 13a: the circles shrink to fit the height left under the heading,
   so all four rows always show and the screen never scrolls. When height
   runs short, each circle may grow wider than tall (a slight oval) so the
   longest sentences keep clear of the edge. Design specified up to 1.3x;
   measured on a 375x600 screen that still let "I can't stop imagining…"
   touch the edge, so the cap is 1.5x (full-height phones are unaffected:
   there the 150px cap wins and circles stay round). The triggers
   screen is exactly one viewport tall (100dvh, see body[data-screen]). */
.trigger-fit {
  flex: 1;
  min-height: 0;
  container-type: size;
  margin: 14px 28px 24px;
}
.trigger-grid {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding-bottom: 8px;
  justify-items: center;
  align-items: center;
}

.trigger {
  position: relative;
  width: min(100%, 150px, calc((100cqh - 54px) / 4 * 1.5));
  height: min(150px, calc((100cqh - 54px) / 4));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(168deg, var(--c1) 0%, var(--c2) 165%);
  color: #22283c;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(11px, 2.1cqh, 13px);
  line-height: 1.3;
  text-align: center;
  text-wrap: pretty;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(84,112,160,0.18);
  animation: var(--drift) ease-in-out infinite;
  transition: box-shadow 0.4s ease;
}
.trigger:hover { box-shadow: 0 12px 26px rgba(84,112,160,0.26); }
.trigger::before {
  content: "";
  position: absolute;
  left: -6px; top: -5px; right: 2px; bottom: 3px;
  border-radius: 50%;
  background: var(--disc);
  opacity: 0.5;
  pointer-events: none;
}
.trigger span { position: relative; }

/* Very short screens (e.g. iPhone SE in Safari with both toolbars, ~553px):
   tighten the space above the circles so each row stays tall enough for the
   four-line sentence. */
@media (max-height: 620px) {
  body[data-screen="trigger"] #app-header { margin-top: calc(var(--safe-top) + 8px); }
  .triggers-head { padding-top: 4px; }
  .triggers-title { font-size: 24px; }
  .triggers-sub { margin-top: 4px; font-size: 13.5px; }
  .trigger-fit { margin: 10px 24px 14px; }
  .trigger-grid { gap: 8px; padding-bottom: 4px; }
}

/* Exactly one screen tall while the triggers show, so nothing scrolls. */
body[data-screen="trigger"] #app { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }

/* Browsers without size container queries (older than iOS 16): fall back
   to fixed round circles and let the screen scroll. */
@supports not (container-type: size) {
  body[data-screen="trigger"] #app { height: auto; min-height: 100dvh; overflow: visible; }
  .trigger-fit { flex: none; }
  .trigger-grid { height: auto; grid-template-rows: none; gap: 14px; padding-bottom: 32px; }
  .trigger { width: 100%; max-width: 150px; height: auto; aspect-ratio: 1; font-size: 13px; }
}


/* ---------- Body reset (dorsal) ---------- */

.reset-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px 30px 0;
}
.reset-title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 27px; line-height: 1.24; color: var(--warm-ink); text-wrap: pretty; }
.reset-text { margin: 14px 0 0; font-size: 15.5px; line-height: 1.6; color: var(--warm-body); text-wrap: pretty; }
.reset-steps {
  list-style: none;
  margin: 22px 0 0;
  padding: 20px;
  border-radius: 24px;
  background: rgba(255,255,255,0.5);
  box-shadow: inset 0 0 0 1px rgba(150,86,58,0.1);
  display: flex;
  flex-direction: column;
  gap: 14px;
  counter-reset: step;
}
.reset-steps li { display: flex; gap: 14px; align-items: flex-start; counter-increment: step; }
.reset-steps li::before {
  content: counter(step);
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(229,148,104,0.22);
  color: #8a4a2c;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reset-steps li span { padding-top: 2px; font-size: 15.5px; line-height: 1.5; color: var(--warm-ink); text-wrap: pretty; }
.reset-note { margin: 18px 4px 0; font-size: 13.5px; line-height: 1.55; font-style: italic; color: var(--warm-muted); text-wrap: pretty; }

/* ---------- Breath ---------- */

.breath-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 8px;
}
.breath-canvas {
  display: block;
  width: 100%;
  height: clamp(260px, calc(100dvh - 330px), 440px);
}
.phase-word {
  height: 58px;
  margin-top: 12px;
  font-family: var(--serif);
  font-weight: 300;
  font-size: 47px;
  line-height: 1.08;
  letter-spacing: 0.012em;
  color: #f2dcac;
  transition: color 900ms ease;
}

/* ---------- Quick check ---------- */

.check-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 28px 90px;
  text-align: center;
}
.check-question { margin: 18px 0 0; font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.3; color: var(--ink); text-wrap: balance; }
.check-choices { margin-top: 40px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Writing screens (journal, self-distancing, bridge) ---------- */

.write-head { flex: none; padding: 26px 30px 0; }
.write-head .kicker + .write-prompt { margin-top: 12px; }
.write-prompt {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.42;
  letter-spacing: 0.004em;
  color: var(--ink);
  text-wrap: pretty;
}
.laid-out .line { display: block; }
.laid-out .line-q { padding-left: 18px; }
.laid-out .line-gap { margin-top: 0.7em; }
.mantra-text.laid-out .line-gap { margin-top: 0.55em; }

.bridge-lead { font-size: 25px; line-height: 1.34; margin-top: 12px; }
.bridge-sub { margin: 14px 0 0; font-size: 16px; line-height: 1.55; color: var(--body-2); text-wrap: pretty; }

.write-field { flex: 1; display: flex; padding: 22px 26px 0; min-height: 200px; }
.textarea {
  flex: 1;
  width: 100%;
  border: none;
  border-radius: 22px;
  background: rgba(255,255,255,0.66);
  padding: 20px 22px;
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.66;
  color: var(--ink);
  resize: none;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(122,142,182,0.16), 0 2px 16px rgba(84,104,150,0.07);
  transition: box-shadow 0.3s ease;
}
.textarea:focus { box-shadow: inset 0 0 0 1.5px rgba(123,167,224,0.6), 0 2px 20px rgba(84,104,150,0.1); }
.textarea::placeholder, .email-input::placeholder { color: rgba(43,45,66,0.4); }

.write-helper { margin: 14px 30px 0; font-size: 14.5px; line-height: 1.55; color: var(--muted-2); text-align: center;  text-wrap: balance; }

/* ---------- Mantra ---------- */

.mantra-body {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 42px;
  text-align: center;
}
.hairline { width: 34px; height: 1px; background: rgba(123,167,224,0.5); margin: 26px 0 0; }
.hairline-top { margin: 22px 0 26px; }
.mantra-text {
  margin: 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: 33px;
  line-height: 1.42;
  letter-spacing: 0.006em;
  color: var(--ink-read);
  text-wrap: pretty;
}
.mantra-text.rise { animation: cessaRise 1.4s ease-out both; }
.mantra-sub { margin: 24px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--muted-2);  text-wrap: balance; }
#screen-mantra .screen-foot { position: relative; padding-top: 0; }

/* ---------- Task ---------- */

.task-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 30px; }
.task-body .kicker { text-align: center; }
.task-card {
  margin-top: 26px;
  width: 100%;
  border-radius: 30px;
  background: rgba(255,255,255,0.72);
  padding: 40px 32px;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(122,142,182,0.14), 0 6px 26px rgba(84,104,150,0.09);
}
.task-text { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1.42; color: var(--ink-read); text-wrap: pretty; }
.task-sub { margin: 18px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--muted-2);  text-wrap: balance; }
#screen-task .screen-foot { padding-top: 0; }

/* ---------- Complete ---------- */

.done-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.settle-canvas { display: block; width: 100%; height: clamp(300px, calc(100dvh - 380px), 420px); margin: -24px 0 -48px; cursor: pointer; }
.done-copy { text-align: center; padding: 0 40px; animation: cessaRise 1.4s ease-out both; }
.done-title { margin: 18px 0 0; font-family: var(--serif); font-weight: 400; font-size: 36px; line-height: 1.15; color: var(--ink); }
.done-sub { margin: 14px auto 0; max-width: 280px; font-size: 16px; line-height: 1.6; color: var(--muted); text-wrap: pretty;  text-wrap: balance; }
#screen-complete .screen-foot { padding-top: 0; }
#complete-feel-better { width: 260px; max-width: 100%; }

/* ---------- Grounding ---------- */

.ground-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: 16px 32px 0;
}
.ground-body p { margin: 0; text-wrap: pretty; }
.ground-lead { font-family: var(--serif); font-weight: 400; font-size: 25px; line-height: 1.3; color: var(--ink-read); }
.ground-lead-sm { font-size: 22px; line-height: 1.36; }
.ground-text { font-size: 16px; line-height: 1.6; color: var(--body-2); }
.ground-example { padding: 14px 18px; border-radius: 18px; background: rgba(255,255,255,0.5); font-size: 14px; line-height: 1.55; font-style: italic; color: var(--muted-2); }
.ground-instruction { font-family: var(--serif); font-weight: 400; font-size: 20px; line-height: 1.4; color: var(--ink-read); }
.ground-quote { display: block; margin-top: 8px; padding: 12px 16px; border-radius: 16px; background: rgba(255,255,255,0.55); font-family: var(--serif); font-size: 19px; line-height: 1.4; color: var(--ink-read); }
#screen-grounding .screen-foot, #screen-grounding-deep .screen-foot { gap: 10px; padding: 18px 28px 30px; }

/* ---------- Finish ---------- */

.finish-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 16px 20px 0; text-align: center; }
.finish-copy { display: flex; flex-direction: column; gap: 12px; font-family: var(--serif); font-weight: 400; font-size: 19px; line-height: 1.45; color: var(--ink-read); }
.finish-copy p { margin: 0; }

.email-card {
  margin: 28px 8px 0;
  padding: 20px 20px 8px;
  border-radius: 24px;
  background: rgba(255,255,255,0.6);
  box-shadow: inset 0 0 0 1px rgba(122,142,182,0.14);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.email-intro { margin: 0 0 14px; font-size: 14.5px; line-height: 1.5; color: var(--body-2); text-wrap: pretty; }
.email-input {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 999px;
  background: #fff;
  padding: 0 20px;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(122,142,182,0.25);
  transition: box-shadow 0.25s ease;
}
.email-input:focus { box-shadow: inset 0 0 0 1.5px rgba(123,167,224,0.6); }
.email-input.has-error { box-shadow: inset 0 0 0 1.5px #c9606f; }
.email-error { margin: 8px 0 0 20px; min-height: 0; font-size: 12.5px; line-height: 1.4; color: #a3404f; text-align: left; }
.email-error:empty { display: none; }
.email-buttons { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 14px; }
.email-thanks { display: none; padding: 22px 20px; animation: cessaRise 0.6s ease-out both; }
.finish-affirm { display: none; animation: cessaRise 1.2s ease-out both; }
.finish-affirm p { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1.5; color: #fff; }
/* Affirmation shows on the dark breath ground; the button takes the
   breath screen's exhale-blue pill. */
body[data-ground="dark"] #final-done {
  background-color: #a9cdf2;
  background-image: linear-gradient(135deg,rgba(255,255,255,0.34) 0%,rgba(255,255,255,0.04) 54%,rgba(35,38,58,0.1) 100%);
  color: #23263a;
  box-shadow: 0 10px 26px rgba(0,0,0,0.34);
}
.email-thanks p { margin: 0; font-size: 15.5px; line-height: 1.5; color: var(--body-2); }
#screen-finish .screen-foot { padding-top: 18px; }

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  .halo, .trigger { animation: none !important; }
  .bg-layer { transition: none; }
}

/* ---------- Test build only (see js/build.js) ---------- */

.test-skip {
  margin-top: 12px;
  padding: 8px 16px;
  border: 1.5px dashed rgba(74,50,39,0.45);
  border-radius: 999px;
  background: rgba(255,255,255,0.6);
  font-size: 13px;
  color: #4a3227;
  cursor: pointer;
}
.test-badge {
  position: fixed;
  z-index: 10;
  right: 10px;
  bottom: calc(var(--safe-bottom) + 8px);
  padding: 4px 9px;
  border: none;
  border-radius: 999px;
  background: rgba(43,45,66,0.72);
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  cursor: pointer;
}

/* ---------- Footer: legal links + "Manage or cancel subscription" ----------
   Welcome and Finish only. */

.app-legal {
  position: relative;
  flex: none;
  padding: 0 28px 18px;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--warm-muted);
}
.app-legal a { color: inherit; text-decoration: none; }
.app-legal a:hover { text-decoration: underline; }
.app-legal .manage-link { display: none; margin-top: 2px; text-decoration: underline; text-underline-offset: 2px; }
#screen-finish .app-legal { color: var(--muted); }
body[data-ground="dark"] #screen-finish .app-legal { color: rgba(242,232,216,0.55); }
#screen-finish .screen-foot { padding-bottom: 22px; }
.welcome-center { padding-bottom: 24px; }

/* ---------- Closing screen (Finish) ----------
   The message sits in the box; the survey and email are smaller and
   box-free below it. One Continue goes to the final page. */

.close-body { flex: 1; display: flex; flex-direction: column; padding: 6px 18px 0; }
.proud-card {
  margin: 4px 0 0;
  padding: 20px 16px;
  border-radius: 26px;
  background: rgba(255,255,255,0.66);
  box-shadow: inset 0 0 0 1px rgba(122,142,182,0.16), 0 6px 26px rgba(84,104,150,0.09);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.4;
  color: var(--ink-read);
}
.proud-card p { margin: 0; text-wrap: balance; }

.mini { margin-top: 20px; text-align: center; }
.mini-label { margin: 0 0 10px; font-family: var(--serif); font-size: 18px; color: var(--ink-read); }
.mini-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini-choice {
  min-height: 40px;
  border: none;
  border-radius: 999px;
  background: rgba(255,255,255,0.55);
  box-shadow: inset 0 0 0 1.5px rgba(123,167,224,0.4);
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink-read);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.mini-choice:hover { background: #fff; }
.mini-choice.on { background: #7ba7e0; color: #fff; box-shadow: none; }

.mini-follow { display: none; margin-top: 12px; text-align: left; animation: cessaRise 0.4s ease-out both; }
.mini-question { margin: 0 0 8px; font-size: 14px; line-height: 1.45; color: var(--body-2); text-align: center; text-wrap: balance; }
.mini-textarea {
  width: 100%;
  height: 72px;
  border: none;
  border-radius: 16px;
  background: #fff;
  padding: 10px 14px;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  resize: none;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(122,142,182,0.25);
  transition: box-shadow 0.25s ease;
}
.mini-textarea:focus { box-shadow: inset 0 0 0 1.5px rgba(123,167,224,0.6); }
.mini-textarea::placeholder { color: rgba(43,45,66,0.4); }

.feedback-share {
  position: relative;
  display: none;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--body-2);
  cursor: pointer;
}
.feedback-share input { position: absolute; opacity: 0; width: 18px; height: 18px; margin: 0; }
.feedback-share-box {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid rgba(74,90,120,0.45);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  color: #fff;
}
.feedback-share input:checked + .feedback-share-box { background: #4a5a78; border-color: #4a5a78; }
.feedback-share input:checked + .feedback-share-box::after { content: "✓"; }
.feedback-share input:focus-visible + .feedback-share-box { outline: 2px solid #7ba7e0; outline-offset: 2px; }
.feedback-crisis { margin: 8px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--muted-2); text-align: center; text-wrap: balance; }

.mini-email-intro { margin: 0 0 8px; font-size: 13.5px; line-height: 1.45; color: var(--body-2); text-wrap: balance; }
.mini-email {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: rgba(255,255,255,0.8);
  padding: 0 18px;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  text-align: center;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(122,142,182,0.25);
  transition: box-shadow 0.25s ease;
}
.mini-email:focus { box-shadow: inset 0 0 0 1.5px rgba(123,167,224,0.6); }
.mini-email.has-error { box-shadow: inset 0 0 0 1.5px #c9606f; }
.mini-email::placeholder { color: rgba(43,45,66,0.4); }
#finish-email-block .email-error { margin: 6px 0 0; text-align: center; }

#screen-finish .close-foot { padding: 18px 28px 12px; }

/* ---------- Final page ---------- */

#screen-final .finish-affirm { display: block; }
.final-foot { padding-bottom: 38px; }
.btn-final { width: auto; min-width: 220px; min-height: 50px; padding: 0 32px; font-size: 16px; }

/* ---------- "Save to home screen" tip (Welcome) ---------- */

.install-tip {
  position: relative;
  flex: none;
  margin: 0 22px 12px;
  padding: 12px 14px 12px;
  border-radius: 20px;
  background: rgba(255,255,255,0.72);
  box-shadow: inset 0 0 0 1px rgba(150,86,58,0.10), 0 6px 20px rgba(150,86,58,0.09);
  color: var(--warm-ink);
  text-align: left;
  animation: cessaRise 0.6s ease-out both;
}
.install-tip[hidden], .install-tip [hidden] { display: none !important; }
.install-x {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 30px;
  height: 30px;
  border: none;
  background: none;
  color: var(--warm-muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.install-row { display: flex; gap: 10px; align-items: center; padding-right: 22px; }
.install-icon {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: url(/icons/icon-192.png) center / cover;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.install-title { margin: 0; font-family: var(--serif); font-size: 16.5px; line-height: 1.25; color: var(--warm-ink); }
.install-text { margin: 2px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--warm-body); }
.install-steps { list-style: none; margin: 10px 0 0 2px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
/* Plain instruction lines, not button-like rows: each icon sits right
   next to its word so nothing looks tappable. */
.install-steps li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 2px 2px;
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--warm-ink);
}
.install-steps .n {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(229,148,104,0.22);
  color: #8a4a2c;
  font-size: 11.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.install-steps .ic { display: inline-flex; vertical-align: -3px; margin-left: 4px; color: #4a3227; }
.install-hint { color: var(--warm-muted); font-size: 12px; }
.install-btn {
  margin-top: 10px;
  width: 100%;
  min-height: 42px;
  border: none;
  border-radius: 999px;
  background: #4a3227;
  color: #fcf1e5;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}
