:root {
  --bg: #111111;
  --bg-elev: #161616;
  --bg-elev-2: #1c1c1c;
  --text: #ecebe4;
  --muted: #a0a0a0;
  --line: #2a2a2a;
  --accent: #00e385;
  --accent-soft: #0f2a1e;
  --danger: #d89d9d;
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --grey: #6a6a6a;
  --bg-deep: #0a0a0a;
  --line-hover: #3a3a3a;
  --bg-hover: #242424;
  --text-bright: #fff;
  --select-bg: #161616;
  --badge-catholic: #e0a458;
  --badge-protestant: #6aa9ff;
  --badge-modern: #b48ead;
  --badge-judaism: #d08770;
  --badge-apocrypha: #8fbcbb;
  --badge-heterodox: #bf616a;
  --badge-textual: #88c0d0;
  --badge-other: #a3a3a3;
  --text-xs: 13px;
  --text-sm: 14px;
  --text-base: 15px;
  --text-md: 16px;
  --text-lg: 17px;
  --text-xl: 18px;
  --text-2xl: 20px;
  --text-title: clamp(30px, 3.8vw, 40px);
  --text-heading: clamp(20px, 2.4vw, 26px);
  --verse-size: var(--text-xl);
  --verse-num-size: var(--text-sm);
  --menu-text-size: var(--text-md);
  --ts: 0.14s;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --font-primary: "STIX Two Text", Georgia, serif;
  --font-ui: "Atkinson Hyperlegible Next", system-ui, sans-serif;
}
html[data-font="next"] {
  --font-primary:
    "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI",
    sans-serif;
}

/* ============================== */
/* FONTS */
@font-face {
  font-family: "STIX Two Text";
  font-weight: 400 600;
  font-style: normal;
  src: url("/assets/fonts/STIXTwoText.woff2") format("woff2");
  font-display: swap;
  line-gap-override: 0%;
}
@font-face {
  font-family: "STIX Two Text";
  font-weight: 400 600;
  font-style: italic;
  src: url("/assets/fonts/STIXTwoText-Italic.woff2") format("woff2");
  font-display: swap;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-weight: 200 800;
  font-style: normal;
  src: url("/assets/fonts/AtkinsonHyperlegibleNext.woff2") format("woff2")
    tech(variations);
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-weight: 200 800;
  font-style: italic;
  src: url("/assets/fonts/AtkinsonHyperlegibleNext-Italic.woff2")
    format("woff2") tech(variations);
  font-display: swap;
}

/* ============================== */
/* BASE */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  scrollbar-width: thin;
  scrollbar-color: var(--grey) transparent;
}
*:hover {
  scrollbar-color: var(--accent) transparent;
}
::selection {
  background: rgba(0, 227, 133, 0.3);
  color: var(--text-bright);
}
html {
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--grey) transparent;
}
html:hover {
  scrollbar-color: var(--accent) transparent;
}
.vm-comments-body,
.custom-select-menu,
.content-pane {
  scrollbar-width: thin;
  scrollbar-color: var(--grey) transparent;
}
.vm-comments-body:hover,
.custom-select-menu:hover,
.content-pane:hover {
  scrollbar-color: var(--accent) transparent;
}
html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-primary);
}
body {
  padding: 18px;
}

/* ============================== */
/* READER SHELL & FADE-IN */
.reader-shell {
  width: min(1400px, 100%);
  margin: 0 auto;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.reader-content {
  opacity: 0;
}
.reader-content.is-ready {
  animation: readerFadeIn 0.25s ease-out forwards;
}
@keyframes readerFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ============================== */
/* HEADER */
.reader-header {
  padding: 0;
  border-bottom: 1px solid var(--line);
  background: var(--bg-elev);
}
.header-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 20px;
}
.header-meta {
  padding: 14px;
  border-top: 1px solid var(--line);
  background: var(--bg-elev-2);
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.header-cross {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--accent);
  flex-shrink: 0;
  font-size: 48px;
  line-height: 1;
  font-family: "STIX Two Text", "Segoe UI Symbol", "Apple Symbols", serif;
  font-variant-emoji: text;
  -webkit-font-variant-emoji: text;
  text-rendering: optimizeLegibility;
  font-weight: 400;
  overflow: visible;
  pointer-events: none;
}
.reader-header h1 {
  margin: 0;
  font-size: var(--text-title);
  letter-spacing: -0.01em;
  font-weight: 600;
  color: var(--text);
  line-height: 1.15;
}
.header-description {
  margin: 0 auto;
  color: var(--muted);
  font-size: var(--text-base);
  line-height: 1.5;
  text-align: center;
}

