:root {
  --cream: #f5f0e8;
  --cream-2: #ece4d6;
  --paper: #fffdf9;
  --navy: #0a1f3f;
  --navy-2: #061830;
  --ink: #1b2536;
  --muted: #5d6677;
  --line: #e0d6c4;
  --gold: #fbc40b;
  --gold-2: #d3ae36;
  --gold-soft: #fdf3d2;
  --red: #d62828;
  --husband: #1d4f91;
  --husband-soft: #e6eef9;
  --wife: #a8435e;
  --wife-soft: #f8e8ed;
  --together: #8a6a12;
  --together-soft: #fbf1d4;
  --ok: #2f7d4f;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(10, 31, 63, .06), 0 8px 24px rgba(10, 31, 63, .07);
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Lora", Georgia, serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; outline: none; overflow-x: clip; }
a { color: var(--navy); }
button { font: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-left));
  background: var(--navy);
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.brand-logo { height: 44px; width: auto; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; padding-left: 12px; border-left: 1px solid rgba(255,255,255,.2); }
.brand-text strong { font-size: 15px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.brand-text small { font-size: 11px; color: var(--gold); letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
.topnav { display: flex; gap: 4px; }
.topnav a {
  color: rgba(255,255,255,.8); text-decoration: none; font-weight: 600; font-size: 14px;
  padding: 7px 12px; border-radius: 999px;
}
.topnav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.topnav a.active { background: var(--gold); color: var(--navy); }
@media (max-width: 560px) {
  .brand-text small { display: none; }
  .brand-text strong { font-size: 14px; }
  .topnav a { padding: 6px 9px; font-size: 13px; }
}
@media (max-width: 480px) { .brand-text { display: none; } .brand-logo { height: 38px; } }

/* ---------- Layout ---------- */
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }
.eyebrow { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: var(--gold-2); margin: 0 0 6px; }
h1, h2, h3 { color: var(--navy); line-height: 1.2; margin: 0; }
h1 { font-size: clamp(30px, 6vw, 46px); font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: clamp(22px, 4vw, 28px); font-weight: 800; }
h3 { font-size: 19px; font-weight: 700; }
.lead { font-family: var(--serif); font-size: 19px; color: var(--muted); margin: 10px 0 0; }
.serif { font-family: var(--serif); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.stack > * + * { margin-top: 14px; }

/* ---------- Hero ---------- */
.hero { padding: 44px 0 30px; }
.hero-home { padding: 52px 0 36px; text-align: center; }
.hero-home .lead { max-width: 620px; margin-left: auto; margin-right: auto; }
.hero-band { background: var(--navy); color: #fff; padding: 36px 0 34px; }
.hero-band h1 { color: #fff; }
.hero-band .lead { color: rgba(255,255,255,.78); }
.hero-band .eyebrow { color: var(--gold); }
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; text-decoration: none; color: inherit; opacity: .8; margin-bottom: 14px; }
.crumb:hover { opacity: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px; border: 2px solid transparent;
  font-weight: 700; font-size: 16px; text-decoration: none; line-height: 1.2;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
}
.btn:active { transform: scale(.98); }
.btn-gold { background: var(--gold); color: var(--navy); box-shadow: 0 4px 14px rgba(251,196,11,.35); }
.btn-gold:hover { background: #ffd23d; }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: #12305c; }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--navy); }
.btn-light { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- Path cards (home) ---------- */
.paths { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 8px 0 40px; }
@media (max-width: 760px) { .paths { grid-template-columns: 1fr; } }
.path {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  background: var(--paper); border-radius: var(--radius); padding: 24px 22px 22px;
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
  border-top: 5px solid var(--accent, var(--navy));
  transition: transform .15s ease, box-shadow .15s ease;
}
.path:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(10,31,63,.06), 0 16px 34px rgba(10,31,63,.12); }
.path .tag { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.path h3 { font-size: 21px; }
.path p { margin: 0; color: var(--muted); font-size: 15px; }
.path .go { margin-top: auto; padding-top: 8px; font-weight: 700; color: var(--navy); display: flex; justify-content: space-between; align-items: center; }
.path .meter { height: 6px; border-radius: 99px; background: var(--cream-2); overflow: hidden; }
.path .meter span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.path-husband { --accent: var(--husband); }
.path-wife { --accent: var(--wife); }
.path-couples { --accent: var(--gold-2); }

/* ---------- Rhythm timeline ---------- */
.rhythm { background: var(--paper); border-radius: var(--radius); padding: 26px 22px; box-shadow: var(--shadow); margin-bottom: 40px; }
.rhythm-track { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 18px; }
.rhythm-step { text-align: center; }
.rhythm-step .dot { width: 42px; height: 42px; border-radius: 50%; margin: 0 auto 8px; background: var(--navy); color: var(--gold); display: grid; place-items: center; font-weight: 800; }
.rhythm-step b { display: block; font-size: 14px; color: var(--navy); }
.rhythm-step span { font-size: 13px; color: var(--muted); line-height: 1.35; display: block; }
@media (max-width: 560px) {
  .rhythm-track { grid-template-columns: 1fr; gap: 10px; }
  .rhythm-step { display: flex; align-items: center; gap: 12px; text-align: left; }
  .rhythm-step .dot { margin: 0; flex: none; }
}

/* ---------- Letter (pastor) ---------- */
.letter { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 40px; display: grid; grid-template-columns: 240px 1fr; }
.letter img { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; }
.letter .body { padding: 26px 26px 24px; }
.letter .body p { font-family: var(--serif); margin: 0 0 12px; }
@media (max-width: 680px) { .letter { grid-template-columns: 1fr; } .letter img { height: 260px; } }
.sig { font-family: var(--serif); font-style: italic; color: var(--navy); }

/* ---------- Disclosure ---------- */
details.fold { background: var(--paper); border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 12px; }
details.fold > summary { list-style: none; cursor: pointer; padding: 16px 20px; font-weight: 700; color: var(--navy); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "+"; font-size: 22px; color: var(--gold-2); line-height: 1; }
details.fold[open] > summary::after { content: "−"; }
details.fold .fold-body { padding: 0 20px 18px; }
details.fold .fold-body p { font-family: var(--serif); margin: 0 0 12px; }
details.fold ul { margin: 0 0 12px; padding-left: 20px; }
details.fold li { margin-bottom: 6px; }

/* ---------- Guide overview ---------- */
.progress-card { display: flex; align-items: center; gap: 20px; margin-top: 22px; flex-wrap: wrap; }
.ring { --p: 0; width: 84px; height: 84px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), rgba(255,255,255,.15) 0); }
.ring > div { width: 66px; height: 66px; border-radius: 50%; background: var(--navy); display: grid; place-items: center; text-align: center; line-height: 1.05; }
.ring b { font-size: 22px; color: #fff; }
.ring small { display: block; font-size: 11px; color: rgba(255,255,255,.7); }
.week { margin: 34px 0; }
.week-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.week-head .eyebrow { margin: 0; }
.week-intro { font-family: var(--serif); color: var(--muted); margin: 6px 0 16px; }
.days { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.day-tile {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px;
  background: var(--paper); text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
  border: 2px solid transparent; transition: border-color .15s ease, transform .15s ease;
}
.day-tile:hover { border-color: var(--gold); transform: translateY(-1px); }
.day-tile .num { width: 38px; height: 38px; border-radius: 12px; background: var(--cream-2); color: var(--navy); font-weight: 800; display: grid; place-items: center; flex: none; font-size: 15px; }
.day-tile .t { font-weight: 600; font-size: 15px; line-height: 1.3; }
.day-tile.done .num { background: var(--ok); color: #fff; }
.day-tile.next { border-color: var(--gold); }
.day-tile.next .num { background: var(--gold); }
.session-tile {
  display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 14px 18px; border-radius: 14px;
  background: var(--navy); color: #fff; text-decoration: none;
}
.session-tile .ico { width: 40px; height: 40px; border-radius: 50%; background: var(--gold); color: var(--navy); display: grid; place-items: center; flex: none; font-weight: 800; }
.session-tile small { display: block; color: var(--gold); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: 11px; }
.session-tile b { font-size: 16px; }
.session-tile .arr { margin-left: auto; font-size: 20px; color: var(--gold); }
.session-tile.done .ico { background: var(--ok); color: #fff; }

/* ---------- Study (day / session) ---------- */
.study-top { background: var(--navy); color: #fff; padding: 18px 0 0; position: relative; }
.study-top .crumb { margin-bottom: 8px; }
.study-top h1 { color: #fff; font-size: clamp(24px, 5vw, 34px); }
.study-top .eyebrow { color: var(--gold); }
.steps { display: flex; gap: 6px; overflow-x: auto; padding: 16px 0 14px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.steps::-webkit-scrollbar { display: none; }
.steps button {
  flex: none; border: 0; border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 600;
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.72); white-space: nowrap; display: flex; align-items: center; gap: 6px;
}
.steps button .n { width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,.15); display: grid; place-items: center; font-size: 11px; }
.steps button.seen .n { background: var(--ok); color: #fff; }
.steps button.cur { background: var(--gold); color: var(--navy); }
.steps button.cur .n { background: var(--navy); color: var(--gold); }
.bar { height: 4px; background: rgba(255,255,255,.12); }
.bar span { display: block; height: 100%; background: var(--gold); transition: width .3s ease; }

.step { padding: 30px 0 120px; animation: rise .35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.step-ico { width: 44px; height: 44px; border-radius: 14px; background: var(--gold-soft); color: var(--navy); display: grid; place-items: center; font-size: 22px; flex: none; }
.step h2 { font-size: 26px; }
.hint { color: var(--muted); font-size: 15px; margin: 6px 0 20px; }
.card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card + .card { margin-top: 14px; }
.card p { margin: 0 0 12px; }
.card p:last-child { margin-bottom: 0; }
.prose p { font-family: var(--serif); font-size: 18px; line-height: 1.75; margin: 0 0 16px; }
.prose p:last-child { margin-bottom: 0; }

.verse { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 24px 22px; position: relative; overflow: hidden; }
.verse + .verse { margin-top: 14px; }
.verse::before { content: "\201C"; position: absolute; top: -18px; left: 12px; font-family: var(--serif); font-size: 120px; color: var(--gold); opacity: .28; line-height: 1; }
.verse p { position: relative; font-family: var(--serif); font-size: 21px; line-height: 1.6; color: var(--navy); margin: 0 0 12px; }
.verse cite { font-style: normal; font-weight: 700; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-2); }

.prayer { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 26px 24px; box-shadow: var(--shadow); }
.prayer p { font-family: var(--serif); font-size: 19px; line-height: 1.7; margin: 0 0 14px; font-style: italic; }
.prayer .lbl { font-family: var(--sans); font-style: normal; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: var(--gold); margin-bottom: 10px; display: block; }

.declare {
  background: linear-gradient(160deg, #0d2750, var(--navy-2)); color: #fff; border-radius: 20px;
  padding: 34px 26px; box-shadow: var(--shadow); text-align: center; position: relative; overflow: hidden;
}
.declare::after { content: ""; position: absolute; inset: 0; border: 2px solid rgba(251,196,11,.35); border-radius: 20px; margin: 8px; pointer-events: none; }
.declare .lbl { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; color: var(--gold); }
.declare p { font-family: var(--serif); font-size: clamp(20px, 4.4vw, 25px); line-height: 1.6; margin: 14px 0 0; }

.info { background: var(--gold-soft); border-left: 4px solid var(--gold-2); border-radius: 12px; padding: 18px 20px; }
.info p { margin: 0; font-family: var(--serif); font-size: 18px; }

.q { margin-bottom: 18px; }
.q label, .q .ql { display: block; font-weight: 700; color: var(--navy); margin-bottom: 8px; font-size: 17px; line-height: 1.4; }
textarea {
  width: 100%; min-height: 110px; resize: vertical; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font: 17px/1.55 var(--serif); color: var(--ink); background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea:focus { outline: none; border-color: var(--gold-2); box-shadow: 0 0 0 4px rgba(251,196,11,.2); }
textarea.tall { min-height: 280px; }
.saved { font-size: 12px; color: var(--ok); font-weight: 600; height: 16px; margin-top: 4px; opacity: 0; transition: opacity .2s; }
.saved.on { opacity: 1; }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .two { grid-template-columns: 1fr; } }
.who { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; display: inline-block; margin-bottom: 6px; }
.who-husband { background: var(--husband-soft); color: var(--husband); }
.who-wife { background: var(--wife-soft); color: var(--wife); }
.who-together { background: var(--together-soft); color: var(--together); }

.check {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--paper); border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; font-weight: 600; color: var(--navy);
  transition: border-color .15s ease, background .15s ease;
}
.check + .check { margin-top: 10px; }
.check .box { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; flex: none; background: #fff; color: #fff; font-size: 15px; }
.check.on { border-color: var(--ok); background: #eef7f1; }
.check.on .box { background: var(--ok); border-color: var(--ok); }
.amen { margin-top: 16px; }

.textcard { background: #fff; border: 1.5px dashed var(--gold-2); border-radius: 14px; padding: 18px; margin-top: 14px; }
.textcard .bubble { background: #e9f1ff; color: #10284d; border-radius: 18px 18px 18px 6px; padding: 12px 16px; font-size: 16px; line-height: 1.5; margin: 10px 0 14px; max-width: 520px; }
.textcard h4 { margin: 0; font-size: 15px; color: var(--navy); }

/* Call and response */
.cr { display: flex; flex-direction: column; gap: 10px; }
.cr-line { border-radius: 14px; padding: 14px 18px; background: var(--paper); box-shadow: var(--shadow); border-left: 5px solid var(--c); opacity: .45; transition: opacity .25s ease, transform .25s ease; cursor: pointer; }
.cr-line.past { opacity: .75; }
.cr-line.cur { opacity: 1; transform: scale(1.015); box-shadow: 0 2px 4px rgba(10,31,63,.08), 0 14px 32px rgba(10,31,63,.14); }
.cr-line .who { margin-bottom: 4px; }
.cr-line p { margin: 0; font-family: var(--serif); font-size: 19px; line-height: 1.55; color: var(--navy); }
.cr-line.cur p { font-size: 21px; }
.cr-husband { --c: var(--husband); }
.cr-wife { --c: var(--wife); }
.cr-together { --c: var(--gold-2); background: var(--together-soft); }
.cr-together p { font-weight: 600; }
.cr-ctrl { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }

.letterbox { background: #fff; border-radius: 14px; padding: 20px; border: 1.5px solid var(--line); font-family: var(--serif); white-space: pre-wrap; font-size: 18px; line-height: 1.7; }

/* Bottom nav */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: rgba(245,240,232,.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
.dock .wrap { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 0; }
.dock .pos { font-size: 13px; color: var(--muted); font-weight: 600; text-align: center; }

/* Completion */
.done-screen { text-align: center; padding: 50px 0 120px; animation: rise .4s ease; }
.seal { width: 96px; height: 96px; margin: 0 auto 18px; border-radius: 50%; background: var(--gold); color: var(--navy); display: grid; place-items: center; font-size: 44px; box-shadow: 0 0 0 10px rgba(251,196,11,.2); }
.done-screen .btn-row { justify-content: center; margin-top: 24px; }
.gate { margin: 28px auto 0; max-width: 560px; background: var(--navy); color: #fff; border-radius: var(--radius); padding: 24px; text-align: left; }
.gate h3 { color: #fff; }
.gate p { color: rgba(255,255,255,.8); margin: 8px 0 16px; }

.pill-toggle { display: inline-flex; background: var(--cream-2); border-radius: 999px; padding: 4px; gap: 4px; }
.pill-toggle button { border: 0; border-radius: 999px; padding: 8px 16px; background: transparent; font-weight: 700; color: var(--muted); font-size: 14px; }
.pill-toggle button.on { background: var(--navy); color: #fff; }
.banner { background: var(--gold-soft); border-radius: 12px; padding: 12px 16px; font-size: 15px; margin-bottom: 18px; color: var(--navy); }

/* Journal */
.jday { background: var(--paper); border-radius: 14px; box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 12px; }
.jday h3 { font-size: 17px; margin-bottom: 8px; }
.jq { font-weight: 700; color: var(--navy); font-size: 15px; margin: 10px 0 2px; }
.ja { font-family: var(--serif); white-space: pre-wrap; margin: 0; }
.empty { text-align: center; color: var(--muted); padding: 30px 0; }

/* Footer + toast */
.foot { text-align: center; padding: 26px 16px 34px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
.foot p { margin: 4px 0; }
.foot-small { font-size: 12px; }
body.studying .foot { padding-bottom: 110px; }
#toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px); background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 50; }
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

@media print {
  .topbar, .dock, .foot, .no-print, #toast { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .jday { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
