@font-face {
  font-family: "Fette UNZ Fraktur";
  src: url('/static/fonts/fette-unz-fraktur.woff2') format('woff2');
  font-display: swap;
}
:root {
  color-scheme: light;
  --paper: #f8f6f0;
  --surface: #fffdf8;
  --ink: #292b26;
  --soft: #606257;
  --gold: #886520;
  --line: #deddd2;
  --selection: #f0e5c8;
  --focus: #916a19;
  --header: rgba(248, 246, 240, .97);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #191d18;
  --surface: #22271f;
  --ink: #eeede5;
  --soft: #b4b9aa;
  --gold: #d8bb72;
  --line: #3b4337;
  --selection: #3b3523;
  --focus: #e0c47e;
  --header: rgba(25, 29, 24, .97);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --paper: #191d18;
    --surface: #22271f;
    --ink: #eeede5;
    --soft: #b4b9aa;
    --gold: #d8bb72;
    --line: #3b4337;
    --selection: #3b3523;
    --focus: #e0c47e;
    --header: rgba(25, 29, 24, .97);
  }
}
* { box-sizing: border-box; }
html { scroll-padding-top: 100px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.6 Inter, system-ui, sans-serif; }
a { color: var(--gold); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; }
button, input, select { border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); min-height: 44px; padding: 9px 12px; }
button { cursor: pointer; font-weight: 500; }
button:hover { border-color: var(--gold); }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.icon { display: block; width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; width: 44px; min-height: 44px; padding: 10px; flex: none; text-decoration: none; }
a.icon-button { border: 1px solid transparent; border-radius: 5px; }
a.icon-button:hover { text-decoration: none; border-color: var(--line); background: var(--surface); }
input, select { width: 100%; min-width: 0; }
select { padding-right: 26px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
[hidden] { display: none !important; }
::selection { background: var(--selection); color: var(--ink); }
.skip-link { position: fixed; top: 10px; left: 15px; z-index: 10; padding: 10px 16px; background: var(--surface); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.site-header { min-height: 78px; padding: 16px clamp(20px, 4vw, 56px); display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); background: var(--header); }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font: 27px/1 "Fette UNZ Fraktur", Newsreader, Georgia, serif; }
.brand img { flex: none; }
.site-header nav { display: flex; align-items: center; gap: 24px; font-size: 13px; }
.site-header nav a { text-decoration: none; }
.library-link { color: var(--ink); }
.app-link { padding: 8px 14px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); }
.theme-toggle { color: var(--soft); border-color: transparent; background: transparent; }
main { width: min(1160px, calc(100% - 64px)); margin: 0 auto; min-height: 60vh; padding: 60px 0 90px; }
h1, h2, h3, h4, h5, h6 { font-family: Newsreader, Georgia, serif; font-weight: 400; line-height: 1.2; }
h1 { font-size: clamp(38px, 5vw, 58px); letter-spacing: -.035em; margin: 12px 0 20px; overflow-wrap: anywhere; }
h2 { font-size: 30px; margin: 0 0 24px; }
h3 { font-size: 25px; }
h4 { font-size: 22px; }
p { margin: 0 0 18px; }
.intro { max-width: 800px; margin-bottom: 52px; }
.intro > p:not(.eyebrow):not(.source) { font-size: 17px; color: var(--soft); max-width: 620px; }
.eyebrow { font: 500 11px/1.6 Inter, system-ui, sans-serif; color: var(--gold); text-transform: uppercase; letter-spacing: .12em; margin-bottom: 12px; }
.eyebrow a { text-decoration: none; }
.muted, .source, .link-help, .edition-note { color: var(--soft); font-size: 13px; }
.source { margin: 20px 0; line-height: 1.9; }
.source a { white-space: normal; }
.edition-note { border-left: 2px solid var(--line); padding-left: 15px; max-width: 580px; }
.bible-card { display: grid; gap: 8px; padding: 27px 30px; margin-top: 30px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 4px; text-decoration: none; color: var(--ink); max-width: 620px; }
.bible-card:hover { text-decoration: none; border-color: var(--gold); }
.bible-card > span:first-child { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); }
.bible-card strong { font: 400 31px/1.2 Newsreader, Georgia, serif; }
.bible-card > span:last-child { font-size: 12px; color: var(--soft); }
.catalogue { padding-top: 32px; border-top: 1px solid var(--line); }
.search { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 26px; max-width: 800px; }
.search label { flex: 2 1 260px; }
.search label + label { flex: 1 1 200px; }
label { display: grid; gap: 7px; color: var(--soft); font-size: 12px; min-width: 0; }
.search button { background: var(--ink); color: var(--paper); border-color: var(--ink); padding-inline: 22px; }
.search button:hover { opacity: .85; }
.search > .icon-button { width: 44px; padding: 10px; flex: 0 0 44px; }
.reference-search { margin-top: 24px; }
.document-list { list-style: none; margin: 0; padding: 0; }
.document-list li { padding: 21px 0; border-bottom: 1px solid var(--line); }
.document-list a { font: 400 23px/1.3 Newsreader, Georgia, serif; display: inline-block; text-decoration: none; color: var(--ink); overflow-wrap: anywhere; }
.document-list a:hover { color: var(--gold); }
.document-list span { display: block; color: var(--soft); font-size: 12px; margin-top: 7px; overflow-wrap: anywhere; }
.reader-layout { display: grid; grid-template-columns: 225px minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.reader-layout aside { position: sticky; top: 28px; font-size: 12px; max-height: calc(100vh - 60px); overflow-y: auto; padding-right: 16px; scrollbar-width: thin; }
.reader-layout aside > a { display: inline-block; margin-bottom: 26px; text-decoration: none; }
.reader-layout aside summary { font-weight: 500; cursor: pointer; color: var(--ink); padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.contents { list-style: none; padding: 0; margin: 16px 0 0; }
.contents li { margin: 0 0 12px; }
.contents a { color: var(--soft); text-decoration: none; display: block; overflow-wrap: anywhere; line-height: 1.5; }
.contents a:hover, .contents a[aria-current="location"] { color: var(--gold); }
.reader { min-width: 0; max-width: 740px; }
.reader-heading { padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 30px; }
.reader-heading h1 { font-size: clamp(36px, 4.4vw, 52px); margin-bottom: 12px; }
.reader-heading > .muted { margin-bottom: 12px; }
.reader-heading .link-help { font-size: 12px; margin: 18px 0 0; }
.copy-link { margin-top: 18px; font-size: 12px; min-height: 38px; padding: 7px 12px; color: var(--gold); }
.document-text, .scripture { font: 400 22px/1.65 Newsreader, Georgia, serif; overflow-wrap: anywhere; }
.passage { position: relative; display: flow-root; padding: 5px 10px 5px 31px; margin-left: -31px; scroll-margin-top: 26px; border-radius: 3px; }
.passage + .passage { margin-top: 10px; }
.passage:target, .passage.range-selected { background: var(--selection); }
.passage p:last-child { margin-bottom: 10px; }
.permalink { position: absolute; top: 8px; left: 2px; width: 25px; min-height: 32px; text-align: center; font: 15px/1.7 Georgia, serif; text-decoration: none; color: var(--gold); opacity: .55; }
.passage:hover > .permalink, .permalink:focus-visible, .passage:target > .permalink { opacity: 1; }
.passage.heading { margin-top: 35px; }
.passage.heading h2, .passage.heading h3, .passage.heading h4 { margin: 10px 0 18px; }
.document-text ul, .document-text ol { padding-left: 26px; }
.document-text blockquote { margin: 16px 0; padding-left: 22px; border-left: 2px solid var(--line); }
.document-text table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 18px; }
.document-text td, .document-text th { padding: 8px 12px; border: 1px solid var(--line); }
.document-text img { max-width: 100%; height: auto; }
.document-text pre { overflow-x: auto; font-size: 15px; }
.book-section { margin: 46px 0 0; padding-top: 30px; border-top: 1px solid var(--line); }
.book-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 30px; list-style: none; margin: 0; padding: 0; }
.book-grid li { border-bottom: 1px solid var(--line); padding: 17px 0; min-width: 0; }
.book-grid a { display: block; font: 400 22px/1.3 Newsreader, Georgia, serif; color: var(--ink); text-decoration: none; }
.book-grid a:hover { color: var(--gold); }
.book-grid span { font-size: 11px; color: var(--soft); }
.chapter-grid { list-style: none; padding: 0; margin: 30px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 10px; }
.chapter-grid a { display: grid; place-items: center; min-height: 48px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; border-radius: 3px; }
.chapter-grid a:hover { border-color: var(--gold); }
.bible-reader { margin: 0 auto; }
.bible-reader h1 { font-size: clamp(44px, 5vw, 62px); }
.reader-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-top: 25px; }
.reader-tools label { display: none; }
.enhanced .reader-tools label { display: grid; }
.reader-tools label:first-child { flex: 2 1 180px; }
.reader-tools label:nth-child(2) { flex: 1 1 75px; }
.reader-tools > a { font-size: 12px; padding: 12px 0; }
.verse { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; margin: 0 -12px 0 -12px; padding: 8px 12px; border-radius: 3px; scroll-margin-top: 25px; }
.verse:target, .verse.range-selected { background: var(--selection); }
.verse-number { font: 500 11px/2.1 Inter, system-ui, sans-serif; text-align: right; color: var(--gold); text-decoration: none; padding-top: 5px; align-self: start; min-height: 32px; }
.verse-number:hover { text-decoration: underline; }
.verse-number:focus-visible { outline-offset: 1px; }
.chapter-navigation { display: flex; justify-content: space-between; gap: 24px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 12px; }
.chapter-navigation a { text-decoration: none; }
.chapter-navigation a:last-child { text-align: right; margin-left: auto; }
.chapter-navigation span { display: block; color: var(--soft); font-size: 11px; margin-top: 5px; }
.site-footer { border-top: 1px solid var(--line); padding: 25px clamp(20px, 4vw, 56px); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; color: var(--soft); font-size: 11px; }
.site-footer a { text-decoration: none; }
.link-status { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); max-width: calc(100vw - 32px); border-radius: 5px; font-size: 13px; text-align: center; z-index: 5; }
.link-status:not(:empty) { padding: 12px 20px; }
@media (max-width: 900px) {
  .reader-layout { grid-template-columns: 180px minmax(0, 1fr); gap: 32px; }
  .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .site-header { min-height: 70px; padding: 14px 20px; gap: 12px; }
  .site-header nav { gap: 15px; font-size: 12px; }
  .app-link { padding-inline: 9px; }
  main { width: calc(100% - 44px); padding-top: 38px; padding-bottom: 58px; }
  .intro { margin-bottom: 36px; }
  h1 { font-size: 39px; }
  .bible-card { padding: 22px; }
  .bible-card strong { font-size: 28px; }
  .search label, .search label + label { flex: 1 1 100%; }
  .search label + label { flex-basis: calc(100% - 56px); }
  .search button { width: 100%; }
  .reference-search label { flex: 1 1 180px; }
  .reference-search button { width: auto; }
  .reader-layout { display: block; }
  .reader-layout aside { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; max-height: none; overflow: visible; padding: 0 0 12px; margin-bottom: 25px; border-bottom: 1px solid var(--line); }
  .reader-layout aside > a { grid-column: 1; grid-row: 1; display: inline-flex; align-items: center; min-height: 36px; margin: 0; justify-self: start; position: relative; z-index: 1; }
  .reader-layout aside details { grid-column: 2; grid-row: 1; padding: 0; border: 0; background: transparent; }
  .reader-layout aside summary { border: 0; padding: 9px 0 9px 10px; min-height: 36px; font-size: 12px; }
  .reader-layout aside details[open] { grid-column: 1 / -1; padding-top: 42px; }
  .reader-layout aside details[open] summary { position: absolute; top: 0; right: 0; }
  .contents { max-height: 240px; overflow-y: auto; padding-right: 6px; }
  .reader-layout aside details[open] .contents { margin: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
  .reader-heading h1 { font-size: 36px; }
  .bible-reader h1 { font-size: 45px; }
  .reader-heading { margin-bottom: 25px; }
  .document-text, .scripture { font-size: 21px; line-height: 1.65; }
  .passage { margin-left: -15px; padding-left: 25px; }
  .permalink { left: 0; width: 20px; font-size: 13px; }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
  .book-grid a { font-size: 21px; }
  .verse { gap: 10px; grid-template-columns: 24px minmax(0, 1fr); }
  .site-footer { padding: 22px; }
  .site-footer span { order: 3; width: 100%; }
}
@media print {
  :root { --paper: white; --ink: black; --soft: #444; --gold: #444; --line: #ccc; }
  .site-header, .site-footer, .reader-layout aside, .reader-tools, .reference-search, .copy-link, .link-help, .link-status, .chapter-navigation, .permalink { display: none; }
  main { width: 100%; padding: 0; }
  .reader-layout { display: block; }
  .reader { max-width: none; }
  .reader-heading h1 { font-size: 30px; }
  .document-text, .scripture { font-size: 12pt; }
  .verse, .passage { break-inside: avoid; }
}
@media (max-width: 380px) {
  .brand span { display: none; }
  .site-header nav { gap: 12px; }
}

/* Sharing controls stay outside the source text and remain usable by touch. */
[data-copy-passage], [data-copy-edition] { display: none; }
.permalink, .verse-number, .subsection-links, [data-copy-passage] { user-select: none; }
.enhanced [data-copy-passage], .enhanced [data-copy-edition] { display: inline-flex; align-items: center; justify-content: center; }
[data-copy-passage] { width: 30px; min-height: 30px; padding: 6px; color: var(--soft); background: transparent; border-color: transparent; margin: 0; opacity: 0; pointer-events: none; transition: opacity .15s; flex: none; }
[data-copy-passage] svg { display: block; }
[data-copy-passage] .icon { width: 16px; height: 16px; }
[data-copy-passage]:hover { color: var(--gold); border-color: transparent; background: var(--selection); }
.passage { padding-right: 34px; }
.passage > [data-copy-passage] { position: absolute; top: 5px; right: 0; }
.passage > .passage { margin-right: -34px; }
.passage > .passage { clear: both; }
.verse { grid-template-columns: 30px minmax(0, 1fr) 30px; }
.verse > [data-copy-passage] { grid-column: 3; grid-row: 1; align-self: start; margin: 3px 0 0; }
.verse > span:not(.subsection-controls) { grid-column: 2; grid-row: 1; }
.passage:focus-within:not(:has(.passage:focus-within)) > [data-copy-passage],
.verse:focus-within > [data-copy-passage], [data-copy-passage]:focus-visible { opacity: .8; pointer-events: auto; }
@media (hover: hover) and (pointer: fine) {
  .passage:hover:not(:has(.passage:hover)) > [data-copy-passage],
  .verse:hover > [data-copy-passage] { opacity: .8; pointer-events: auto; }
}
.subsection-links { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 12px; clear: both; margin: 2px 0 12px; font: 12px/1.5 Inter, system-ui, sans-serif; }
.subsection-links [data-copy-passage] { margin: 0; }
.subsection-permalink, .passage-number { color: inherit; text-decoration: none; }
.subsection-permalink:hover, .passage-number:hover { color: var(--gold); text-decoration: underline; }
.enhanced .subsection-links { display: none; }
.share-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.share-actions button, [data-copy-edition] { font-size: 12px; min-height: 38px; padding: 8px 12px; color: var(--gold); }
.share-actions .icon-button, .edition-tools .icon-button { min-height: 44px; padding: 10px; }
.share-actions .copy-link { margin: 0; }
.share-actions button:disabled { color: var(--soft); opacity: .65; cursor: default; }
.selection-help { font: 12px/1.6 Inter, system-ui, sans-serif; color: var(--soft); margin: 12px 0 0; }
.quote-highlight { background: var(--selection); color: var(--ink); outline: 1px solid var(--gold); outline-offset: 2px; border-radius: 2px; }
.subsection-highlight { background: var(--selection); color: var(--ink); border-radius: 2px; }
.share-dialog { width: min(560px, calc(100vw - 40px)); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 28px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); }
.share-dialog::backdrop { background: rgba(0, 0, 0, .45); }
.share-dialog h2 { margin: 0 44px 12px 0; }
.share-dialog p { color: var(--soft); font-size: 14px; }
.share-dialog input { font-size: 13px; }
.share-dialog > .icon-button { position: absolute; top: 12px; right: 12px; margin: 0; background: transparent; border-color: transparent; }
.edition-tools { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; }
.edition-tools .muted { margin-bottom: 10px; overflow-wrap: anywhere; }
.edition-tools .copy-link { margin: 0 0 0 8px; }
.retired-anchor-notice { margin: 18px 0 0; padding: 13px 15px; background: var(--selection); color: var(--ink); border-radius: 4px; font: 13px/1.6 Inter, system-ui, sans-serif; }

/* Reader utilities share one row; source and edition details open on demand. */
.document-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin-top: 14px; color: var(--soft); font-size: 13px; }
.document-toolbar > a, .document-toolbar > .source { min-width: 0; margin: 0; line-height: 1.4; overflow-wrap: anywhere; }
.document-toolbar > a { text-decoration: none; }
.document-toolbar > a:hover { text-decoration: underline; }
.language-selector { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: 0 1 auto; max-width: 100%; }
.language-selector select { width: auto; max-width: min(260px, calc(100vw - 130px)); font-size: 13px; }
.language-selector select:disabled { opacity: 1; color: var(--soft); cursor: default; }
.reader-actions { display: flex; align-items: center; gap: 3px; flex: none; }
.document-toolbar .icon-button { width: 44px; min-height: 44px; padding: 10px; margin: 0; border: 1px solid transparent; background: transparent; color: var(--soft); }
.document-toolbar .icon-button:hover { color: var(--ink); background: var(--surface); border-color: var(--line); text-decoration: none; }
.document-details { position: relative; padding: 0; margin: 0; border: 0; }
.document-details > summary { cursor: pointer; list-style: none; }
.document-details > summary::-webkit-details-marker { display: none; }
.document-details[open] > summary { color: var(--gold); background: var(--selection); }
.document-details > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.details-panel { position: absolute; right: 0; top: calc(100% + 10px); z-index: 6; width: min(520px, calc(100vw - 48px)); max-height: min(65vh, 540px); overflow-y: auto; padding: 22px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 12px 35px rgba(0, 0, 0, .12); font: 13px/1.65 Inter, system-ui, sans-serif; overflow-wrap: anywhere; }
.details-panel h2, .details-panel h3 { font: 500 14px/1.5 Inter, system-ui, sans-serif; margin: 0 0 12px; }
.details-panel p { margin: 0 0 14px; }
.details-panel p:last-child { margin-bottom: 0; }
.details-panel .source { font-size: 13px; margin: 0 0 14px; line-height: 1.65; }
.details-panel .edition-note { font-size: 13px; border: 0; padding: 0; margin: 0 0 14px; }
.details-panel .edition-tools { margin: 14px 0 0; padding: 14px 0 0; font-size: 13px; }
.details-panel .edition-tools .muted { font-size: 13px; margin-bottom: 10px; }
.details-panel .edition-tools .icon-button { margin-left: 5px; }
.details-panel .link-help, .details-panel .selection-help { font-size: 12px; margin: 14px 0 0; }
.details-panel > .icon-button { float: right; margin: -10px -10px 0 8px; }
.share-actions { margin-top: 12px; padding: 10px 0 0; border-top: 1px solid var(--line); gap: 6px; }
.share-actions[hidden] { display: none; }
@media (max-width: 680px) {
  .document-toolbar { margin-top: 10px; font-size: 12px; gap: 8px; }
  .details-panel { padding: 18px; max-height: 60vh; }
  .reader-heading .document-toolbar + .share-actions { margin-top: 10px; }
}
@media print {
  .document-toolbar, .document-details, .details-panel { display: none; }
}
@media (max-width: 680px) {
  .verse { grid-template-columns: 24px minmax(0, 1fr) 32px; gap: 8px; }
  [data-copy-passage] { width: 32px; min-height: 34px; }
  .subsection-links { gap: 6px 10px; }
  .share-dialog { padding: 22px; }
}
@media (hover: none), (pointer: coarse) {
  .sharing-active > [data-copy-passage] { opacity: .8; pointer-events: auto; }
}
@media (prefers-reduced-motion: reduce) {
  [data-copy-passage] { transition: none; }
}
@media print {
  [data-copy-passage], [data-copy-edition], .enhanced [data-copy-passage], .enhanced [data-copy-edition],
  .share-actions, .selection-help, .subsection-links, .subsection-controls, .share-dialog { display: none; }
}
