/* Decade4U shared styles: calm and warm, follows the phone's light/dark setting */
:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --text: #2b2622;
  --muted: #7a7068;
  --line: #e6dfd4;
  --bead: #ffffff;
  --bead-edge: #a99c8a;
  --glow: #f5c542;
  --prayed: #f2d98f;
  --cord: #bdb1a1;
  --on-glow: #2b2310;
  --glow-text: #a8780a;
  --spark: #e0a91c;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16141a;
    --surface: #1f1c24;
    --text: #f1ece4;
    --muted: #a39a90;
    --line: #2f2b36;
    --bead: #f4f1ec;
    --bead-edge: #8c847a;
    --glow: #ffd257;
    --prayed: #8f7a45;
    --cord: #4a4450;
    --on-glow: #2b2310;
    --glow-text: #ffd257;
    --spark: #fff6d6;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.serif { font-family: "Cormorant Garamond", Georgia, serif; }
[hidden] { display: none !important; }

/* ---------- buttons ---------- */
.btn {
  appearance: none;
  border: 1px solid var(--bead-edge);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 500;
  font-size: 1.05rem;
  padding: 14px 22px;
  border-radius: 14px;
  min-height: 52px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .08s ease, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .35; cursor: default; }
.btn.primary { background: var(--glow); border-color: var(--glow); color: var(--on-glow); }
.btn:focus-visible { outline: 3px solid var(--glow); outline-offset: 3px; }
.link {
  background: none; border: 0; font: inherit; color: var(--muted);
  font-size: .9rem; cursor: pointer; text-decoration: none; padding: 8px 4px;
}

/* ---------- home ---------- */
/* ---------- home ---------- */
.home {
  min-height: 100%;
  background:
    radial-gradient(120% 55% at 50% -8%, color-mix(in srgb, var(--glow) 22%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
.home main {
  max-width: 440px; margin: 0 auto; text-align: center;
  padding: calc(36px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom));
}
.hero { padding: 8px 0 6px; }
.hero h1 {
  font-weight: 600; font-size: clamp(3rem, 15vw, 4.2rem); line-height: 1; letter-spacing: -.01em;
  margin-bottom: 10px;
}
.hero .tagline {
  font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-weight: 500;
  font-size: 1.35rem; color: var(--glow-text); margin-bottom: 10px;
}
.hero .intro { color: var(--muted); font-size: 1rem; line-height: 1.6; max-width: 340px; margin: 0 auto; }
.home .actions { display: grid; gap: 10px; margin-top: 18px; }
.home .soon { font-size: .85rem; color: var(--muted); }
.foot { margin-top: 28px; font-size: .8rem; color: var(--muted); }
.foot a { color: inherit; }

.beads-row {
  position: relative; display: flex; justify-content: space-between; align-items: center;
  width: 100%; max-width: 260px; margin: 0 auto 26px;
}
.beads-row::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%;
  height: 2px; background: var(--cord); transform: translateY(-50%);
}
.beads-row span {
  position: relative; width: 18px; height: 18px; border-radius: 50%;
  background: var(--bead); border: 1px solid var(--bead-edge);
  animation: rowglow 10s infinite;
}
.beads-row span:nth-child(2)  { animation-delay: 1s; }
.beads-row span:nth-child(3)  { animation-delay: 2s; }
.beads-row span:nth-child(4)  { animation-delay: 3s; }
.beads-row span:nth-child(5)  { animation-delay: 4s; }
.beads-row span:nth-child(6)  { animation-delay: 5s; }
.beads-row span:nth-child(7)  { animation-delay: 6s; }
.beads-row span:nth-child(8)  { animation-delay: 7s; }
.beads-row span:nth-child(9)  { animation-delay: 8s; }
.beads-row span:nth-child(10) { animation-delay: 9s; }
@keyframes rowglow {
  0%, 10%, 100% { background: var(--bead); box-shadow: none; }
  3%, 7% {
    background: var(--glow); border-color: var(--glow);
    box-shadow: 0 0 14px 4px color-mix(in srgb, var(--glow) 60%, transparent);
  }
}

/* ---------- prayer page ---------- */
.pray {
  height: 100%;
  height: 100dvh;
  display: flex; flex-direction: column;
  max-width: 560px; margin: 0 auto;
  padding: 8px 16px calc(12px + env(safe-area-inset-bottom));
}
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.where {
  text-align: center; color: var(--muted); font-size: .85rem;
  letter-spacing: .04em; margin: 2px 0 6px;
}
.progress { height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--glow); transition: width .3s ease; }

