:root {
  color-scheme: dark;
  --ink: #eef3fb;
  --ink-soft: #a9b8cc;
  --ink-faint: #75879e;
  --bg: #061426;
  --bg-deep: #030d19;
  --surface: rgba(13, 35, 64, 0.84);
  --surface-solid: #0d2340;
  --surface-raised: #102b4e;
  --line: rgba(229, 197, 126, 0.17);
  --line-strong: rgba(229, 197, 126, 0.42);
  --gold: #e5c57e;
  --gold-bright: #f5dda7;
  --gold-deep: #af7e2d;
  --green: #71c6a2;
  --red: #eb958d;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --reader-size: 18px;
}

html[data-theme="light"] {
  color-scheme: light;
  --ink: #10243e;
  --ink-soft: #53637a;
  --ink-faint: #7d8794;
  --bg: #f6f2e9;
  --bg-deep: #eee7d9;
  --surface: rgba(255, 252, 246, 0.9);
  --surface-solid: #fffdf8;
  --surface-raised: #f7f0e3;
  --line: rgba(123, 83, 24, 0.14);
  --line-strong: rgba(143, 98, 28, 0.32);
  --gold: #9e6f21;
  --gold-bright: #744b0d;
  --gold-deep: #bf8e39;
  --green: #267957;
  --red: #b54840;
  --shadow: 0 20px 55px rgba(56, 38, 14, 0.12);
}

@media (prefers-color-scheme: light) {
  html[data-theme="system"] {
    color-scheme: light;
    --ink: #10243e;
    --ink-soft: #53637a;
    --ink-faint: #7d8794;
    --bg: #f6f2e9;
    --bg-deep: #eee7d9;
    --surface: rgba(255, 252, 246, 0.9);
    --surface-solid: #fffdf8;
    --surface-raised: #f7f0e3;
    --line: rgba(123, 83, 24, 0.14);
    --line-strong: rgba(143, 98, 28, 0.32);
    --gold: #9e6f21;
    --gold-bright: #744b0d;
    --gold-deep: #bf8e39;
    --green: #267957;
    --red: #b54840;
    --shadow: 0 20px 55px rgba(56, 38, 14, 0.12);
  }
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg-deep); }

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 10% 6%, color-mix(in srgb, var(--gold) 12%, transparent), transparent 27rem),
    linear-gradient(155deg, var(--bg), var(--bg-deep));
  color: var(--ink);
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell { min-height: 100vh; position: relative; overflow-x: clip; }
.ambient { position: fixed; border-radius: 50%; filter: blur(80px); opacity: .17; pointer-events: none; }
.ambient-one { width: 20rem; height: 20rem; background: var(--gold); top: -12rem; right: -7rem; }
.ambient-two { width: 16rem; height: 16rem; background: #246aa0; bottom: 10rem; left: -12rem; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: calc(68px + env(safe-area-inset-top, 0px));
  padding: calc(12px + env(safe-area-inset-top, 0px)) clamp(16px, 4vw, 32px) 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px);
}

.brand { display: flex; align-items: center; gap: 11px; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 13px; background: linear-gradient(145deg, var(--surface-raised), var(--surface)); color: var(--gold-bright); font: 700 22px/1 "Libre Baskerville", serif; box-shadow: inset 0 0 18px color-mix(in srgb, var(--gold) 8%, transparent); }
.brand b { display: block; font: 700 18px/1.05 "Libre Baskerville", serif; letter-spacing: -.02em; }
.brand small { display: block; margin-top: 4px; color: var(--ink-faint); font-size: 10px; letter-spacing: .045em; text-transform: uppercase; }
.top-actions { display: flex; gap: 8px; }
.icon-button { width: 41px; height: 41px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); cursor: pointer; }
.icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.main { position: relative; width: min(100%, 1080px); min-height: calc(100vh - 142px); margin: 0 auto; padding: 24px clamp(16px, 4vw, 32px) calc(102px + var(--safe-bottom)); outline: none; }
.main.reader-main { width: min(100%, 840px); }
.page { animation: arrive .3s ease both; }
@keyframes arrive { from { opacity: 0; transform: translateY(7px); } }

