

:root {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --ink: #26241f;
  --muted: #70695f;
  --faint: #746b5f;
  --accent: #8b3e2e;
  --on-accent: #ffffff;
  --accent-soft: #f4e8e3;
  --paper: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f6f3ed;
  --line: #e7e2d8;
  --line-strong: #d9d1c3;
  --shadow: 0 14px 50px rgba(56, 43, 31, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); scrollbar-color: var(--line-strong) var(--paper); scrollbar-width: thin; scrollbar-gutter: stable; }
::selection { background: var(--accent-soft); color: var(--ink); }
input { caret-color: var(--accent); }
input::placeholder { color: var(--muted); opacity: 1; }
input[type="range"] { cursor: pointer; }
.rail, .context-panel, .chapter-sheet, .settings-drawer, .book-grid { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input { font: inherit; }
button { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app {
  --reader-font-size: 21px;
  --reader-line-height: 1.75;
  --reader-width: 740px;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  transition: background .25s, color .25s;
}

.theme-sepia {
  --ink: #342a20;
  --muted: #766a5b;
  --faint: #6f604c;
  --accent: #925128;
  --accent-soft: #eadcc7;
  --paper: #f1e8d7;
  --surface: #f8f1e4;
  --surface-2: #eadfcd;
  --line: #ddd0ba;
  --line-strong: #cdbca1;
}

/* Dusty rose accents and lightly tinted paper keep long reading sessions calm. */
.theme-rose {
  color-scheme: light;
  --ink: #35272d;
  --muted: #725c64;
  --faint: #775e67;
  --accent: #964c65;
  --accent-soft: #f1dfe6;
  --paper: #faf1f4;
  --surface: #fffafb;
  --surface-2: #f3e6eb;
  --line: #e6d3dc;
  --line-strong: #c9abb8;
  --shadow: 0 14px 50px rgba(82, 45, 60, .08);
}

.theme-dark {
  color-scheme: dark;
  --ink: #f4eee5;
  --muted: #c4baae;
  --faint: #9f968b;
  --accent: #efa18c;
  --on-accent: #211710;
  --accent-soft: #4a2d28;
  --paper: #131310;
  --surface: #211f1a;
  --surface-2: #2b2821;
  --line: #423d33;
  --line-strong: #625a4c;
  --shadow: 0 20px 60px rgba(0, 0, 0, .28);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 78px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 30px;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  width: max-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: none;
  min-height: 44px;
  cursor: pointer;
}

.brand-icon { width: 42px; height: 42px; object-fit: contain; filter: drop-shadow(0 3px 8px rgba(25, 35, 52, .12)); }

.brand-copy { display: grid; text-align: left; }
.brand-copy strong { font: 600 20px Georgia, serif; letter-spacing: .01em; }
.brand-copy small { margin-top: 4px; color: var(--muted); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }

.location-pill {
  min-width: 205px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 24px;
  padding: 10px 14px 9px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: none;
  cursor: pointer;
  text-align: left;
}
.location-pill span { grid-column: 1; max-width: 190px; overflow: hidden; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.location-pill b { grid-column: 1; font-size: 14px; font-weight: 600; }
.location-pill .icon { grid-column: 2; grid-row: 1 / 3; color: var(--muted); font-size: 18px; }

.top-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.round-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.round-button:hover, .location-pill:hover { border-color: var(--line-strong); background: var(--surface-2); }
.reader-controls button:not(:disabled):hover, .chapter-end button:hover, .chapter-grid button:not(:disabled):hover, .book-grid button:hover { border-color: var(--accent); background: var(--accent-soft); }
.round-button .icon { font-weight: 600; }
.desktop-markers-button { position: relative; }
.desktop-markers-button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.account-button { display: inline-flex; align-items: center; justify-content: center; margin-left: 4px; border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.account-button:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }

.search-strip { position: sticky; top: 78px; z-index: 25; padding: 10px 24px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 96%, transparent); backdrop-filter: blur(18px); }
.search-shell { max-width: 820px; margin: auto; }
.search-shell form { display: flex; gap: 8px; }
.search-field { min-width: 0; height: 44px; flex: 1; display: flex; align-items: center; gap: 10px; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); }
.search-field:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.search-strip input { min-width: 0; flex: 1; border: 0; outline: none; color: var(--ink); background: transparent; }
.search-field input:focus-visible { outline: none; }
.search-strip button { border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.search-strip .search-ai { position: relative; flex: 0 0 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border-radius: 6px; color: var(--muted); transition: color .12s ease; }
.search-ai-label { font-size: 12px; line-height: 1; font-weight: 500; transition: opacity .12s ease; }
.search-ai::after { content: ""; position: absolute; top: 14px; right: -4px; bottom: 14px; width: 1px; background: var(--line); pointer-events: none; }
.search-strip .search-ai[aria-pressed="true"] { color: var(--ink); }
.search-ai[aria-pressed="true"] .search-ai-label { font-weight: 600; }
.search-ai:not(:disabled):active .search-ai-label { opacity: .55; }
.search-strip .search-ai:focus-visible { outline-color: var(--ink); outline-offset: -3px; }
@media (hover: hover) and (pointer: fine) {
  .search-strip .search-ai:not(:disabled):hover { color: var(--ink); }
  .search-ai:not(:disabled):hover .search-ai-label { opacity: .75; }
}
.search-strip .search-ai:disabled, .search-strip .search-submit:disabled { cursor: wait; opacity: .7; }
.search-shell { --ai-ink: #5642a4; --ai-tint: #f0edfc; --ai-violet: #9270ed; --ai-blue: #4bb7d1; }
.theme-dark .search-shell { --ai-ink: #d3c6ff; --ai-tint: #302744; }
/* Moving pools of color are clipped to a fixed rim; the input and its text stay still. */
.search-field { position: relative; isolation: isolate; }
.ai-search-decoration { display: contents; border-radius: inherit; }
.ai-search-aura { display: none; position: absolute; z-index: -1; inset: -2px; border-radius: inherit; pointer-events: none; }
.search-field.is-ai { border-color: transparent; }
.search-field.is-ai .ai-search-aura, .search-field.is-ai ~ .search-submit .ai-search-aura { display: block; }
.ai-search-aura-rim { position: absolute; inset: 0; overflow: hidden; padding: 2px; border-radius: inherit; background: linear-gradient(115deg, #b4ed70, #79dbe7 32%, #b99aff 62%, #ffb58a); mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); mask-composite: exclude; }
.ai-search-aura-rim i { position: absolute; top: -100%; left: 15%; width: 70%; height: 300%; background: radial-gradient(ellipse, var(--aura-color) 12%, transparent 66%); animation: ai-aura-drift 4s linear infinite paused; }
.ai-search-aura-rim i:nth-child(1) { --aura-color: #b5f36b; transform: translate3d(-65%, -8%, 0); }
.ai-search-aura-rim i:nth-child(2) { --aura-color: #69dbf4; animation-delay: -1s; transform: translate3d(5%, 12%, 0); }
.ai-search-aura-rim i:nth-child(3) { --aura-color: #b394ff; animation-delay: -2s; transform: translate3d(65%, -8%, 0); }
.ai-search-aura-rim i:nth-child(4) { --aura-color: #ffa878; animation-delay: -3s; transform: translate3d(5%, -24%, 0); }
.ai-search-aura-glow { position: absolute; inset: -1px; border-radius: inherit; filter: blur(5px); opacity: .55; }
.ai-search-aura-glow .ai-search-aura-rim { padding: 3px; }
.search-field.is-ai[data-motion-active="true"] .ai-search-aura-rim i, .search-field.is-ai[data-motion-active="true"] ~ .search-submit .ai-search-aura-rim i { animation-play-state: running; }
.search-field.is-ai:focus-within { outline: none; }
.search-field.is-ai:focus-within .ai-search-aura-glow { opacity: .8; }
.search-field.is-ai:has(input:focus-visible) .ai-search-aura-rim { padding: 3px; }
.search-field.is-ai input { caret-color: var(--ai-ink); }
.search-scope .ai-search-hint { color: var(--ai-ink); }
.search-strip .ai-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; padding: 3px 6px; border-radius: 5px; background: var(--ai-tint); color: var(--ai-ink); font: 700 10px/1.3 ui-sans-serif, system-ui, sans-serif; letter-spacing: .02em; }
.search-group-title { display: flex; align-items: center; gap: 8px; margin: 16px 10px 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.search-group-title:first-child { margin-top: 8px; }
.search-result-list .ai-search-result { background: color-mix(in srgb, var(--ai-tint) 35%, var(--surface)); }
.search-result-list .ai-search-result:hover { background: var(--ai-tint); }
.ai-search-empty, .ai-search-loading { margin: 0; padding: 14px 10px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.ai-search-loading { display: flex; align-items: center; gap: 12px; }
.ai-loading-orbit { width: 18px; height: 18px; flex: 0 0 18px; border: 2px solid var(--ai-tint); border-top-color: var(--ai-ink); border-radius: 50%; animation: ai-orbit 1s linear infinite; }
@keyframes ai-aura-drift {
  0%, 100% { transform: translate3d(-65%, -8%, 0); }
  25% { transform: translate3d(5%, 12%, 0); }
  50% { transform: translate3d(65%, -8%, 0); }
  75% { transform: translate3d(5%, -24%, 0); }
}
@keyframes ai-orbit { to { transform: rotate(360deg); } }
.search-strip .search-clear { position: relative; isolation: isolate; flex: 0 0 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
.search-strip .search-clear::before { content: ""; position: absolute; z-index: -1; inset: 6px; border-radius: 7px; }
.search-strip .search-clear:hover::before, .search-strip .search-clear:active::before { background: var(--surface-2); }
.search-strip .search-clear:hover { color: var(--ink); }
.search-strip .search-submit { min-width: 86px; padding: 0 18px; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; }
.search-strip .search-submit:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.search-submit-label { position: relative; }
.search-strip .search-field.is-ai ~ .search-submit { position: relative; isolation: isolate; color: #fff; background: #282334; }
@media (hover: hover) and (pointer: fine) { .search-strip .search-field.is-ai ~ .search-submit:hover { background: #383047; } }
.search-strip .search-field.is-ai ~ .search-submit:focus-visible { outline: 2px solid var(--ai-ink); outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) {
  .ai-search-aura-rim i, .ai-loading-orbit { animation: none; }
}
@media (forced-colors: active) {
  .search-field.is-ai { border-color: Highlight; }
  .search-field.is-ai:focus-within { outline: 2px solid Highlight; outline-offset: 2px; }
  .search-field.is-ai .ai-search-aura, .search-field.is-ai ~ .search-submit .ai-search-aura { display: none; }
  .search-strip .search-field.is-ai ~ .search-submit { border: 1px solid ButtonText; color: ButtonText; background: ButtonFace; }
}
.search-scope { margin: 8px 3px 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 18px; color: var(--faint); font-size: 12px; line-height: 1.5; }
.search-recent-shell { position: relative; z-index: 24; max-width: 820px; margin: 10px auto 0; padding: 0 12px; }
.recent-history { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 13px; background: color-mix(in srgb, var(--surface) 96%, transparent); box-shadow: 0 9px 28px rgba(35, 27, 20, .08); }
.recent-history-row { min-width: 0; display: grid; grid-template-columns: 100px minmax(0, 1fr); align-items: center; gap: 10px; }
.recent-history-row > span { color: var(--faint); font-size: 10px; line-height: 1.4; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.recent-history-row > div { min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.recent-history-row > div::-webkit-scrollbar { display: none; }
.recent-history-row button { flex: 0 0 auto; display: flex; align-items: baseline; gap: 5px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--ink); cursor: pointer; }
.recent-history-row button:hover { border-color: var(--line-strong); background: var(--accent-soft); }
.recent-history-row b { font: 600 12px/1.4 Georgia, serif; }
.recent-history-row small { flex-shrink: 0; color: var(--accent); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.search-state { padding: 24px 10px 16px; color: var(--muted); font: italic 14px Georgia, serif; text-align: center; }
.search-state.error { color: var(--accent); }
.global-search-results { margin-top: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.search-results-head { min-height: 58px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 6px 10px 6px 15px; border-bottom: 1px solid var(--line); }
.search-results-head b { min-width: 0; font: 600 15px Georgia, serif; font-variant-numeric: tabular-nums; }
.search-testaments { display: flex; flex-shrink: 0; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.search-testaments button { min-width: 44px; min-height: 44px; padding: 0 10px; border: 1px solid transparent; border-radius: 7px; color: var(--faint); font-size: 11px; font-weight: 600; }
.search-testaments button:hover { background: var(--surface); color: var(--ink); }
.search-testaments button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.search-result-list { max-height: min(58vh, 620px); overflow-y: auto; overscroll-behavior: contain; }
.search-result-list > button { width: 100%; display: block; padding: 13px 15px; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.search-result-list > button:hover { background: var(--surface-2); }
.search-result-list > button > span { display: flex; align-items: center; gap: 8px; }
.search-result-list b { color: var(--accent); font-size: 11px; }
.search-result-list i { margin-left: auto; flex-shrink: 0; padding: 3px 6px; border-radius: 4px; background: var(--surface-2); color: var(--faint); font-size: 10px; font-style: normal; }
.search-result-list p { margin: 5px 0 0; color: var(--ink); font: 15px/1.55 Georgia, serif; overflow-wrap: anywhere; }
.search-strip .search-more { width: 100%; min-height: 44px; padding: 13px; background: var(--surface-2); color: var(--accent); font-size: 11px; font-weight: 700; }
.search-strip .search-more:hover { background: var(--accent-soft); }
.russian-search-note { margin: 0; padding: 11px 15px; background: var(--accent-soft); color: var(--muted); font-size: 10px; line-height: 1.45; }

.layout {
  min-height: calc(100vh - 78px);
  display: grid;
  grid-template-columns: 258px minmax(520px, 1fr) 286px;
}

.rail {
  position: sticky;
  top: 78px;
  height: calc(100vh - 78px);
  padding: 30px 18px 22px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 46%, var(--paper));
  overflow-y: auto;
}

.rail-section + .rail-section { margin-top: 30px; }
.rail-label { display: block; margin: 0 10px 12px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.book-current { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 11px 10px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; text-align: left; }
.book-current:hover { background: var(--surface); }
.book-icon { width: 36px; height: 42px; display: grid; place-items: center; border-radius: 3px 8px 8px 3px; background: var(--accent); box-shadow: inset 4px 0 rgba(255,255,255,.16); color: var(--on-accent); font: 700 17px Georgia, serif; }
.book-current b, .book-current small { display: block; }
.book-current b { font: 600 14px/1.3 Georgia, serif; text-wrap: balance; }
.book-current small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.book-current > .icon { color: var(--faint); }

.chapter-list { display: grid; gap: 4px; }
.chapter-list > button { position: relative; width: 100%; display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 8px; padding: 9px 10px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; text-align: left; }
.chapter-list > button:hover { background: var(--surface); }
.chapter-list > button.active { background: var(--accent-soft); box-shadow: none; }
.chapter-list > button > span:first-child { color: var(--muted); font: 500 18px Georgia, serif; text-align: center; }
.chapter-list > button.active > span:first-child, .chapter-list > button.active b { color: var(--accent); }
.chapter-list b, .chapter-list small { display: block; }
.chapter-list b { font-size: 12px; }
.chapter-list small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.chapter-list button i { position: absolute; right: 0; width: 3px; height: 23px; border-radius: 3px 0 0 3px; background: var(--accent); }
.future-chapters { margin-top: 7px; padding: 10px; display: flex; gap: 5px; align-items: center; border-top: 1px solid var(--line); color: var(--faint); }
.future-chapters span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; font-size: 11px; }
.future-chapters em { margin-left: auto; font-size: 9px; font-style: normal; letter-spacing: .08em; text-transform: uppercase; }

.rail-note { margin-top: 22px; display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 13px; border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line)); border-radius: 12px; background: var(--accent-soft); }
.rail-note .icon { color: var(--accent); }
.rail-note p { margin: 0; }
.rail-note b, .rail-note span { display: block; }
.rail-note b { color: var(--accent); font-size: 11px; }
.rail-note span { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }

.reader-column { min-width: 0; padding: 56px clamp(38px, 5vw, 88px) 100px; }
.reader-head { max-width: var(--reader-width); margin: 0 auto; text-align: center; }
.eyebrow { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.eyebrow span { width: 26px; height: 1px; background: color-mix(in srgb, var(--accent) 50%, transparent); }
.reader-head h1 { margin: 20px 0 2px; font: 400 clamp(38px, 4.2vw, 58px)/1.06 Georgia, "Times New Roman", serif; letter-spacing: -.025em; text-wrap: balance; }
.reader-head h1 b { font-weight: 400; }
.reader-head h1 i { color: var(--accent); font-style: normal; }
.reader-head > p { margin: 10px 0 18px; color: var(--muted); font: italic 16px Georgia, serif; }
.reader-head > .chapter-description { line-height: 1.5; text-wrap: balance; }
.chapter-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; color: var(--muted); font-size: 11px; letter-spacing: .02em; }
.chapter-facts b { font-weight: 400; font-variant-numeric: tabular-nums; }
.chapter-facts span { display: flex; align-items: center; gap: 5px; }
.chapter-facts .icon { font-size: 13px; }

.reader-controls { max-width: var(--reader-width); margin: 24px auto 28px; padding-bottom: 18px; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; }
.reader-toggles, .reader-actions { display: flex; align-items: center; gap: 6px; min-width: 0; }
.reader-controls button { min-height: 40px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; white-space: nowrap; }
.reader-controls button.active { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); background: var(--accent-soft); }
.reader-controls button:disabled { cursor: default; opacity: .78; }
.reader-controls .icon, .reader-controls .original-icon { width: 18px; height: 18px; flex: 0 0 18px; color: inherit; }
.reader-actions button { border-color: transparent; }
.reader-controls .copy-control:disabled { opacity: .55; }
.reader-controls .copy-control.active { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.reader-controls .markers-control.active { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.reader-controls .markers-control b { min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 4px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 8px; }
.reader-controls .future-control { opacity: .55; }
.reader-controls .future-control em { font-size: 9px; font-style: normal; }
.switch { width: 25px; height: 14px; padding: 2px; border-radius: 12px; background: var(--line-strong); transition: .2s; }
.switch::after { content: ""; display: block; width: 10px; height: 10px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .2s; }
.reader-controls button.active .switch { background: var(--accent); }
.reader-controls button.active .switch::after { transform: translateX(11px); }
.results-note { max-width: var(--reader-width); margin: 0 auto 18px; color: var(--muted); font-size: 12px; }

.verses { max-width: var(--reader-width); margin: 0 auto; }
.verse { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 16px; margin: 0 -20px; padding: 8px 20px 13px; border: 1px solid transparent; border-radius: 12px; cursor: pointer; transition: background .18s, border-color .18s; }
.verse { -webkit-tap-highlight-color: transparent; }
.verse:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.verse.selected { z-index: 2; border-color: var(--line-strong); background: var(--surface); box-shadow: none; }
.verse.selected.selection-joins-previous { margin-top: -1px; border-top-color: transparent; border-top-left-radius: 0; border-top-right-radius: 0; }
.verse.selected.selection-joins-next { border-bottom-color: transparent; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.verse.selection-anchor { z-index: 4; }
.verse.marked { background: color-mix(in srgb, var(--marker) 30%, transparent); }
.verse.marked.marker-joins-previous { border-top-left-radius: 2px; border-top-right-radius: 2px; }
.verse.marked.marker-joins-next { border-bottom-left-radius: 2px; border-bottom-right-radius: 2px; }
.verse.marked.selected { background: color-mix(in srgb, var(--marker) 22%, var(--surface)); }
.verse.marked .english { color: color-mix(in srgb, var(--ink) 88%, var(--marker)); }
.marker-yellow { --marker: #f4c94e; }
.marker-green { --marker: #8bc69b; }
.marker-blue { --marker: #85bfe0; }
.marker-rose { --marker: #e8a2a4; }
.marker-lemon { --marker: #e4d77a; }
.marker-peach { --marker: #edb88e; }
.marker-coral { --marker: #eaa08b; }
.marker-blush { --marker: #e6bac9; }
.marker-lilac { --marker: #c6b1de; }
.marker-honey { --marker: #d9b963; }
.marker-apricot { --marker: #e6ab75; }
.marker-terracotta { --marker: #cd9582; }
.marker-mauve { --marker: #c99bae; }
.marker-lavender { --marker: #b5a6d5; }
.marker-sand { --marker: #d6c39a; }
.marker-caramel { --marker: #c6a583; }
.marker-clay { --marker: #bc9b8c; }
.marker-heather { --marker: #b5a0b9; }
.marker-periwinkle { --marker: #a2aed9; }
.marker-ice { --marker: #b5d4dc; }
.marker-aqua { --marker: #8ecbd0; }
.marker-mint { --marker: #a8d6bd; }
.marker-pistachio { --marker: #c4d29a; }
.marker-olive { --marker: #b9bd86; }
.marker-cornflower { --marker: #93b0d9; }
.marker-turquoise { --marker: #78bebc; }
.marker-seafoam { --marker: #8fc4ad; }
.marker-fern { --marker: #9dbb8e; }
.marker-moss { --marker: #a5b28b; }
.marker-slate { --marker: #9cabbc; }
.marker-lagoon { --marker: #85afb3; }
.marker-eucalyptus { --marker: #95b3a5; }
.marker-sage { --marker: #a9b6a0; }
.marker-stone { --marker: #b7afa1; }
.verse-number { width: 32px; height: 32px; margin-top: 2px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--accent); cursor: pointer; font: 600 12px Georgia, serif; }
.verse:hover .verse-number, .verse.selected .verse-number { background: var(--accent-soft); }
.russian { margin: 0; color: var(--ink); font: 400 var(--reader-font-size)/var(--reader-line-height) Georgia, "Times New Roman", serif; letter-spacing: .002em; text-wrap: pretty; }
.russian em, .english em { font-style: italic; }
.kjv-primary { color: var(--ink); }
.source-label { display: inline-flex; margin-right: 9px; color: var(--accent); font: 700 8px/1 Inter, sans-serif; letter-spacing: .13em; vertical-align: .24em; }
.paragraph-start { margin-top: 18px; }
.english { margin: 12px 0 3px; padding-left: 13px; border-left: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); color: var(--muted); font: 400 calc(var(--reader-font-size) * .71)/1.55 Georgia, serif; }
.english-source { display: block; margin-bottom: 3px; color: var(--accent); font: 700 8px/1 Inter, sans-serif; letter-spacing: .14em; }
.parallel-row { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.parallel-row > span { margin-right: 3px; color: var(--faint); font-size: 9px; letter-spacing: .09em; text-transform: uppercase; }
.parallel-row button { min-height: 28px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--accent); cursor: pointer; font-size: 11px; }
.marker-dot { position: absolute; top: 15px; right: 11px; width: 5px; height: 5px; border-radius: 50%; background: var(--marker); }
.verse-tools { position: absolute; z-index: 6; bottom: calc(100% + 6px); left: 52px; display: flex; align-items: center; gap: 2px; width: max-content; padding: 4px; border-radius: 12px; background: var(--surface); box-shadow: 0 6px 24px rgba(56, 43, 31, .18); cursor: default; }
.verse-tools[data-placement="below"] { top: calc(100% + 6px); bottom: auto; }
.verse-tools button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 36px; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.verse-tools button:hover { background: var(--surface-2); color: var(--ink); }
.verse-tools .verse-color-strip button::before { content: ''; width: 18px; height: 18px; border-radius: 50%; background: var(--marker); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.verse-tools button.chosen::before { outline: 2px solid var(--accent); outline-offset: 3px; }
/* Only the color strip scrolls; the three actions keep their fixed positions. */
.verse-color-strip { --color-size: 36px; --color-gap: 2px; display: flex; align-items: center; gap: var(--color-gap); flex: 0 0 calc(4 * var(--color-size) + 3 * var(--color-gap)); width: calc(4 * var(--color-size) + 3 * var(--color-gap)); min-width: 0; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: none; user-select: none; }
.verse-color-strip::-webkit-scrollbar { display: none; }
.verse-color-strip button { scroll-snap-align: start; }
.verse-color-strip button:focus-visible { outline-offset: -2px; }
.verse-tools .tool-action { color: var(--muted); }
.verse-tools .note-action { color: var(--accent); }

.empty-state { max-width: var(--reader-width); min-height: 260px; margin: auto; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--muted); text-align: center; }
.empty-state .icon { font-size: 34px; color: var(--faint); }
.empty-state span { font-size: 12px; }
.chapter-end { max-width: var(--reader-width); margin: 65px auto 0; padding-top: 22px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); }
.chapter-end > span { color: var(--faint); font-size: 10px; letter-spacing: .11em; text-transform: uppercase; }
.chapter-end button { min-width: 145px; display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 20px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; text-align: left; }
.chapter-end button small, .chapter-end button b { display: block; }
.chapter-end button small { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.chapter-end button b { margin-top: 2px; font: 600 14px Georgia, serif; }
.chapter-end button .icon { color: var(--accent); }
.translation-copyright { max-width: var(--reader-width); margin: 56px auto 0; padding-top: 22px; display: grid; grid-template-columns: .8fr 1.25fr .75fr; gap: 28px; border-top: 1px solid var(--line); }
.translation-copyright p { margin: 0; }
.translation-copyright span, .translation-copyright b { display: block; }
.translation-copyright span { margin-bottom: 6px; color: var(--faint); font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.translation-copyright b { color: var(--muted); font-size: 10px; font-weight: 400; line-height: 1.55; }
.translation-copyright a { color: inherit; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); text-underline-offset: 2px; }
.translation-copyright .salvation-link { grid-column: 1 / -1; justify-self: start; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--accent); background: var(--surface); font-size: 13px; font-weight: 500; text-decoration: none; }
.translation-copyright .salvation-link:hover { border-color: var(--accent); background: var(--accent-soft); }
.translation-copyright .salvation-link .icon { margin: 0; color: inherit; }

.modal-backdrop.account-backdrop, .static-sheet.account-backdrop { align-items: center; }
.chapter-sheet.account-sheet, .static-sheet .account-sheet { width: min(460px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; overscroll-behavior: contain; }
.account-backdrop[data-closing="true"] { pointer-events: none; }
.account-sheet .account-description { margin: 16px 0 22px; font-size: 13px; line-height: 1.6; }
.account-providers { display: grid; gap: 10px; }
.account-providers button { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 13px; text-align: left; cursor: default; }
.account-providers small { flex-shrink: 0; color: var(--accent); font-size: 11px; }
.account-benefits { margin-top: 28px; }
.account-benefits h3 { margin: 0 0 12px; color: var(--ink); font-size: 13px; font-weight: 600; }
.account-benefits ul { display: grid; gap: 12px; margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.account-benefits li::marker { color: var(--accent); }

.context-panel { position: sticky; top: 78px; height: calc(100vh - 78px); padding: 34px 24px; border-left: 1px solid var(--line); background: color-mix(in srgb, var(--surface-2) 45%, var(--paper)); overflow-y: auto; }
.context-card { min-height: 200px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.context-card:has(.context-empty) { min-height: 180px; padding: 12px; border-color: transparent; background: transparent; }
.context-kicker, .context-label { color: var(--faint); font-size: 9px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.context-card h2 { margin: 10px 0 9px; color: var(--accent); font: 600 20px Georgia, serif; }
.context-card > p { margin: 0; color: var(--ink); font: 15px/1.65 Georgia, serif; }
.context-divider { height: 1px; margin: 18px 0; background: var(--line); }
.context-links { display: grid; gap: 5px; margin-top: 9px; }
.context-links button { display: flex; justify-content: space-between; padding: 7px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--accent); cursor: pointer; font-size: 11px; text-align: left; }
.context-links button i { color: var(--faint); font-size: 8px; font-style: normal; }
.context-links .all-refs { margin-top: 7px; justify-content: center; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-weight: 700; }
.context-links small { color: var(--muted); line-height: 1.5; }
.context-empty { min-height: 150px; display: grid; place-items: center; align-content: center; color: var(--faint); text-align: center; }
.context-empty .icon { font-size: 22px; }
.context-empty p { max-width: 190px; margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.reading-tip { margin-top: 16px; padding: 20px 0; border-top: 1px solid var(--line); }
.reading-tip span { color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.reading-tip p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }

.mobile-nav { display: none; }
.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; padding: 20px; background: rgba(22, 18, 15, .42); backdrop-filter: blur(5px); animation: fade .18s ease-out; }
.chapter-sheet { width: min(580px, 100%); padding: 12px 24px 28px; border-radius: 20px; background: var(--surface); box-shadow: 0 30px 90px rgba(0,0,0,.25); animation: rise .25s ease-out; }
.sheet-handle { width: 38px; height: 4px; margin: 0 auto 13px; border-radius: 4px; background: var(--line-strong); }
.sheet-head, .settings-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head > div { min-width: 0; }
.sheet-head small, .settings-head small { color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.sheet-head h2, .settings-head h2 { max-width: 680px; margin: 4px 0 0; font: 500 25px/1.18 Georgia, serif; text-wrap: balance; overflow-wrap: anywhere; }
.sheet-head button, .settings-head button { width: 44px; height: 44px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-2); cursor: pointer; font-size: 22px; }
.chapter-sheet > p { margin: 20px 0 10px; color: var(--muted); font-size: 11px; }
.chapter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.chapter-grid button { min-height: 82px; display: grid; align-content: center; gap: 3px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); cursor: pointer; text-align: center; }
.chapter-grid button b { font: 500 22px Georgia, serif; }
.chapter-grid button span { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.chapter-grid button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chapter-grid button:disabled { opacity: .45; cursor: default; }

.language-notice {
  max-width: var(--reader-width);
  margin: 24px auto -13px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 11px;
  padding: 13px 15px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 11px;
  background: var(--accent-soft);
}
.language-notice > span { padding-top: 2px; color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.language-notice p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.language-notice b { color: var(--ink); }

.modal-backdrop.library-backdrop, .static-sheet.library-backdrop {
  --library-viewport-height: 100vh;
  top: var(--library-viewport-top, 0px);
  bottom: auto;
  height: var(--library-viewport-height);
  padding: max(12px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
}
@supports (height: 100dvh) {
  .modal-backdrop.library-backdrop, .static-sheet.library-backdrop { --library-viewport-height: 100dvh; }
}
.library-sheet {
  width: min(840px, 100%);
  max-height: min(820px, 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.library-sheet > .sheet-handle, .library-sheet > .sheet-head, .library-sheet > .book-search, .library-sheet > .library-view-toolbar { flex-shrink: 0; }
.library-views { position: relative; display: grid; grid-template-rows: minmax(0, 1fr); flex: 1 1 auto; min-height: min(360px, max(0px, calc(var(--library-viewport-height) - 280px))); }
.library-standard-view { min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
/* The standard view reserves the same space while the alternate view fills it. */
.library-standard-view[aria-hidden="true"] { visibility: hidden; pointer-events: none; }
.book-search {
  height: 42px;
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.book-search:focus-within, .search-strip label:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.book-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.testament-tabs { display: flex; gap: 6px; margin: 11px 0; }
.testament-tabs button { min-height: 36px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; }
.testament-tabs button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.library-view-toolbar { display: flex; align-items: center; gap: 8px; }
.library-view-toolbar .testament-tabs { flex: 1; }
.library-view-toggle { appearance: none; -webkit-appearance: none; flex-shrink: 0; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--muted); cursor: pointer; touch-action: manipulation; }
.library-view-toggle span { display: flex; }
.library-view-toggle[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.book-navigator { position: absolute; inset: 0; display: flex; flex-direction: column; min-height: 0; padding-top: 6px; }
.book-navigator-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); flex: 1; min-height: 0; gap: 24px; }
.book-navigator-columns[hidden] { display: none; }
.navigator-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.navigator-column-head { display: flex; align-items: baseline; justify-content: space-between; flex-shrink: 0; gap: 8px; margin-bottom: 12px; padding: 0 12px; }
.navigator-column-head > span { font-size: 13px; font-weight: 600; }
.navigator-column-head small { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.navigator-wheel-frame { position: relative; flex: 1; min-height: 0; }
.navigator-options { position: relative; height: 100%; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; padding: 4px; border-radius: 12px; background: var(--paper); }
.navigator-options:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.navigator-options [role="option"] { min-width: 0; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 12px; border-radius: 7px; color: var(--muted); cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; transition: color .16s ease-out, background-color .16s ease-out; }
.navigator-options [role="option"][aria-selected="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.navigator-row { display: flex; align-items: center; justify-content: inherit; gap: 8px; width: 100%; height: 100%; }
.navigator-books .navigator-row > span { flex: 1; min-width: 0; font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.navigator-books [role="option"] small { font-size: 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.navigator-chapters .navigator-options { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: 44px; align-content: start; gap: 4px; }
.navigator-chapters [role="option"] { justify-content: center; height: 44px; padding: 0; border-radius: 10px; font-size: 13px; font-variant-numeric: lining-nums tabular-nums; }
.navigator-footer { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; gap: 12px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.navigator-hint { color: var(--muted); font-size: 12px; }
.navigator-open { appearance: none; -webkit-appearance: none; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border: 0; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-size: 13px; cursor: pointer; touch-action: manipulation; }
.navigator-open:disabled { opacity: .5; cursor: default; }
.navigator-open b { font-weight: 600; }
.navigator-empty { padding: 40px 12px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.6; }
@media (hover: hover) and (pointer: fine) {
  .library-view-toggle:hover { border-color: var(--accent); color: var(--accent); }
  .navigator-options [role="option"]:hover { background: var(--surface-2); color: var(--ink); }
  .navigator-open:not(:disabled):hover { background: color-mix(in srgb, var(--accent) 90%, var(--ink)); }
}
@media (max-width: 820px) {
  .modal-backdrop.library-backdrop, .static-sheet.library-backdrop { padding: max(10px, env(safe-area-inset-top, 0px)) max(8px, env(safe-area-inset-right, 0px)) max(10px, env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); }
  .library-views { min-height: 0; }
  .book-navigator { --wheel-row: 60px; }
  .library-view-toolbar .testament-tabs { gap: 5px; }
  .library-view-toolbar .testament-tabs button { min-height: 44px; padding: 8px 9px; }
  .book-navigator-columns { grid-template-columns: minmax(0, 1fr) 96px; gap: 12px; }
  .navigator-column-head { height: 24px; align-items: center; padding: 0 10px; margin-bottom: 8px; }
  .navigator-column-head small { font-size: 10px; white-space: nowrap; }
  .navigator-chapters .navigator-column-head { justify-content: center; padding: 0; gap: 5px; }
  .navigator-wheel-frame { isolation: isolate; overflow: hidden; }
  .navigator-options, .navigator-chapters .navigator-options { display: block; padding: 0; scroll-snap-type: y mandatory; scroll-padding-block: calc((100% - var(--wheel-row)) / 2); scrollbar-width: none; border-radius: 0; background: transparent; touch-action: pan-y pinch-zoom; cursor: grab; }
  .navigator-options::before, .navigator-options::after { content: ""; display: block; height: calc((100% - var(--wheel-row)) / 2); }
  .navigator-options::-webkit-scrollbar { display: none; }
  .navigator-options[data-dragging="true"] { cursor: grabbing; }
  .navigator-options [role="option"], .navigator-chapters [role="option"] { position: relative; height: var(--wheel-row); border-radius: 0; scroll-snap-align: center; background: transparent; -webkit-user-select: none; transition: none; cursor: inherit; }
  .navigator-row { transform-origin: center; backface-visibility: hidden; }
  .navigator-options [role="option"][aria-selected="true"] { background: transparent; }
  .navigator-options [role="option"]:hover { background: transparent; }
  .navigator-wheel-frame::before { content: ""; position: absolute; top: 50%; height: var(--wheel-row); left: 0; right: 0; transform: translateY(-50%); background: var(--surface-2); border-radius: 10px; pointer-events: none; }
  .navigator-wheel-frame:has(.navigator-options:focus-visible)::before { outline: 2px solid var(--accent); outline-offset: -2px; }
  .navigator-options:focus-visible { outline: none; }
  .navigator-books .navigator-row > span { font-size: 17px; font-weight: inherit; line-height: 1.25; }
  .navigator-books [role="option"] small { display: none; }
  .navigator-chapters .navigator-row { font-size: 17px; line-height: 1.25; }
  .navigator-footer { display: block; margin-top: 10px; padding-top: 14px; }
  .navigator-hint { display: block; text-align: center; margin-bottom: 12px; }
  .navigator-open { width: 100%; }
}
@media (max-width: 820px) and (max-height: 740px) {
  .book-navigator { --wheel-row: 52px; }
  .navigator-footer { margin-top: 8px; padding-top: 10px; }
  .navigator-hint { display: none; }
}
@media (max-width: 360px) {
  .library-view-toolbar .testament-tabs { gap: 4px; }
  .library-view-toolbar .testament-tabs button { padding-inline: 6px; font-size: 10px; }
  .library-view-toggle { width: 44px; }
}
@media (max-height: 500px) {
  .library-sheet { overflow-y: auto; }
  .library-views { flex: 0 0 260px; min-height: 260px; }
}
.library-backdrop[data-compact="true"] .library-sheet { overflow-y: auto; }
.library-backdrop[data-compact="true"] .library-views { flex: 0 0 260px; min-height: 260px; }
.library-backdrop[data-compact="true"] .book-navigator { --wheel-row: 52px; }
.library-backdrop[data-compact="true"] .navigator-footer { margin-top: 8px; padding-top: 10px; }
.library-backdrop[data-compact="true"] .navigator-hint { display: none; }
@media (prefers-reduced-motion: reduce) {
  .navigator-options [role="option"] { transition: none; }
}
.book-grid { max-height: 300px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 2px 2px 10px; overflow-y: auto; }
.book-grid button { min-width: 0; min-height: 52px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 3px 8px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); cursor: pointer; text-align: left; }
.book-grid button b { grid-row: 1 / 3; color: var(--accent); font-size: 9px; }
.book-grid button span { font-size: 12px; font-weight: 600; line-height: 1.32; text-wrap: balance; overflow-wrap: anywhere; }
.book-grid button small { grid-column: 2; color: var(--muted); font-size: 10px; white-space: nowrap; }
.book-grid button.active { border-color: var(--accent); background: var(--accent-soft); }
/* Muted group hues blend into each theme's paper; text keeps theme contrast. */
.book-group-law { --book-group-color: #967445; }
.book-group-history { --book-group-color: #64846c; }
.book-group-poetry { --book-group-color: #a07b42; }
.book-group-major { --book-group-color: #80709c; }
.book-group-minor { --book-group-color: #a76f7b; }
.book-group-gospels { --book-group-color: #598999; }
.book-group-acts { --book-group-color: #729087; }
.book-group-paul { --book-group-color: #697fa8; }
.book-group-general { --book-group-color: #a17d69; }
.book-group-revelation { --book-group-color: #92768f; }
.book-grid.divided-books button { background: color-mix(in srgb, var(--book-group-color) 12%, var(--paper)); border-color: color-mix(in srgb, var(--book-group-color) 40%, var(--line)); border-left: 3px solid var(--book-group-color); }
.book-grid.divided-books button b { color: var(--ink); }
.book-grid.divided-books button small { color: var(--muted); }
.book-grid.divided-books button:hover { background: color-mix(in srgb, var(--book-group-color) 20%, var(--paper)); }
.book-grid.divided-books button.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.theme-dark .book-grid.divided-books button { background: color-mix(in srgb, var(--book-group-color) 18%, var(--paper)); }
.theme-dark .book-grid.divided-books button:hover { background: color-mix(in srgb, var(--book-group-color) 26%, var(--paper)); }
.no-books, .no-refs { grid-column: 1 / -1; padding: 28px; color: var(--muted); text-align: center; font-size: 11px; }
.library-chapters-head { display: flex; justify-content: space-between; margin: 14px 2px 9px; color: var(--faint); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.chapter-grid.compact { grid-template-columns: repeat(10, 1fr); }
.chapter-grid.compact button { min-height: 44px; }
.chapter-grid.compact button b { font-size: 15px; }

.refs-sheet { width: min(600px, 100%); max-height: min(82vh, 720px); overflow-y: auto; }
.refs-sheet > p { margin: 17px 0 10px; color: var(--muted); font-size: 10px; }
.refs-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.ref-card { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--accent); cursor: pointer; text-align: left; }
.ref-card span { font-size: 11px; font-weight: 650; }
.ref-card i { color: var(--faint); font-size: 8px; font-style: normal; white-space: nowrap; }
.empty-state button { margin-top: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--accent); cursor: pointer; }

.markers-sheet { width: min(680px, 100%); max-height: min(86vh, 760px); overflow-y: auto; }
.markers-summary { margin: 16px 0 11px; }
.markers-list { display: grid; gap: 8px; }
.marked-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); overflow: hidden; }
.marked-jump { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 12px 13px; border: 0; background: transparent; color: var(--ink); cursor: pointer; text-align: left; }
.marked-jump:hover { background: var(--surface-2); }
.marked-jump > span { min-width: 0; }
.marked-jump b, .marked-jump small { display: block; }
.marked-jump b { color: var(--accent); font: 600 13px Georgia, serif; }
.marked-jump small { margin-top: 4px; overflow: hidden; display: -webkit-box; color: var(--muted); font: 11px/1.45 Georgia, serif; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.marked-jump .icon { color: var(--faint); font-size: 17px; }
.marked-swatch { width: 9px; height: 32px; border-radius: 7px; background: var(--marker, var(--accent)); }
.marked-remove { width: 44px; min-height: 44px; border: 0; border-left: 1px solid var(--line); background: var(--surface); color: var(--faint); cursor: pointer; font-size: 19px; }
.marked-remove:hover { color: var(--accent); background: var(--accent-soft); }

.copy-toast { position: fixed; z-index: 120; left: var(--toast-x); top: var(--toast-y); display: flex; align-items: center; gap: 8px; padding: 10px 13px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); border-radius: 11px; background: color-mix(in srgb, var(--surface) 96%, transparent); box-shadow: 0 12px 36px rgba(24, 20, 16, .18); color: var(--ink); pointer-events: none; transform: translate(12px, 12px); animation: toast-in .16s ease-out; }
.copy-toast .icon { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 10px; }
.copy-toast span { font-size: 11px; font-weight: 650; white-space: nowrap; }
.reference-return { position: fixed; z-index: 70; right: 24px; bottom: 24px; display: flex; align-items: center; gap: 8px; padding: 10px 13px; border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--surface) 95%, transparent); box-shadow: 0 12px 34px rgba(24, 20, 16, .16); color: var(--muted); backdrop-filter: blur(14px); cursor: pointer; animation: rise .18s ease-out; }
.reference-return:hover { background: var(--accent-soft); color: var(--ink); }
.reference-return .icon { color: var(--accent); font-size: 15px; }
.reference-return span { font-size: 10px; white-space: nowrap; }
.reference-return b { color: var(--ink); font: 600 11px Georgia, serif; }
.markers-empty { min-height: 230px; display: grid; place-items: center; align-content: center; gap: 7px; color: var(--muted); text-align: center; }
.markers-empty .icon { color: var(--accent); font-size: 25px; }
.markers-empty b { color: var(--ink); font: 500 17px Georgia, serif; }
.markers-empty span { max-width: 290px; font-size: 12px; line-height: 1.6; }

.chapter-list.full { padding-right: 2px; }
.chapter-list.full > button { min-height: 50px; }
.chapter-end { gap: 10px; }
.chapter-end > button { flex: 1; }
.chapter-end > button.next { margin-left: auto; }
.chapter-end > button.previous { grid-template-columns: auto 1fr; }
.chapter-end > button.next { grid-template-columns: 1fr auto; }

.settings-drawer { width: min(440px, 100%); height: 100%; margin-left: auto; display: flex; flex-direction: column; background: var(--surface); box-shadow: -16px 0 64px rgba(22,18,15,.16); overflow: hidden; animation: slide .25s ease-out; }
.settings-backdrop, .modal-backdrop:has(.settings-drawer) { padding: 0; align-items: stretch; justify-content: stretch; }
.settings-head { flex: 0 0 auto; gap: 16px; padding: 24px 28px 20px; border-bottom: 1px solid var(--line); }
.settings-head h2 { margin: 0; font: 500 25px/1.2 Georgia, serif; letter-spacing: -.025em; }
.settings-head button { width: 44px; height: 44px; flex: 0 0 44px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); }
.settings-head button:hover { background: var(--surface-2); color: var(--ink); }
.settings-body { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 26px 28px 12px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.settings-section { padding: 0 0 24px; }
.settings-section + .settings-section { padding-top: 24px; border-top: 1px solid var(--line); }
.settings-section h3 { margin: 0 0 16px; color: var(--muted); font-size: 12px; line-height: 1.4; font-weight: 600; }
.theme-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.theme-options button { display: grid; gap: 10px; padding: 0 0 5px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; line-height: 1.4; }
.theme-options button.chosen { color: var(--ink); font-weight: 600; }
.theme-swatch { position: relative; display: grid; place-items: center; height: 66px; border: 1px solid var(--line-strong); border-radius: 12px; font: 26px/1 Georgia, serif; transition: border-color .18s ease; }
.theme-options button:hover .theme-swatch { border-color: var(--accent); }
.theme-options button.chosen .theme-swatch { border: 2px solid var(--accent); }
.light-swatch { background: #fbfaf7; color: #26241f; }
.sepia-swatch { background: #f1e8d7; color: #392c20; }
.dark-swatch { background: #171713; color: #f4eee5; }
.rose-swatch { background: #faf1f4; color: #35272d; }
.theme-check { position: absolute; right: -5px; bottom: -5px; display: none; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.theme-check .icon { width: 12px; height: 12px; flex-basis: 12px; }
.chosen .theme-check { display: grid; }
.preview-type { display: flex; flex-direction: column; justify-content: center; gap: 10px; min-height: 124px; margin: 0 0 18px; padding: 18px 20px; border-radius: 12px; background: var(--paper); }
.preview-type p { margin: 0; color: var(--ink); font-family: Georgia, serif; overflow-wrap: break-word; }
.preview-type sup { padding-right: 8px; color: var(--accent); font: 500 11px/1 ui-sans-serif, sans-serif; }
.preview-type > span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.range-setting { display: block; padding: 9px 0; }
.range-setting > span { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.range-setting b { font-size: 13px; line-height: 1.5; font-weight: 500; }
.range-setting output { flex-shrink: 0; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.range-setting input { display: block; width: 100%; height: 30px; margin: 5px 0 0; padding: 0; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; }
.range-setting input::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: linear-gradient(to right, var(--accent) 0 var(--range-fill), var(--line-strong) var(--range-fill) 100%); }
.range-setting input::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7.5px; border: 2px solid var(--accent); border-radius: 50%; background: var(--surface); box-shadow: 0 2px 4px rgba(22,18,15,.12); }
.range-setting input::-moz-range-track { height: 3px; border-radius: 2px; background: var(--line-strong); }
.range-setting input::-moz-range-progress { height: 3px; border-radius: 2px; background: var(--accent); }
.range-setting input::-moz-range-thumb { width: 14px; height: 14px; border: 2px solid var(--accent); border-radius: 50%; background: var(--surface); box-shadow: 0 2px 4px rgba(22,18,15,.12); }
.range-setting input:focus-visible { outline-offset: 3px; border-radius: 4px; }
.toggle-setting { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 0; }
.toggle-setting + .toggle-setting { border-top: 1px solid var(--line); }
.toggle-setting b, .toggle-setting small { display: block; }
.toggle-setting b { font-size: 13px; line-height: 1.5; font-weight: 500; }
.toggle-setting small { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.toggle-setting .resource-note { margin-top: 7px; font-size: 11px; }
.toggle-setting > button { position: relative; width: 44px; height: 44px; flex: 0 0 44px; padding: 0; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.toggle-setting > button::before { content: ''; position: absolute; inset: 10px 0; border: 1px solid var(--line-strong); border-radius: 24px; background: var(--surface-2); transition: background-color .18s ease, border-color .18s ease; }
.toggle-setting > button i { position: absolute; left: 4px; top: 14px; display: block; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .18s ease, background-color .18s ease; }
.toggle-setting > button.active::before { background: var(--accent); border-color: var(--accent); }
.toggle-setting > button.active i { transform: translateX(20px); background: var(--on-accent); }
.toggle-setting > button:hover::before { border-color: var(--accent); }
.settings-foot { flex: 0 0 auto; margin: 0; padding: 15px 28px max(15px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.5; }
.aquamorphic-setting { margin-top: 20px; padding-bottom: 0; border-top: 1px solid var(--line); }
.aquamorphic-setting > span { min-width: 0; }
.offline-setting { padding-top: 24px; border-top: 1px solid var(--line); }
.offline-setting h3 { display: flex; align-items: center; gap: 10px; }
.offline-heading-icon { width: 22px; height: 22px; flex: 0 0 22px; color: var(--accent); }
.offline-setting p { margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.offline-setting button { width: 100%; min-height: 44px; padding: 12px 16px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent); color: var(--on-accent); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.offline-setting button:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.offline-setting button:disabled { opacity: .65; cursor: wait; }
.offline-setting .offline-install { margin-top: 10px; background: transparent; color: var(--accent); }
.offline-setting .offline-install:hover { background: var(--accent-soft); }
.offline-status-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; }
.offline-setting .offline-status { flex: 1; min-width: 0; margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.offline-setting .offline-help { margin: 12px 0 0; }
.offline-meter { position: relative; margin-top: 18px; }
.offline-meter-label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 9px; color: var(--muted); font-size: 11px; }
.offline-percent { color: var(--accent); font-variant-numeric: tabular-nums; }
.offline-track { height: 8px; overflow: hidden; border-radius: 4px; background: var(--surface-2); }
.offline-fill { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; border-radius: inherit; background: var(--accent); transform: scaleX(0); transform-origin: left center; }
.offline-glint { position: absolute; inset: 0; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--on-accent) 30%, transparent), transparent); animation: offline-glint 1.8s ease-in-out infinite; animation-play-state: paused; }
.offline-setting[data-motion-active="true"] .offline-glint { animation-play-state: running; }
.offline-setting[data-offline-phase="ready"] .offline-glint { opacity: 0; }
.offline-setting .offline-native-progress { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
.offline-success-icon { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); transform-origin: center; }
.offline-success-icon svg { width: 22px; height: 22px; }
.offline-check { stroke-dasharray: 1; stroke-dashoffset: 0; }
@keyframes offline-glint { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .offline-glint { animation: none; opacity: 0; } }
.offline-setting [hidden] { display: none; }

.not-found-page {
  --not-found-art: #8a6d52;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(28px, 6vw, 72px) 22px;
  background:
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--not-found-art) 7%, transparent), transparent 42%),
    var(--paper);
  color: var(--ink);
}
.not-found-page.theme-sepia, html.theme-sepia .not-found-page { --not-found-art: #7f6247; }
.not-found-page.theme-rose, html.theme-rose .not-found-page { --not-found-art: #966879; }
.not-found-page.theme-dark, html.theme-dark .not-found-page { --not-found-art: #92979d; }
.not-found-shell { width: min(620px, 100%); display: grid; justify-items: center; text-align: center; }
.not-found-brand { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .18em; text-transform: uppercase; }
.not-found-art { width: min(330px, 78vw); margin: 26px 0 14px; color: var(--not-found-art); }
.not-found-art g { stroke-width: 3; }
.not-found-bible { opacity: .82; }
.not-found-sword { stroke-width: 2.7 !important; }
.not-found-copy > p { margin: 0 0 10px; color: var(--not-found-art); font-size: 10px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.not-found-copy h1 { max-width: 560px; margin: 0; font: 400 clamp(31px, 6vw, 52px)/1.08 Georgia, "Times New Roman", serif; letter-spacing: -.025em; text-wrap: balance; }
.not-found-return { min-width: min(330px, 100%); margin: 32px auto 0; display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 18px; padding: 13px 15px 13px 18px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-align: left; text-decoration: none; transition: transform .18s, border-color .18s, background .18s; }
.not-found-return:hover { border-color: var(--not-found-art); background: var(--surface-2); }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .not-found-return:hover { transform: translateY(-2px); }
}
.not-found-return span, .not-found-return b { display: block; }
.not-found-return span { color: var(--muted); font-size: 9px; letter-spacing: .04em; }
.not-found-return b { margin-top: 3px; color: var(--not-found-art); font: 600 15px Georgia, serif; }
.not-found-return i { grid-column: 2; grid-row: 1 / 3; color: var(--not-found-art); font-size: 19px; font-style: normal; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(30px); opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes toast-in { from { opacity: 0; transform: translate(12px, 18px) scale(.96); } }
@keyframes toast-mobile-in { from { opacity: 0; transform: translate(-50%, 7px) scale(.96); } }

@media (max-width: 1180px) {
  .layout { grid-template-columns: 226px minmax(480px, 1fr); }
  .context-panel { display: none; }
  .reader-column { padding-inline: clamp(36px, 6vw, 74px); }
}

@media (max-width: 820px) {
  .topbar { height: 62px; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; padding: 0 12px; }
  .brand-copy { display: none; }
  .brand-icon { width: 37px; height: 37px; }
  .location-pill { justify-self: center; min-width: 116px; min-height: 44px; padding: 7px 10px 7px 13px; }
  .location-pill span { display: none; }
  .location-pill b { font-size: 13px; }
  .location-pill .icon { grid-row: 1; }
  .top-actions { justify-self: end; gap: 5px; }
  .top-actions .round-button { width: 40px; height: 44px; border-color: transparent; border-radius: 10px; }
  .top-actions .account-button { order: -1; width: 44px; margin-left: 0; background: transparent; color: var(--ink); }
  .top-actions .account-button:hover { background: var(--surface-2); }
  .desktop-markers-button { display: none; }
  .layout { display: block; min-height: calc(100vh - 62px); }
  .rail { display: none; }
  .reader-column { padding: 38px 23px 120px; }
  .reader-head h1 { font-size: clamp(34px, 9vw, 44px); line-height: 1.08; }
  .reader-head > p { font-size: 14px; }
  .reader-controls { display: grid; margin: 22px auto 22px; padding-bottom: 14px; gap: 4px; }
  .reader-toggles, .reader-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .reader-controls button { min-width: 0; min-height: 44px; gap: 5px; padding: 7px 5px; line-height: 1.3; }
  .reader-controls .future-control em { display: none; }
  .reader-controls button span { font-size: 11px; }
  .reader-controls .icon { width: 18px; height: 18px; flex-basis: 18px; }
  .verse { grid-template-columns: 28px minmax(0, 1fr); gap: 9px; margin-inline: -8px; padding: 7px 8px 11px; border-radius: 9px; }
  .verse-number { width: 27px; height: 28px; }
  .russian { font-size: clamp(18px, var(--reader-font-size), 27px); line-height: var(--reader-line-height); }
  .english { font-size: calc(var(--reader-font-size) * .68); }
  .verse-tools { left: 50%; transform: translateX(-50%); gap: 0; }
  .verse-tools button { flex-basis: 44px; width: 44px; height: 44px; }
  .verse-color-strip { --color-size: 44px; --color-gap: 0px; }
  .chapter-end { margin-top: 50px; gap: 12px; }
  .chapter-end > span { max-width: 80px; }
  .translation-copyright { margin-top: 44px; grid-template-columns: 1fr; gap: 18px; }
  .mobile-nav { position: fixed; left: 12px; right: 12px; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 45; height: 64px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 5px; border: 1px solid var(--line); border-radius: 17px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(18px); box-shadow: 0 10px 40px rgba(35, 27, 20, .16); }
  .mobile-nav { transform: translate3d(0, var(--reader-nav-offset, 0px), 0); opacity: 1; transition: none; }
  .mobile-nav[data-scroll-moving="true"] { will-change: transform; }
  .mobile-nav[data-scroll-hidden="true"] { pointer-events: none; }
  /* Retain the native tab order; keyboard focus brings controls back before paint. */
  .mobile-nav:has(:focus-visible) { transform: translateY(0); opacity: 1; pointer-events: auto; transition: none; }
  .copy-toast { left: 50%; top: auto; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); border-radius: 18px; animation-name: toast-mobile-in; }
  .reference-return { left: 50%; right: auto; bottom: calc(84px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); transform: translateX(-50%); border-radius: 18px; animation: none; }
  .mobile-nav button { min-width: 0; display: grid; grid-template-rows: 24px 14px; place-items: center; align-content: center; gap: 2px; padding: 4px 0; border: 1px solid transparent; border-radius: 11px; background: transparent; color: var(--muted); cursor: pointer; }
  .mobile-nav button.active { border-color: color-mix(in srgb, var(--accent) 22%, var(--line)); background: var(--accent-soft); color: var(--accent); }
  .mobile-nav button:disabled { opacity: .55; cursor: default; }
  .mobile-nav button > .icon, .mobile-nav button > .original-icon { width: 24px; height: 24px; flex: 0 0 24px; color: inherit; }
  .mobile-nav button > span:last-child { font-size: 10px; line-height: 14px; white-space: nowrap; }
  .search-strip { top: 62px; }
  .search-strip { padding: 8px 10px; }
  .search-strip .search-submit { min-width: 68px; padding: 0 12px; }
  .search-strip input { font-size: 16px; }
  .search-scope { display: block; line-height: 1.5; }
  .search-scope span { display: block; }
  .search-scope span:last-child { display: none; }
  .search-recent-shell { margin-top: 8px; padding: 0 10px; }
  .recent-history { padding: 9px; }
  .recent-history-row { grid-template-columns: 1fr; gap: 5px; }
  .search-results-head { padding-left: 10px; }
  .search-result-list { max-height: 55vh; }
  .search-result-list p { font-size: 14px; }
  .modal-backdrop { padding: 10px; }
  .modal-backdrop.account-backdrop, .static-sheet.account-backdrop { align-items: flex-end; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .chapter-sheet { padding: 10px 16px 23px; }
  .chapter-grid { grid-template-columns: repeat(3, 1fr); }
  .library-sheet { height: 100%; max-height: 100%; }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 38vh; }
  .chapter-grid.compact { grid-template-columns: repeat(6, 1fr); }
  .refs-list { grid-template-columns: 1fr; }
  .parallel-row button, .ref-card { min-height: 44px; }
  .book-search input { font-size: 16px; }
  .markers-sheet { max-height: 92vh; }
  .marked-jump { gap: 9px; padding: 11px 10px; }
  .marked-jump small { max-width: calc(100vw - 150px); }
  .language-notice { margin-top: 20px; }
  .settings-head { padding: max(16px, env(safe-area-inset-top)) 22px 14px; }
  .settings-head h2 { font-size: 24px; }
  .settings-body { padding: 22px 22px 12px; }
  .settings-foot { padding-inline: 22px; }
  .range-setting input { height: 44px; }
  .theme-swatch { height: 64px; }
}

@media (max-width: 360px) {
  .topbar { gap: 6px; padding-inline: 10px; }
  .top-actions { gap: 4px; }
}

@media (max-width: 350px) {
  .verse-tools { padding: 0; }
}

@media (max-width: 520px) {
  .settings-drawer { width: 100%; }
}

@media (max-width: 390px) {
  .reader-column { padding-inline: 17px; }
  .reader-controls button span { font-size: 10px; }
  .chapter-facts { gap: 10px; }
  .not-found-return { min-width: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mobile-nav { transform: none; opacity: var(--reader-nav-opacity, 1); }
  .mobile-nav[data-scroll-moving="true"] { will-change: opacity; }
}

/* Lucide Animated icons share a consistent stroke and footprint. */
.icon { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex: 0 0 20px; vertical-align: middle; }
.icon > .icon { width: 100%; height: 100%; }
.icon svg { display: block; width: 100%; height: 100%; }
.icon > div { display: flex; align-items: center; justify-content: center; }
.sheet-head button, .settings-head button, .tool-action, .marked-remove { display: inline-flex; align-items: center; justify-content: center; }
button, a { -webkit-tap-highlight-color: transparent; }
button { transition: background-color .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease, scale .16s var(--ease-out); }
button:not(:disabled):active { scale: .97; }
button:focus-visible:active { scale: 1; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.search-strip, .search-recent-shell { animation: content-reveal .2s var(--ease-out); }
.static-sheet .chapter-sheet, .static-settings .settings-drawer, .modal-backdrop, .modal-backdrop .chapter-sheet, .modal-backdrop .settings-drawer { animation: none; }
.copy-toast { animation: none; }
@starting-style { .copy-toast { opacity: 0; } }
.copy-toast { transition: opacity .16s var(--ease-out); }
@keyframes content-reveal { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  button:not(:disabled):active { scale: 1; }
  .modal-backdrop, .chapter-sheet, .settings-drawer, .search-strip, .search-recent-shell, .copy-toast, .reference-return { animation: none; }
  button, .app { transition: background-color .1s ease, color .1s ease, border-color .1s ease, opacity .1s ease; }
  .toggle-setting > button i { transition: background-color .1s ease; }
  .not-found-return:hover { transform: none; }
}

/* Preserve source whitespace, accents, line breaks, notes and Psalm headings. */
.russian { white-space: pre-wrap; }
.russian u { text-decoration: underline; text-underline-offset: .12em; }
.source-footnote { color: var(--muted); font-size: .65em; vertical-align: super; }
.verse-heading { display: block; margin: 0 0 12px; color: var(--accent); font: 600 12px/1.5 Georgia, serif; letter-spacing: .06em; white-space: pre-wrap; }

.continuous-mode > .verses, .continuous-mode > .chapter-end, .continuous-mode > .single-chapter { display: none; }
.continuous-reader { overflow-anchor: none; }
.continuous-chapter { max-width: var(--reader-width); margin: 0 auto; padding-top: 30px; }
.continuous-heading { margin: 0 0 28px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--ink); font: 400 30px/1.25 Georgia, serif; text-align: center; }
.continuous-heading:has(+ .continuous-description) { margin-bottom: 10px; }
.continuous-description { margin: 0 0 28px; color: var(--muted); font: italic 16px/1.5 Georgia, serif; text-align: center; text-wrap: balance; }
.continuous-status { max-width: var(--reader-width); margin: 20px auto; color: var(--muted); font-size: 12px; text-align: center; }
.continuous-status:empty { display: none; }
.continuous-status button { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--accent); background: var(--surface); cursor: pointer; }
.toggle-setting > span { padding-right: 12px; }
.toggle-setting > button { flex-shrink: 0; }
.toggle-setting small.resource-note { margin-top: 7px; font-size: 11px; line-height: 1.5; }

.original-icon { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex: 0 0 20px; color: inherit; vertical-align: middle; }
.original-icon svg { display: block; width: 100%; height: 100%; transition: transform .16s var(--ease-out), opacity .16s var(--ease-out); }
.original-stroke { transform-origin: 12px 12px; transition: transform .16s var(--ease-out); }
.original-icon[data-feedback="true"] [data-language="he"] .original-stroke-0 { transform: rotate(-6deg) scale(.94); }
.original-icon[data-feedback="true"] [data-language="grc"] .original-stroke-0 { transform: translate(.4px, .6px) rotate(2deg); }
.original-icon[data-feedback="true"] [data-language="grc"] .original-stroke-1 { transform: translate(-.4px, -.6px) rotate(-2deg); }
.icon svg { transition: transform .16s var(--ease-out), opacity .16s var(--ease-out); }
.icon[data-feedback="true"] svg { transform: scale(.9); opacity: .6; }
.original-icon[data-feedback="true"] svg { opacity: .75; }
@media (prefers-reduced-motion: reduce) {
  .original-icon svg, .icon svg { transition: opacity .1s ease; }
  .original-icon .original-stroke { transition: none; }
  .original-icon[data-feedback="true"] svg[data-language] .original-stroke { transform: none; }
  .original-icon[data-feedback="true"] svg, .icon[data-feedback="true"] svg { transform: none; }
}
.original { margin: 13px 0 5px; padding: 2px 0 2px 13px; border-left: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); }
.original-source { display: block; margin-bottom: 5px; color: var(--accent); font: 600 10px/1.4 Inter, sans-serif; }
.original-text { margin: 0; color: var(--ink); font: 400 calc(var(--reader-font-size) * .85)/1.8 Georgia, "Times New Roman", serif; overflow-wrap: anywhere; }
.original-text[dir="rtl"] { font-size: calc(var(--reader-font-size) * 1.02); line-height: 1.9; text-align: right; }
.original-status { margin: 10px 0; color: var(--muted); font: 12px/1.6 Inter, sans-serif; }
.original-load-error { max-width: var(--reader-width); margin: 12px auto; color: var(--muted); font-size: 12px; }
.original-load-error button { border: 0; background: transparent; color: var(--accent); text-decoration: underline; cursor: pointer; }

/* Personal verse notes share the reader's quiet surfaces and all four themes. */
.verse-note-indicator { position: absolute; top: 1px; right: 0; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--accent); cursor: pointer; }
.verse-note-indicator:hover { background: var(--accent-soft); }
.verse:has(> .verse-note-indicator) .verse-body { padding-right: 20px; }
.verse:has(> .verse-note-indicator) .marker-dot { display: none; }
.note-card .marked-jump { grid-template-columns: auto minmax(0, 1fr); }
.note-card .marked-jump small { white-space: normal; overflow-wrap: anywhere; font-family: inherit; font-size: 13px; line-height: 1.55; }
.note-card-label { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; }
.note-backdrop, .static-sheet.note-backdrop { align-items: center; }
.note-sheet { width: min(600px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; overscroll-behavior: contain; }
.note-sheet .sheet-head h2 { margin: 0; }
.note-sheet .sheet-head > button { min-width: 44px; min-height: 44px; }
.note-sheet .note-reference { margin: 6px 0 24px; color: var(--accent); font: 16px/1.5 Georgia, serif; overflow-wrap: anywhere; }
.note-sheet form > label { display: block; margin-bottom: 8px; color: var(--ink); font-size: 14px; font-weight: 600; }
.note-sheet textarea { display: block; width: 100%; min-height: 200px; max-height: 45dvh; resize: vertical; padding: 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--paper); color: var(--ink); font-family: inherit; font-size: 16px; line-height: 1.6; caret-color: var(--accent); }
.note-sheet textarea::placeholder { color: var(--muted); opacity: 1; }
.note-sheet textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.note-meta { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.note-meta output { font-variant-numeric: tabular-nums; white-space: nowrap; }
.note-meta .at-limit { color: var(--accent); font-weight: 600; }
.note-color-field { margin: 24px 0; padding: 0; border: 0; }
.note-color-field legend { margin-bottom: 8px; padding: 0; color: var(--ink); font-size: 13px; font-weight: 600; }
.note-colors { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.note-colors button, .note-color-none { min-height: 44px; padding: 0; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); cursor: pointer; touch-action: manipulation; }
.note-colors button:hover, .note-color-none:hover { background: var(--surface-2); }
.note-colors .chosen, .note-color-none.chosen { outline: 2px solid var(--accent); outline-offset: 2px; }
.note-colors button:focus-visible, .note-color-none:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.note-color-swatch { position: relative; width: 44px; flex: 0 0 44px; }
.note-color-swatch::before { content: ''; display: block; width: 24px; height: 24px; margin: auto; border-radius: 50%; background: var(--marker); box-shadow: inset 0 0 0 1px #26241f26; }
.note-color-swatch.chosen::after { content: ''; position: absolute; top: 14px; left: calc(50% - 3px); width: 6px; height: 10px; border: solid #26241f; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.note-colors-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; color: var(--muted); }
.note-colors-toggle > .icon { transition: transform .24s var(--ease-out); }
.note-colors-toggle[aria-expanded="true"] > .icon { transform: rotate(180deg); }
.note-palette-disclosure { display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden; transition: grid-template-rows .24s var(--ease-out), opacity .2s var(--ease-out), visibility 0s .24s; }
.note-palette-disclosure[data-expanded="true"] { grid-template-rows: 1fr; opacity: 1; visibility: visible; transition-delay: 0s; }
.note-palette-clip { min-height: 0; overflow: hidden; }
.note-colors-extra { display: grid; grid-template-columns: repeat(5, 44px); gap: 8px; margin-top: 16px; padding: 16px 4px 4px; border-top: 1px solid var(--line); }
.note-color-options { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; }
.note-color-none { padding: 8px 12px; color: var(--ink); font-size: 13px; }
.note-color-current { color: var(--muted); font-size: 12px; }
@media (min-width: 640px) { .note-colors-extra { grid-template-columns: repeat(10, 44px); } }
@media (prefers-reduced-motion: reduce) { .note-colors-toggle > .icon { transition: none; } .note-palette-disclosure { transition: opacity .1s var(--ease-out), visibility 0s .1s; } .note-palette-disclosure[data-expanded="true"] { transition-delay: 0s; } }
.note-footer { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.note-footer button { min-height: 44px; padding: 10px 14px; border: 0; border-radius: 8px; font-size: 13px; cursor: pointer; }
.note-delete { margin-right: auto; background: transparent; color: var(--accent); }
.note-cancel { background: var(--surface-2); color: var(--ink); }
.note-save { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.note-save:disabled { opacity: .5; cursor: default; }
.note-error { color: var(--accent); font-size: 13px; line-height: 1.6; }
.note-backdrop, .static-sheet.note-backdrop { z-index: 90; }
.note-read-text { max-height: 55dvh; overflow-y: auto; overscroll-behavior: contain; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); font-size: 16px; line-height: 1.75; padding: 0 4px 24px 0; }
.note-view-sheet .note-reference { margin-bottom: 20px; }
.note-view-footer button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.note-delete-confirm > p { margin: 20px 0 12px; color: var(--ink); font-weight: 600; }
.note-view-footer[hidden], .note-delete-confirm[hidden] { display: none; }

/* Saved verses expand into a searchable library, retaining the reading context. */
.markers-sheet { display: flex; flex-direction: column; overflow: hidden; }
.markers-sheet .sheet-head { flex-shrink: 0; gap: 16px; }
.markers-sheet .sheet-head h2 { margin: 0; }
.saved-head-actions { display: flex; gap: 4px; }
.saved-head-actions button { min-width: 44px; min-height: 44px; }
.theme-sepia .markers-sheet { --muted: var(--faint); }
.markers-sheet .markers-summary { flex-shrink: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.markers-sheet .markers-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; grid-auto-rows: max-content; align-content: start; padding-right: 4px; }
.saved-expand-footer { flex-shrink: 0; padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--line); }
.saved-expand { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 44px; padding: 10px 14px; border: 0; border-radius: 8px; background: var(--surface-2); color: var(--accent); font-size: 14px; cursor: pointer; }
.saved-expand:hover { background: var(--accent-soft); }
.markers-backdrop:not(.is-expanded) .saved-tools, .markers-backdrop:not(.is-expanded) [data-action="collapse-markers"] { display: none; }
.markers-backdrop.is-expanded { padding: 0; align-items: stretch; }
.is-expanded .markers-sheet { width: 100%; height: 100dvh; max-height: none; padding: max(28px, env(safe-area-inset-top)) max(32px, calc((100vw - 1200px) / 2)) max(24px, env(safe-area-inset-bottom)); border: 0; border-radius: 0; background: var(--paper); box-shadow: none; }
.is-expanded .markers-sheet .sheet-head h2 { font-size: 26px; }
.is-expanded .markers-summary { margin: 2px 0 24px; font-size: 12px; }
.is-expanded .markers-counts { display: none; }
.is-expanded .sheet-handle, .is-expanded .saved-expand-footer { display: none; }
.is-expanded .markers-list { flex: 1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: 8px; }
.is-expanded .marked-jump { padding: 18px; align-items: start; }
.is-expanded .marked-jump b { font-size: 16px; line-height: 1.5; }
.is-expanded .marked-jump small { font-size: 14px; line-height: 1.65; max-width: none; }
.is-expanded .marked-card { align-self: start; }
.saved-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; flex-shrink: 0; margin: 8px 0 16px; }
.saved-search { display: flex; align-items: center; gap: 10px; flex: 1 1 320px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--paper); color: var(--muted); }
.saved-search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.saved-search input { min-width: 0; width: 100%; min-height: 44px; border: 0; background: transparent; outline: none; color: var(--ink); font: inherit; font-size: 16px; }
.saved-search input::placeholder { color: var(--muted); opacity: 1; }
.saved-filters { display: flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.saved-filters button { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; }
.saved-filters button[aria-pressed="true"] { background: var(--surface); color: var(--accent); }
.saved-filters button:hover { color: var(--ink); }
.saved-filters span { font-size: 11px; font-variant-numeric: tabular-nums; }
.saved-no-results { color: var(--muted); font-size: 14px; line-height: 1.7; }
.marked-card[hidden] { display: none; }
.markers-list .markers-empty { grid-column: 1 / -1; }
@media (max-width: 820px) {
  .verse:has(> .verse-note-indicator) .verse-body { padding-right: 28px; }
  .note-backdrop, .static-sheet.note-backdrop { align-items: flex-end; padding: 8px; }
  .note-sheet { max-height: calc(100dvh - 16px); padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .note-sheet textarea { min-height: 160px; }
  .note-sheet .note-reference { margin-bottom: 18px; }
  .note-footer .note-delete { flex: 1 0 100%; margin: 0; text-align: left; }
  .note-cancel, .note-save { flex: 1; }
  .is-expanded .markers-sheet { padding: max(20px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }
  .is-expanded .markers-sheet .sheet-head { align-items: flex-start; gap: 8px; }
  .is-expanded .markers-sheet .sheet-head h2 { font-size: 24px; line-height: 1.3; }
  .is-expanded .markers-list { grid-template-columns: minmax(0, 1fr); }
  .is-expanded .marked-jump { padding: 14px; }
  .saved-tools { gap: 10px; }
  .saved-search { flex-basis: 100%; }
  .saved-filters { width: 100%; }
  .saved-filters button { flex: 1; min-width: 0; gap: 5px; padding: 8px 5px; font-size: 12px; }
  .note-view-footer .note-delete { justify-content: flex-start; }
}

/* Public legal documents use the reader's quiet, warm typography. */
.policy-links { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 18px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.policy-links a, .policy-links a:visited { display: inline-flex; align-items: center; min-height: 32px; color: var(--muted); text-decoration: none; text-underline-offset: 4px; }
.policy-links a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); }
.translation-copyright > .policy-links, .translation-copyright > .reader-policy-footer { grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid var(--line); }
.account-legal { margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--line); }
.account-legal .policy-links { gap: 2px 16px; }
@media (max-width: 820px) { .policy-links a { min-height: 44px; } }
.policy-page { min-height: 100vh; background: #fbfaf7; color: #292723; font-family: Arial, sans-serif; }
.policy-page header, .policy-page main, .policy-page footer { width: min(760px, calc(100% - 40px)); margin-inline: auto; }
.policy-page header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-block: 28px; border-bottom: 1px solid #dedbd4; font-size: 14px; }
.policy-page a { color: inherit; text-underline-offset: 4px; overflow-wrap: anywhere; }
.policy-page a:focus-visible, .policy-links a:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.policy-brand { font: bold 26px Georgia, serif; text-decoration: none; }
.policy-brand span { display: block; margin-top: 5px; font: normal 12px Arial, sans-serif; }
.policy-page main { padding-block: 48px; }
.policy-kicker, .policy-date { font-size: 13px; color: #625e57; }
.policy-page h1 { margin-block: 16px; font: normal clamp(30px, 6vw, 48px)/1.12 Georgia, serif; overflow-wrap: anywhere; }
.policy-page h2 { margin-block: 32px 14px; font: normal 25px/1.3 Georgia, serif; }
.policy-page section p { font-size: 16px; line-height: 1.8; margin-block: 14px; }
.policy-page footer { border-top: 1px solid #dedbd4; padding-block: 24px 40px; }
@media print { .policy-page header, .policy-page footer { display: none; } .policy-page { background: white; color: black; } .policy-page main { width: 100%; padding: 0; } }

/* Profile pictures stay on the provider's servers. */
.account-button.is-signed-in { width: auto; max-width: 230px; height: 46px; gap: 9px; padding: 3px 11px 3px 3px; border-color: transparent; background: transparent; color: var(--ink); text-align: left; }
.account-button.is-signed-in:hover { background: transparent; border-color: transparent; }
.account-avatar { position: relative; display: inline-grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; overflow: hidden; padding: 2px; border-radius: 50%; background: #1877f2; color: var(--ink); font-size: 16px; font-weight: 600; }
.account-avatar-google { background: conic-gradient(#4285f4 0deg 90deg, #34a853 90deg 180deg, #fbbc05 180deg 270deg, #ea4335 270deg 360deg); }
.account-avatar-content { position: relative; display: grid; place-items: center; width: 100%; height: 100%; overflow: hidden; border-radius: 50%; background: var(--surface-2); }
.account-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.account-button-copy { display: grid; gap: 2px; min-width: 0; }
.account-button-copy b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.account-button-copy small { font-size: 10px; color: var(--muted); white-space: nowrap; }
.account-identity { display: flex; align-items: center; gap: 14px; margin: 24px 0 14px; }
.account-identity .account-avatar { width: 60px; height: 60px; flex-basis: 60px; font-size: 24px; }
.account-identity > div { display: grid; gap: 4px; min-width: 0; }
.account-identity strong { overflow-wrap: anywhere; font-size: 19px; }
.account-identity > div > span { color: var(--muted); font-size: 12px; }
.account-providers .account-facebook { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; padding: 12px 16px; border: 0; border-radius: 10px; background: #1877f2; color: white; text-decoration: none; font: inherit; font-size: 14px; font-weight: 600; }
.account-providers .account-facebook:hover { background: #1266d3; }
.account-providers .account-facebook:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.account-quota { margin: 18px 0; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.account-quota > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.account-quota strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.account-quota strong small { color: var(--muted); font-size: 15px; font-weight: 400; }
.account-quota p { margin: 8px 0 4px; color: var(--muted); font-size: 12px; }
.account-quota > small { color: var(--faint); font-size: 11px; }
.account-sync { min-height: 20px; color: var(--muted); font-size: 12px; }
.account-error { color: #bd3434; overflow-wrap: anywhere; font-size: 13px; line-height: 1.5; }
.account-conflict, .account-delete-confirm { margin-top: 18px; padding: 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-2); }
.account-conflict p, .account-delete-confirm p { font-size: 13px; line-height: 1.6; }
.account-delete-confirm h3 { margin: 0; font-size: 16px; }
.account-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.account-actions button { min-height: 44px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.account-actions button:hover { background: var(--surface-2); }
.account-actions button:disabled { opacity: .55; cursor: wait; }
.account-actions .account-delete { margin-left: auto; border-color: transparent; color: #bd3434; }
.account-actions .account-danger { background: #b82e2e; border-color: #b82e2e; color: white; }
.account-actions .account-danger:hover { background: #9f2525; }
.account-sheet a:focus-visible, .account-sheet button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 820px) {
  .top-actions .account-button.is-signed-in { width: 44px; max-width: 44px; padding: 2px; background: transparent; }
  .account-button-copy { display: none; }
  .account-actions { flex-direction: column; }
  .account-actions .account-delete { margin-left: 0; }
}

.account-providers { display: grid; gap: 10px; }
.account-providers .account-google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); text-decoration: none; font: inherit; font-size: 14px; font-weight: 600; }
.account-providers .account-google:hover { background: var(--surface-2); }
.account-providers .account-google:disabled { color: var(--muted); cursor: not-allowed; }
.account-providers a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* Public reading destinations beside the salvation link. */
.reader-footer-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Saved records: one readable list, with organization revealed as needed. */
.saved-organizer { position: relative; display: flex; flex: 1; flex-direction: column; min-height: 180px; min-width: 0; overflow: hidden; color: var(--ink); }
.saved-organizer button, .note-folder-picker button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.saved-organizer button:focus-visible, .saved-organizer select:focus-visible, .note-folder-picker button:focus-visible, .note-folder-picker select:focus-visible, .folder-editor input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.saved-organizer button:disabled { opacity: .4; cursor: default; }
.saved-organizer svg, .note-folder-picker svg { flex-shrink: 0; }
/* The collection rail and workspace share one quiet, paper-like surface. */
.organizer-layout { display: flex; flex: 1; min-height: 0; min-width: 0; overflow: hidden; }
.organizer-workspace { display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 0; }
.folder-nav { display: none; min-width: 0; }
.folder-nav-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; margin-bottom: 12px; font-size: 12px; color: var(--muted); }
.folder-nav-heading > b { font-weight: 500; letter-spacing: .02em; }
.folder-nav-heading > button { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
.organizer-new-folder { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 16px; padding: 10px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--accent); text-align: left; font-size: 13px !important; }
.folder-actions button, .folder-editor-heading button { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
.folder-nav-items { display: flex; flex: 1; flex-direction: column; gap: 4px; min-height: 0; overflow: auto; padding: 3px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; overscroll-behavior: contain; }
.folder-nav-item { position: relative; display: flex; flex: 0 0 auto; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px !important; text-align: left; transition: background-color .15s ease-out, color .15s ease-out; }
.folder-nav-item > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-nav-item small { margin-left: auto; font-size: 12px; font-variant-numeric: tabular-nums; }
.folder-nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.folder-nav-item:nth-child(2) { margin-bottom: 16px; }
.organizer-gesture-hint { flex-shrink: 0; max-width: 24ch; margin: 8px 12px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.gesture-mouse { display: none; }
.saved-color-dot { display: inline-block; flex-shrink: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--marker); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 18%, transparent); }
.folder-nav-item > .saved-color-dot { width: 14px; height: 14px; margin: 2px; }
.folder-content-heading { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; margin-bottom: 20px; }
.folder-heading-copy { display: flex; flex-wrap: wrap; align-items: baseline; min-width: 0; gap: 4px 14px; }
.folder-content-heading h3 { min-width: 0; margin: 0; font: 400 28px/1.3 Georgia, serif; overflow-wrap: anywhere; text-wrap: balance; }
.folder-heading-actions { display: flex; flex-shrink: 0; align-items: center; gap: 4px; }
.folder-actions:empty { display: none; }
.folder-nav-toggle, .organizer-filter-toggle { display: flex; flex-shrink: 0; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px !important; }
.organizer-search-area { position: relative; flex-shrink: 0; }
.organizer-tools { display: flex; align-items: center; flex-shrink: 0; gap: 12px; }
.organizer-tools .saved-search { flex: 1; min-width: 0; background: var(--surface); }
.organizer-filter-toggle[aria-expanded="true"], .organizer-filter-toggle.has-filters { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.organizer-filter-toggle b { font-size: 12px; font-weight: 500; }
.organizer-filter-panel { display: flex; flex-shrink: 0; flex-wrap: wrap; align-items: flex-end; gap: 12px 24px; max-height: 36dvh; overflow-y: auto; padding: 16px; margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.organizer-filter-panel[hidden] { display: none; }
.organizer-color-section { flex: 1 1 200px; min-width: 0; }
.organizer-color-section > span, .organizer-sort { color: var(--muted); font-size: 12px; line-height: 1.5; }
.used-color-filters { display: flex; flex-wrap: wrap; align-items: center; min-width: 0; margin: 4px -6px -6px; }
.organizer-sort { display: flex; flex-direction: column; gap: 4px; }
.organizer-sort select { width: 100%; min-height: 44px; padding: 8px 28px 8px 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--paper); color: var(--ink); font: inherit; font-size: 14px; }
.organizer-reset { min-height: 44px; padding: 8px; border: 0; border-radius: 6px; background: transparent; color: var(--accent); font-size: 13px !important; }
.organizer-workspace > .saved-filters { flex-shrink: 0; gap: 24px; margin: 12px 0 0; padding: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.organizer-workspace > .saved-filters button { min-width: 44px; position: relative; flex: 0 1 auto; gap: 8px; min-height: 48px; padding: 10px 0; border-radius: 0; font-size: 13px; }
.organizer-workspace > .saved-filters button[aria-pressed="true"] { color: var(--accent); background: transparent; }
.organizer-workspace > .saved-filters button[aria-pressed="true"]::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--accent); content: ""; }
.organizer-workspace > .saved-filters span { font-size: 12px; }
.organizer-main { flex: 1; min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 4px 16px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.organizer-main:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.saved-color-choice { display: grid; flex: 0 0 44px; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink); }
.saved-palette-dot { position: relative; display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: var(--marker); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 24%, transparent); }
.saved-palette-dot.is-neutral { background: var(--paper); color: var(--muted); }
.saved-color-choice[aria-checked="true"] .saved-palette-dot::after, .saved-color-choice[aria-pressed="true"] .saved-palette-dot::after { position: absolute; inset: -4px; border: 2px solid var(--accent); border-radius: 50%; content: ""; }
.clear-color-filter { flex-shrink: 0; min-height: 44px; padding: 6px 9px; border: 0; border-radius: 6px; background: transparent; color: var(--accent); font-size: 12px !important; }
.organizer-status { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.organizer-entries { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; }
.saved-entry { min-width: 0; padding: 12px 12px 8px; border-bottom: 1px solid var(--line); border-radius: 8px; -webkit-touch-callout: none; }
.saved-entry-top { display: flex; align-items: flex-start; gap: 8px; }
.entry-menu { display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted); }
.saved-entry-open { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 8px; padding: 8px 0; border: 0; border-radius: 4px; background: transparent; color: var(--ink); text-align: left; }
.saved-entry-reference { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }
.saved-entry-reference b { font: 400 19px/1.4 Georgia, serif; overflow-wrap: anywhere; }
.saved-entry-colors { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; max-width: 112px; }
.saved-entry-open > .saved-entry-preview { max-inline-size: 75ch; text-wrap: pretty; display: -webkit-box; width: 100%; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: var(--ink); font: 16px/1.65 Georgia, serif; overflow-wrap: anywhere; white-space: normal; }
.saved-entry[data-entry-kind="note"] .saved-entry-preview { color: var(--muted); font-family: inherit; font-size: 15px; }
.saved-entry-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 20px; min-height: 44px; color: var(--muted); font-size: 12px; }
.saved-entry-type { display: flex; align-items: center; gap: 6px; }
.saved-entry-type svg, .saved-entry-folder svg { width: 14px; height: 14px; }
.saved-color-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.saved-entry-folder { display: flex; align-items: center; gap: 6px; min-width: 44px; min-height: 44px; max-width: 100%; padding: 4px 0; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 12px !important; text-align: left; }
.saved-entry-folder span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-action-panel { margin: 8px 0 4px; padding: 16px; border-radius: 8px; background: var(--surface-2); }
.entry-action-panel > label, .folder-editor label, .note-folder-row label { display: flex; flex-direction: column; gap: 7px; min-width: 0; color: var(--muted); font-size: 12px; }
.entry-action-panel select, .folder-editor input, .note-folder-row select { width: 100%; min-width: 0; min-height: 44px; padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--paper); color: var(--ink); font: inherit; font-size: 16px; }
.entry-action-buttons, .folder-settings-actions { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; }
.entry-action-buttons button, .folder-settings-actions button { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 0; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.folder-settings-actions [data-delete-folder] { margin-left: auto; }
.organizer-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 36px 16px; text-align: center; }
.organizer-empty > svg { width: 28px; height: 28px; color: var(--muted); }
.organizer-empty b { font: 400 20px/1.4 Georgia, serif; }
.organizer-empty p { max-width: 40ch; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.organizer-empty button { min-height: 44px; padding: 10px; border: 0; border-radius: 7px; background: var(--surface-2); color: var(--accent); }
.folder-edit-host { position: absolute; z-index: 5; inset: 0; display: flex; align-items: safe center; justify-content: center; overflow-y: auto; overscroll-behavior: contain; padding: 16px; background: color-mix(in srgb, var(--paper) 92%, transparent); }
.folder-edit-host[hidden] { display: none; }
.folder-edit-host > div { width: min(480px, 100%); margin: auto; padding: 24px; border: 1px solid var(--line-strong); background: var(--surface); box-shadow: var(--shadow); }
.folder-editor, .folder-delete-confirm { margin-bottom: 16px; padding: 16px; border-radius: 10px; background: var(--surface-2); }
.folder-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 14px; }
.folder-editor output { display: block; margin: 5px 0 14px; text-align: right; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.folder-color-caption { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.folder-color-caption b { color: var(--ink); font-weight: 400; }
.folder-color-palette { display: flex; gap: 0; overflow-x: auto; padding: 6px 3px; margin-top: 3px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; overscroll-behavior-x: contain; touch-action: pan-x; }
.folder-color-help, .folder-delete-confirm p { margin: 10px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.folder-editor-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.folder-editor-actions button { min-height: 44px; padding: 10px 14px; border: 0; border-radius: 7px; background: var(--paper); color: var(--ink); font-size: 13px; }
.folder-editor-actions .folder-primary { background: var(--accent); color: var(--on-accent); }
.folder-error { color: var(--accent); font-size: 13px; line-height: 1.6; }
.note-folder-picker { margin: 20px 0; }
.note-folder-row { display: flex; align-items: flex-end; gap: 8px; }
.note-folder-row label { flex: 1; color: var(--ink); font-size: 14px; font-weight: 500; }
.note-folder-row select { font-weight: 400; }
.folder-add { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 7px; background: var(--surface-2); color: var(--accent); font-size: 13px !important; }
.note-folder-hint { margin: 8px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.saved-notice:empty { display: none; }
.saved-notice { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 4px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.saved-notice > span { min-width: 0; overflow-wrap: anywhere; }
.saved-notice button { min-height: 44px; padding: 6px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--accent); }
.saved-drop-tray { position: absolute; z-index: 4; right: 8px; bottom: 8px; left: 8px; padding: 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.saved-drop-tray[hidden], .saved-drag-preview[hidden] { display: none; }
.saved-drop-caption { display: block; margin: 0 8px 8px; color: var(--muted); font-size: 12px; }
.saved-drop-folders { display: flex; flex-direction: column; gap: 4px; max-height: min(32dvh, 280px); overflow-y: auto; padding: 3px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; overscroll-behavior: contain; }
.saved-drop-folders button { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; min-height: 48px; padding: 10px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--ink); font-size: 13px; text-align: left; }
.saved-drop-folders button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-drag-preview { position: fixed; z-index: 151; top: 0; left: 0; display: flex; align-items: flex-start; gap: 10px; width: min(260px, calc(100vw - 16px)); padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); pointer-events: none; }
.saved-drag-preview:not([hidden]) { will-change: transform; }
.saved-drag-preview > svg { flex-shrink: 0; margin-top: 2px; }
.saved-drag-preview > span { min-width: 0; }
.saved-drag-preview b, .saved-drag-preview small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-drag-preview b { font: 400 16px/1.5 Georgia, serif; }
.saved-drag-preview small { margin-top: 4px; color: var(--muted); font: 12px/1.5 ui-sans-serif, sans-serif; }
.is-drag-source { opacity: .4; }
.is-dragging { user-select: none; cursor: grabbing; }
.is-drop-target { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft) !important; }
.folder-nav-item.is-drop-before::before, .folder-nav-item.is-drop-after::after { position: absolute; right: 0; left: 0; height: 2px; border-radius: 1px; background: var(--accent); content: ""; }
.folder-nav-item.is-drop-before::before { top: -3px; }
.folder-nav-item.is-drop-after::after { bottom: -3px; }
.is-expanded .saved-organizer { margin-top: 0; }
@media (hover: hover) {
  .folder-nav-item:hover, .entry-menu:hover, .folder-actions button:hover, .folder-editor-heading button:hover { background: var(--surface-2); color: var(--ink); }
  .saved-entry-open:hover b, .folder-nav-heading > button:hover, .entry-action-buttons button:hover, .folder-settings-actions button:hover { color: var(--accent); }
  .saved-color-choice:hover .saved-palette-dot { box-shadow: inset 0 0 0 2px var(--muted); }
}
@media (hover: hover) and (pointer: fine) {
  .saved-organizer .saved-entry-open, .saved-organizer .folder-nav-item, .saved-entry { cursor: grab; }
  .saved-organizer.is-dragging, .saved-organizer.is-dragging * { cursor: grabbing !important; }
  .saved-entry:hover:not(.is-drag-source), .saved-entry:focus-within:not(.is-drag-source) { background: var(--surface-2); }
  .saved-entry-folder:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
  .gesture-mouse { display: inline; }
  .gesture-touch { display: none; }
}
.saved-organizer button:active { background-color: var(--accent-soft); }
.organizer-filter-toggle:hover, .folder-nav-toggle:hover, .organizer-new-folder:hover { background-color: var(--surface-2); color: var(--ink); }
@media (min-width: 821px) {
  .is-expanded .organizer-layout { gap: 40px; }
  .is-expanded .folder-nav { display: flex; flex: 0 0 224px; flex-direction: column; min-height: 0; padding-right: 24px; border-right: 1px solid var(--line); }
  .folder-nav-heading > button, .folder-nav-toggle { display: none; }
}
@media (max-width: 820px) {
  .is-expanded .markers-sheet { padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .is-expanded .markers-summary { margin: 0 0 20px; }
  .is-expanded .markers-sheet .sheet-head { align-items: center; gap: 8px; }
  .is-expanded .markers-sheet .sheet-head h2 { font-size: 23px; }
  .folder-content-heading { gap: 8px; margin-bottom: 12px; }
  .folder-content-heading h3 { font-size: 24px; }
  .folder-heading-copy { flex-direction: column; gap: 2px; }
  .organizer-status { font-size: 12px; }
  .folders-open .folder-nav { position: absolute; z-index: 3; inset: 0 0 auto; display: flex; flex-direction: column; max-height: 100%; padding: 16px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
  .folders-open .folder-nav-items { max-height: 50dvh; }
  .saved-entry { padding: 12px 4px 8px; }
  .saved-entry[data-entry-kind="note"] .saved-entry-preview { font-size: 16px; }
  .organizer-workspace > .saved-filters { gap: 20px; }
  .folder-add span { display: none; }
  .saved-expand-footer { padding-top: 10px; margin-top: 8px; }
  .folder-settings-actions { gap: 4px 10px; }
  .folder-settings-actions [data-delete-folder] { margin-left: 0; }
  .organizer-sort { flex: 1 1 170px; min-width: 0; }
  .organizer-sort select { font-size: 16px; }
}
@media (max-width: 380px) {
  .is-expanded .markers-sheet .sheet-head h2 { font-size: 21px; }
  .organizer-tools { gap: 8px; }
  .organizer-filter-toggle { gap: 4px; padding-inline: 8px; }
  .organizer-workspace > .saved-filters { gap: 16px; }
  .saved-entry-footer { gap: 4px 12px; }
}
@media (max-height: 500px) and (max-width: 820px) {
  .is-expanded .markers-summary { display: none; }
  .folder-content-heading { margin-bottom: 4px; min-height: 44px; }
  .organizer-workspace > .saved-filters { margin-top: 4px; }
  .saved-entry { padding-block: 8px; }
  .organizer-filter-panel { position: absolute; z-index: 3; top: 100%; right: 0; left: 0; max-height: 50dvh; box-shadow: var(--shadow); }
}
@media (prefers-reduced-motion: reduce) { .folder-nav-item { transition: none; } }
.saved-organizer:not(.organizer-expanded) .organizer-search-area,
.saved-organizer:not(.organizer-expanded) .organizer-tools,
.saved-organizer:not(.organizer-expanded) .folder-nav,
.saved-organizer:not(.organizer-expanded) .folder-content-heading,
.saved-organizer:not(.organizer-expanded) .folder-edit-host,
.saved-organizer:not(.organizer-expanded) .organizer-filter-panel,
.saved-organizer:not(.organizer-expanded) .saved-filters,
.saved-organizer:not(.organizer-expanded) .organizer-sort,
.saved-organizer:not(.organizer-expanded) .organizer-status { display: none; }
.saved-organizer:not(.organizer-expanded) .organizer-entries { gap: 8px; }
.saved-organizer:not(.organizer-expanded) .marked-remove { display: grid; place-items: center; }
.saved-organizer:not(.organizer-expanded) .organizer-main { padding: 0; }
.markers-backdrop:not(.is-expanded) .markers-sheet { height: auto; }
.saved-organizer:not(.organizer-expanded) { flex: 0 1 auto; }
.saved-page-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0 4px; }
.saved-page-controls button { min-width: 72px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.saved-page-controls button:hover:enabled { border-color: var(--accent); color: var(--accent); }
.saved-page-controls span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* Optional ColorOS 17 inspired material: diffuse light, a frosted body and a
   quiet luminous rim. Only floating UI receives the material; reading stays paper.
   One backdrop per surface avoids stacking filters on its individual controls. */
[data-aquamorphic="true"] {
  --aqua-fill: color-mix(in srgb, var(--surface) 82%, transparent);
  --aqua-bar: color-mix(in srgb, var(--paper) 74%, transparent);
  --aqua-control: color-mix(in srgb, var(--surface) 56%, transparent);
  --aqua-hover: color-mix(in srgb, var(--surface) 86%, transparent);
  --aqua-light: rgb(255 255 255 / .32);
  --aqua-rim: rgb(255 255 255 / .78);
  --aqua-lower-rim: rgb(255 255 255 / .18);
  --aqua-shadow: rgb(39 45 52 / .16);
  --aqua-scrim: rgb(26 30 34 / .2);
  --aqua-muted: color-mix(in srgb, var(--ink) 78%, var(--surface));
  --aqua-faint: color-mix(in srgb, var(--ink) 72%, var(--surface));
}
.theme-dark[data-aquamorphic="true"], .theme-dark [data-aquamorphic="true"] {
  --aqua-fill: color-mix(in srgb, var(--surface) 86%, transparent);
  --aqua-bar: color-mix(in srgb, var(--paper) 78%, transparent);
  --aqua-control: rgb(255 255 255 / .055);
  --aqua-hover: rgb(255 255 255 / .11);
  --aqua-light: rgb(255 255 255 / .055);
  --aqua-rim: rgb(255 255 255 / .2);
  --aqua-lower-rim: rgb(255 255 255 / .035);
  --aqua-shadow: rgb(0 0 0 / .32);
  --aqua-scrim: rgb(0 0 0 / .3);
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  [data-aquamorphic="true"] :is(.modal-backdrop, .static-sheet, .static-settings) {
    background: var(--aqua-scrim);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  [data-aquamorphic="true"] .library-settings::backdrop {
    background: var(--aqua-scrim);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  [data-aquamorphic="true"] :is(.chapter-sheet, .settings-drawer, .mobile-nav, .verse-tools, .reference-return, .copy-toast) {
    --muted: var(--aqua-muted);
    --faint: var(--aqua-faint);
    background: linear-gradient(145deg, var(--aqua-light), transparent 48%), var(--aqua-fill);
    border-color: transparent;
    -webkit-backdrop-filter: blur(28px) saturate(1.45);
    backdrop-filter: blur(28px) saturate(1.45);
    box-shadow: inset 0 1px 0 var(--aqua-rim), inset 0 0 0 1px var(--aqua-lower-rim), 0 18px 56px var(--aqua-shadow);
  }
  [data-aquamorphic="true"] .chapter-sheet { border-radius: 24px; }
  [data-aquamorphic="true"] .is-expanded .markers-sheet { border-radius: 0; }
  [data-aquamorphic="true"] :is(.search-strip, .rail, .context-panel, .book-contents) {
    --muted: var(--aqua-muted);
    --faint: var(--aqua-faint);
    background: linear-gradient(150deg, var(--aqua-light), transparent 60%), var(--aqua-bar);
    -webkit-backdrop-filter: blur(24px) saturate(1.35);
    backdrop-filter: blur(24px) saturate(1.35);
    border-color: color-mix(in srgb, var(--line) 66%, transparent);
  }
  [data-aquamorphic="true"] .topbar {
    --muted: var(--aqua-muted);
    --faint: var(--aqua-faint);
    background: color-mix(in srgb, var(--paper) 10%, transparent);
    -webkit-backdrop-filter: blur(24px) saturate(1.35);
    backdrop-filter: blur(24px) saturate(1.35);
    border-color: transparent;
    box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--aqua-rim) 16%, transparent);
  }
  [data-aquamorphic="true"] :is(.location-pill, .round-button:not(.account-button):not(.active), .reader-controls button:not(.active):not(:disabled), .search-field, .sheet-head > button, .settings-head > button, .book-search, .library-view-toggle, .organizer-filter-panel, .entry-action-panel, .folder-editor, .note-folder-row) {
    background: linear-gradient(155deg, var(--aqua-light), transparent 65%), var(--aqua-control);
    border-color: color-mix(in srgb, var(--line-strong) 55%, transparent);
    box-shadow: inset 0 1px 0 var(--aqua-lower-rim);
  }
  /* Nested scrolling lists use the parent's frost instead of another backdrop. */
  [data-aquamorphic="true"] :is(.navigator-options, .book-grid button, .chapter-grid button, .preview-type, .organizer-rail) {
    background-color: var(--aqua-control);
  }
  [data-aquamorphic="true"] :is(.book-grid button.active, .chapter-grid button.active) { background: var(--accent-soft); }
  [data-aquamorphic="true"] .toggle-setting > button::before {
    box-shadow: inset 0 1px 0 var(--aqua-lower-rim);
  }
  @media (min-width: 821px) {
    [data-aquamorphic="true"] .settings-drawer { border-radius: 28px 0 0 28px; }
  }
  @media (max-width: 820px) {
    [data-aquamorphic="true"] .mobile-nav { border-radius: 24px; }
    [data-aquamorphic="true"] .navigator-options { background: transparent; }
    [data-aquamorphic="true"] .navigator-wheel-frame::before { background: var(--aqua-control); box-shadow: inset 0 1px 0 var(--aqua-lower-rim); }
  }
  @media (hover: hover) and (pointer: fine) {
    [data-aquamorphic="true"] :is(.location-pill, .round-button:not(.account-button):not(.active), .reader-controls button:not(.active):not(:disabled), .sheet-head > button, .settings-head > button, .library-view-toggle):hover { background: var(--aqua-hover); border-color: var(--line-strong); }
    [data-aquamorphic="true"] :is(.book-grid button, .chapter-grid button):hover { background: var(--accent-soft); }
  }
  @media (max-width: 820px) {
    [data-aquamorphic="true"] .topbar button.round-button:not(.account-button),
    [data-aquamorphic="true"] .topbar button.round-button:not(.account-button):hover {
      background: transparent;
      border-color: transparent;
      box-shadow: none;
    }
    [data-aquamorphic="true"] .topbar button.round-button:not(.account-button):hover { color: var(--accent); }
    [data-aquamorphic="true"] .topbar button.round-button:not(.account-button):active { opacity: .65; }
  }
}

/* System readability preferences take priority over the optional material.
   Browsers without backdrop-filter keep the existing opaque panel surfaces. */
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more), (forced-colors: active) {
  [data-aquamorphic="true"] :is(.chapter-sheet, .settings-drawer, .mobile-nav, .verse-tools, .reference-return, .copy-toast, .topbar, .search-strip, .rail, .context-panel, .book-contents) {
    background: var(--surface);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
    border-color: var(--line-strong);
  }
  [data-aquamorphic="true"] :is(.location-pill, .round-button:not(.account-button):not(.active), .reader-controls button:not(.active):not(:disabled), .search-field, .sheet-head > button, .settings-head > button, .book-search, .library-view-toggle, .organizer-filter-panel, .entry-action-panel, .folder-editor, .note-folder-row, .navigator-options, .preview-type, .organizer-rail) { background: var(--surface-2); box-shadow: none; }
}

@font-face{font-family:History Geist;src:url('/assets/salvation/geist.ttf') format('truetype');font-weight:100 900;font-display:swap}
html:has(.history-app){scroll-behavior:auto}
.history-app{--history-baptist:#9b392e;--history-bible:#285b79;--history-catholic:#80601c;--history-other:#69517a;--history-serif:Georgia,'Times New Roman',serif;--history-sans:'History Geist',sans-serif;background:var(--paper);color:var(--ink);font-family:var(--history-sans);min-height:100vh;overflow:clip}
.history-app.theme-dark{--history-baptist:#f3a293;--history-bible:#9fc8e5;--history-catholic:#ddc08a;--history-other:#cbb1e0}
.history-app :is(h1,h2,h3,p,figure){margin:0}.history-app a{color:inherit;text-underline-offset:.2em}.history-app button,.history-app select{font:inherit;cursor:pointer}.history-app button{border:0}.history-app button:disabled{cursor:default;opacity:.5}.history-app [hidden]{display:none!important}.history-app :is(a,button,input,select,summary):focus-visible{outline:2px solid var(--accent);outline-offset:5px}.history-app input{accent-color:var(--accent)}.history-app ::selection{background:var(--accent-soft);color:var(--ink)}
.history-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.history-skip{position:fixed;top:10px;left:20px;transform:translateY(-180%);z-index:99;padding:14px 22px;background:var(--ink);color:var(--paper)!important}.history-skip:focus{transform:none}
.history-header{min-height:78px;max-width:1440px;margin:auto;padding:14px 5%;display:flex;align-items:center;gap:32px;border-bottom:1px solid var(--line)}.history-brand{display:inline-flex;align-items:center;gap:10px;text-decoration:none;font:500 25px var(--history-serif)}.history-brand img{object-fit:contain}.history-back{margin-left:auto;font-size:14px;text-decoration:none;padding:12px 0}.history-back:hover{text-decoration:underline}.history-theme-label{display:flex;align-items:center;gap:9px;font-size:12px;color:var(--muted)}.history-theme-label select{min-height:44px;max-width:145px;border:1px solid var(--line-strong);border-radius:8px;padding:0 12px;background:var(--paper);color:var(--ink)}
.history-hero{max-width:1320px;margin:auto;min-height:650px;display:grid;grid-template-columns:1.25fr 1fr;align-items:center;padding:74px 5% 96px;gap:12px}.history-hero h1{font:400 clamp(44px,5.8vw,84px)/1.06 var(--history-serif);letter-spacing:-.035em;max-width:100%;text-wrap:balance}.history-hero h1 em{color:var(--accent);font-weight:400}.history-hero-copy>p{max-width:510px;font-size:17px;line-height:1.75;color:var(--muted);margin-top:30px}.history-hero-actions{display:flex;align-items:center;gap:28px;flex-wrap:wrap;margin-top:36px;font-size:14px}.history-hero-actions>a{min-height:48px;display:inline-flex;align-items:center;gap:22px}.history-primary{background:var(--accent);color:var(--on-accent)!important;padding:0 22px;border-radius:9px;text-decoration:none;transition:background .2s,transform .2s}.history-primary:hover{background:color-mix(in srgb,var(--accent),var(--ink) 14%);transform:translateY(-2px)}.history-hero-art{align-self:center;min-width:0}.history-hero-art img{display:block;width:100%;height:auto;max-height:480px;object-fit:contain}.history-hero-art figcaption{font:italic 16px/1.5 var(--history-serif);text-align:center;color:var(--muted);margin-top:14px}
.history-tools{max-width:1120px;margin:0 auto 112px;padding:0 30px}.history-tools-heading{display:flex;align-items:baseline;gap:20px;justify-content:space-between}.history-tools h2{font:400 clamp(27px,3vw,38px)/1.2 var(--history-serif);letter-spacing:-.02em;text-wrap:balance}.history-tools-heading button{flex-shrink:0;min-height:44px;background:none;color:var(--accent);font-size:13px;text-decoration:underline;text-underline-offset:4px}.history-tools>p{font-size:14px;color:var(--muted);line-height:1.6;margin-top:12px}.history-filters{border:0;padding:0;margin:28px 0 0;display:grid;grid-template-columns:1fr 1fr;grid-auto-flow:dense;gap:0}.history-filter{display:flex;align-items:center;gap:13px;min-height:74px;border-top:1px solid var(--line);padding:16px 18px;font-size:14px;line-height:1.45;cursor:pointer;position:relative;transition:background .18s}.history-filter:nth-of-type(odd){padding-left:0}.history-filter:nth-of-type(even){padding-right:0}.history-filter:nth-last-of-type(-n+2){border-bottom:1px solid var(--line)}.history-filter:hover{background:var(--surface-2)}.history-filter input{position:absolute;opacity:0;width:22px;height:22px;left:18px}.history-filter:nth-of-type(odd) input{left:0}.history-filter-check{width:23px;height:23px;flex-shrink:0;border:1px solid currentColor;border-radius:5px;position:relative}.history-filter-check:after{content:'';position:absolute;inset:5px 4px 7px;border-bottom:2px solid currentColor;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:0}.history-filter input:checked+.history-filter-check:after{opacity:1}.history-filter input:focus-visible+.history-filter-check{outline:2px solid var(--accent);outline-offset:4px}.history-filter-number{margin-left:auto;min-width:26px;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.history-baptist{color:var(--history-baptist)}.history-bible{color:var(--history-bible)}.history-catholic{color:var(--history-catholic)}.history-other{color:var(--history-other)}.history-search-row{display:grid;grid-template-columns:1fr 230px;gap:28px;margin-top:28px}.history-search>span,.history-year-form>label{display:block;font-size:12px;color:var(--muted);margin-bottom:9px}.history-search input,.history-year-form input{border:1px solid var(--line-strong);border-radius:8px;padding:12px 14px;background:var(--surface);color:var(--ink);font-size:16px;min-height:48px;width:100%;min-width:0}.history-search input::placeholder,.history-year-form input::placeholder{color:var(--muted);opacity:1}.history-year-form>div{display:flex;gap:8px}.history-year-form input{width:110px}.history-year-form button{background:var(--ink);color:var(--paper);padding:0 14px;border-radius:8px;font-size:13px}.history-toolbar{display:flex;align-items:center;justify-content:space-between;gap:20px;flex-wrap:wrap;font-size:12px;color:var(--muted);margin-top:18px}.history-jump-status:empty{display:none}.history-jump-status{color:var(--accent)!important;font-size:13px!important}
.history-reading-layout{max-width:1420px;padding:0 4%;margin:auto;display:grid;grid-template-columns:160px minmax(0,1fr);gap:54px;align-items:start}.history-era-nav{position:sticky;top:32px;display:flex;flex-direction:column;gap:3px;align-self:start;padding:4px 0 28px}.history-era-nav>p{font:italic 20px var(--history-serif);margin-bottom:19px}.history-era-nav a{display:grid;gap:6px;min-height:62px;padding:10px 12px;margin-left:-12px;text-decoration:none;font-size:12px;line-height:1.45;color:var(--muted);border-radius:7px;transition:background .2s,color .2s}.history-era-nav a>span:first-child{font-size:11px;letter-spacing:.04em;color:var(--faint)}.history-era-nav a[aria-current],.history-era-nav a:hover{background:var(--accent-soft);color:var(--accent)}.history-timeline{position:relative;min-width:0;outline:none}.history-line{position:absolute;left:83px;top:90px;bottom:40px;width:1px;background:var(--line-strong);pointer-events:none}.history-line>span{display:block;background:var(--accent);height:100%;width:1px;transform-origin:top;transform:scaleY(0)}.history-epoch{scroll-margin-top:32px;margin-bottom:98px;position:relative}.history-epoch-heading{display:grid;grid-template-columns:1fr auto;gap:6px 20px;align-items:baseline;padding-bottom:32px;border-bottom:1px solid var(--line);margin-bottom:18px;position:relative;background:var(--paper)}.history-epoch-heading h2{font:400 clamp(29px,3.1vw,44px)/1.15 var(--history-serif);letter-spacing:-.025em;grid-column:1}.history-epoch-heading p{font-size:13px;color:var(--muted);grid-column:1}.history-epoch-heading>span{grid-column:2;grid-row:1/3;align-self:center;font:italic 23px var(--history-serif);color:var(--accent);font-variant-numeric:tabular-nums}.history-year{display:grid;grid-template-columns:84px minmax(0,1fr);gap:28px;scroll-margin-top:32px;position:relative}.history-year-date{padding-top:34px;position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:5px;font-variant-numeric:tabular-nums}.history-year-date:after{content:'';width:7px;height:7px;border-radius:50%;border:1px solid var(--accent);background:var(--paper);position:absolute;right:-3px;top:45px}.history-year-date>a{font:400 29px/1 var(--history-serif);text-decoration:none;letter-spacing:-.025em}.history-year-date>span{font-size:10px;color:var(--muted)}.history-year-body{min-width:0;border-bottom:1px solid var(--line);padding:30px 0}.history-event{scroll-margin-top:35px;padding:0 0 24px;margin-bottom:24px;border-bottom:1px solid var(--line)}.history-event:last-child{border:0;margin-bottom:0;padding-bottom:0}.history-category{display:inline-flex;align-items:center;gap:7px;font-size:10px;line-height:1.45;letter-spacing:.015em}.history-category:before{content:'';display:inline-block;flex-shrink:0;width:5px;height:5px;border-radius:50%;background:currentColor}.history-event h3{font:400 clamp(23px,2.1vw,30px)/1.24 var(--history-serif);letter-spacing:-.015em;margin-top:10px;text-wrap:balance}.history-event h3 a{text-decoration:none}.history-event h3 a:hover{text-decoration:underline;text-decoration-thickness:1px}.history-event-copy>p{font:400 16px/1.8 var(--history-serif);margin-top:15px;max-width:72ch}.history-references{display:flex;gap:8px 18px;flex-wrap:wrap;margin-top:16px;font-size:11px;color:var(--muted);line-height:1.6}.history-references a{text-decoration-color:var(--line-strong)}.history-references a:hover{color:var(--accent)}
.history-group{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(180px,1fr);align-items:center;gap:18px}.history-group-art img{width:100%;height:auto;display:block;object-fit:contain;aspect-ratio:1}.history-group-art figcaption{font-size:10px;line-height:1.6;color:var(--muted);text-align:center;max-width:260px;margin:8px auto 0}.history-group-about{margin-top:16px;font:13px/1.7 var(--history-sans);color:var(--muted)}.history-group-about summary{cursor:pointer;color:var(--accent);min-height:32px}.history-group-about p{margin:12px 0}.history-group-region{font-size:11px}.history-group-about>a{font-size:11px}.history-empty{padding:65px 0;position:relative;background:var(--paper)}.history-empty h2{font:32px var(--history-serif)}.history-empty p{margin-top:14px;color:var(--muted)}.history-empty button{margin-top:24px;padding:14px 20px;border-radius:8px;background:var(--accent);color:var(--on-accent)}.history-footer{max-width:1340px;margin:auto;border-top:1px solid var(--line);padding:35px 5%;display:flex;justify-content:space-between;align-items:center;gap:20px}.history-footer p{font:italic 17px var(--history-serif);color:var(--muted)}.history-footer>a:last-child{font-size:12px;min-height:44px;display:flex;align-items:center}
@media(min-width:1500px){.history-reading-layout{gap:80px;grid-template-columns:180px minmax(0,1fr)}}
@media(max-width:1050px){.history-reading-layout{gap:28px;grid-template-columns:130px minmax(0,1fr)}.history-group{grid-template-columns:minmax(0,1fr)}.history-group-art{max-width:320px;margin:auto}.history-hero{min-height:570px}.history-event-copy>p{font-size:16px}.history-group-art img{max-height:300px}.history-era-nav a{padding-right:0}}
@media(max-width:720px){.history-header{min-height:68px;padding:10px 20px;gap:18px}.history-brand{font-size:23px}.history-brand img{width:29px;height:29px}.history-back{font-size:12px}.history-theme-label{font-size:0;gap:0}.history-theme-label select{font-size:12px;padding:0 8px;max-width:100px}.history-hero{grid-template-columns:1fr;gap:28px;padding:52px 24px 64px;min-height:0}.history-hero h1{font-size:clamp(37px,9vw,63px);letter-spacing:-.035em}.history-hero-copy>p{font-size:15px;margin-top:24px;max-width:48ch}.history-hero-actions{gap:22px;margin-top:26px;font-size:12px}.history-primary{padding:0 15px}.history-hero-art{width:min(85%,360px);margin:auto}.history-hero-art img{max-height:330px}.history-hero-art figcaption{font-size:14px}.history-tools{padding:0 22px;margin-bottom:60px}.history-tools h2{font-size:28px;max-width:270px}.history-tools-heading{gap:10px;align-items:center}.history-tools-heading button{font-size:11px}.history-tools>p{font-size:13px}.history-filters{grid-template-columns:1fr}.history-filter,.history-filter:nth-of-type(even),.history-filter:nth-of-type(odd){min-height:65px;padding:15px 0;font-size:13px}.history-filter:nth-last-of-type(2){border-bottom:0}.history-filter input,.history-filter:nth-of-type(odd) input{left:0}.history-filter-number{font-size:11px}.history-search-row{grid-template-columns:1fr;gap:18px;margin-top:23px}.history-year-form>div{max-width:265px}.history-year-form input{flex:1;width:120px}.history-toolbar{gap:0;font-size:11px;align-items:flex-start;flex-direction:column}.history-toolbar>span{margin-top:5px}.history-reading-layout{display:block;padding:0 22px}.history-era-nav{position:relative;top:auto;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 12px;margin-bottom:45px;padding-bottom:22px;border-bottom:1px solid var(--line)}.history-era-nav>p{grid-column:1/-1;font-size:21px;margin-bottom:5px}.history-era-nav a{margin:0;min-height:62px;padding:10px;font-size:11px;gap:4px}.history-era-nav a>span:first-child{font-size:10px}.history-epoch{margin-bottom:60px}.history-epoch-heading{gap:9px;padding-bottom:23px;margin-bottom:10px}.history-epoch-heading h2{font-size:28px}.history-epoch-heading p{font-size:11px}.history-epoch-heading>span{font-size:16px}.history-line{left:54px;top:83px}.history-year{grid-template-columns:55px minmax(0,1fr);gap:16px}.history-year-date>a{font-size:23px}.history-year-date>span{font-size:9px}.history-year-date:after{top:42px}.history-year-body{padding:29px 0}.history-category{font-size:9px;letter-spacing:0}.history-event h3{font-size:24px;overflow-wrap:anywhere}.history-event-copy>p{font-size:15px;line-height:1.75;margin-top:13px}.history-references{font-size:10px;margin-top:14px;gap:8px}.history-group{gap:22px}.history-group-art{max-width:270px}.history-group-art img{max-height:270px}.history-group-about{font-size:12px}.history-group-about summary{line-height:1.6;min-height:44px}.history-footer{padding:25px 22px;gap:10px;flex-wrap:wrap}.history-footer .history-brand{font-size:23px}.history-footer p{font-size:14px}.history-footer>a:last-child{font-size:11px}}
@media(prefers-reduced-motion:reduce){html:has(.history-app),.history-app *{scroll-behavior:auto!important;animation:none!important;transition:none!important}.history-line>span{transform:scaleY(1)}}
@media print{.history-app{background:white!important;color:black!important}.history-header,.history-tools,.history-era-nav,.history-line,.history-hero-actions,.history-footer{display:none}.history-hero{min-height:0;padding:20px}.history-reading-layout{display:block;padding:0}.history-year{break-inside:avoid}.history-event-copy>p{font-size:11pt}.history-group-art img{max-width:180px}}

/* Reading extensions: the acrostic, historical comparison and tagged library. */
.history-beliefs,.history-ages,.history-library{--history-secondary:color-mix(in srgb,var(--muted) 92%,var(--ink));max-width:1120px;margin:0 auto 128px;padding:0 30px;scroll-margin-top:32px}
.history-section-intro{display:grid;grid-template-columns:1fr 1fr;gap:56px;align-items:start}.history-section-intro h2,.history-library h2{font:400 clamp(32px,3.7vw,50px)/1.15 var(--history-serif);letter-spacing:-.025em;text-wrap:balance}.history-section-intro h2 em,.history-library h2 em{font-weight:400;color:var(--accent)}.history-section-intro>div>p{font:16px/1.8 var(--history-serif);max-width:64ch}.history-section-intro>div>p+p{margin-top:18px;color:var(--history-secondary)}.history-section-intro strong{font-weight:400;color:var(--accent);letter-spacing:.06em}
.history-principles{display:grid;grid-template-columns:1fr 1fr;column-gap:56px;margin:48px 0 0;padding:0;list-style:none}.history-principles li{display:grid;grid-template-columns:44px minmax(0,1fr);gap:22px;padding:28px 0;border-top:1px solid var(--line)}.history-principles li:nth-last-child(-n+2){border-bottom:1px solid var(--line)}.history-principle-letter{font:italic 60px/1 var(--history-serif);color:var(--accent)}.history-principles h3{font:400 24px/1.25 var(--history-serif);letter-spacing:-.01em;text-wrap:balance}.history-principles li p{font:14px/1.8 var(--history-serif);color:var(--history-secondary);margin-top:12px}.history-principle-verses{display:flex;flex-wrap:wrap;gap:0 16px;margin-top:5px}.history-principle-verses a{display:inline-flex;align-items:center;min-height:44px;font-size:12px;text-decoration-color:var(--line-strong)}.history-principle-verses a:hover{color:var(--accent);text-decoration-color:currentColor}
.history-ages{margin-top:128px}.history-age-controls{display:grid;grid-template-columns:1.6fr 1fr 1.15fr;gap:24px;margin-top:40px}.history-age-controls>label,.history-age-year-field{display:flex;flex-direction:column;gap:10px;min-width:0;font-size:12px;color:var(--history-secondary)}.history-age-controls input,.history-age-controls select{width:100%;min-width:0;min-height:48px;border:1px solid var(--line-strong);border-radius:8px;padding:10px 12px;color:var(--ink);background:var(--surface);font:16px/1.4 var(--history-sans)}.history-age-controls input::placeholder{color:var(--history-secondary);opacity:1}.history-age-year-control{display:flex;gap:8px}.history-age-year-control input{width:100px;flex:1}.history-age-year-control button,.history-age-empty button{min-height:48px;padding:10px 13px;border-radius:8px;background:var(--ink);color:var(--paper);font-size:13px}.history-age-year-control button:hover,.history-age-empty button:hover{background:var(--accent);color:var(--on-accent)}.history-age-error:empty{display:none}.history-age-error{margin-top:12px!important;color:var(--accent);font-size:13px;line-height:1.6}.history-age-meta{display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap;margin:26px 0 16px;font-size:12px;color:var(--history-secondary);line-height:1.6}
.history-age-table{width:100%;border-collapse:collapse;text-align:left;table-layout:fixed}.history-age-table thead th{font-size:12px;font-weight:400;color:var(--history-secondary);padding:14px 16px 14px 0;border-top:1px solid var(--line-strong);border-bottom:1px solid var(--line-strong)}.history-age-table thead th:first-child{width:63%}.history-age-table thead th:nth-child(2){width:14%}.history-age-table thead th:last-child{width:23%}.history-age-table tbody tr{border-bottom:1px solid var(--line)}.history-age-table tbody th,.history-age-table tbody td{padding:22px 20px 22px 0;vertical-align:top;font-weight:400}.history-age-table tbody th>a{display:inline-flex;align-items:center;min-height:32px;font:400 22px/1.35 var(--history-serif);text-decoration:none}.history-age-table tbody th>a:hover{text-decoration:underline;text-decoration-thickness:1px;color:var(--accent)}.history-age-table tbody th p{font:12px/1.65 var(--history-sans);color:var(--history-secondary);margin-top:7px;max-width:65ch}.history-age-start,.history-age-number{font:400 23px/1.4 var(--history-serif);font-variant-numeric:tabular-nums}.history-age-start{color:var(--history-secondary)}.history-age-approx{font:12px var(--history-sans)}.history-age-number{color:var(--accent)}.history-age-table td:last-child{padding-right:0}.history-age-bar{display:block;height:3px;background:var(--line);margin-top:12px;width:100%;max-width:140px}.history-age-bar>span{display:block;width:100%;height:100%;background:var(--accent);transform:scaleX(var(--age-share));transform-origin:left;transition:transform .2s}.history-age-future .history-age-number{font:13px/1.6 var(--history-sans);color:var(--history-secondary)}.history-age-empty{padding:35px 0;font:16px/1.7 var(--history-serif)}.history-age-empty button{margin-top:16px}
.history-library-heading{display:flex;justify-content:space-between;align-items:baseline;gap:24px}.history-library-heading>a{font-size:13px;min-height:44px;display:inline-flex;align-items:center;gap:12px;color:var(--accent)}.history-library-intro{font:16px/1.8 var(--history-serif);color:var(--history-secondary);max-width:65ch;margin-top:22px!important}.history-library-list{display:grid;grid-template-columns:1fr 1fr;column-gap:56px;margin-top:36px}.history-library-list article{border-top:1px solid var(--line);padding:30px 0}.history-book-author{font-size:12px;color:var(--history-secondary);line-height:1.6}.history-library-list h3{font:400 26px/1.3 var(--history-serif);letter-spacing:-.015em;margin-top:10px;text-wrap:balance}.history-library-list h3>a{display:flex;gap:24px;justify-content:space-between;text-decoration:none}.history-library-list h3>a:hover{text-decoration:underline;text-decoration-thickness:1px;color:var(--accent)}.history-library-list h3 span{font:18px var(--history-sans);flex-shrink:0;color:var(--accent)}.history-book-description{font:15px/1.8 var(--history-serif);color:var(--history-secondary);margin-top:14px!important}
@media(max-width:1050px){.history-section-intro,.history-principles,.history-library-list{column-gap:36px}.history-age-controls{grid-template-columns:1.4fr 1fr;gap:20px}.history-age-controls>label:last-child{grid-column:1/-1;max-width:300px}}
@media(max-width:720px){.history-beliefs,.history-ages,.history-library{padding:0 22px;margin-bottom:72px}.history-section-intro{grid-template-columns:1fr;gap:24px}.history-section-intro h2,.history-library h2{font-size:34px}.history-section-intro>div>p{font-size:15px;line-height:1.8}.history-principles{grid-template-columns:1fr;margin-top:32px}.history-principles li{grid-template-columns:33px minmax(0,1fr);gap:18px;padding:26px 0}.history-principles li:nth-last-child(2){border-bottom:0}.history-principle-letter{font-size:48px}.history-principles h3{font-size:23px}.history-principles li p{font-size:14px}.history-principle-verses{gap:0 12px}.history-principle-verses a{font-size:12px}.history-ages{margin-top:72px}.history-age-controls{grid-template-columns:1fr;gap:18px;margin-top:28px}.history-age-controls>label:last-child{grid-column:auto;max-width:none}.history-age-year-control{max-width:280px}.history-age-meta{font-size:12px;gap:6px;margin-top:22px}.history-age-meta>span{display:none}.history-age-table thead th{font-size:11px;padding:12px 10px 12px 0}.history-age-table thead th:first-child{width:56%}.history-age-table thead th:nth-child(2){width:16%}.history-age-table thead th:last-child{width:28%}.history-age-table tbody th,.history-age-table tbody td{padding:19px 12px 19px 0}.history-age-table tbody th>a{font-size:18px;min-height:44px;align-items:flex-start}.history-age-table tbody th p{font-size:12px;line-height:1.6;margin-top:5px;overflow-wrap:anywhere}.history-age-start{font-size:16px;line-height:1.6}.history-age-number{font-size:17px;line-height:1.5}.history-age-approx{font-size:10px}.history-age-bar{max-width:100px;margin-top:9px}.history-age-future .history-age-number{font-size:12px;overflow-wrap:anywhere}.history-library-heading{display:block}.history-library-heading>a{font-size:12px;margin-top:12px}.history-library-intro{font-size:15px;margin-top:15px!important}.history-library-list{grid-template-columns:1fr;margin-top:28px}.history-library-list article{padding:25px 0}.history-library-list h3{font-size:25px}.history-book-description{font-size:15px}}
@media print{.history-age-controls,.history-age-meta{display:none}.history-beliefs,.history-ages,.history-library{max-width:none;padding:0;margin:30px 0}.history-principles li,.history-library-list article{break-inside:avoid}.history-age-table{font-size:10pt}.history-age-table tbody th>a,.history-age-number,.history-age-start{font-size:12pt}.history-age-table tbody tr{break-inside:avoid}}

/* Dated legal source notes stay adjacent to their historical event. */
.history-event-copy>.history-event-notice{width:fit-content;max-width:100%;margin-top:16px;padding:8px 10px;border:1px solid var(--line-strong);border-radius:6px;background:var(--surface);color:var(--ink);font:12px/1.6 var(--history-sans);overflow-wrap:anywhere}
