/* The Discipline of Fasting. System fonts only, no external resources. */
:root {
  --bg: #faf6ee; --surface: #fffdf8; --surface-2: #f2ebdc; --text: #2a2118; --muted: #5e5343;
  --line: #ddd2bd; --accent: #7a2e2a; --accent-text: #ffffff; --link: #1f4e79; --focus: #1f4e79;
  --danger: #a3261f; --ok: #2f6b3a; --shadow: 0 1px 2px rgba(60, 40, 10, .08);
  --serif: Charter, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15120e; --surface: #1e1a14; --surface-2: #28221a; --text: #efe7d6; --muted: #bdb29d;
    --line: #3b3327; --accent: #d9857d; --accent-text: #1a0f0d; --link: #8fbde8; --focus: #8fbde8;
    --danger: #ef8b84; --ok: #8fcf9b; --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }
@supports (font: -apple-system-body) { html { font: -apple-system-body; } body { font-size: 1.07rem; } }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); line-height: 1.55; min-height: 100vh; min-height: 100dvh; }
[hidden] { display: none !important; }
a { color: var(--link); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.25; margin: 0 0 .5rem; font-weight: 600; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.3rem; margin-top: 1.75rem; } h3 { font-size: 1.1rem; margin-top: 1.25rem; }
p { margin: 0 0 1rem; } ul, ol { padding-left: 1.4rem; margin: 0 0 1rem; } li { margin-bottom: .45rem; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: .5rem; top: -4rem; background: var(--surface); padding: .5rem 1rem; z-index: 100; }
.skip:focus { top: .5rem; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: calc(.6rem + env(safe-area-inset-top)) 1rem .6rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.topbar .brand { font-family: var(--serif); font-size: 1rem; font-weight: 600; color: var(--text); text-decoration: none; }
main { max-width: 42rem; margin: 0 auto; padding: 1.25rem 1.1rem calc(6.5rem + env(safe-area-inset-bottom)); }
main:focus { outline: none; }
main.centered { padding-bottom: 2rem; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 20; }
.tabbar a { flex: 1; text-align: center; padding: .65rem .25rem; text-decoration: none; color: var(--muted); font-size: .8rem; min-height: 3.2rem; }
.tabbar a[aria-current="page"] { color: var(--accent); font-weight: 700; box-shadow: inset 0 3px 0 var(--accent); }
.tabbar .ico { display: block; font-size: 1.15rem; line-height: 1.3; }

.eyebrow { color: var(--muted); font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; margin-bottom: .25rem; }
.focus { font-size: 1.05rem; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem; margin: 0 0 1rem; box-shadow: var(--shadow); }
.card > :last-child { margin-bottom: 0; }
.card.quiet { background: var(--surface-2); box-shadow: none; }
.psalm { font-family: var(--serif); font-size: 1.15rem; line-height: 1.75; }
.psalm .verse { white-space: pre-line; margin: 0 0 .9rem; }
.psalm .gap { color: var(--muted); text-align: center; margin: 0 0 .9rem; letter-spacing: .3em; }
.prayer { font-family: var(--serif); font-style: italic; font-size: 1.12rem; border-left: 4px solid var(--accent); padding: .2rem 0 .2rem 1rem; margin: 0 0 1rem; }
.meta { color: var(--muted); font-size: .9rem; }
.badge { display: inline-block; font-size: .75rem; padding: .1rem .55rem; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 3rem; padding: .6rem 1.2rem; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { background: transparent; }
.btn.big { width: 100%; min-height: 3.6rem; font-size: 1.1rem; }
.btn[disabled] { opacity: .55; cursor: default; }
.link-btn { background: none; border: 0; padding: .25rem 0; color: var(--link); font: inherit; text-decoration: underline; cursor: pointer; min-height: 2.75rem; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0 0; }
.actions .btn { flex: 1 1 9rem; }

label, .label { display: block; font-weight: 600; margin: 1rem 0 .3rem; }
.hint { color: var(--muted); font-size: .9rem; margin: .2rem 0 .6rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="time"], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--muted); border-radius: 10px; padding: .65rem .8rem; min-height: 3rem; }
textarea { min-height: 7rem; resize: vertical; line-height: 1.5; }
.check { display: flex; gap: .7rem; align-items: flex-start; font-weight: 400; margin: .5rem 0; }
.check input { width: 1.4rem; height: 1.4rem; margin-top: .2rem; flex: none; }
.error { color: var(--danger); font-weight: 600; }
.ok { color: var(--ok); font-weight: 600; }
.warn { border-left: 4px solid var(--danger); padding-left: .9rem; }
.notice { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; margin: 0 0 1rem; }

.list { list-style: none; padding: 0; margin: 0 0 1rem; }
.list > li { margin: 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list a.row, .list .row { display: block; padding: .8rem .2rem; text-decoration: none; color: var(--text); }
.list a.row:hover { background: var(--surface-2); }
.row .title { font-weight: 600; display: block; }
.row .sub { color: var(--muted); font-size: .9rem; display: block; }
.chips { display: flex; gap: .5rem; margin: 0 0 1rem; flex-wrap: wrap; }
.chips button { min-height: 2.75rem; padding: .4rem 1rem; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.stepper { display: flex; gap: .5rem; }
.stepper button { flex: 1; min-height: 3rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 1.1rem; cursor: pointer; }
.stepper button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 700; }
.cols { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 40rem) { .cols { grid-template-columns: 1fr 1fr; } }
.reply { white-space: pre-wrap; font-family: var(--serif); font-size: 1.08rem; }
.daynav { display: flex; justify-content: space-between; gap: 1rem; margin: 1.5rem 0 0; }

.hungry { text-align: center; padding-top: 2rem; }
.hungry .breath { font-family: var(--serif); font-size: 2rem; line-height: 1.3; margin: 1.5rem 0 2rem; }
.hungry .verse-box { font-family: var(--serif); font-size: 1.2rem; font-style: italic; margin: 0 auto 2rem; max-width: 30rem; white-space: pre-line; }
.hungry form { text-align: left; }

.banner { display: flex; gap: .75rem; align-items: center; justify-content: space-between; padding: .6rem 1rem; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: .95rem; }
.banner .link-btn { flex: none; font-weight: 700; }
dialog.modal { max-width: min(34rem, calc(100vw - 2rem)); width: 100%; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); padding: 1.25rem; max-height: 90dvh; overflow-y: auto; }
dialog.modal::backdrop { background: rgba(20, 12, 4, .55); }
dialog.modal h2 { margin-top: 0; }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(5.2rem + env(safe-area-inset-bottom)); background: var(--text); color: var(--bg); padding: .65rem 1.1rem; border-radius: 99px; z-index: 60; max-width: 90vw; text-align: center; }
#lock { position: fixed; inset: 0; z-index: 50; background: var(--bg); overflow-y: auto; padding: calc(2rem + env(safe-area-inset-top)) 1.25rem 2rem; }
#lock .inner { max-width: 26rem; margin: 0 auto; text-align: center; }
#lock form { text-align: left; }
.cross { font-size: 2.2rem; color: var(--accent); }
.progress-dots { display: flex; justify-content: center; gap: .4rem; margin-bottom: 1rem; }
.progress-dots span { width: .6rem; height: .6rem; border-radius: 50%; background: var(--line); }
.progress-dots span.on { background: var(--accent); }
.steps li { margin-bottom: .8rem; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
[tabindex="-1"]:focus { outline: none; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