.center-view { min-height: 65vh; display: grid; place-content: center; justify-items: center; color: var(--ink-soft); }
.halo-loader { width: 42px; height: 42px; border: 2px solid var(--line-strong); border-top-color: var(--gold); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

.bottom-nav {
  position: fixed;
  z-index: 30;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 760px);
  min-height: calc(70px + var(--safe-bottom));
  padding: 8px 12px calc(8px + var(--safe-bottom));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: color-mix(in srgb, var(--bg-deep) 88%, transparent);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  backdrop-filter: blur(24px);
  box-shadow: 0 -15px 45px rgba(0, 0, 0, .16);
}
.nav-item { display: grid; place-items: center; gap: 3px; padding: 5px; border: 0; border-radius: 14px; background: none; color: var(--ink-faint); font-size: 11px; cursor: pointer; }
.nav-item svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.is-active { color: var(--gold-bright); background: color-mix(in srgb, var(--gold) 8%, transparent); }

.is-hidden { display: none !important; }
.eyebrow { margin: 0 0 9px; color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--ink); }
h1 { margin-bottom: 9px; font: 700 clamp(29px, 6vw, 42px)/1.13 "Libre Baskerville", serif; letter-spacing: -.035em; }
h2 { margin-bottom: 9px; font: 700 clamp(22px, 4vw, 28px)/1.25 "Libre Baskerville", serif; letter-spacing: -.025em; }
h3 { margin-bottom: 6px; font-size: 16px; }
.subtitle { max-width: 640px; color: var(--ink-soft); line-height: 1.6; }
.page-heading { margin-bottom: 22px; display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.page-heading p { margin-bottom: 0; }
.section-heading { margin: 32px 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-heading h2 { margin: 0; font-size: 20px; }
.section-heading button { flex: none; }

.card { padding: clamp(18px, 4vw, 25px); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.card + .card { margin-top: 14px; }
.gold-card { border-color: var(--line-strong); background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 10%, var(--surface-solid)), var(--surface)); }
.quiet-card { box-shadow: none; }
.card-label { color: var(--ink-faint); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; border: 1px solid transparent; border-radius: 14px; background: linear-gradient(135deg, var(--gold-bright), var(--gold)); color: #182337; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform .15s ease, filter .15s ease; }
.button:active { transform: scale(.985); }
.button:hover { filter: brightness(1.04); }
.button.secondary { border-color: var(--line-strong); background: color-mix(in srgb, var(--gold) 7%, var(--surface-solid)); color: var(--gold-bright); }
.button.ghost { border-color: var(--line); background: transparent; color: var(--ink-soft); }
.button.small { min-height: 37px; padding: 0 12px; border-radius: 11px; font-size: 13px; }
.button.block { width: 100%; }
.button[disabled] { opacity: .55; cursor: wait; }
.text-button { padding: 4px; border: 0; background: none; color: var(--gold); font-weight: 700; cursor: pointer; }

.onboarding { min-height: calc(100vh - 140px); display: grid; place-items: center; }
.onboarding-card { width: min(100%, 560px); padding: clamp(26px, 7vw, 44px); text-align: center; }
.onboarding-symbol { width: 82px; height: 82px; margin: 0 auto 24px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 27px; background: radial-gradient(circle, color-mix(in srgb, var(--gold) 20%, transparent), transparent 70%); color: var(--gold-bright); font: 700 42px/1 "Libre Baskerville", serif; }
.onboarding-copy { max-width: 420px; margin: 0 auto 26px; color: var(--ink-soft); line-height: 1.65; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.choice-card { padding: 17px 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-raised); text-align: left; cursor: pointer; }
.choice-card.is-active { border-color: var(--line-strong); box-shadow: inset 0 0 0 1px var(--line-strong); }
.choice-card b { display: block; margin-bottom: 4px; }
.choice-card small { color: var(--ink-soft); line-height: 1.4; }
.form-stack { display: grid; gap: 14px; margin-top: 22px; text-align: left; }
.field { display: grid; gap: 7px; }
.field label { color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; outline: none; background: var(--bg-deep); color: var(--ink); }
.field textarea { min-height: 92px; resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 13%, transparent); }
.field-hint { color: var(--ink-faint); font-size: 11px; }

.today-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(270px, .7fr); gap: 16px; }
.progress-hero { min-height: 270px; display: grid; grid-template-columns: minmax(160px, .72fr) 1fr; align-items: center; gap: clamp(20px, 5vw, 44px); overflow: hidden; }
.time-ring { --progress: 0deg; position: relative; width: min(46vw, 190px); aspect-ratio: 1; margin: auto; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--gold) var(--progress), color-mix(in srgb, var(--gold) 10%, transparent) 0); box-shadow: 0 0 60px color-mix(in srgb, var(--gold) 12%, transparent); }
.time-ring::before { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: var(--surface-solid); border: 1px solid var(--line); }
.time-ring-content { position: relative; text-align: center; }
.time-ring strong { display: block; font: 700 clamp(28px, 7vw, 42px)/1 "Libre Baskerville", serif; }
.time-ring span { display: block; margin-top: 7px; color: var(--ink-faint); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.hero-copy h2 { font-size: clamp(24px, 5vw, 34px); }
.hero-copy p { color: var(--ink-soft); line-height: 1.55; }
.progress-track { height: 8px; margin: 17px 0 9px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb, var(--gold) 10%, transparent); }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright)); }
.progress-caption { display: flex; justify-content: space-between; color: var(--ink-faint); font-size: 11px; }