.rosary-wrap {
  flex: 0 0 auto; display: flex; justify-content: center;
  padding: 10px 0 6px;
}
#rosary { height: clamp(150px, 34vh, 340px); height: clamp(150px, 34dvh, 340px); width: auto; display: block; }

#rosary .cord { fill: none; stroke: var(--cord); stroke-width: 1.4; }
#rosary .bead { fill: var(--bead); stroke: var(--bead-edge); stroke-width: 1; transition: fill .35s ease; }
#rosary .bead.medal { stroke-width: 1.2; }
#rosary .cross { stroke-width: .8; }
#rosary .cross rect { fill: inherit; stroke: inherit; stroke-width: inherit; }
#rosary .bead.prayed { fill: var(--prayed); }
#rosary .bead.active {
  fill: var(--glow); stroke: var(--glow); filter: url(#glow);
  transform-box: fill-box; transform-origin: center;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@media (prefers-reduced-motion: reduce) {
  #rosary .bead.active { animation: none; }
  .beads-row span { animation: none; }
  .beads-row span:first-child { background: var(--glow); border-color: var(--glow); }
}

.card {
  flex: 1 1 auto; min-height: 120px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 18px 18px 20px; margin: 6px 0 12px;
}
.card .kicker { color: var(--muted); font-size: .82rem; letter-spacing: .05em; text-transform: uppercase; min-height: 1em; margin-bottom: 4px; }
.card h2 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: 1.6rem; line-height: 1.2; margin-bottom: 10px; }
.card .text p { font-size: 1.12rem; line-height: 1.65; }
.card .text p + p { margin-top: .6em; }
.card.is-mystery { border-color: var(--glow); }
.card.is-mystery .kicker { color: var(--text); }
.card.is-mystery .text p { color: var(--muted); font-size: 1rem; }

.controls { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: .9rem;
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
}

.done {
  min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 14px; padding: 24px 16px;
}
.done h2 { font-family: "Cormorant Garamond", Georgia, serif; font-size: 2.6rem; font-weight: 600; outline: none; }
.done p { color: var(--muted); max-width: 340px; line-height: 1.6; }
.done .actions { display: grid; gap: 10px; width: 100%; max-width: 320px; margin-top: 10px; }

@media (max-height: 640px) {
  .card h2 { font-size: 1.35rem; }
  .card .text p { font-size: 1.02rem; line-height: 1.55; }
}

/* ---------- setup screen ---------- */
.choose {
  min-height: 100%; max-width: 480px; margin: 0 auto;
  display: flex; flex-direction: column; justify-content: center; gap: 14px;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
}
.choose .back-home { align-self: flex-start; }
.choose h2 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: 2rem; text-align: center; margin: 8px 0 6px; }
.choice {
  appearance: none; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 18px; display: grid; gap: 6px; transition: border-color .2s, transform .08s;
}
.choice:hover, .choice:focus-visible { border-color: var(--glow); outline: none; }
.choice:active { transform: scale(.98); }
.choice strong { font-size: 1.15rem; font-weight: 600; }
.choice span { color: var(--muted); line-height: 1.5; font-size: .98rem; }
.choose .fine { text-align: center; color: var(--muted); font-size: .85rem; }

