:root {
  --nav: #07182b;
  --nav-soft: #102a45;
  --bg: #edf2f7;
  --surface: #ffffff;
  --surface-soft: #f6f8fb;
  --ink: #12213a;
  --muted: #64748b;
  --line: #d9e2ec;
  --brand: #2f68d7;
  --brand-dark: #1e4ea8;
  --green: #16704a;
  --gold: #bc7a20;
  --red: #bd3d35;
  --shadow: 0 18px 45px rgba(16, 36, 62, 0.13);
  --content: 1480px;
  color-scheme: light;
}

body.dark {
  --bg: #0d1520;
  --surface: #172230;
  --surface-soft: #101a27;
  --ink: #edf4ff;
  --muted: #aab7c9;
  --line: #2b3c51;
  --brand: #73a2ff;
  --brand-dark: #99baff;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--brand-dark); }
img { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 72px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 10px clamp(16px, 3vw, 42px);
  color: #edf6ff;
  background: color-mix(in srgb, var(--nav) 96%, transparent);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
}

.brand { display: flex; align-items: center; gap: 11px; color: #fff; text-decoration: none; min-width: 235px; }
.brand-icon { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.38); border-radius: 8px; font-family: Georgia, serif; font-weight: 800; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: .98rem; }
.brand small { margin-top: 2px; color: #9eb5cf; font-size: .72rem; }

.primary-nav { justify-self: center; display: flex; align-items: center; gap: 5px; }
.primary-nav a { min-height: 40px; display: inline-flex; align-items: center; padding: 0 13px; border-radius: 7px; color: #cfe0f3; text-decoration: none; font-size: .86rem; font-weight: 760; }
.primary-nav a:hover, .primary-nav a.active { background: rgba(255,255,255,.11); color: #fff; }
.header-actions { display: flex; gap: 8px; }
.account-button { min-height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 4px 11px 4px 5px; border: 1px solid rgba(255,255,255,.22); border-radius: 99px; background: rgba(255,255,255,.08); color: #fff; cursor: pointer; font-weight: 760; }
.account-button:hover { background: rgba(255,255,255,.14); }
.account-avatar { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; background: #edf6ff; color: var(--nav); font-size: .78rem; font-weight: 900; }
.icon-button, .quiet-button { min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); cursor: pointer; font-weight: 740; }
.app-header .icon-button { border-color: rgba(255,255,255,.18); background: transparent; color: #fff; }

#app { width: min(var(--content), calc(100% - 40px)); margin: 0 auto; padding: 24px 0 52px; outline: 0; }
.app-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { width: min(var(--content), calc(100% - 40px)); min-height: 94px; display: flex; align-items: center; justify-content: space-between; gap: 28px; margin: 0 auto; padding: 20px 0; }
.footer-brand { display: grid; gap: 4px; }
.footer-brand strong { font-family: Georgia, serif; font-size: 1.05rem; }
.footer-brand span { color: var(--muted); font-size: .78rem; }
.ai-disclosure { position: relative; flex: 0 0 auto; }
.ai-disclosure summary { min-height: 40px; display: inline-flex; align-items: center; padding: 0 13px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); color: var(--ink); cursor: pointer; font-size: .8rem; font-weight: 800; list-style: none; }
.ai-disclosure summary::-webkit-details-marker { display: none; }
.ai-disclosure summary::before { content: "AI"; display: grid; place-items: center; width: 25px; height: 25px; margin-right: 8px; border-radius: 50%; background: var(--brand); color: #fff; font-size: .65rem; }
.ai-disclosure-content { position: absolute; right: 0; bottom: calc(100% + 10px); z-index: 60; width: min(480px, calc(100vw - 28px)); padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.ai-disclosure-content h2 { margin-bottom: 10px; font-family: Georgia, serif; font-size: 1.35rem; }
.ai-disclosure-content p { margin-bottom: 10px; color: var(--muted); font-size: .86rem; line-height: 1.55; }
.ai-disclosure-content p:last-child { margin-bottom: 0; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; color: var(--muted); font-size: .82rem; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--brand); }
.eyebrow { margin-bottom: 6px; color: var(--brand-dark); font-size: .73rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.page-head { display: flex; flex-direction: column; align-items: flex-start; margin: 12px 0 24px; max-width: 850px; }
.page-head h1 { margin-bottom: 8px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 4vw, 3.8rem); line-height: 1; }
.page-head p:last-child { max-width: 700px; color: var(--muted); font-size: 1.03rem; line-height: 1.55; }
.primary-button, .secondary-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 0 15px; border: 1px solid transparent; border-radius: 7px; text-decoration: none; font-weight: 800; cursor: pointer; }
.primary-button { background: var(--brand); color: #fff; }
.secondary-button { border-color: var(--line); background: var(--surface); color: var(--ink); }

.home-hero { position: relative; min-height: 460px; overflow: hidden; border-radius: 8px; background: var(--nav); box-shadow: var(--shadow); }
.home-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.home-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5,19,35,.9) 0%, rgba(5,19,35,.62) 45%, rgba(5,19,35,.08) 78%); }
.home-hero-content { position: relative; z-index: 1; width: min(680px, 85%); padding: clamp(46px, 8vw, 92px); color: #fff; }
.home-hero-content .eyebrow { color: #a8c5ff; }
.home-hero-content h1 { margin-bottom: 18px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.6rem, 6vw, 5.5rem); line-height: .95; }
.home-hero-content p { color: #d6e4f5; font-size: 1.08rem; line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.home-hero .secondary-button { border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.08); color: #fff; }

.content-section { margin-top: 42px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.section-heading h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(1.6rem, 3vw, 2.5rem); }
.section-heading > a { font-weight: 780; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.path-card { min-width: 0; overflow: hidden; display: grid; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.path-card.featured { grid-template-columns: minmax(280px, .75fr) 1fr; }
.path-image { min-height: 190px; overflow: hidden; background: var(--surface-soft); }
.path-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.path-content { padding: 20px; }
.path-content h3 { margin-bottom: 8px; font-family: Georgia, serif; font-size: 1.45rem; }
.path-content > p:not(.eyebrow) { color: var(--muted); line-height: 1.5; }
.progress-track { height: 7px; overflow: hidden; margin: 18px 0 8px; border-radius: 99px; background: var(--line); }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.path-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--muted); font-size: .82rem; }

.event-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.event-card { min-width: 0; overflow: hidden; display: grid; grid-template-rows: 150px 1fr; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); text-decoration: none; }
.event-card img { width: 100%; height: 100%; object-fit: cover; }
.event-card > span { padding: 14px; }
.event-card small, .event-card strong { display: block; }
.event-card small { margin-bottom: 5px; color: var(--muted); }
.event-card p { margin-top: 8px; color: var(--muted); font-size: .86rem; line-height: 1.4; }

.welcome-dialog { width: min(1040px, calc(100% - 28px)); max-height: calc(100vh - 32px); padding: 0; overflow: auto; border: 0; border-radius: 8px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 100px rgba(0,0,0,.42); }
.welcome-dialog::backdrop { background: rgba(4, 14, 26, .78); backdrop-filter: blur(6px); }
.account-dialog { width: min(470px, calc(100% - 28px)); padding: 0; overflow: visible; border: 0; border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 100px rgba(0,0,0,.42); }
.account-dialog::backdrop { background: rgba(4,14,26,.72); backdrop-filter: blur(5px); }
.account-dialog-content { padding: 38px; text-align: center; }
.account-dialog-content h1 { margin-bottom: 10px; font-family: Georgia, serif; font-size: clamp(1.8rem, 5vw, 2.35rem); }
.account-dialog-content > p:not(.eyebrow) { color: var(--muted); line-height: 1.55; }
.dialog-close { position: absolute; top: 12px; right: 12px; padding: 7px 9px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-weight: 750; }
.account-mark { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 14px; background: var(--nav); color: #fff; font-family: Georgia, serif; font-weight: 800; }
.auth-provider-list { display: grid; gap: 10px; margin: 24px 0 18px; }
.auth-provider { min-height: 50px; display: grid; grid-template-columns: 28px 1fr 28px; align-items: center; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer; font-weight: 800; }
.auth-provider span { font-size: 1.05rem; }
.auth-provider:hover { border-color: var(--brand); background: var(--surface-soft); }
.auth-provider.apple { background: #080808; border-color: #080808; color: #fff; }
.auth-provider.apple:hover { background: #252525; }
.account-summary { display: grid; gap: 6px; margin: 24px 0 18px; padding: 20px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.account-summary strong { font-size: 1.1rem; }
.account-summary > span { color: var(--muted); font-size: .86rem; }
.account-summary p { margin: 10px 0; color: var(--green); font-size: .84rem; }
.account-summary[data-sync="error"] p { color: var(--gold); }
.sync-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: currentColor; }
.account-privacy { margin: 15px 0 0; font-size: .76rem; }
.account-setup { margin: 20px 0 0 !important; padding: 12px; border-radius: 7px; background: color-mix(in srgb, var(--gold) 12%, var(--surface)); color: var(--ink) !important; font-size: .82rem; }
.welcome-art { height: 210px; overflow: hidden; }
.welcome-art img { width: 100%; height: 100%; object-fit: cover; }
.welcome-content { padding: clamp(24px, 5vw, 46px); text-align: center; }
.welcome-content h1 { margin-bottom: 10px; font-family: Georgia, serif; font-size: clamp(2rem, 5vw, 3.5rem); }
.welcome-content > p:not(.eyebrow) { color: var(--muted); }
.welcome-content .welcome-disclosure { margin: 17px auto 0; font-size: .76rem; }
.welcome-disclosure a { font-weight: 800; }
.welcome-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 30px 0 20px; text-align: left; }
.welcome-choices button { min-height: 155px; display: grid; align-content: start; gap: 9px; padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); color: var(--ink); cursor: pointer; }
.welcome-choices button:hover { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 7%, var(--surface)); }
.welcome-choices strong { font-size: 1.02rem; }
.welcome-choices span { color: var(--muted); line-height: 1.45; }

.filter-drawer { position: fixed; top: 0; right: 0; z-index: 80; width: min(390px, 92vw); height: 100vh; display: grid; align-content: start; gap: 14px; padding: 20px; background: var(--surface); color: var(--ink); box-shadow: -20px 0 55px rgba(0,0,0,.22); transform: translateX(105%); transition: transform .2s ease; }
.filter-drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.drawer-head h2 { margin: 0; }
.filter-drawer label { display: grid; gap: 6px; }
.filter-drawer label span { color: var(--muted); font-size: .8rem; font-weight: 750; }
.filter-drawer select, .search-form input, textarea { width: 100%; min-height: 43px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); color: var(--ink); }
.drawer-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 10px; }
.drawer-actions button { min-height: 42px; padding: 0 15px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); cursor: pointer; }
.drawer-actions .primary-button { background: var(--brand); color: #fff; }
.drawer-scrim { position: fixed; inset: 0; z-index: 70; background: rgba(5,16,29,.52); }
.scripture-panel { position: fixed; top: 0; left: 0; z-index: 90; width: min(460px, 94vw); height: 100vh; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 14px; padding: 20px; background: var(--surface); color: var(--ink); box-shadow: 20px 0 55px rgba(0,0,0,.26); transform: translateX(-105%); transition: transform .2s ease; }
.scripture-panel.open { transform: translateX(0); }
.scripture-panel-head { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.scripture-panel-head h2 { margin: 2px 0 0; font-family: Georgia, serif; font-size: clamp(1.55rem, 5vw, 2.1rem); }
.scripture-panel-meta { color: var(--muted); font-size: .85rem; font-weight: 750; }
.scripture-panel-body { min-height: 0; overflow: auto; padding-right: 4px; }
.scripture-panel-body .verse-list { max-height: none; padding: 0; }
.scripture-loading { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); color: var(--muted); line-height: 1.55; }
.scripture-loading p { margin: 0; }
.scripture-panel-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding-top: 10px; border-top: 1px solid var(--line); }
.scripture-panel-actions .secondary-button.active { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 18%, var(--surface)); color: var(--ink); }
.scripture-panel-link { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 0 13px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); color: var(--ink); text-decoration: none; font-weight: 800; }
.scripture-scrim { position: fixed; inset: 0; z-index: 85; background: rgba(5,16,29,.52); }