/* ============================== */
/* BUTTONS BASE — SINGLE SOURCE OF TRUTH */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  min-height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-elev-2);
  color: var(--text);
  font: inherit;
  font-size: var(--text-base);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform var(--ts) var(--ease),
    opacity var(--ts) var(--ease);
  will-change: transform;
}
.btn:hover {
  border-color: var(--line-hover);
  background: var(--bg-hover);
}
.btn:active {
  opacity: 0.96;
}
.btn:focus-visible {
  outline: none;
  border-color: var(--accent);
}
.btn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  pointer-events: none;
}
.btn.is-active {
  border-color: var(--accent);
  background: rgba(0, 227, 133, 0.12);
  color: var(--text-bright);
}
.auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  min-height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-elev-2);
  color: var(--text);
  font-size: var(--text-base);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform var(--ts) var(--ease);
}
.auth-btn:hover {
  border-color: var(--accent);
  background: rgba(0, 227, 133, 0.1);
  color: var(--text-bright);
}
.auth-btn:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 227, 133, 0.2);
}
.auth-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  overflow: hidden;
  display: block;
  flex-shrink: 0;
}

/* ============================== */
/* CONTROL PANEL — FLEX WRAP USES SPACE, NO REDUNDANT GRID OVERRIDES */
.control-panel {
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.control-group {
  display: grid;
  gap: 6px;
  flex: 1 1 180px;
  min-width: 160px;
  position: relative;
}
.control-group span {
  color: var(--muted);
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}
.control-group:has(select),
.control-group:has(.custom-select) {
  min-width: 180px;
}
.text-size-group,
.font-group {
  flex: 0 1 160px;
  min-width: 140px;
}
.font-group {
  flex: 0 1 180px;
}
.nav-actions {
  flex: 0 1 220px;
  display: grid;
  gap: 6px;
  align-self: end;
  min-width: 180px;
}
.nav-actions-row {
  display: flex;
  gap: 8px;
}
.nav-actions-row .btn {
  flex: 1 1 0;
  min-width: 0;
}
.control-break {
  flex-basis: 100%;
  height: 0;
}
@media (max-width: 768px) {
  .control-break {
    display: none;
  }
}
@media (min-width: 769px) {
  .control-panel {
    row-gap: 8px;
  }
  .control-panel .text-size-group,
  .control-panel .font-group,
  .control-panel .nav-actions {
    flex: 1 1 0;
    min-width: 0;
  }
}
.text-size-options,
.font-options {
  display: grid;
  gap: 4px;
}
.text-size-options {
  grid-template-columns: repeat(3, 1fr);
}
.font-options {
  grid-template-columns: repeat(2, 1fr);
}
.text-size-options .btn,
.font-options .btn {
  width: 100%;
  min-width: 0;
  padding: 10px;
}
.font-options [data-font="stix"] {
  font-family: "STIX Two Text", Georgia, serif;
}
.font-options [data-font="next"] {
  font-family: "Atkinson Hyperlegible Next", system-ui, sans-serif;
}

/* ============================== */
/* SELECTS & CUSTOM SELECT */
select,
.custom-select-trigger {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-elev-2);
  color: var(--text);
  padding: 12px;
  font: inherit;
  font-size: var(--text-base);
  font-weight: 700;
  transition: transform var(--ts) var(--ease);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a0a0a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
  cursor: pointer;
  width: 100%;
}
select option {
  background-color: var(--bg-elev);
  color: var(--text);
}
select:hover,
.custom-select-trigger:hover {
  border-color: var(--line-hover);
  background-color: var(--bg-hover);
}
select:focus-visible,
.custom-select-trigger:focus-visible {
  outline: none;
  border-color: var(--accent);
}
select:disabled,
.custom-select.is-disabled .custom-select-trigger {
  opacity: 0.62;
  cursor: not-allowed;
  pointer-events: none;
}
select.native-select--hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.custom-select {
  position: relative;
}
.custom-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}
.custom-select-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.custom-select-caret {
  color: var(--muted);
  font-size: var(--text-sm);
  transition: transform var(--ts) var(--ease);
}
.custom-select[data-open="true"] .custom-select-caret {
  transform: rotate(180deg);
  color: var(--accent);
}
@keyframes dropdownSlide {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.custom-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 336px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elev-2);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.42);
  transform-origin: top center;
}
.custom-select[data-open="true"] .custom-select-menu {
  animation: dropdownSlide 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.custom-select-option {
  width: 100%;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 10px;
  font: inherit;
  font-size: var(--text-base);
  font-weight: 700;
  line-height: 1.32;
  cursor: pointer;
  transition: opacity var(--ts) var(--ease);
}
.custom-select-option:hover {
  background: rgba(0, 227, 133, 0.11);
  color: var(--text-bright);
}
.custom-select-option[aria-selected="true"] {
  background: rgba(0, 227, 133, 0.2);
  color: var(--text-bright);
}
.custom-select-option:focus-visible {
  outline: none;
  background: rgba(0, 227, 133, 0.16);
}
.custom-select-option[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}
.custom-select-section {
  text-align: center;
  padding: 10px 12px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(0, 0, 0, 0.04);
  border-top: 1px solid var(--accent);
  cursor: default;
  user-select: none;
  pointer-events: none;
}
.custom-select-section:first-child {
  border-top: none;
}

/* ============================== */
/* STATUS BAR & PASSAGE HEAD */
.status-bar {
  min-height: 36px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-base);
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
}
.status-bar[data-state="error"] {
  color: var(--danger);
}
.status-bar[data-state="ok"] {
  color: var(--accent);
}
.passage-head {
  padding: 16px;
  display: grid;
  place-items: center;
  gap: 6px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  background: var(--bg-elev);
}
.passage-head h2 {
  margin: 0;
  font-size: var(--text-heading);
  letter-spacing: -0.015em;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.2;
  text-align: center;
  position: relative;
  padding-bottom: 6px;
}
.passage-head h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 2px;
  background: var(--accent);
  border-radius: var(--radius-xs);
  opacity: 0.9;
}
.passage-head p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
}
.greek-title {
  margin: 0;
  color: var(--accent);
  font-size: var(--text-sm);
  letter-spacing: 0.08em;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.3;
  text-align: center;
  opacity: 0.9;
}
.empty {
  color: var(--muted);
}