.streak-card { min-height: 128px; display: flex; align-items: center; gap: 18px; }
.streak-flame { width: 58px; height: 58px; flex: none; display: grid; place-items: center; border-radius: 18px; background: color-mix(in srgb, var(--gold) 13%, transparent); color: var(--gold-bright); font-size: 29px; }
.streak-card strong { display: block; font: 700 27px/1.1 "Libre Baskerville", serif; }
.streak-card p { margin: 6px 0 0; color: var(--ink-soft); font-size: 13px; }
.forecast-card { min-height: 128px; }
.forecast-card strong { display: block; margin: 10px 0 6px; font: 700 19px/1.3 "Libre Baskerville", serif; }
.forecast-card p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.5; }

.badge-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; }
.badge-mini { min-width: 0; padding: 14px 8px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); text-align: center; opacity: .55; }
.badge-mini.is-earned { opacity: 1; border-color: var(--line-strong); background: color-mix(in srgb, var(--gold) 8%, var(--surface)); }
.badge-icon { width: 42px; height: 42px; margin: 0 auto 9px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--gold-bright); background: var(--surface-raised); font-size: 20px; }
.badge-mini b { display: block; overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.badge-mini small { color: var(--ink-faint); font-size: 10px; }

.continue-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.continue-card h3 { margin: 5px 0; font: 700 20px/1.3 "Libre Baskerville", serif; }
.continue-card p { margin: 0; color: var(--ink-soft); font-size: 13px; }
.continue-mark { width: 58px; height: 58px; flex: none; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 18px; color: var(--gold-bright); font: italic 700 24px/1 "Libre Baskerville", serif; }

.testament-switch { display: inline-flex; margin-bottom: 17px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.testament-switch button { min-height: 36px; padding: 0 13px; border: 0; border-radius: 9px; background: none; color: var(--ink-soft); cursor: pointer; }
.testament-switch button.is-active { background: var(--surface-raised); color: var(--gold-bright); }
.book-search { position: relative; margin-bottom: 18px; }
.book-search input { width: 100%; min-height: 50px; padding: 0 16px 0 45px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); color: var(--ink); outline: none; }
.book-search svg { position: absolute; top: 15px; left: 16px; width: 20px; height: 20px; fill: none; stroke: var(--ink-faint); stroke-width: 1.8; }
.books-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.book-card { min-height: 110px; padding: 17px; display: flex; flex-direction: column; align-items: start; justify-content: space-between; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); cursor: pointer; text-align: left; }
.book-card:hover { border-color: var(--line-strong); }
.book-card b { font: 700 16px/1.25 "Libre Baskerville", serif; }
.book-card small { color: var(--ink-faint); }

.chapter-picker { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.chapter-button { aspect-ratio: 1; min-width: 0; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink-soft); cursor: pointer; }
.chapter-button.is-complete { border-color: color-mix(in srgb, var(--green) 50%, transparent); background: color-mix(in srgb, var(--green) 12%, var(--surface)); color: var(--green); }