.study-shell { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.study-mode-header, .path-timeline-intro { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 18px; }
.study-mode-header h1 { margin: 4px 0 5px; font-family: Georgia, serif; font-size: clamp(2rem, 4vw, 3.5rem); }
.study-mode-header p, .path-timeline-intro p { color: var(--muted); }
.view-switch { flex: 0 0 auto; display: grid; gap: 8px; padding: 12px; border: 1px solid color-mix(in srgb, var(--brand) 34%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--brand) 7%, var(--surface)); box-shadow: var(--shadow); }
.view-switch > span { color: var(--muted); font-size: .68rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.segmented-control { display: grid; grid-template-columns: repeat(2, auto); gap: 6px; padding: 4px; border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--line)); border-radius: 9px; background: var(--surface-soft); }
.segmented-control a { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; border-radius: 7px; color: var(--ink); text-decoration: none; font-size: .9rem; font-weight: 900; }
.segmented-control a:hover { background: color-mix(in srgb, var(--brand) 9%, var(--surface)); }
.segmented-control a.active { background: var(--brand); color: #fff; box-shadow: 0 8px 18px color-mix(in srgb, var(--brand) 26%, transparent); }
.path-timeline-intro { align-items: center; margin-top: 28px; }
.path-timeline-intro h2 { margin: 3px 0 6px; font-family: Georgia, serif; font-size: clamp(1.5rem, 3vw, 2.3rem); }
.chapter-nav { position: sticky; top: 92px; max-height: calc(100vh - 112px); overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.chapter-summary { position: sticky; top: 0; z-index: 1; padding: 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.chapter-summary h2 { margin-bottom: 6px; font-family: Georgia, serif; font-size: 1.3rem; }
.chapter-summary p { color: var(--muted); font-size: .82rem; }
.chapter-nav ol { list-style: none; margin: 0; padding: 8px; }
.chapter-nav li a { display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 8px; align-items: center; padding: 10px; border-radius: 7px; color: var(--ink); text-decoration: none; }
.chapter-nav li a:hover, .chapter-nav li.active a { background: color-mix(in srgb, var(--brand) 9%, var(--surface)); }
.chapter-nav li a > span { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: .75rem; }
.chapter-nav li.complete a > span { background: var(--green); border-color: var(--green); color: #fff; }
.chapter-nav li strong { font-size: .84rem; line-height: 1.25; }
.study-article, .standalone-article { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.standalone-article { width: min(1120px, 100%); margin: 0 auto; }
.article-hero { position: relative; min-height: clamp(340px, 42vw, 610px); overflow: hidden; background: #1a2a3b; }
.article-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.article-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(4,14,26,.02) 25%, rgba(4,14,26,.82) 100%); }
.article-overlay { position: absolute; left: clamp(22px, 5vw, 56px); right: clamp(22px, 5vw, 56px); bottom: clamp(24px, 5vw, 50px); z-index: 1; color: #fff; }
.article-overlay h1 { max-width: 900px; margin: 11px 0 7px; font-family: Georgia, serif; font-size: clamp(2.2rem, 5.5vw, 5rem); line-height: .98; }
.article-overlay p { color: #dbe7f5; }
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-row span { min-height: 27px; display: inline-flex; align-items: center; padding: 0 9px; border: 1px solid rgba(255,255,255,.32); border-radius: 99px; background: rgba(4,14,26,.35); font-size: .73rem; font-weight: 800; }
.article-toolbar { position: sticky; top: 72px; z-index: 5; display: flex; justify-content: flex-end; gap: 9px; padding: 11px 24px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); }
.article-toolbar button, .article-toolbar a { min-height: 36px; display: inline-flex; align-items: center; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); text-decoration: none; cursor: pointer; font-weight: 750; }
.article-toolbar button.active { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 13%, var(--surface)); color: var(--gold); }
.article-body { display: grid; grid-template-columns: 180px minmax(0, 760px); justify-content: center; gap: 36px; padding: clamp(26px, 5vw, 58px); }
.article-toc { position: sticky; top: 137px; align-self: start; display: grid; gap: 8px; padding-right: 16px; border-right: 1px solid var(--line); }
.article-toc strong { margin-bottom: 4px; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.article-toc a { color: var(--muted); text-decoration: none; font-size: .82rem; }
.article-toc a:hover { color: var(--brand); }
.article-content { min-width: 0; }
.article-content section { scroll-margin-top: 145px; padding: 30px 0; border-bottom: 1px solid var(--line); }
.article-content section:first-child { padding-top: 0; }
.article-content section:last-child { border-bottom: 0; }
.article-content h2 { margin-bottom: 12px; font-family: Georgia, serif; font-size: clamp(1.65rem, 3vw, 2.35rem); }
.article-content h3 { margin: 22px 0 9px; font-size: 1rem; }
.article-content p, .article-content li { color: var(--muted); font-size: 1rem; line-height: 1.72; }
.lead { color: var(--ink) !important; font-family: Georgia, serif; font-size: clamp(1.3rem, 2.4vw, 1.75rem) !important; line-height: 1.5 !important; }
.section-label { margin-bottom: 7px; color: var(--brand-dark); font-size: .72rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.fact-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; margin-top: 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--line); }
.fact-strip > div { padding: 13px; background: var(--surface-soft); }
.fact-strip span, .fact-strip strong { display: block; }
.fact-strip span { margin-bottom: 4px; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.fact-strip strong { font-size: .85rem; line-height: 1.35; }
.passage-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin: 18px 0; }
.passage-card { display: grid; gap: 3px; width: 100%; text-align: left; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); color: var(--ink); text-decoration: none; font: inherit; cursor: pointer; }
.passage-card:hover { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 7%, var(--surface-soft)); }
.passage-card span, .passage-card small { color: var(--muted); font-size: .74rem; }
.passage-card strong { font-size: .95rem; }
.verse-list { display: grid; gap: 9px; }
.verse-list p { margin: 0; color: var(--muted); }
.verse-list sup { display: inline-block; min-width: 2.85rem; color: var(--brand-strong); font-size: .72rem; font-weight: 900; vertical-align: baseline; }
.explanation-list, .connection-cards { display: grid; gap: 10px; }
.explanation-list article, .connection-cards article { padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.explanation-list article p, .connection-cards article p { margin-bottom: 0; font-size: .9rem; }
.explanation-list article a, .connection-cards article a { font-weight: 800; }
.scripture-ref-button { display: inline-flex; width: fit-content; max-width: 100%; padding: 0; border: 0; background: transparent; color: var(--brand-strong); font: inherit; font-weight: 800; text-align: left; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.scripture-ref-button:hover { color: var(--ink); }
.connection-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.connection-cards article h3 { margin: 7px 0 5px; }
.translation-notice { margin-top: 15px; padding: 11px 13px; border-left: 3px solid var(--brand); background: var(--surface-soft); font-size: .82rem !important; }
.callout { margin-top: 18px; padding: 17px; border-left: 4px solid var(--green); background: color-mix(in srgb, var(--green) 7%, var(--surface-soft)); }
.callout p { margin: 7px 0 0; }
.promise-list { display: grid; gap: 12px; }
.promise-list article { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; padding: 17px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.promise-list article > div:not(.promise-arrow) { display: grid; gap: 4px; }
.promise-list article span { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.promise-list article h3, .promise-list article p { grid-column: 1 / -1; }
.promise-list article h3 { margin: 8px 0 0; }
.promise-list article p { margin: 0; font-size: .9rem; }
.promise-arrow { align-self: center; color: var(--muted); font-weight: 800; }
.context-pills { display: flex; flex-wrap: wrap; gap: 7px; }
.context-pills span { padding: 7px 9px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface-soft); color: var(--muted); font-size: .78rem; }
.uncertainty-notes { margin-top: 18px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.uncertainty-notes h3 { margin-top: 0; }
.uncertainty-notes ul { margin-bottom: 0; padding-left: 20px; }
.related-groups { display: grid; gap: 18px; }
.related-groups h3 { margin: 0 0 8px; }
.related-links { display: flex; flex-wrap: wrap; gap: 8px; }
.related-links a { padding: 8px 11px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface-soft); color: var(--brand); font-size: .84rem; font-weight: 700; text-decoration: none; }
.related-links a:hover, .related-links a:focus-visible { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--surface-soft)); }
.views-panel { border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.views-panel summary { padding: 15px; cursor: pointer; font-weight: 800; }
.views-panel > div { padding: 0 15px 15px; }
.views-panel article { padding-top: 12px; border-top: 1px solid var(--line); }
.note-editor > p { max-width: 620px; }
.note-editor label { display: block; margin: 18px 0 7px; color: var(--ink); font-size: .84rem; font-weight: 800; }
.note-editor textarea { min-height: 160px; resize: vertical; line-height: 1.55; }
.note-actions, .note-card-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 11px; }
.notes-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.note-card { min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.note-card small { color: var(--muted); }
.note-card h2 { margin: 6px 0 10px; font-family: Georgia, serif; font-size: 1.35rem; }
.note-card h2 a { color: var(--ink); text-decoration: none; }
.note-card h2 a:hover { color: var(--brand); }
.note-card p { margin: 0; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.note-card-actions { margin-top: 0; }
.source-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.source-card { display: grid; gap: 3px; width: 100%; text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); color: var(--ink); font: inherit; text-decoration: none; cursor: pointer; }
.source-card:hover { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 7%, var(--surface-soft)); }
.source-card span, .source-card small { color: var(--muted); font-size: .76rem; }
.source-card small { font-weight: 800; }
.passage-bookmark-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.passage-bookmark-card { min-height: 92px; display: grid; align-content: center; gap: 5px; text-align: left; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); color: var(--ink); font: inherit; cursor: pointer; }
.passage-bookmark-card:hover { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 7%, var(--surface-soft)); }
.passage-bookmark-card span { color: var(--muted); font-size: .78rem; }
.chapter-actions { display: flex; justify-content: space-between; gap: 12px; padding-top: 26px; }

