/* The Daily Word: one quiet reading column. Colors follow the reader's light or dark setting. */
:root {
  --bg: #F3F5F2; --paper: #FFFFFF; --ink: #1C2A33; --muted: #5D6B70; --line: #D9DFDB;
  --accent: #2F6B5C; --accent-ink: #FFFFFF; --accent-soft: #E3EEEA;
  --gold: #9A6B1E; --gold-soft: #F5ECDA; --danger: #A3392F; --danger-soft: #F6E3E0;
  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-read: "Spectral", Georgia, "Times New Roman", serif;
  --font-ui: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12191D; --paper: #19232A; --ink: #E4EAE7; --muted: #94A3A6; --line: #2C3A40;
    --accent: #7CC1AE; --accent-ink: #0E1A17; --accent-soft: #1E3530;
    --gold: #D9AE62; --gold-soft: #2E2615; --danger: #E58A7F; --danger-soft: #3A1F1C;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-ui); font-size: 15px; line-height: 1.55; padding: 0 16px; }
a { color: var(--accent); }
img { max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 720px; margin: 0 auto; padding: 28px 0 48px; display: flex; flex-direction: column; gap: 26px; }
.muted { color: var(--muted); }

/* Header */
.mast { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.brand { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 30px; line-height: 1; }
.brand-tag { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-top: 6px; }
.nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 14px; }
.nav a:not(.btn) { color: var(--ink); text-decoration: none; }
.nav a:not(.btn):hover { color: var(--accent); }
.who { color: var(--muted); }
.who b { color: var(--ink); font-weight: 600; }
.inline { display: inline; margin: 0; }

/* Buttons and links */
.btn { display: inline-block; border: 1px solid var(--line); background: var(--paper); border-radius: 8px; padding: 7px 14px; cursor: pointer; font-weight: 500; font-size: 14px; color: var(--ink); text-decoration: none; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.small { padding: 5px 12px; }
.btn.danger { color: var(--danger); }
.link { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; font-size: 13px; text-decoration: underline; text-underline-offset: 2px; }
.link:hover { color: var(--ink); }
.danger-text { color: var(--danger); }

/* Messages */
.flash { border-radius: 10px; padding: 11px 14px; font-size: 14px; background: var(--accent-soft); }
.flash.error { background: var(--danger-soft); color: var(--danger); }
.flash.info { background: var(--gold-soft); }

/* Recent days strip */
.days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.day { flex: 0 0 auto; border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 6px 12px; text-align: center; min-width: 58px; color: var(--ink); text-decoration: none; }
.day small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.day strong { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.day[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.day[aria-current="page"] small { color: var(--accent-ink); }

/* Devotion */
.dev { display: flex; flex-direction: column; gap: 22px; }
.dateline { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--gold); font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dev h1, .page h1, .placeholder h1 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; margin: 6px 0 0; text-wrap: balance; }
.dev h1 { font-size: clamp(32px, 6vw, 44px); }
.page h1, .placeholder h1 { font-size: 34px; margin-bottom: 12px; }
.scripture { margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 24px clamp(18px, 4vw, 32px); }
.scripture blockquote { margin: 0; }
.scripture p { font-family: var(--font-display); font-style: italic; font-weight: 500; font-size: clamp(21px, 3.6vw, 25px); line-height: 1.45; margin: 0; }
.scripture sup { font-family: var(--font-ui); font-style: normal; font-size: 11px; font-weight: 600; color: var(--gold); margin-right: 3px; vertical-align: .55em; }
.ref { margin-top: 14px; font-size: 14px; font-weight: 600; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.tr { font-size: 11px; letter-spacing: .1em; border: 1px solid var(--line); padding: 1px 6px; border-radius: 4px; }
.section-label { font-family: var(--font-ui); font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 600; margin: 0 0 8px; display: block; }
.reading { font-family: var(--font-read); font-size: 17.5px; line-height: 1.75; max-width: 65ch; }
.reading p { margin: 0 0 1em; }
.prayer { border-left: 3px solid var(--gold); padding: 4px 0 4px 18px; font-family: var(--font-read); font-style: italic; font-size: 17px; line-height: 1.7; }
.prayer p { margin: 0 0 .6em; }
.pager { display: flex; justify-content: space-between; font-size: 14px; }
.owner-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.placeholder { background: var(--paper); border: 1px dashed var(--line); border-radius: 14px; padding: 32px 24px; text-align: center; color: var(--muted); }
.placeholder h1 { color: var(--ink); }

/* Inline confirmations built with <details> */
details.confirm, details.answer-box { display: inline-block; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details.confirm[open] form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; font-size: 13px; }

/* Discussion */
.talk { border-top: 1px solid var(--line); padding-top: 26px; display: flex; flex-direction: column; gap: 16px; }
.talk-title { font-family: var(--font-display); font-size: 28px; font-weight: 600; margin: 0; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; font-size: 14px; color: var(--ink); text-decoration: none; }
.tab span { color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 4px; }
.tab[aria-current="page"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tab[aria-current="page"] span { color: var(--bg); opacity: .75; }
.compose { display: flex; flex-direction: column; gap: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.compose textarea, .answer-form textarea { width: 100%; min-height: 84px; resize: vertical; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--bg); }
.compose-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.kind { display: flex; gap: 14px; font-size: 14px; border: 0; padding: 0; margin: 0; }
.kind label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.note { font-size: 14px; color: var(--muted); background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; }
.list { display: flex; flex-direction: column; gap: 16px; }
.item { display: grid; grid-template-columns: 34px 1fr; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 600; }
.item-body { min-width: 0; }
.item-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.item-head b { color: var(--ink); font-size: 14px; }
.item-text { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.item-actions { display: flex; gap: 14px; margin-top: 6px; flex-wrap: wrap; align-items: flex-start; }
.answer { margin-top: 10px; background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; }
.answer .item-head b { color: var(--accent); }
.answer-form { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; width: min(560px, 80vw); }
.pill { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 1px 8px; border-radius: 999px; }
.pill.q { background: var(--gold-soft); color: var(--gold); }
.pill.done { background: var(--accent-soft); color: var(--accent); }
.pill.plain { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.empty { color: var(--muted); font-size: 14px; font-style: italic; }

/* Forms */
.page { display: flex; flex-direction: column; gap: 14px; }
.page.narrow { max-width: 420px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.editor { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.field input, .field textarea { border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; background: var(--bg); width: 100%; }
.field textarea { resize: vertical; }
.hint { font-size: 12px; color: var(--muted); }

/* Archive */
.archive { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.archive a { display: grid; grid-template-columns: 110px 1fr; gap: 2px 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.archive a:hover { background: var(--paper); }
.a-date { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; grid-row: span 2; padding-top: 3px; }
.a-title { font-family: var(--font-display); font-size: 21px; font-weight: 600; line-height: 1.2; }
.a-ref { font-size: 13px; color: var(--muted); }
@media (max-width: 480px) { .archive a { grid-template-columns: 1fr; } .a-date { grid-row: auto; } }

/* People table */
.table-wrap { overflow-x: auto; }
.people { width: 100%; border-collapse: collapse; font-size: 14px; }
.people th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); }
.people td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.people .num { font-variant-numeric: tabular-nums; }
.people .actions { display: flex; gap: 12px; flex-wrap: wrap; }

.foot { border-top: 1px solid var(--line); padding-top: 18px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