.reader-toolbar { position: sticky; top: calc(68px + env(safe-area-inset-top, 0px)); z-index: 15; margin: -24px calc(clamp(16px, 4vw, 32px) * -1) 24px; padding: 12px clamp(16px, 4vw, 32px); display: flex; align-items: center; justify-content: space-between; gap: 10px; background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(18px); }
.reader-toolbar .text-button { display: inline-flex; align-items: center; gap: 5px; }
.reader-actions { display: flex; gap: 7px; }
.reader-heading { text-align: center; }
.reader-heading h1 { margin-bottom: 7px; font-size: clamp(27px, 6vw, 38px); }
.reader-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; color: var(--ink-faint); font-size: 12px; }
.reading-status { display: inline-flex; align-items: center; gap: 6px; }
.reading-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.reading-status.is-paused::before { background: var(--ink-faint); box-shadow: none; }
.scripture { margin: 28px 0; padding: clamp(20px, 5vw, 42px); border: 1px solid var(--line); border-radius: var(--radius-xl); background: color-mix(in srgb, var(--surface-solid) 86%, transparent); box-shadow: var(--shadow); }
.verse { margin: 0 0 1.3em; color: var(--ink); font: 400 var(--reader-size)/1.9 "Libre Baskerville", Georgia, serif; letter-spacing: .005em; }
.verse-number { margin-right: .45em; color: var(--gold); font-family: "DM Sans", sans-serif; font-size: .62em; font-weight: 700; vertical-align: super; }
.reader-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.complete-button.is-complete { background: color-mix(in srgb, var(--green) 80%, white); }

.circle-list { display: grid; gap: 10px; }
.member-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.avatar { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--gold) 13%, var(--surface-raised)); color: var(--gold-bright); font-weight: 700; }
.member-row h3 { margin: 0; }
.member-row p { margin: 4px 0 0; color: var(--ink-faint); font-size: 12px; }
.member-time { text-align: right; }
.member-time strong { display: block; font-size: 18px; }
.member-time small { color: var(--ink-faint); }
.invite-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 15px; }
.invite-code { margin-top: 6px; color: var(--gold-bright); font: 700 23px/1.2 "DM Sans", sans-serif; letter-spacing: .16em; }
.privacy-note { margin-top: 14px; padding: 13px 15px; border-radius: 13px; background: color-mix(in srgb, var(--green) 8%, transparent); color: var(--ink-soft); font-size: 12px; line-height: 1.5; }

.calendar-controls { display: flex; align-items: center; gap: 8px; }
.calendar-title { min-width: 150px; text-align: center; font-weight: 700; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.calendar-weekday { padding: 5px 0; color: var(--ink-faint); font-size: 10px; font-weight: 700; text-align: center; text-transform: uppercase; }
.calendar-day { aspect-ratio: 1; min-height: 53px; padding: 8px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink-soft); cursor: pointer; }
.calendar-day.is-empty { visibility: hidden; }
.calendar-day.is-today { border-color: var(--gold); }
.calendar-day.has-reading { background: color-mix(in srgb, var(--gold) 8%, var(--surface)); }
.day-dots { display: flex; gap: 3px; }
.day-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.day-detail { margin-top: 16px; }

.cabinet-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.cabinet-badge { min-height: 150px; padding: 17px 10px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); text-align: center; }
.cabinet-badge.is-locked { opacity: .47; filter: grayscale(.5); }
.cabinet-badge .badge-icon { width: 55px; height: 55px; font-size: 25px; }
.cabinet-badge b { font-size: 12px; }
.cabinet-badge small { color: var(--ink-faint); font-size: 11px; }
.promise-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.promise-card { min-height: 230px; position: relative; overflow: hidden; padding: 24px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line-strong); border-radius: 21px; background: linear-gradient(150deg, color-mix(in srgb, var(--gold) 14%, var(--surface-solid)), var(--surface-solid)); }
.promise-card::after { content: "✦"; position: absolute; right: -5px; bottom: -32px; color: color-mix(in srgb, var(--gold) 8%, transparent); font-size: 120px; }
.promise-card blockquote { position: relative; z-index: 1; margin: 13px 0; font: italic 400 15px/1.7 "Libre Baskerville", serif; }
.promise-card footer { position: relative; z-index: 1; color: var(--gold-bright); font-size: 12px; font-weight: 700; }