.timeline-head { max-width: none; flex-direction: row; justify-content: space-between; align-items: end; }
.timeline-head h1 { max-width: 850px; }
.story-lens { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 12px; padding: 11px 13px 11px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 10px 28px rgba(16,36,62,.08); }
.story-lens > div { display: grid; gap: 2px; min-width: 180px; }
.story-lens-kicker { color: var(--muted); font-size: .64rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.story-lens strong { font-family: Georgia, serif; font-size: 1rem; }
.story-lens nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.story-lens a { min-height: 34px; display: inline-flex; align-items: center; padding: 0 11px; border: 1px solid transparent; border-radius: 99px; color: var(--muted); text-decoration: none; font-size: .73rem; font-weight: 800; }
.story-lens a:hover { color: var(--ink); background: var(--surface-soft); }
.story-lens a.active { border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); background: color-mix(in srgb, var(--brand) 10%, var(--surface)); color: var(--brand-dark); }
.story-river { overflow: hidden; border: 1px solid #294766; border-radius: 12px; background: radial-gradient(circle at 72% 20%, rgba(80,124,171,.28), transparent 28%), linear-gradient(165deg, #0d2238 0%, #102b43 52%, #0a1a2b 100%); color: #eef6ff; box-shadow: var(--shadow); }
.story-river-copy { position: relative; z-index: 2; width: min(620px, calc(100% - 40px)); padding: 24px 24px 0; }
.story-river-copy .eyebrow { color: #91baff; }
.story-river-copy h2 { margin-bottom: 7px; font-family: Georgia, serif; font-size: clamp(1.55rem, 3vw, 2.35rem); }
.story-river-copy p:last-child { margin: 0; color: #b9cbe0; font-size: .86rem; line-height: 1.5; }
.story-river-scroll { overflow-x: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
.story-river-canvas { position: relative; width: 100%; min-width: 1000px; height: 278px; overflow: hidden; }
.story-river-canvas::before, .story-river-canvas::after { content: ""; position: absolute; left: -3%; right: -3%; bottom: -92px; height: 190px; border-radius: 50% 50% 0 0; background: rgba(24,63,74,.52); transform: rotate(-2deg); }
.story-river-canvas::after { bottom: -124px; background: rgba(9,31,43,.88); transform: rotate(2deg); }
.story-river-stars { position: absolute; inset: 0; opacity: .48; background-image: radial-gradient(circle, rgba(218,235,255,.8) 0 1px, transparent 1.6px); background-size: 83px 71px; mask-image: linear-gradient(to bottom, #000, transparent 72%); }
.story-river-canvas svg { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; overflow: visible; }
.story-river-canvas path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.story-river-bank { stroke: rgba(80,176,218,.18); stroke-width: 30; filter: blur(9px); }
.story-river-line { stroke: #8dd8f3; stroke-width: 3; stroke-dasharray: .09 .91; filter: drop-shadow(0 0 7px rgba(119,216,252,.9)); animation: story-river-flow 8s linear infinite; }
.story-era { position: absolute; left: var(--era-x); top: var(--era-y); z-index: 2; color: #fff; text-decoration: none; transform: translate(-50%, -50%); }
.story-era-node { display: block; width: 18px; height: 18px; border: 3px solid rgba(255,255,255,.92); border-radius: 50%; background: var(--era-color); box-shadow: 0 0 0 5px color-mix(in srgb, var(--era-color) 25%, transparent), 0 0 18px rgba(113,205,241,.38); transition: transform .18s ease, box-shadow .18s ease; }
.story-era-label { position: absolute; left: 50%; bottom: 25px; width: 106px; display: grid; gap: 2px; padding: 7px 6px; border: 1px solid rgba(255,255,255,.15); border-radius: 8px; background: rgba(7,24,43,.84); box-shadow: 0 7px 20px rgba(0,0,0,.2); backdrop-filter: blur(8px); transform: translateX(-50%); text-align: center; }
.story-era:nth-of-type(even) .story-era-label { top: 25px; bottom: auto; }
.story-era-label strong { color: color-mix(in srgb, var(--era-color) 75%, white); font-size: .72rem; }
.story-era-label small { color: #b7c9dc; font-size: .59rem; }
.story-era-label em { margin-top: 2px; color: #eaf5ff; font-size: .58rem; font-style: normal; font-weight: 800; }
.story-era:hover .story-era-node, .story-era:focus-visible .story-era-node, .story-era.active .story-era-node { transform: scale(1.35); box-shadow: 0 0 0 8px color-mix(in srgb, var(--era-color) 30%, transparent), 0 0 26px color-mix(in srgb, var(--era-color) 75%, white); }
.story-era.active .story-era-label { border-color: color-mix(in srgb, var(--era-color) 70%, white); background: rgba(7,24,43,.96); }
.story-river-footer { position: relative; z-index: 3; display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 14px; align-items: center; padding: 10px 20px; border-top: 1px solid rgba(255,255,255,.1); background: rgba(5,18,31,.68); color: #b7c9dc; font-size: .69rem; font-weight: 750; }
.story-river-footer small { text-align: center; font: inherit; font-weight: 600; }
@keyframes story-river-flow { to { stroke-dashoffset: -1; } }
.timeline-board { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.era-row { display: grid; grid-template-columns: repeat(10, minmax(112px, 1fr)); overflow-x: auto; }
.era-row a { min-height: 67px; display: grid; place-content: center; gap: 4px; padding: 8px; border-right: 1px solid var(--line); color: var(--ink); text-align: center; text-decoration: none; }
.era-row a strong { color: var(--era-color); font-size: .78rem; }
.era-row a span { color: var(--muted); font-size: .68rem; }
.era-row a.active { box-shadow: inset 0 -3px 0 var(--era-color); background: color-mix(in srgb, var(--era-color) 8%, var(--surface)); }
.timeline-art { position: relative; height: clamp(230px, 25vw, 350px); overflow: hidden; }
.timeline-art > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.timeline-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.25)); pointer-events: none; }
.living-panorama::after { background: linear-gradient(180deg, rgba(5,19,35,.02), rgba(5,19,35,.12)); }
.story-thread { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.story-thread svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.story-thread path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.story-thread-glow { stroke: rgba(255, 220, 118, .42); stroke-width: 8; filter: blur(5px); }
.story-thread-line { stroke: #ffe6a2; stroke-width: 2.2; stroke-dasharray: .12 .88; animation: story-thread-travel 6.5s linear infinite; filter: drop-shadow(0 0 5px rgba(255,226,145,.95)); }
.whole-story-thread .story-thread-glow { stroke: rgba(226, 240, 255, .32); }
.whole-story-thread .story-thread-line { stroke: rgba(241,247,255,.94); animation-duration: 11s; }
.story-stop { position: absolute; left: var(--stop-x); top: var(--stop-y); z-index: 2; width: 12px; height: 12px; padding: 0; border: 2px solid rgba(255,255,255,.95); border-radius: 50%; background: #f6c85f; box-shadow: 0 0 0 4px rgba(246,200,95,.18), 0 2px 8px rgba(5,19,35,.35); transform: translate(-50%, -50%); pointer-events: auto; cursor: pointer; }
.story-stop::after { content: ""; position: absolute; inset: -9px; border-radius: inherit; }
.story-stop span { position: absolute; left: 50%; bottom: 16px; width: max-content; max-width: 145px; overflow: hidden; padding: 5px 8px; border: 1px solid rgba(255,255,255,.34); border-radius: 99px; background: rgba(7,24,43,.78); color: #fff; box-shadow: 0 4px 14px rgba(5,19,35,.22); backdrop-filter: blur(7px); transform: translateX(-50%); font-size: .64rem; font-weight: 820; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.story-stop:nth-of-type(even) span { top: 16px; bottom: auto; }
.story-stop:hover, .story-stop:focus-visible, .story-stop.active { width: 17px; height: 17px; background: #fff1bd; box-shadow: 0 0 0 6px rgba(255,222,123,.28), 0 0 20px rgba(255,225,139,.85); }
.story-stop:hover span, .story-stop:focus-visible span, .story-stop.active span { background: rgba(7,24,43,.94); }
.ambient-motion { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; opacity: .7; }
.ambient-motion span { position: absolute; display: block; }
.ambient-river { left: 7%; top: 40%; width: 31%; height: 5%; border-radius: 50%; background: linear-gradient(100deg, transparent, rgba(213,241,255,.52), transparent); filter: blur(2px); animation: river-shimmer 7s ease-in-out infinite; transform: rotate(-8deg); }
.ambient-smoke { width: 8px; height: 20px; border-radius: 50%; background: rgba(235,238,228,.46); filter: blur(4px); animation: smoke-rise 6.5s ease-out infinite; }
.smoke-one { left: 55%; top: 41%; }
.smoke-two { left: 71%; top: 33%; animation-delay: -3s; }
.ambient-fire { width: 5px; height: 8px; border-radius: 50% 50% 45% 45%; background: rgba(255,174,68,.9); box-shadow: 0 0 9px rgba(255,132,42,.75); animation: fire-flicker 1.8s ease-in-out infinite; }
.fire-one { left: 26%; top: 67%; }
.fire-two { left: 63%; top: 71%; animation-delay: -.8s; }
.ambient-bird { width: 9px; height: 5px; border-top: 1.5px solid rgba(37,48,52,.72); border-radius: 50%; animation: bird-crossing 14s linear infinite; }
.ambient-bird::after { content: ""; position: absolute; left: 7px; top: -2px; width: 9px; height: 5px; border-top: 1.5px solid rgba(37,48,52,.72); border-radius: 50%; transform: rotate(-9deg); }
.bird-one { left: 8%; top: 16%; }
.bird-two { left: 26%; top: 23%; animation-delay: -8s; animation-duration: 18s; transform: scale(.75); }
.ambient-wave { right: 1%; width: 26%; height: 2px; border-top: 1px solid rgba(229,246,255,.62); border-radius: 50%; animation: wave-breathe 4.8s ease-in-out infinite; }
.wave-one { top: 40%; }
.wave-two { top: 44%; right: 4%; animation-delay: -2.3s; }
@keyframes story-thread-travel { to { stroke-dashoffset: -1; } }
@keyframes river-shimmer { 0%, 100% { opacity: .22; transform: translateX(-2%) rotate(-8deg); } 50% { opacity: .72; transform: translateX(4%) rotate(-8deg); } }
@keyframes smoke-rise { 0% { opacity: 0; transform: translateY(8px) scale(.65); } 35% { opacity: .5; } 100% { opacity: 0; transform: translate(7px, -28px) scale(1.55); } }
@keyframes fire-flicker { 0%, 100% { opacity: .48; transform: scale(.72,.85); } 50% { opacity: 1; transform: scale(1.08,1.28) translateY(-1px); } }
@keyframes bird-crossing { 0% { opacity: 0; transform: translateX(-30px); } 12%, 82% { opacity: .75; } 100% { opacity: 0; transform: translateX(540px) translateY(-24px); } }
@keyframes wave-breathe { 0%, 100% { opacity: .18; transform: translateX(-4px) scaleX(.94); } 50% { opacity: .7; transform: translateX(5px) scaleX(1.06); } }
.timeline-line { position: absolute; left: 22px; right: 22px; bottom: 30px; z-index: 2; height: 4px; border-radius: 99px; background: rgba(255,255,255,.85); }
.timeline-marker { position: absolute; top: 50%; width: 18px; height: 18px; padding: 0; border: 3px solid #fff; border-radius: 99px; background: var(--era-color); box-shadow: 0 4px 14px rgba(0,0,0,.3); transform: translate(-50%, -50%); cursor: pointer; }
.timeline-marker.active { width: 24px; height: 24px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--era-color) 35%, transparent), 0 4px 14px rgba(0,0,0,.35); }
.master-timeline-board .timeline-marker { width: 10px; height: 10px; border-width: 2px; }
.master-timeline-board .timeline-marker.staggered { top: calc(50% - var(--marker-offset)); }
.master-timeline-board .timeline-marker::before { content: ""; position: absolute; inset: -7px; border-radius: 99px; }
.master-timeline-board .timeline-marker:hover, .master-timeline-board .timeline-marker:focus-visible { z-index: 3; width: 18px; height: 18px; }
.timeline-tooltip { position: absolute; left: 50%; bottom: 25px; width: max-content; max-width: min(280px, 70vw); display: grid; gap: 3px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.65); border-radius: 7px; background: rgba(255,255,255,.97); color: #12213a; box-shadow: var(--shadow); transform: translateX(-50%); opacity: 0; pointer-events: none; transition: opacity .12s ease; text-align: left; }
.timeline-tooltip strong { white-space: normal; line-height: 1.25; }
.timeline-tooltip small { color: #64748b; white-space: normal; }
.timeline-marker:hover .timeline-tooltip, .timeline-marker:focus .timeline-tooltip { opacity: 1; }
.timeline-years { display: grid; grid-template-columns: repeat(6, 1fr); padding: 12px 22px; color: var(--muted); font-size: .73rem; font-weight: 760; }
.timeline-years span { text-align: center; }
.timeline-scale-note { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 11px 22px; color: var(--muted); font-size: .73rem; font-weight: 760; }
.timeline-scale-note small { text-align: center; font: inherit; font-weight: 600; }
.study-era-row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.study-timeline-board .timeline-art > img { filter: saturate(.88) brightness(.78); }
.study-timeline-art > img { object-position: center center; }
.filtered-study-art > img { object-position: center 42%; filter: saturate(.9) brightness(.7); }
.timeline-art-caption { position: absolute; left: 22px; top: 18px; z-index: 2; max-width: min(420px, calc(100% - 44px)); display: grid; gap: 3px; padding: 11px 13px; border: 1px solid rgba(255,255,255,.28); border-radius: 10px; background: rgba(18, 33, 58, .72); color: #fff; box-shadow: var(--shadow); }
.timeline-art-caption span { color: rgba(255,255,255,.74); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.timeline-art-caption strong { font-size: .95rem; line-height: 1.2; }
.study-timeline-range { display: flex; justify-content: space-between; gap: 20px; padding: 12px 22px; color: var(--muted); font-size: .75rem; font-weight: 760; }
.study-timeline-range span:last-child { text-align: right; }
.timeline-results { display: grid; grid-template-columns: 430px minmax(0, 1fr); gap: 18px; align-items: start; margin-top: 18px; }
.result-list { max-height: calc(100vh - 110px); overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.timeline-item { width: 100%; min-height: 82px; display: grid; grid-template-columns: 112px minmax(0,1fr); gap: 11px; align-items: center; padding: 9px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.timeline-item:hover, .timeline-item.active { background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
.timeline-item img { width: 112px; aspect-ratio: 16 / 9; border-radius: 6px; object-fit: cover; object-position: center; }
.timeline-item strong, .timeline-item small { display: block; }
.timeline-item small { margin-top: 4px; color: var(--muted); font-size: .74rem; line-height: 1.3; }
.timeline-preview { position: sticky; top: 92px; min-height: 540px; overflow: hidden; padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.preview-image { aspect-ratio: 16 / 9; overflow: hidden; margin: -22px -22px 22px; }
.preview-image img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.timeline-preview h2 { font-family: Georgia, serif; font-size: clamp(1.7rem, 3vw, 2.7rem); }
.timeline-preview > p:not(.eyebrow) { color: var(--muted); line-height: 1.55; }
.preview-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }

.search-page { width: min(1050px, 100%); margin: 0 auto; }
.search-form { display: grid; grid-template-columns: 1fr auto; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.search-form input { min-height: 50px; border: 0; background: transparent; font-size: 1.02rem; outline: 0; }
.search-groups { display: grid; gap: 26px; margin-top: 32px; }
.search-groups section h2 { font-family: Georgia, serif; }
.search-result-list { display: grid; gap: 7px; }
.search-result-list a { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); text-decoration: none; }
.search-result-list span { color: var(--muted); font-size: .8rem; text-align: right; }
.search-suggestions { margin-top: 30px; }
.suggestion-grid { display: flex; flex-wrap: wrap; gap: 9px; }
.suggestion-grid a { padding: 10px 13px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); text-decoration: none; font-weight: 750; }

.directory-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.directory-grid a { min-height: 130px; display: flex; flex-direction: column; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); text-decoration: none; }
.directory-grid p { flex: 1; margin: 8px 0; color: var(--muted); font-size: .85rem; }
.directory-grid span { color: var(--brand); font-size: .76rem; font-weight: 800; }
.note-list { display: grid; gap: 12px; max-width: 900px; }
.note-list article { padding: 17px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.note-list a { font-weight: 850; }
.note-list p { margin: 8px 0 0; color: var(--muted); line-height: 1.5; }
.empty-state { display: grid; justify-items: start; gap: 8px; max-width: 700px; margin: 70px auto; padding: 35px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.empty-state h1, .empty-state h2, .empty-state p { margin-bottom: 0; }
.empty-state p { color: var(--muted); }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 100; padding: 12px 16px; border-radius: 7px; background: var(--nav); color: #fff; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .16s ease, transform .16s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1120px) {
  .app-header { grid-template-columns: auto 1fr; }
  .primary-nav { grid-row: 2; grid-column: 1 / -1; justify-self: stretch; overflow-x: auto; }
  .header-actions { justify-self: end; }
  .article-body { grid-template-columns: 1fr; }
  .article-toc { position: static; display: flex; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 15px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .directory-grid, .event-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 860px) {
  #app { width: min(100% - 24px, var(--content)); padding-top: 12px; }
  .brand { min-width: 0; }
  .brand small { display: none; }
  .study-shell { grid-template-columns: 1fr; }
  .study-mode-header, .path-timeline-intro { align-items: flex-start; flex-direction: column; }
  .chapter-nav { position: static; max-height: 360px; }
  .path-card.featured { grid-template-columns: 1fr; }
  .welcome-choices { grid-template-columns: 1fr; }
  .welcome-choices button { min-height: 110px; }
  .timeline-results { grid-template-columns: 1fr; }
  .result-list { max-height: 520px; }
  .timeline-preview { position: static; min-height: 0; }
  .master-timeline-board .timeline-marker { width: 8px; height: 8px; }
  .timeline-head { align-items: flex-start; }
  .story-lens { align-items: flex-start; flex-direction: column; }
  .story-lens nav { justify-content: flex-start; }
  .directory-grid, .event-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .app-header { gap: 8px; padding: 9px 12px; }
  .account-button { padding-right: 5px; }
  .account-button > span:last-child { display: none; }
  .account-dialog-content { padding: 34px 22px 24px; }
  .brand strong { font-size: .85rem; }
  .brand-icon { width: 34px; height: 34px; }
  .primary-nav a { padding: 0 10px; font-size: .78rem; }
  .header-actions .icon-button:first-child { display: inline-flex; }
  .home-hero { min-height: 520px; }
  .home-hero::after { background: linear-gradient(180deg, rgba(5,19,35,.35), rgba(5,19,35,.94)); }
  .home-hero-content { width: 100%; padding: 36px 23px; margin-top: 170px; }
  .card-grid, .directory-grid, .event-grid { grid-template-columns: 1fr; }
  .path-card.featured { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 2.35rem; }
  .study-mode-header h1 { font-size: 2.25rem; }
  .view-switch { width: 100%; }
  .segmented-control { width: 100%; grid-template-columns: 1fr 1fr; }
  .segmented-control a { justify-content: center; padding-inline: 8px; }
  .article-hero { min-height: 420px; }
  .article-overlay { left: 18px; right: 18px; bottom: 20px; }
  .article-toolbar { top: 116px; overflow-x: auto; justify-content: flex-start; padding: 9px 12px; }
  .article-body { padding: 25px 18px; }
  .scripture-panel { width: min(420px, 96vw); padding: 16px; }
  .scripture-panel-actions { grid-template-columns: 1fr; }
  .fact-strip, .passage-grid, .connection-cards, .source-list, .notes-grid { grid-template-columns: 1fr; }
  .passage-bookmark-grid { grid-template-columns: 1fr; }
  .promise-list article { grid-template-columns: 1fr; }
  .promise-arrow { display: none; }
  .search-form { grid-template-columns: 1fr; }
  .search-result-list a { align-items: flex-start; flex-direction: column; }
  .search-result-list span { text-align: left; }
  .timeline-art { height: 270px; }
  .story-lens { padding: 12px; }
  .story-lens nav { flex-wrap: nowrap; width: 100%; overflow-x: auto; padding-bottom: 3px; }
  .story-lens a { flex: 0 0 auto; }
  .story-river-copy { width: calc(100% - 24px); padding: 18px 12px 0; }
  .story-river-canvas { height: 260px; }
  .story-river-footer { padding-inline: 12px; font-size: .6rem; }
  .story-stop span { max-width: 94px; padding: 4px 6px; font-size: .55rem; }
  .study-timeline-art { height: 190px; background: #172230; }
  .study-timeline-art > img { object-fit: contain; object-position: center top; }
  .filtered-study-art > img { object-fit: cover; object-position: center center; }
  .timeline-art-caption { left: 12px; right: 12px; top: 12px; max-width: none; }
  .study-timeline-art .timeline-line { bottom: 18px; }
  .timeline-years { font-size: .6rem; padding-inline: 8px; }
  .timeline-scale-note { gap: 8px; padding-inline: 12px; font-size: .61rem; }
  .timeline-line { left: 12px; right: 12px; }
  .master-timeline-board .timeline-marker { width: 4px; height: 4px; border-width: 1px; }
  .master-timeline-board .timeline-marker::before { inset: -8px; }
  .timeline-tooltip { max-width: 220px; }
  .preview-image { aspect-ratio: 16 / 9; }
  .chapter-actions { flex-direction: column; }
  .chapter-actions a { width: 100%; }
  .footer-inner { align-items: stretch; flex-direction: column; gap: 15px; }
  .ai-disclosure summary { width: 100%; justify-content: center; }
  .ai-disclosure-content { position: static; width: 100%; margin-top: 10px; }
}

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