/* ============================== */
/* CONTENT PANE & VERSES */
.content-pane {
  margin: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elev-2);
  padding: 16px;
  line-height: 1.6;
  content-visibility: auto;
  contain-intrinsic-size: auto 500px;
}
.paragraph {
  margin: 0 0 12px;
  line-height: 1.75;
}
.paragraph:last-child {
  margin-bottom: 0;
}
.verse,
.nt-verse {
  display: inline;
  padding: 2px;
  font-size: var(--verse-size);
  line-height: inherit;
  cursor: pointer;
  border-radius: var(--radius-xs);
}
.verse--poetry,
.nt-verse.verse--poetry {
  display: inline;
  margin: 0;
  font-style: italic;
}
.verse-tap-active {
  background: rgba(0, 227, 133, 0.14);
  outline: 1px solid rgba(0, 227, 133, 0.35);
  border-radius: var(--radius-xs);
}
.verse--poetry.verse-tap-active,
.nt-verse.verse--poetry.verse-tap-active {
  display: inline;
  width: auto;
  max-width: 100%;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.verse--poetry .verse-num,
.verse--poetry .fn-sup,
.nt-verse.verse--poetry .verse-num,
.nt-verse.verse--poetry .fn-sup {
  font-style: normal;
}
.verse-num {
  color: var(--accent);
  font-size: var(--verse-num-size);
  font-weight: 700;
  display: inline;
  margin-right: 3px;
  vertical-align: super;
  user-select: none;
  line-height: 0;
}
.verse:hover .verse-num,
.nt-verse:hover .verse-num {
  color: var(--text-bright);
}
.section-heading {
  margin: 16px 0 12px;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  line-height: 1.3;
  text-align: center;
  text-transform: uppercase;
}
.content-pane > .section-heading:first-of-type {
  margin-top: 8px;
}
.poetry-block {
  display: inline;
  margin: 0;
  font-style: italic;
}
.poetry-line {
  display: inline;
  line-height: inherit;
  margin: 0;
  font-style: italic;
}
.front-block-intro {
  margin-bottom: 16px;
}
.front-block-intro .paragraph {
  font-weight: 700;
}
.plates-details {
  margin-top: 10px;
  font-size: var(--text-sm);
  color: var(--muted);
}
.plates-details summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 700;
}
.plates-details ul {
  margin: 8px 0 0;
  padding-left: 20px;
}
.parallel-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: var(--text-md);
}
.parallel-table th,
.parallel-table td {
  border: 1px solid var(--line);
  padding: 10px;
  vertical-align: top;
  text-align: left;
  line-height: 1.4;
}
.parallel-table th {
  background: var(--bg-elev);
  color: var(--accent);
  font-weight: 700;
}
.fn-sup {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.68em;
  vertical-align: super;
  line-height: 0;
  cursor: pointer;
  margin-left: 1px;
  padding: 2px;
}
.fn-sup:hover {
  text-decoration: underline;
  color: var(--text-bright);
}
.fn-sup--marker {
  font-style: normal;
}
.sheet-content h4 {
  margin: 14px 0 6px;
  color: var(--accent);
  font-size: var(--text-md);
  line-height: 1.3;
}
.vm-corpus-toggle {
  display: flex;
  gap: 6px;
  padding: 12px;
  flex-wrap: wrap;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.corpus-chip {
  border: 1px solid var(--line);
  background: var(--bg-elev-2);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 6px;
  font-size: var(--text-xs);
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform var(--ts) var(--ease);
}
.corpus-chip:hover {
  border-color: var(--line-hover);
}
.corpus-chip.is-active {
  border-color: var(--accent);
  color: var(--accent);
}
.corpus-chip:disabled {
  opacity: 0.45;
  cursor: default;
}
.corpus-chip-count {
  background: rgba(127, 127, 127, 0.25);
  border-radius: var(--radius-xs);
  padding: 4px;
  font-size: var(--text-xs);
  line-height: 1.2;
}
.vm-comment-tradition {
  font-size: var(--text-md);
  color: var(--muted);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.badge-orthodox {
  color: var(--accent);
}
.badge-catholic {
  color: var(--badge-catholic);
}
.badge-protestant {
  color: var(--badge-protestant);
}
.badge-modern {
  color: var(--badge-modern);
}
.badge-judaism {
  color: var(--badge-judaism);
}
.badge-apocrypha {
  color: var(--badge-apocrypha);
}
.badge-heterodox {
  color: var(--badge-heterodox);
}
.badge-textual {
  color: var(--badge-textual);
}
.badge-other {
  color: var(--badge-other);
}
.provenance-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  margin-left: 6px;
  white-space: nowrap;
  cursor: help;
  vertical-align: middle;
}
.vm-comment-split {
  margin-top: 6px;
  font-size: var(--text-xs);
  color: var(--muted);
  font-style: italic;
}
.chapter-notes {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.chapter-notes-heading {
  margin: 0 0 12px;
  text-align: center;
  font-size: var(--text-md);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.footnote-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0 0 4px;
  font-size: var(--text-base);
  color: var(--muted);
  line-height: 1.45;
  scroll-margin: 120px;
}
.footnote-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  padding: 0;
  color: var(--bg);
  background: var(--accent);
  border-radius: var(--radius-xs);
  font-weight: 700;
  font-size: var(--text-sm);
  letter-spacing: 0;
  text-transform: uppercase;
  text-align: center;
  line-height: 1;
  flex: none;
}
.footnote-text {
  min-width: 0;
  font-size: var(--text-md);
  line-height: 1.35;
}
@media (min-width: 769px) {
  .chapter-notes {
    columns: 2;
    column-gap: 32px;
    column-rule: 1px solid var(--line);
    display: block;
  }
  .chapter-notes-heading {
    column-span: all;
  }
  .footnote-item {
    break-inside: avoid;
    margin: 0 0 6px;
  }
}
.note-flash {
  background: rgba(0, 227, 133, 0.18);
  border-radius: var(--radius-xs);
}

/* ============================== */
/* BOTTOM NAV & FOOTER */
.bottom-nav {
  margin: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elev-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.bottom-nav .btn {
  min-width: 110px;
  padding: 12px;
}
.bottom-chapter-display {
  font-weight: 700;
  color: var(--accent);
  font-size: var(--text-md);
  text-align: center;
  line-height: 1.2;
  flex: 1;
}
.reader-footer {
  padding: 16px;
  border-top: 1px solid var(--line);
  background: var(--bg-elev);
  display: grid;
  gap: 12px;
}
.footer-credits {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.credits-text {
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
  line-height: 1.3;
}
.pizza-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  min-height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: rgba(0, 227, 133, 0.12);
  color: var(--accent);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  font-size: var(--text-xs);
  line-height: 1;
  transition: transform var(--ts) var(--ease);
}
.pizza-btn:hover {
  border-color: var(--accent);
  background: rgba(0, 227, 133, 0.2);
  color: var(--text-bright);
}
.pizza-btn:focus-visible {
  outline: none;
  border-color: var(--accent);
}

/* ============================== */
/* SCROLLBAR — THIN AND INTEGRATED (FIREFOX + WEBKIT) */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--grey);
  border-radius: var(--radius-xs);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ============================== */
/* VERSE MENU (BOTTOM SHEET) — GPU ONLY */
.vm-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity;
}
.vm-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}
.verse-menu {
  --actions-offset: 152px;
  --comments-offset: 8px;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  height: 92vh;
  height: 92svh;
  max-width: 960px;
  margin: 0 auto;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-bottom: 0;
  transform: translateY(calc(100% + 8px));
  will-change: transform;
  transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.verse-menu[data-mode="actions"] {
  transform: translateY(calc(100% - var(--actions-offset)));
}
.verse-menu[data-mode="comments"] {
  transform: translateY(var(--comments-offset));
}
.vm-actions-view {
  flex-shrink: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.verse-menu[data-mode="comments"] .vm-actions-view {
  display: none;
}
.vm-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.vm-ref {
  font-weight: 700;
  font-size: var(--text-md);
  color: var(--muted);
  user-select: none;
  line-height: 1.2;
}
.vm-actions-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 12px;
}
.vm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elev-2);
  color: var(--text);
  font: inherit;
  font-size: var(--text-md);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
  transition: transform var(--ts) var(--ease);
}
.vm-btn[hidden] {
  display: none;
}
.vm-btn:hover {
  border-color: var(--accent);
  background: rgba(0, 227, 133, 0.07);
}
.vm-btn-accent {
  border-color: var(--accent);
  background: rgba(0, 227, 133, 0.12);
  color: var(--accent);
}
.vm-btn-accent:hover {
  background: rgba(0, 227, 133, 0.2);
  color: var(--text-bright);
}
.vm-btn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.vm-close-btn,
.vm-back-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elev-2);
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: transform var(--ts) var(--ease);
}
.vm-close-btn svg,
.vm-back-btn svg {
  width: 18px;
  height: 18px;
}
.vm-close-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(216, 157, 157, 0.08);
}
.vm-back-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 227, 133, 0.08);
}