.ai-sheet { width: min(100%, 760px); height: min(88vh, 820px); display: flex; flex-direction: column; overflow: hidden; }
.modal-backdrop { position: fixed; z-index: 60; inset: 0; padding: max(16px, env(safe-area-inset-top, 0px)) 12px max(12px, var(--safe-bottom)); display: grid; place-items: end center; background: rgba(0, 7, 16, .68); backdrop-filter: blur(12px); }
.modal-panel { width: min(100%, 580px); max-height: 92vh; overflow: auto; padding: 22px; border: 1px solid var(--line-strong); border-radius: 24px; background: var(--surface-solid); box-shadow: 0 30px 90px rgba(0, 0, 0, .5); animation: sheetUp .3s ease both; }
@keyframes sheetUp { from { transform: translateY(24px); opacity: 0; } }
.modal-head { display: flex; align-items: start; justify-content: space-between; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 21px; }
.modal-head p { margin: 5px 0 0; color: var(--ink-faint); font-size: 12px; }
.close-button { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-raised); cursor: pointer; }
.ai-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 3px; }
.chat-bubble { max-width: 88%; margin-bottom: 12px; padding: 13px 15px; border-radius: 16px; white-space: pre-wrap; line-height: 1.55; font-size: 14px; }
.chat-bubble.user { margin-left: auto; border-bottom-right-radius: 5px; background: var(--gold); color: #172238; }
.chat-bubble.assistant { border: 1px solid var(--line); border-bottom-left-radius: 5px; background: var(--surface-raised); }
.chat-bubble.pending { color: var(--ink-faint); font-style: italic; }
.ai-form { padding-top: 14px; border-top: 1px solid var(--line); }
.ai-form-row { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px; }
.ai-form textarea { width: 100%; min-height: 49px; max-height: 130px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-deep); color: var(--ink); resize: none; outline: none; }
.ai-privacy { margin: 8px 2px 0; color: var(--ink-faint); font-size: 10px; }

.mystery-reveal { text-align: center; }
.mystery-star { margin: 4px 0 12px; color: var(--gold-bright); font-size: 55px; animation: bloom .65s ease both; }
@keyframes bloom { from { transform: scale(.4) rotate(-30deg); opacity: 0; } }
.mystery-reveal blockquote { margin: 20px 0; padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-raised); font: italic 400 16px/1.7 "Libre Baskerville", serif; }

.toast-region { position: fixed; z-index: 100; top: calc(78px + env(safe-area-inset-top, 0px)); left: 50%; width: min(calc(100% - 28px), 440px); transform: translateX(-50%); pointer-events: none; }
.toast { margin-bottom: 8px; padding: 13px 16px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface-solid); box-shadow: var(--shadow); color: var(--ink); animation: toastIn .25s ease both; }
.toast.error { border-color: color-mix(in srgb, var(--red) 55%, transparent); }
@keyframes toastIn { from { transform: translateY(-8px); opacity: 0; } }
.empty-state { padding: 42px 20px; border: 1px dashed var(--line-strong); border-radius: 18px; color: var(--ink-soft); text-align: center; }
.empty-state strong { display: block; margin-bottom: 7px; color: var(--ink); }

@media (max-width: 780px) {
  .today-grid { grid-template-columns: 1fr; }
  .progress-hero { grid-template-columns: 1fr; text-align: center; }
  .progress-caption { text-align: left; }
  .badge-strip { grid-template-columns: repeat(5, minmax(76px, 1fr)); overflow-x: auto; padding-bottom: 4px; }
  .books-grid { grid-template-columns: repeat(2, 1fr); }
  .chapter-picker { grid-template-columns: repeat(6, 1fr); }
  .cabinet-grid { grid-template-columns: repeat(3, 1fr); }
  .promise-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
  .main { padding-top: 19px; }
  .brand small { display: none; }
  .page-heading { align-items: start; }
  .page-heading .button { min-height: 40px; padding: 0 12px; font-size: 12px; }
  .choice-grid { grid-template-columns: 1fr; }
  .continue-card { align-items: start; }
  .books-grid { gap: 9px; }
  .book-card { min-height: 96px; padding: 14px; }
  .chapter-picker { grid-template-columns: repeat(5, 1fr); }
  .reader-toolbar { top: calc(68px + env(safe-area-inset-top, 0px)); }
  .reader-toolbar .button span { display: none; }
  .scripture { margin-left: -5px; margin-right: -5px; padding: 23px 20px; border-radius: 21px; }
  .reader-footer { grid-template-columns: 1fr; }
  .invite-card { grid-template-columns: 1fr; }
  .calendar-day { min-height: 44px; padding: 6px; font-size: 12px; }
  .cabinet-grid { grid-template-columns: repeat(2, 1fr); }
  .promise-grid { grid-template-columns: 1fr; }
}

@media (min-width: 900px) {
  .bottom-nav { bottom: 18px; border-radius: 22px; border-bottom: 1px solid var(--line); min-height: 70px; padding-bottom: 8px; }
  .main { padding-bottom: 125px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
