:root {
  --bg: #FBF6EE;
  --surface: #FFFFFF;
  --surface-muted: #F3EADD;
  --text: #2E2620;
  --text-secondary: #6F6155;
  --accent: #C7852E;
  --accent-dark: #A96E24;
  --calm: #5E8B7E;
  --divider: #E7DBC9;
  --support: #B5603F;
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 720px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}
.serif { font-family: Georgia, "Times New Roman", serif; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 600; line-height: 1.25; }
a { color: var(--accent-dark); text-decoration: none; }
.hidden { display: none !important; }

/* ---- Header / nav ---- */
header.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(251,246,238,0.9); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--divider);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.brand img { width: 34px; height: 34px; }
.brand span { font-family: Georgia, serif; font-weight: 600; font-size: 19px; }
nav.tabs { display: flex; gap: 4px; }
nav.tabs button {
  border: none; background: transparent; font: inherit; cursor: pointer;
  color: var(--text-secondary); padding: 8px 12px; border-radius: 999px; font-weight: 600; font-size: 15px;
}
nav.tabs button.active { background: var(--surface-muted); color: var(--accent-dark); }
.topbar .account { display: flex; align-items: center; gap: 8px; }

main { max-width: var(--maxw); margin: 0 auto; padding: 24px 20px 80px; }

/* ---- Buttons ---- */
button.btn {
  font: inherit; cursor: pointer; border: none; border-radius: var(--radius-sm);
  padding: 13px 18px; background: var(--accent); color: #fff; font-weight: 700; font-size: 16px;
}
button.btn:hover { background: var(--accent-dark); }
button.btn.secondary { background: var(--surface-muted); color: var(--accent-dark); }
button.btn.full { width: 100%; }
button.link { border: none; background: none; color: var(--accent-dark); font: inherit; font-weight: 600; cursor: pointer; }
button.ghost { border: none; background: none; color: var(--text-secondary); font: inherit; cursor: pointer; padding: 6px; }

/* ---- Cards ---- */
.card {
  background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px;
}
.row { display: flex; align-items: center; gap: 14px; }
.row .grow { flex: 1; min-width: 0; }
.chev::after { content: "›"; color: var(--text-secondary); font-size: 22px; margin-left: auto; }
.muted { color: var(--text-secondary); }
.small { font-size: 14px; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: rgba(94,139,126,0.15); color: var(--calm); }
.icon-badge { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(199,133,46,0.12); color: var(--accent); font-size: 20px; flex: none; }

.section-title { font-size: 15px; font-weight: 700; color: var(--text); margin: 22px 0 10px; }
.eyebrow { font-size: 14px; font-weight: 700; color: var(--calm); }

/* ---- Scripture ---- */
.scripture { border-left: 3px solid rgba(94,139,126,0.5); padding-left: 14px; margin-top: 10px; }
.scripture .q { font-family: Georgia, serif; font-style: italic; color: var(--text); }
.scripture .ref { color: var(--calm); font-weight: 700; font-size: 15px; margin-top: 4px; }
.scripture .reflink { display: inline-block; background: none; border: none; cursor: pointer; padding: 0; font: inherit; }
.scripture .reflink:hover { text-decoration: underline; }

/* ---- Grid (topics) ---- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius);
  padding: 18px; cursor: pointer; min-height: 140px; display: flex; flex-direction: column; gap: 8px; }
.tile:hover { border-color: var(--accent); }
.tile .t-icon { font-size: 26px; }
.tile h3 { font-size: 18px; }

/* ---- Hero / daily word ---- */
.today .eyebrow { display:flex; align-items:center; justify-content: space-between; }
.today .word { font-family: Georgia, serif; font-size: 21px; color: var(--text); margin: 8px 0; }

/* ---- Video ---- */
.video-wrap { position: relative; padding-top: 56.25%; border-radius: var(--radius); overflow: hidden;
  background: #000; margin-bottom: 16px; }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---- Crisis ---- */
.crisis { background: rgba(181,96,63,0.10); border: 1px solid rgba(181,96,63,0.4); border-radius: var(--radius); padding: 20px; }
.crisis h2 { color: var(--support); font-size: 20px; }
.crisis .line { background: var(--surface); border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 10px; display: flex; gap: 12px; align-items: center; }

/* ---- Segmented ---- */
.segmented { display: flex; background: var(--surface-muted); border-radius: 999px; padding: 4px; gap: 4px; margin-bottom: 16px; }
.segmented button { flex: 1; border: none; background: transparent; font: inherit; font-weight: 600; cursor: pointer;
  padding: 8px; border-radius: 999px; color: var(--text-secondary); }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

/* ---- Back link ---- */
.back { background: none; border: none; color: var(--accent-dark); font: inherit; font-weight: 600; cursor: pointer;
  margin-bottom: 12px; padding: 0; }

/* ---- Empty state ---- */
.empty { text-align: center; padding: 48px 20px; }
.empty .e-icon { font-size: 40px; }
.empty h3 { font-family: Georgia, serif; font-size: 20px; margin: 12px 0 6px; }

/* ---- Modal (auth) ---- */
.modal-overlay { position: fixed; inset: 0; background: rgba(46,38,32,0.45); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: var(--bg); border-radius: 22px; max-width: 420px; width: 100%; padding: 28px; text-align: center; }
.modal h2 { font-size: 24px; }
.modal .providers { display: flex; flex-direction: column; gap: 10px; margin: 20px 0 10px; }
.prov-btn { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 13px; border-radius: var(--radius-sm);
  font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; border: 1px solid var(--divider); }
.prov-btn.apple { background: #000; color: #fff; border-color: #000; }
.prov-btn.google { background: #fff; color: #3c4043; }
.prov-btn.email { background: var(--surface-muted); color: var(--accent-dark); border: none; }
.modal input { width: 100%; padding: 12px 14px; border: 1px solid var(--divider); border-radius: var(--radius-sm);
  font: inherit; margin-top: 8px; background: var(--surface); }
.modal .err { color: var(--support); font-size: 14px; margin-top: 10px; }

/* ---- Toast ---- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff;
  padding: 12px 20px; border-radius: 999px; opacity: 0; transition: opacity .2s; z-index: 60; pointer-events: none; }
.toast.show { opacity: 1; }

/* ---- List item clickable ---- */
.click { cursor: pointer; }
.click:hover { border-color: var(--accent); }

textarea { font: inherit; width: 100%; padding: 12px 14px; border: 1px solid var(--divider); border-radius: var(--radius-sm);
  background: var(--surface); resize: vertical; min-height: 110px; }

@media (max-width: 480px) {
  nav.tabs button { padding: 8px 9px; font-size: 14px; }
  .brand span { display: none; }
}

/* Bible reader */
.book-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.book-row { text-align: left; background: var(--surface); border: 1px solid var(--divider);
  border-radius: var(--radius-sm); padding: 13px 16px; font: inherit; font-weight: 600;
  color: var(--text); cursor: pointer; }
.book-row:hover { background: var(--surface-muted); }
.chapter-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.chapter-cell { aspect-ratio: 1 / 1; background: var(--surface); border: 1px solid var(--divider);
  border-radius: var(--radius-sm); font: inherit; font-weight: 700; color: var(--text); cursor: pointer; }
.chapter-cell:hover { background: var(--surface-muted); color: var(--accent-dark); }
#rbody .serif { line-height: 1.75; }
.translation-pick { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.translation-pick label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.translation-pick select { font: inherit; padding: 6px 10px; border: 1px solid var(--divider);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text); cursor: pointer; }
