/* Faith Over Fortune web app. Brand: ink / bone / amber. Warm, calm, readable. */
:root {
  --ink: #1F1B16; --bone: #F5EFE3; --paper: #FFFDF8; --amber: #B8701F; --link: #8A4F0F;
  --muted: #5A5246; --line: #E2D8C6; --soft: #EFE6D6; --ok: #2F6B3A;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --size: 19px;
}
html[data-size="s"] { --size: 17px; } html[data-size="l"] { --size: 22px; } html[data-size="xl"] { --size: 26px; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bone); color: var(--ink); font: 17px/1.55 var(--sans); padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
a { color: var(--link); text-underline-offset: 2px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; z-index: 9; background: var(--paper); padding: 8px 12px; }

.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: calc(8px + env(safe-area-inset-top)) 16px 8px; background: var(--ink); color: var(--bone); }
.brand { color: var(--bone); text-decoration: none; font: 700 18px/1 var(--serif); letter-spacing: .01em; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; color: var(--bone); border-radius: 8px; }

.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--paper); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 60px; font: 600 12px/1 var(--sans); color: var(--muted); text-decoration: none; }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current="page"] { color: var(--ink); }
.tabs a[aria-current="page"] svg { stroke: var(--amber); }

main, main:focus, main:focus-visible { outline: none; }
.page { max-width: 640px; margin: 0 auto; padding: 20px 18px 32px; }
.loading { color: var(--muted); padding-top: 40px; }
h1 { font: 700 30px/1.15 var(--serif); margin: 6px 0 10px; letter-spacing: -.01em; }
h2 { font: 700 21px/1.25 var(--serif); margin: 28px 0 10px; }
.eyebrow { font: 700 12px/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0; }
.lede { font: var(--size)/1.6 var(--serif); color: var(--ink); margin: 0 0 18px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 10px; border: 1px solid var(--ink); background: transparent; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink); transition: background .15s, transform .1s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--ink); color: var(--bone); }
.btn.quiet { border-color: var(--line); background: var(--paper); }
.btn.block { width: 100%; }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.link-btn { background: none; border: 0; padding: 10px 0; min-height: 44px; color: var(--link); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font-weight: 600; }

/* Today's progress: seven dots, never a score. */
.dots { display: flex; gap: 8px; margin: 6px 0 18px; } .dots i { width: 10px; height: 10px; border-radius: 50%; background: #9C8F7B; opacity: .45; }
.dots i.on { opacity: 1; }
.dots i.on { background: var(--amber); }

.reading { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 22px 20px 16px; }
.ref { font: 700 14px/1.2 var(--sans); letter-spacing: .04em; color: var(--muted); margin: 0 0 10px; }
.scripture { font: var(--size)/1.65 var(--serif); margin: 0; }
.scripture p { margin: 0 0 8px; }
.scripture .vn { font: 700 .6em var(--sans); color: var(--muted); vertical-align: super; margin-right: 3px; }
.scripture .ctx { color: var(--muted); }
.ctx-hint { font: 600 13px var(--sans); color: var(--muted); margin: 0 0 8px; }
.scripture i { font-style: italic; }
.label { display: inline-block; font: 700 11px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; padding: 4px 6px; border-radius: 4px; background: var(--soft); color: var(--muted); }
.note { border-left: 3px solid var(--amber); padding: 4px 0 4px 14px; margin: 18px 0; font: var(--size)/1.55 var(--serif); }
.tools { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; }
.tools button, .tools a { font: 600 14px var(--sans); }

.choices { display: grid; gap: 10px; margin: 16px 0; }
.choice { text-align: left; padding: 14px 16px; min-height: 56px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; font: var(--size)/1.45 var(--serif); }
.choice[aria-pressed="true"] { border-color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber); }
.done-card { text-align: center; padding: 34px 20px; }
.done-card .big { font: 700 34px/1.15 var(--serif); margin: 0 0 12px; }