/* ============================== */
/* VERSE MENU COMMENTS */
.vm-comments-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.verse-menu[data-mode="actions"] .vm-comments-view,
.verse-menu[data-mode="hidden"] .vm-comments-view {
  display: none;
}
.vm-comments-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-elev);
}
.vm-comments-title {
  flex: 1;
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--text);
  text-align: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}
.vm-comments-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 16px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sheet-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sheet-content.is-entering {
  animation: sheetFadeIn 0.34s cubic-bezier(0.4, 0, 0.2, 1);
}
.sheet-content.is-leaving {
  animation: sheetFadeOut 0.14s ease-in forwards;
}
@keyframes sheetFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes sheetFadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(4px);
  }
}
.vm-comment-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elev-2);
  content-visibility: auto;
  contain-intrinsic-size: auto 120px;
}
.vm-comment-author {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  min-width: 0;
}
.vm-comment-author-name {
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--accent);
  line-height: 1.2;
  flex-shrink: 0;
  white-space: nowrap;
}
.vm-comment-author-year {
  font-size: var(--text-md);
  color: var(--muted);
  font-weight: 700;
  line-height: 1.2;
  flex-shrink: 0;
  white-space: nowrap;
}
.vm-comment-work {
  font-size: var(--text-md);
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 8px;
  font-style: italic;
  line-height: 1.3;
}
.vm-comment-quote {
  font-size: var(--text-xl);
  line-height: 1.6;
  color: var(--text);
  quotes: "\201C" "\201D" "\2018" "\2019";
}
.vm-comment-quote::before {
  content: open-quote;
  color: var(--accent);
  font-size: calc(var(--verse-size) + 4px);
  line-height: 0;
  vertical-align: -4px;
}
.vm-comment-quote::after {
  content: close-quote;
  color: var(--accent);
  font-size: calc(var(--verse-size) + 4px);
  line-height: 0;
  vertical-align: -4px;
}
.vm-comment-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: var(--text-base);
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  border-bottom: 1px solid transparent;
  line-height: 1.2;
}
.vm-comment-link:hover {
  border-bottom-color: var(--accent);
}
.vm-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  gap: 12px;
}
.vm-empty-icon {
  color: var(--muted);
  opacity: 0.4;
}
.vm-empty-icon svg {
  width: 48px;
  height: 48px;
}
.vm-empty-text {
  color: var(--muted);
  font-size: var(--text-md);
  font-weight: 700;
  line-height: 1.4;
}
.vm-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  gap: 10px;
  color: var(--muted);
  font-size: var(--text-md);
  font-weight: 700;
}
.vm-loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: vmSpin 0.7s linear infinite;
}
@keyframes vmSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================== */
/* MOBILE — SINGLE BREAKPOINT, MINIMAL OVERRIDES */
@media (max-width: 768px) {
  body {
    padding: 8px;
  }
  .reader-shell {
    border-radius: var(--radius-md);
  }
  .header-main {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 12px;
    padding: 16px;
  }
  .header-brand {
    justify-content: center;
  }
  .auth-btn {
    align-self: center;
  }
  .header-meta {
    padding: 12px;
  }
  .control-panel {
    padding: 12px;
    gap: 10px;
  }
  .control-group {
    flex-basis: 100%;
    min-width: 0;
  }
  .text-size-group,
  .font-group,
  .nav-actions {
    flex-basis: 100%;
    min-width: 0;
  }
  .nav-actions {
    width: 100%;
  }
  .status-bar {
    padding: 12px;
  }
  .passage-head {
    padding: 12px;
  }
  .content-pane {
    margin: 8px;
    padding: 12px;
  }
  .bottom-nav {
    margin: 8px;
    padding: 8px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .bottom-nav .btn {
    width: 100%;
    min-width: 0;
  }
  .bottom-chapter-display {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .reader-footer {
    padding: 12px;
    gap: 10px;
  }
  .footer-credits {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .pizza-btn {
    width: 100%;
    justify-content: center;
  }
  .verse-menu {
    max-width: none;
    height: 96vh;
    height: 96svh;
    --actions-offset: 146px;
    --comments-offset: 0px;
  }
  .vm-actions-view {
    padding: 12px;
  }
  .vm-comments-body {
    padding: 12px;
  }
  .vm-comments-header {
    padding: 12px;
  }
}
