:root {
  --paper: #ffffff; --ink: #000000; --ink-soft: #555555; --ink-faint: #888888;
  --forest: #164a3b; --forest-dark: #0d3027; --forest-soft: #dbe9e1; --coral: #ef6b4f;
  --line: rgba(0, 0, 0, 0.13); --card: #ffffff;
  --serif: "Newsreader", Georgia, serif; --sans: "DM Sans", system-ui, sans-serif; --mono: "DM Mono", monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.app-shell { min-height: 100vh; overflow: hidden; }
.topbar { height: 78px; max-width: 1180px; margin: 0 auto; padding: 0 30px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.04em; font-size: 18px; }
.brand-mark { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; background: var(--forest); color: #d9f0e4; font-size: 13px; }
.brand-muted { color: var(--ink-soft); font-weight: 500; margin-left: 3px; }
.topbar-actions { display: flex; gap: 12px; align-items: center; }
.ghost-button, .icon-button { background: transparent; border: 0; color: var(--ink-soft); font-size: 13px; }
.ghost-button { padding: 10px 0; }
.ghost-button span { color: var(--coral); margin-left: 3px; }
.language-button { border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; background: transparent; color: var(--ink-soft); font-size: 11px; }
.icon-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; font-size: 17px; }
.section-kicker { color: var(--coral); text-transform: uppercase; letter-spacing: .16em; font-family: var(--mono); font-size: 10px; font-weight: 500; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--coral); display: inline-block; }
h2, h3, p { margin-top: 0; }
.navigator { max-width: 1180px; margin: 56px auto 0; padding: 0 30px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nav-field { position: relative; display: flex; align-items: center; background: var(--card); border: 1px solid rgba(28, 41, 37, .17); border-radius: 13px; padding: 7px 8px 7px 18px; box-shadow: 0 10px 26px rgba(41, 48, 43, .06); cursor: pointer; }
.nav-book { width: 258px; }
.nav-chapter { width: 154px; }
.nav-search { flex: 1 1 190px; max-width: 320px; cursor: text; }
.nav-field span { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--ink-faint); font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .14em; white-space: nowrap; }
.nav-field select { flex: 1; min-width: 0; width: auto; border: 0; outline: 0; -webkit-appearance: none; appearance: none; background-color: transparent; background-repeat: no-repeat; background-position: right 12px center; background-size: 10px 6px; background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="6" viewBox="0 0 10 6"><path d="M1 1l4 4 4-4" fill="none" stroke="%23666" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg>'); color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; padding: 10px 28px 10px 4px; cursor: pointer; }
body.dark .nav-field select { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="6" viewBox="0 0 10 6"><path d="M1 1l4 4 4-4" fill="none" stroke="%23aaa" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg>'); }
.nav-book select { padding-left: 40px; }
.nav-chapter select { padding-left: 62px; }
html[lang="zh-Hant"] .nav-book select { padding-left: 34px; }
html[lang="zh-Hant"] .nav-chapter select { padding-left: 24px; }
.nav-field select:disabled { opacity: .5; cursor: wait; }
.nav-search input { flex: 1; min-width: 0; width: 100%; border: 0; outline: 0; -webkit-appearance: none; appearance: none; background: transparent; color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; padding: 10px 12px 10px 4px; }
.nav-search input::placeholder { color: var(--ink-faint); font-weight: 500; opacity: 1; }
.nav-search input::-webkit-search-cancel-button { cursor: pointer; }
.reader-section { max-width: 1180px; margin: 34px auto 0; padding: 0 30px 120px; }
.reader-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.chapter-stepper { display: flex; gap: 6px; align-items: center; }
.chapter-stepper button { width: 34px; height: 34px; border: 1px solid transparent; border-radius: 50%; background: var(--forest-soft); color: var(--forest); font-size: 17px; line-height: 1; }
.chapter-stepper button:hover:not(:disabled) { background: var(--forest); border-color: var(--forest); color: #fff; }
.chapter-stepper button:disabled { opacity: .35; cursor: default; }
.float-nav { position: fixed; top: 50%; translate: 0 -50%; z-index: 30; width: 46px; height: 46px; border-radius: 50%; border: 1px solid transparent; background: var(--forest-soft); color: var(--forest); font-size: 22px; line-height: 1; box-shadow: 0 10px 26px rgba(41, 48, 43, .14); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.float-prev { left: 14px; }
.float-next { right: 14px; }
body.float-nav-visible .float-nav { opacity: 1; pointer-events: auto; }
.float-nav:hover:not(:disabled) { background: var(--forest); border-color: var(--forest); color: #fff; }
.float-nav:disabled { opacity: 0; pointer-events: none; }

.reader-meta { display: flex; align-items: center; gap: 9px; color: var(--ink-soft); font-family: var(--mono); font-size: 10px; letter-spacing: .02em; }
.live-dot { background: #54a680; box-shadow: 0 0 0 4px rgba(84, 166, 128, .12); }
.toolbar-actions { display: flex; gap: 7px; }
.header-remove { margin-left: auto; border: 0; background: transparent; color: var(--ink-faint); font-size: 16px; line-height: 1; padding: 4px 2px 4px 8px; }
.header-remove:hover { color: var(--coral); }
.menu-wrap { position: relative; }
.menu-dropdown { position: absolute; left: 0; top: calc(100% + 8px); min-width: 240px; max-width: calc(100vw - 24px); background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 16px 38px rgba(31, 40, 35, .14); padding: 6px; z-index: 20; }
.menu-dropdown button { display: flex; align-items: baseline; gap: 10px; width: 100%; border: 0; border-radius: 7px; background: transparent; color: var(--ink); padding: 9px 11px; font-size: 13px; text-align: left; }
.menu-dropdown button:hover { background: var(--forest-soft); }
.menu-dropdown button[aria-checked="true"] { background: var(--forest-soft); font-weight: 600; }
.menu-dropdown strong { font-weight: 600; }
.menu-dropdown small { color: var(--ink-faint); font-size: 11px; }
.menu-dropdown .size-sample { margin-left: auto; color: var(--ink-soft); font-family: var(--serif); font-weight: 500; }
.tool-button { background: transparent; color: var(--ink-soft); border: 1px solid transparent; border-radius: 7px; padding: 8px 9px; font-size: 11px; }
.tool-button:hover, .tool-button.is-active { background: rgba(255,255,255,.6); border-color: var(--line); color: var(--ink); }
.tool-icon { color: var(--coral); font-family: var(--mono); margin-right: 5px; }
.reader-card { margin-top: 6px; }
.reader-scroll { overflow-x: auto; }
.translation-grid { min-width: 760px; display: grid; grid-template-columns: 70px repeat(var(--version-count), minmax(260px, 1fr)); }
.grid-cell { border-right: 1px solid var(--line); }
.grid-header { border-bottom: 1px solid var(--line); }
.grid-cell:last-child { border-right: 0; }
.grid-header { min-height: 58px; background: #f4f4f4; display: flex; align-items: center; padding: 0 18px; color: var(--ink-soft); font-family: var(--mono); font-size: 11px; letter-spacing: .04em; }
.grid-header:first-child { color: var(--ink-faint); justify-content: center; }
.grid-header strong { color: var(--ink); font-family: var(--sans); font-size: 13px; letter-spacing: -.02em; }
.grid-header small { color: var(--ink-faint); display: block; font-size: 9px; margin-top: 3px; }
.verse-ref { display: flex; justify-content: center; align-items: flex-start; padding-top: 4px; color: var(--coral); font-family: var(--mono); font-size: 11px; }
.verse-text { position: relative; padding: 4px 20px 6px; color: #000; font: 500 calc(17px * var(--text-scale, 1))/1.5 "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif; }
.verse-text button { position: absolute; opacity: 0; pointer-events: none; border: 0; background: var(--forest); color: white; border-radius: 5px; font-size: 11px; padding: 4px 6px; top: 0; right: 8px; }
.verse-row.active-row .verse-text button, .verse-text:focus-within button { opacity: 1; pointer-events: auto; }
.verse-text.chinese { font-family: var(--serif); font-size: calc(15px * var(--text-scale, 1)); line-height: 1.75; }
.verse-heading { font: 700 calc(18px * var(--text-scale, 1))/1.4 var(--sans); color: var(--coral); margin: 20px 0 10px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.verse-row[data-verse="1"] .verse-heading { margin-top: 2px; }
.verse-row.compact .verse-heading { font-size: calc(16px * var(--text-scale, 1)); margin: 14px 0 8px; padding-bottom: 6px; }
.verse-row.compact[data-verse="1"] .verse-heading { margin-top: 2px; }
body.text-large { --text-scale: 1.25; }
body.text-xl { --text-scale: 1.5; }
body.text-projector { --text-scale: 1.8; }
body.text-projector-plus { --text-scale: 2.3; }
.verse-row.compact .verse-text { padding-top: 2px; padding-bottom: 4px; font-size: calc(15px * var(--text-scale, 1)); line-height: 1.35; }
.verse-row.compact .verse-ref { padding-top: 3px; }
.verse-row.active-row .grid-cell { background: #f0f0f0; }
.verse-row.active-row .verse-ref { box-shadow: inset 3px 0 0 var(--coral); }
.translation-grid .verse-row { display: contents; }
.empty-translation { padding: 4px 20px 6px; color: var(--ink-soft); font: 13px/1.5 var(--sans); background: #f4f4f4; }
.empty-translation strong { display: block; color: var(--ink); margin-bottom: 6px; }
.empty-translation a { color: var(--forest); text-decoration: underline; text-underline-offset: 3px; }
.local-source-label { color: var(--ink-faint); font-family: var(--mono); font-size: 10px; }
.cell-version { display: none; }
body.single-column .reader-scroll { overflow-x: visible; }
body.single-column .translation-grid { min-width: 0; grid-template-columns: 1fr; }
body.single-column .translation-grid .grid-header:first-child { display: none; }
body.single-column .translation-grid .grid-header { min-height: 0; padding: 10px 0; background: transparent; border-bottom: 0; }
body.single-column .header-remove { margin-left: 8px; padding: 8px; }
body.single-column .translation-grid .grid-cell { border-right: 0; }
body.single-column .verse-ref { justify-content: flex-start; padding: 16px 0 0; font-size: 13px; }
body.single-column .verse-text button { right: 0; }
body.single-column .cell-version { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; color: var(--ink-faint); margin-bottom: 4px; }
body.single-column .verse-text, body.single-column .empty-translation { padding-left: 0; padding-right: 0; }
.reader-footer { min-height: 47px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; color: var(--ink-faint); font-family: var(--mono); font-size: 9px; }
.keyboard-key { color: var(--ink-soft); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 3px; padding: 2px 4px; margin: 0 2px; }
.site-footer { max-width: 1180px; border-top: 1px solid var(--line); margin: 0 auto; padding: 22px 30px 30px; color: var(--ink-faint); font-family: var(--mono); font-size: 9px; }
body.wide .topbar, body.wide .navigator, body.wide .reader-section, body.wide .site-footer { max-width: none; }
body.wide .navigator, body.wide .reader-section { padding-left: 12px; padding-right: 12px; }
body.wide .topbar, body.wide .site-footer { padding-left: 12px; padding-right: 12px; }
.modal { max-width: 470px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); padding: 30px; box-shadow: 0 24px 80px rgba(18, 31, 25, .22); }
.modal::backdrop { background: rgba(18, 31, 25, .42); backdrop-filter: blur(4px); }
.modal h2 { font: 600 33px var(--serif); letter-spacing: -.04em; margin: 13px 0 10px; }
.modal p { color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.modal-close { position: absolute; right: 16px; top: 12px; border: 0; background: transparent; color: var(--ink-soft); font-size: 25px; }
.source-list { border-top: 1px solid var(--line); margin: 22px 0; }
.source-list a { display: flex; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.source-list a span:last-child { color: var(--forest); font-family: var(--mono); font-size: 9px; }
.modal-footnote { font-size: 10px !important; color: var(--ink-faint) !important; }
.toast { position: fixed; left: 50%; bottom: 28px; translate: -50% 20px; background: var(--forest-dark); color: #fff; padding: 11px 15px; border-radius: 7px; font-size: 12px; opacity: 0; pointer-events: none; transition: .2s ease; box-shadow: 0 8px 20px rgba(18, 49, 38, .2); }
.toast.show { opacity: 1; translate: -50% 0; }
body.dark { --paper: #17211e; --ink: #edf3ee; --ink-soft: #b3c0b9; --ink-faint: #81918a; --card: #202c27; --line: rgba(235, 243, 238, .14); --forest-soft: #294d3d; }
body.dark .grid-header { background: #1b2823; }
body.dark .verse-text, body.dark .empty-translation { color: #ffffff; background: transparent; }
body.dark .empty-translation { background: rgba(0,0,0,.08); }
body.dark .verse-row.active-row .grid-cell { background: #2a342c; }
body.dark .nav-field, body.dark .modal { background: var(--card); }
body.dark .chapter-stepper button, body.dark .float-nav { color: #dcefe2; }
@media (max-width: 750px) {
  .float-nav { width: 40px; height: 40px; font-size: 19px; }
  .float-prev { left: 8px; }
  .float-next { right: 8px; }
  .topbar { padding: 0 20px; }
  .navigator { margin-top: 40px; padding: 0 20px; }
  .nav-book { width: 218px; }
  .nav-search { max-width: none; }
  .nav-search input { font-size: 16px; }
  .reader-section { padding-left: 20px; padding-right: 20px; }
  .reader-section { margin-top: 28px; }
  .reader-bar { flex-wrap: wrap; gap: 12px; }
  .site-footer { margin: 0 20px; padding-left: 0; padding-right: 0; }
}