/* ---------- own-rosary screens ---------- */
.card.tap-next { cursor: pointer; }
.card.is-group { border-color: var(--glow); }
.checklist { list-style: none; display: grid; gap: 8px; margin: 2px 0 14px; }
.checklist li {
  font-size: 1.08rem; padding-left: 26px; position: relative;
}
.checklist li::before {
  content: ""; position: absolute; left: 4px; top: .42em; width: 10px; height: 10px; border-radius: 50%;
  background: var(--glow); box-shadow: 0 0 8px color-mix(in srgb, var(--glow) 60%, transparent);
}
.card details { border-top: 1px solid var(--line); padding-top: 10px; }
.card summary { cursor: pointer; color: var(--muted); font-size: .95rem; padding: 4px 0; }
.card details h3 { font-size: .95rem; font-weight: 600; margin: 12px 0 4px; }
.card details p { font-size: 1rem; line-height: 1.6; }
.card .hint { color: var(--muted); font-size: .92rem; margin-top: 14px; }
.topbar .link { font-size: .85rem; }

.setup {
  max-width: 480px; margin: 0 auto;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 18px;
}
.setup .back-home { align-self: flex-start; }
.setup h2 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: 2.1rem; text-align: center; margin-top: 4px; }
.setup .lead { text-align: center; color: var(--muted); line-height: 1.5; margin-top: -10px; }
.field { display: grid; gap: 10px; }
.field .label { font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.field .fine { color: var(--muted); font-size: .88rem; line-height: 1.45; }
.seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.seg button {
  appearance: none; font: inherit; font-size: 1.25rem; font-weight: 600; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  min-height: 60px; cursor: pointer; display: grid; place-content: center; gap: 2px;
}
.seg button small { font-size: .62rem; font-weight: 500; color: var(--muted); letter-spacing: .02em; }
.seg button[aria-pressed="true"] { background: var(--glow); border-color: var(--glow); color: var(--on-glow); }
.seg button[aria-pressed="true"] small { color: var(--on-glow); }
.modes { display: grid; gap: 10px; }
.modes .choice { padding: 14px 16px; }
.modes .choice[aria-pressed="true"] { border-color: var(--glow); box-shadow: inset 0 0 0 1px var(--glow); }
.modes .choice[aria-pressed="true"] strong::after { content: " ✓"; color: var(--glow); }
.assigned { list-style: none; display: grid; gap: 8px; }
.assigned li { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.assigned .who { font-size: .8rem; color: var(--muted); margin-bottom: 3px; }
.assigned p { line-height: 1.45; }
.setup .start { width: 100%; position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 8px 24px rgba(0,0,0,.15); }

.for-line { font-size: .82rem; color: var(--muted); margin-bottom: 2px; }
.for-line::before { content: "♥ "; color: var(--glow); }
.intention { background: color-mix(in srgb, var(--glow) 12%, transparent); border-radius: 12px; padding: 12px 14px; margin: 4px 0 12px; }
.intention .who { font-size: .82rem; color: var(--muted); margin-bottom: 4px; }
.intention .what { font-size: 1.1rem; line-height: 1.5; }
.card .text .intention p { font-size: inherit; }
.card .text .intention .what { font-size: 1.1rem; }

.thanks { list-style: none; display: grid; gap: 10px; width: 100%; max-width: 420px; text-align: left; }
.thanks li { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.thanks .who { font-size: .8rem; color: var(--muted); }
.thanks .what { margin: 2px 0 8px; line-height: 1.45; }
.thanks .msg { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.2rem; font-style: italic; color: var(--text); }
.card.is-mystery .text .intention .what { color: var(--text); }
.card.is-mystery .text .intention .who { color: var(--muted); font-size: .82rem; }

/* ---------- hide prayers: big, tappable rosary ---------- */
.pill {
  appearance: none; font: inherit; font-size: .85rem; color: var(--text); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px;
}
.pill[aria-pressed="true"] { background: var(--glow); border-color: var(--glow); color: var(--on-glow); }
.rosary-wrap.tap-next { cursor: pointer; }
#rosary .bead.unused { opacity: .28; }
#rosary .ripple {
  fill: none; stroke: var(--glow); stroke-width: 2;
  transform-box: fill-box; transform-origin: center;
  animation: ripple .7s ease-out forwards;
}
@keyframes ripple { from { transform: scale(1); opacity: .9; } to { transform: scale(3.2); opacity: 0; } }

#rosary .centre { display: none; }
.centre-box {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: var(--text); gap: 3px; font-family: "Inter", system-ui, sans-serif;
}
.c-kicker { font-size: 7.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.c-title { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: 19px; line-height: 1.1; }
.c-count { font-size: 15px; font-weight: 600; color: var(--glow-text); }
.c-sub { font-size: 7.5px; line-height: 1.4; color: var(--muted); max-width: 140px; }
.c-kicker:empty, .c-count:empty, .c-sub:empty { display: none; }

/* decade panel: mystery + intention, shown on every bead of a decade */
.strip {
  display: block; margin: 0 0 8px; padding: 10px 14px;
  background: color-mix(in srgb, var(--glow) 12%, var(--surface)); border-radius: 14px;
}
.strip.empty, .strip.on-mystery { display: none; } /* the mystery card already shows both */
.strip-myst { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: 1.12rem; line-height: 1.2; }
.strip-myst::before { content: "✦ "; color: var(--glow-text); }
.strip-int { margin-top: 2px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.strip-who { color: var(--muted); font-size: .85rem; }
.strip-who::before { content: "♥ "; color: var(--glow); }

.pray.hide-prayers .card { display: none; }
.pray.hide-prayers .rosary-wrap { flex: 1 1 auto; min-height: 0; padding: 4px 0; }
.pray.hide-prayers #rosary { width: 100%; height: 100%; max-height: none; }
.pray.hide-prayers #rosary .centre { display: inline; }
.pray.hide-prayers .strip, .pray.hide-prayers .strip.on-mystery {
  display: block; min-height: 84px; margin: 4px 0 12px; padding: 12px 16px; border-radius: 16px;
}
.pray.hide-prayers .strip.empty { display: block; visibility: hidden; }
.pray.hide-prayers .strip-myst { font-size: 1.25rem; }
.pray.hide-prayers .strip-int { -webkit-line-clamp: 2; }

/* the whole prayer screen listens for sideways swipes; vertical scrolling still works */
.pray { touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.pray .card .text { user-select: text; -webkit-user-select: text; }
.pray.hide-prayers .controls { display: none; }
.pray.hide-prayers .strip { margin-bottom: 8px; }
.gesture-hint {
  text-align: center; color: var(--muted); font-size: .82rem; line-height: 1.4;
  padding: 0 8px 6px;
}

/* ---------- golden counter ring ---------- */
.stat { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 26px auto 4px; }
.stat-ring { position: relative; width: 132px; height: 132px; }
.stat-ring svg { width: 100%; height: 100%; overflow: visible; }
.stat-ring .track { fill: none; stroke: color-mix(in srgb, var(--glow) 22%, transparent); stroke-width: 5; }
.stat-ring .arc {
  fill: none; stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 120 207; /* a golden arc about a third of the way round */
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--glow) 70%, transparent));
}
.stat-ring .spark { fill: var(--spark); filter: drop-shadow(0 0 5px #f5c542); }
.stat-ring .spin { transform-origin: 60px 60px; animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.stat-num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: 2.9rem;
  color: var(--glow-text); text-shadow: 0 0 18px color-mix(in srgb, var(--glow) 45%, transparent);
}
.stat-label { color: var(--muted); font-size: .92rem; letter-spacing: .02em; }
@media (prefers-reduced-motion: reduce) { .stat-ring .spin { animation: none; } }
.done #done-stat .stat { margin-top: 8px; }

/* ---------- "need your prayers" on the home page ---------- */
.need {
  margin: 26px 0 4px; padding: 18px 16px 16px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--glow) 35%, transparent) inset;
}
.need h2 {
  font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: 1.45rem; line-height: 1.2;
  text-align: center; margin-bottom: 12px;
}
.need ul { list-style: none; display: grid; gap: 8px; margin-bottom: 14px; }
.need li {
  display: grid; gap: 1px; padding: 9px 12px 9px 30px; position: relative;
  background: color-mix(in srgb, var(--glow) 9%, transparent); border-radius: 12px;
}
.need li::before {
  content: ""; position: absolute; left: 12px; top: 15px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--glow); box-shadow: 0 0 8px color-mix(in srgb, var(--glow) 70%, transparent);
  animation: breathe 2.8s ease-in-out infinite;
}
.need li:nth-child(2)::before { animation-delay: .9s; }
.need li:nth-child(3)::before { animation-delay: 1.8s; }
@keyframes breathe { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .need li::before { animation: none; } }
.need .nm { font-size: .8rem; color: var(--muted); }
.need .tx { line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.need .btn { width: 100%; }
.all-prayed { margin-top: 22px; color: var(--muted); }
.home .need { margin-top: 28px; }
.home #home-stat .stat { margin-top: 26px; }

/* ---------- golden glow around intention boxes ---------- */
.assigned li, .thanks li, .need li, .intention {
  border: 1px solid color-mix(in srgb, var(--glow) 45%, var(--line));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--glow) 12%, transparent),
    0 0 18px color-mix(in srgb, var(--glow) 20%, transparent),
    inset 0 0 14px color-mix(in srgb, var(--glow) 6%, transparent);
}
.assigned li, .thanks li { animation: glowin .6s ease-out both; }
.assigned li:nth-child(2), .thanks li:nth-child(2) { animation-delay: .08s; }
.assigned li:nth-child(3), .thanks li:nth-child(3) { animation-delay: .16s; }
.assigned li:nth-child(4), .thanks li:nth-child(4) { animation-delay: .24s; }
.assigned li:nth-child(5), .thanks li:nth-child(5) { animation-delay: .32s; }
@keyframes glowin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .assigned li, .thanks li { animation: none; } }
@media (prefers-color-scheme: dark) {
  .assigned li, .thanks li, .need li, .intention {
    border-color: color-mix(in srgb, var(--glow) 55%, var(--line));
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--glow) 15%, transparent),
      0 0 22px color-mix(in srgb, var(--glow) 26%, transparent),
      inset 0 0 16px color-mix(in srgb, var(--glow) 8%, transparent);
  }
}