.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.card a.stretch { text-decoration: none; color: inherit; display: block; }
.moments { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.moments a { display: flex; align-items: center; min-height: 56px; padding: 10px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 600; }
.crisis { background: #FBEFE6; border: 1px solid #E8C9B0; border-radius: 12px; padding: 14px 16px; margin: 22px 0; }
.crisis a { font-weight: 700; }

.seg { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 16px; }
.seg button, .seg a { min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; font: 600 14px var(--sans); text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; }
.seg [aria-pressed="true"], .seg [aria-current="page"] { background: var(--ink); color: var(--bone); border-color: var(--ink); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; list-style: none; padding: 0; }
.grid a { display: flex; align-items: center; justify-content: center; min-height: 48px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink); }
.books { columns: 2; column-gap: 10px; list-style: none; padding: 0; margin: 0; }
.books a { display: block; padding: 10px 12px; min-height: 44px; break-inside: avoid; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); }
.chapter p { font: var(--size)/1.7 var(--serif); margin: 0 0 6px; padding: 2px 6px; border-radius: 6px; }
.chapter p.hl { background: #F6E3C2; }
.chapter p.focus { outline: 2px solid var(--amber); }
.chapter p button.vn { background: none; border: 0; padding: 0 2px; min-width: 28px; min-height: 28px; font: 700 .62em var(--sans); color: var(--link); vertical-align: super; cursor: pointer; }
.pager { display: flex; justify-content: space-between; gap: 10px; margin: 24px 0 0; }

.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; background: var(--paper); border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.12); padding: 16px 18px calc(16px + env(safe-area-inset-bottom)); max-height: 80vh; overflow: auto; }
.sheet h3 { margin: 0 0 6px; font: 700 18px var(--serif); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sheet-x { width: 44px; height: 44px; border: 0; background: var(--soft); border-radius: 22px; font-size: 22px; line-height: 1; cursor: pointer; flex: none; }
.scrim { position: fixed; inset: 0; z-index: 7; background: rgba(31,27,22,.35); }

.feed { height: calc(100vh - 160px); height: calc(100dvh - 160px); overflow-y: auto; scroll-snap-type: y mandatory; margin: 0 -18px; }
.feed section { min-height: 100%; scroll-snap-align: start; display: flex; flex-direction: column; justify-content: center; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.feed .pause { background: var(--ink); color: var(--bone); text-align: center; }
.feed .pause .big { font: 700 30px/1.2 var(--serif); }

input[type="search"], input[type="text"], textarea, select { width: 100%; font: 17px/1.4 var(--sans); padding: 12px 14px; min-height: 48px; border: 1px solid #BFB29C; border-radius: 10px; background: var(--paper); color: var(--ink); }
textarea { min-height: 110px; font-family: var(--serif); font-size: var(--size); }
label { display: block; font-weight: 600; margin: 14px 0 6px; }
mark { background: #F6E3C2; color: inherit; padding: 0 2px; border-radius: 2px; }
.pill { display: inline-block; font: 700 12px var(--sans); padding: 3px 8px; border-radius: 10px; background: var(--soft); color: var(--muted); }
.pill.ok { background: #E3F0E4; color: var(--ok); }

#toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 9; background: var(--ink); color: var(--bone); padding: 10px 16px; border-radius: 20px; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s; }
#toast.show { opacity: 1; }

.freely blockquote { margin: 0 0 22px; padding: 22px 20px; background: var(--ink); color: var(--bone); border-radius: 14px; font: 24px/1.45 var(--serif); }
.freely blockquote cite { display: block; margin-top: 10px; font: 600 14px var(--sans); font-style: normal; color: #E3C9A2; }
.freely ul { padding-left: 20px; } .freely li { margin: 6px 0; }
footer.credits { margin-top: 30px; font-size: 13px; color: var(--muted); }

@media (min-width: 720px) { h1 { font-size: 36px; } .feed { margin: 0; border-radius: 14px; border: 1px solid var(--line); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

.card-sheet .seg { display: flex; gap: 6px; margin: 0 0 10px; flex-wrap: wrap; }
.seg button { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid #BFB29C; background: #fff; color: var(--ink); font: 600 14px/1 var(--sans); cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--bone); border-color: var(--ink); }
.card-frame { display: flex; justify-content: center; margin: 4px 0 12px; }
.card-frame canvas { width: auto; max-width: 100%; max-height: 44vh; border-radius: 8px; box-shadow: 0 2px 14px rgba(31,27,22,.18); }
.seg-label { margin: 4px 0 6px; font: 700 12px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card-sheet { padding-bottom: calc(18px + env(safe-area-inset-bottom)); max-height: 92vh; overflow-y: auto; }