/* =====================================================================
   Desktop and laptop layout (wide screens). Phones keep the layout above.
   ===================================================================== */
@media (min-width: 900px) {
  /* ---- home: title + counter on the left, people who need prayers on the right ---- */
  .home main {
    max-width: 1100px; min-height: 100vh; text-align: left;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 64px;
    grid-template-areas: "hero need" "stat need" "stat actions" "foot foot";
    grid-template-rows: auto auto 1fr auto; align-content: center;
    padding: 56px 40px 32px;
  }
  .hero { grid-area: hero; align-self: end; }
  .hero .beads-row { margin-left: 0; }
  .hero .intro { margin: 0; max-width: 420px; }
  .home .need, .all-prayed { grid-area: need; align-self: center; margin-top: 0; }
  .home #home-stat { grid-area: stat; align-self: start; }
  .home #home-stat .stat { align-items: flex-start; margin-left: 0; }
  .home .actions { grid-area: actions; align-self: start; }
  .foot { grid-area: foot; text-align: center; }

  /* ---- setup: choices left, the people you'll pray for right ---- */
  .setup {
    max-width: 1040px; padding: 32px 40px 40px;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 56px; row-gap: 20px;
    grid-template-areas: "back back" "title title" "lead lead" "dec pray" "modes pray" "modes start";
    grid-template-rows: auto auto auto auto auto 1fr;
  }
  .setup > :nth-child(1) { grid-area: back; }
  .setup > :nth-child(2) { grid-area: title; }
  .setup > :nth-child(3) { grid-area: lead; }
  .setup > :nth-child(4) { grid-area: dec; }
  .setup > :nth-child(5) { grid-area: modes; }
  .setup > :nth-child(6) { grid-area: pray; }
  .setup > :nth-child(7) { grid-area: start; align-self: start; }
  .setup .start { position: static; box-shadow: none; }

  /* ---- prayer screen: big rosary left, mystery/intention/prayer right ---- */
  .pray {
    max-width: 1240px; padding: 16px 40px 24px;
    display: grid; column-gap: 48px;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    grid-template-areas: "top top" "where where" "prog prog" "ring strip" "ring card" "ring hint" "ring controls";
    grid-template-rows: auto auto auto auto 1fr auto auto;
  }
  .pray .topbar { grid-area: top; }
  .pray .where { grid-area: where; }
  .pray .progress { grid-area: prog; margin-bottom: 12px; }
  .pray .rosary-wrap { grid-area: ring; min-height: 0; padding: 0; align-items: center; }
  .pray #rosary { width: 100%; height: 100%; max-height: none; }
  .pray .strip { grid-area: strip; margin: 0 0 12px; }
  .pray .strip.on-mystery { display: none; }
  .pray .card { grid-area: card; margin: 0 0 12px; }
  .pray .gesture-hint { grid-area: hint; }
  .pray .controls { grid-area: controls; }
  .strip-int { -webkit-line-clamp: 3; }
  .card .text p { font-size: 1.18rem; }

  /* prayers hidden: the rosary takes the left, the decade panel sits beside it */
  .pray.hide-prayers {
    grid-template-areas: "top top" "where where" "prog prog" "ring strip" "ring hint";
    grid-template-rows: auto auto auto 1fr auto;
  }
  .pray.hide-prayers .strip, .pray.hide-prayers .strip.on-mystery { align-self: center; margin: 0; }
  .pray.hide-prayers .strip-myst { font-size: 1.6rem; }
  .pray.hide-prayers .strip-int { font-size: 1.1rem; -webkit-line-clamp: 4; }

  /* ---- Amen screen: thank-you messages in a grid ---- */
  .done .thanks { max-width: 980px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}

/* ---------- share your intention ---------- */
.test-banner {
  background: color-mix(in srgb, var(--glow) 25%, var(--surface)); color: var(--text);
  text-align: center; font-size: .85rem; padding: 8px 16px;
}
.share, .sent {
  max-width: 560px; margin: 0 auto; padding: 16px 16px calc(32px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 18px;
}
.share .back-home { align-self: flex-start; }
.share h2, .sent h2 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: 2.1rem; text-align: center; outline: none; }
.share .lead { text-align: center; color: var(--muted); margin-top: -10px; }
.share .opt { text-transform: none; letter-spacing: 0; }
.share textarea, .share input[type="text"] {
  width: 100%; font: inherit; font-size: 1.05rem; line-height: 1.5; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; resize: vertical;
}
.share textarea:focus, .share input[type="text"]:focus {
  outline: none; border-color: var(--glow);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--glow) 25%, transparent);
}
.share input[type="text"] { margin-top: 2px; }
.field-foot { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.count { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.count.near { color: var(--glow-text); font-weight: 600; }
.field-error { color: #c0392b; font-size: .92rem; }
@media (prefers-color-scheme: dark) { .field-error { color: #ff8a7a; } }
.name-modes, .labels { display: flex; flex-wrap: wrap; gap: 8px; }
.name-modes button, .labels button {
  appearance: none; font: inherit; font-size: .95rem; color: var(--text); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px;
}
.name-modes button[aria-pressed="true"], .labels button[aria-pressed="true"] {
  background: var(--glow); border-color: var(--glow); color: var(--on-glow);
}
.care {
  border: 1px solid color-mix(in srgb, var(--glow) 55%, var(--line)); border-radius: 16px; padding: 16px 18px;
  background: color-mix(in srgb, var(--glow) 8%, var(--surface)); display: grid; gap: 8px; line-height: 1.5;
}
.care h3 { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.4rem; }
.care ul { padding-left: 18px; display: grid; gap: 6px; }
.care a { color: var(--glow-text); font-weight: 600; }
.review-note { color: var(--muted); font-size: .88rem; text-align: center; line-height: 1.5; }
.share #send { width: 100%; }

.sent { text-align: center; padding-top: 40px; }
.sent > p { color: var(--muted); line-height: 1.6; }
.sent .beads-row { margin-bottom: 4px; }
.sent-intention {
  font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: 1.35rem; line-height: 1.4;
  padding: 16px 18px; border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--glow) 45%, var(--line));
  box-shadow: 0 0 18px color-mix(in srgb, var(--glow) 20%, transparent);
}
.invite { display: grid; gap: 10px; margin-top: 8px; }
.invite-q { font-weight: 500; }
.test-note { color: var(--muted); }
