:root {
  --ink: #071615;
  --ink-soft: #29413f;
  --muted: #657775;
  --teal-950: #062625;
  --teal-900: #082e2e;
  --teal-750: #00796f;
  --teal-600: #008d80;
  --aqua: #69d8cb;
  --paper: #fffdf8;
  --mist: #f4faf7;
  --mist-strong: #e9f3ee;
  --line: rgba(8, 45, 45, 0.13);
  --line-strong: rgba(8, 45, 45, 0.2);
  --gold: #f5b732;
  --gold-soft: #fff3dc;
  --coral: #de6a5d;
  --shadow: 0 18px 46px rgba(8, 45, 45, 0.1);
  --shadow-soft: 0 10px 24px rgba(8, 45, 45, 0.08);
  --brand-font: "Oxanium", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --reader-size: 21px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--mist);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  margin: -1px;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 338px minmax(300px, 436px) minmax(330px, 1fr) auto;
  gap: 24px;
  align-items: center;
  min-height: 80px;
  padding: 14px 24px;
  color: white;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 46%),
    linear-gradient(90deg, #062625 0%, #062b2b 62%, #072828 100%);
  box-shadow: 0 8px 24px rgba(4, 31, 30, 0.2);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  display: block;
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 14px;
  background: #062625;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: var(--brand-font);
  font-size: 28px;
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: 0.5px;
}

.brand small {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--brand-font);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.passage-search {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.passage-search span {
  color: rgba(255, 255, 255, 0.66);
  font-size: 14px;
  font-weight: 850;
}

.passage-search input {
  min-width: 0;
  border: 0;
  color: white;
  background: transparent;
  outline: none;
  font-size: 15px;
}

.passage-search input::selection {
  background: rgba(142, 247, 233, 0.28);
}

.passage-search kbd {
  padding: 2px 7px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.1);
  font-size: 12px;
  font-family: inherit;
}

.topnav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 26px;
  min-width: 0;
}

.topnav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 50px;
  padding: 0 8px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 800;
}

.topnav a.active,
.topnav a:hover {
  color: white;
}

.topnav a.active::after {
  position: absolute;
  right: 6px;
  bottom: 0;
  left: 6px;
  height: 2px;
  border-radius: 999px;
  content: "";
  background: var(--gold);
}

.top-actions {
  display: flex;
  gap: 10px;
}

.account-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: white;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 900;
}

.account-button:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.16);
}

.account-button.signed-in {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  background: linear-gradient(135deg, var(--teal-600), var(--gold));
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.reader-shell {
  display: grid;
  grid-template-columns: 360px minmax(520px, 1fr) 398px;
  gap: 0;
  padding: 0;
  min-height: calc(100vh - 80px);
  background: #f7faf9;
}

.library-panel,
.study-rail,
.scripture-stage {
  min-width: 0;
}

.library-panel {
  position: sticky;
  top: 98px;
  align-self: start;
  max-height: calc(100vh - 116px);
  overflow: auto;
  margin: 18px 0 18px 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.library-panel::-webkit-scrollbar,
.study-rail::-webkit-scrollbar {
  width: 9px;
}

.library-panel::-webkit-scrollbar-thumb,
.study-rail::-webkit-scrollbar-thumb {
  border: 3px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(8, 103, 95, 0.32);
}

.library-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.library-tabs button,
.select-row,
.chapter-grid button,
.show-all,
.reader-tools button,
.reader-bar-button,
.tool-grid button,
.download-grid button,
.stepper button,
.download-icon,
.segmented button,
.save-note {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.78);
  font-weight: 800;
}

.library-tabs button.active,
.library-tabs button:hover {
  color: var(--teal-750);
  border-color: rgba(10, 139, 128, 0.35);
  background: white;
  box-shadow: 0 8px 16px rgba(8, 45, 45, 0.06);
}

.select-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 12px;
  padding: 0 12px;
  text-align: left;
}

.book-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.testament-section {
  display: grid;
  gap: 2px;
}

.testament-section + .testament-section {
  padding-top: 6px;
}

.testament-toggle {
  margin-bottom: 3px;
}

.testament-books {
  display: grid;
  gap: 2px;
}

.library-panel.bookmark-mode .select-row,
.library-panel.bookmark-mode .chapter-grid,
.library-panel.bookmark-mode .show-all {
  display: none;
}

.book-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 31px;
  padding: 0 11px;
  border: 0;
  border-radius: 9px;
  color: var(--ink-soft);
  background: transparent;
  text-align: left;
}

.bookmark-row,
.empty-library {
  display: grid;
  gap: 5px;
  width: 100%;
  margin-bottom: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.72);
  text-align: left;
}

.bookmark-row strong,
.bookmark-row span,
.empty-library strong,
.empty-library span {
  display: block;
}

.bookmark-row span,
.empty-library span {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-row span:last-child {
  color: var(--muted);
  font-size: 13px;
}

.book-row.active {
  color: white;
  background: linear-gradient(90deg, #00766d, #008679);
  box-shadow: 0 12px 24px rgba(0, 121, 111, 0.18);
}

.book-row.active span:last-child {
  color: rgba(255, 255, 255, 0.86);
}

.book-row.unavailable:not(.active),
.chapter-grid button.unavailable:not(.active) {
  color: #8a9996;
  background: rgba(255, 255, 255, 0.42);
}

.book-row.unavailable:not(.active) span:last-child {
  color: #9ba9a6;
}

.chapter-grid button.active {
  color: white;
  border-color: transparent;
  background: linear-gradient(135deg, #00766d, #008679);
  box-shadow: 0 10px 22px rgba(0, 121, 111, 0.18);
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.chapter-grid button {
  min-width: 0;
  border-radius: 11px;
}

.show-all {
  width: 100%;
  margin-top: 10px;
  color: var(--teal-750);
  background: rgba(255, 255, 255, 0.54);
}

.scripture-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  scroll-margin-top: 96px;
  padding: 50px 36px 94px;
  border: 0;
  border-right: 1px solid rgba(8, 45, 45, 0.08);
  border-left: 1px solid rgba(8, 45, 45, 0.08);
  border-radius: 0;
  background: #fffefb;
  box-shadow: none;
}

.reader-heading {
  order: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  max-width: 680px;
  margin: 0 auto 18px;
}

.reader-heading > div:first-child {
  flex: 0 0 auto;
}

.reader-heading h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 50px;
  line-height: 1;
  white-space: nowrap;
}

.reader-heading p {
  margin: 9px 0 0;
  color: #68766d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-style: italic;
}

.reader-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: flex-end;
}

.reader-tools button {
  min-height: 40px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.86);
}

.reader-tools button.active {
  color: #006e65;
  border-color: rgba(0, 121, 111, 0.28);
  background: rgba(226, 246, 238, 0.95);
}

button:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.scripture-page {
  order: 1;
  max-width: 680px;
  margin: 0 auto;
}

.reader-shell.study-mode .scripture-stage {
  background:
    linear-gradient(180deg, rgba(233, 243, 238, 0.48), transparent 260px),
    #fffefb;
}

.reader-shell.study-mode .scripture-page,
.reader-shell.study-mode .reader-heading {
  width: 100%;
  max-width: 980px;
}

.study-reader {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
  align-items: start;
}

.study-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.study-reader .verse {
  margin-bottom: 0;
  background: rgba(255, 255, 255, 0.58);
}

.study-reader .verse-text {
  font-size: max(18px, calc(var(--reader-size) - 1px));
}

.study-inspector {
  position: sticky;
  top: 104px;
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 128px);
  padding-bottom: 86px;
  overflow: auto;
}

.study-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-soft);
}

.study-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.study-card-title h2 {
  margin: 0;
  font-size: 15px;
}

.study-card-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.study-card p {
  margin: 0;
  color: #263633;
  font-size: 14px;
  line-height: 1.48;
}

.study-card textarea {
  width: 100%;
  min-height: 108px;
  resize: vertical;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  font: inherit;
  line-height: 1.45;
}

.study-card textarea:focus {
  border-color: rgba(0, 121, 111, 0.44);
  outline: 3px solid rgba(105, 216, 203, 0.18);
}

.arc-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 10px;
}

.arc-options button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.74);
  font-size: 13px;
  font-weight: 850;
}

.arc-options button.active {
  color: white;
  border-color: transparent;
  background: linear-gradient(135deg, var(--teal-750), var(--teal-600));
}

.arc-map {
  display: grid;
  gap: 7px;
}

.arc-row {
  display: grid;
  grid-template-columns: 28px 92px 1fr;
  gap: 8px;
  align-items: center;
  min-width: 0;
  min-height: 42px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-soft);
  background: rgba(244, 250, 247, 0.78);
  text-align: left;
}

.arc-row span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: var(--teal-750);
  background: rgba(105, 216, 203, 0.2);
  font-size: 12px;
  font-weight: 950;
}

.arc-row strong {
  font-size: 12px;
}

.arc-row em {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arc-row.active {
  border-color: rgba(245, 183, 50, 0.46);
  background: rgba(255, 243, 220, 0.72);
}

.arc-row.pending {
  opacity: 0.72;
}

.verse {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  margin: 0 0 10px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.verse:hover {
  border-color: rgba(240, 182, 56, 0.34);
  background: rgba(255, 240, 200, 0.32);
}

.verse.selected {
  border-color: rgba(245, 183, 50, 0.45);
  background: linear-gradient(90deg, rgba(245, 183, 50, 0.25), rgba(255, 243, 220, 0.56));
  box-shadow: inset 4px 0 0 var(--gold);
}

.verse.highlighted:not(.selected) {
  background: rgba(255, 243, 220, 0.5);
}

.verse.pending {
  border-color: rgba(8, 45, 45, 0.08);
  background: rgba(244, 250, 247, 0.68);
}

.verse.pending .verse-number,
.verse.pending .verse-text {
  color: #8a9996;
}

.verse.pending .verse-text {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  font-style: italic;
}

.verse-number {
  color: var(--teal-750);
  font-size: 18px;
  font-weight: 850;
  line-height: 1.55;
}

.verse-text {
  margin: 0;
  color: #111c1a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--reader-size);
  line-height: 1.52;
}

.footnote-marker {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  margin-left: 6px;
  padding: 0 4px;
  border: 0;
  border-radius: 999px;
  color: #006e65;
  background: rgba(105, 216, 203, 0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  vertical-align: super;
}

.footnote-marker:hover,
.footnote-marker:focus-visible,
.footnote-marker.active,
.footnote-number:hover,
.footnote-number:focus-visible,
.footnote-number.active {
  color: white;
  background: var(--teal-750);
  outline: 3px solid rgba(105, 216, 203, 0.28);
}

.footnote-popover {
  position: fixed;
  z-index: 120;
  display: none;
  pointer-events: none;
  padding: 13px 14px;
  border: 1px solid rgba(8, 45, 45, 0.14);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 46px rgba(8, 45, 45, 0.18);
  backdrop-filter: blur(18px);
}

.footnote-popover.visible {
  display: block;
}

.footnote-popover-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.footnote-popover-title strong {
  font-size: 13px;
}

.footnote-popover-title span,
.footnote-popover small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.footnote-popover p {
  margin: 0;
  color: #263633;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.35;
}

.chapter-unavailable {
  padding: 28px;
  border: 1px solid rgba(245, 183, 50, 0.4);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 243, 220, 0.64);
}

.chapter-unavailable strong,
.chapter-unavailable span {
  display: block;
}

.chapter-unavailable strong {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 18px;
}

.floating-controls {
  position: sticky;
  bottom: 18px;
  z-index: 6;
  order: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: max-content;
  max-width: 100%;
  margin: 28px auto -68px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 20px 56px rgba(8, 47, 43, 0.14);
  backdrop-filter: blur(18px);
}

.round-control,
.chapter-picker,
.audio-button,
.reader-bar-button {
  min-height: 42px;
  border: 0;
  color: var(--ink-soft);
  background: #f5f8f4;
  font-weight: 900;
}

.round-control {
  width: 42px;
  border-radius: 999px;
}

.chapter-picker,
.audio-button,
.reader-bar-button {
  padding: 0 16px;
  border-radius: 12px;
}

.audio-button.is-playing {
  color: white;
  background: linear-gradient(135deg, var(--teal-750), var(--teal-600));
}

.reader-bar-button.active {
  color: #006e65;
  background: rgba(226, 246, 238, 0.95);
}

.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-soft);
  font-weight: 850;
}

.toggle-row input {
  width: 38px;
  height: 20px;
  accent-color: var(--teal-750);
}

.study-rail {
  position: sticky;
  top: 98px;
  align-self: start;
  display: grid;
  gap: 12px;
  padding: 18px 18px 18px 18px;
}

.panel-card {
  scroll-margin-top: 96px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-title h2 {
  margin: 0;
  font-size: 17px;
}

.panel-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 24px;
  border-radius: 8px;
  color: white;
  background: #aa996a;
  font-size: 13px;
  font-weight: 900;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 10px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
}

.segmented button {
  min-width: 0;
  min-height: 32px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 14px;
}

.segmented button.active {
  color: var(--teal-750);
  background: white;
  box-shadow: 0 8px 18px rgba(8, 47, 43, 0.08);
}

.footnote-list {
  display: grid;
  gap: 5px;
  max-height: 360px;
  overflow: auto;
  padding-right: 2px;
}

.footnote-list::-webkit-scrollbar {
  width: 8px;
}

.footnote-list::-webkit-scrollbar-thumb {
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(8, 103, 95, 0.28);
}

.footnote-item {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 13px;
}

.footnote-item.active {
  background: rgba(255, 240, 200, 0.55);
}

.footnote-ref {
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
}

.footnote-number {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  color: #006e65;
  background: rgba(105, 216, 203, 0.22);
  font-size: 13px;
  font-weight: 950;
}

.footnote-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.footnote-meta strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
}

.footnote-meta span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: capitalize;
}

.footnote-item p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin: 0;
  color: #263633;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  line-height: 1.28;
}

.footnote-item button:not(.footnote-number) {
  justify-self: start;
  min-height: 21px;
  padding: 0;
  border: 0;
  color: var(--teal-750);
  background: transparent;
  font-weight: 850;
}

.empty-note {
  padding: 14px;
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 243, 220, 0.72);
}

.empty-note strong,
.empty-note span {
  display: block;
}

.empty-note strong {
  margin-bottom: 4px;
  color: var(--ink);
}

.tool-grid,
.download-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.note-card {
  display: grid;
  gap: 10px;
}

.note-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.note-card textarea {
  width: 100%;
  resize: vertical;
  min-height: 88px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  font: inherit;
  line-height: 1.45;
}

.note-card textarea:focus {
  border-color: rgba(0, 121, 111, 0.44);
  outline: 3px solid rgba(105, 216, 203, 0.18);
}

.save-note {
  justify-self: start;
  min-height: 38px;
  padding: 0 14px;
  color: white;
  border-color: transparent;
  background: linear-gradient(90deg, #00766d, #008679);
}

.tool-grid button {
  min-height: 42px;
  padding: 0 10px;
  text-align: left;
}

.tool-grid button:hover,
.download-grid button:hover,
.reader-tools button:hover,
.chapter-grid button:hover,
.show-all:hover {
  border-color: rgba(10, 139, 128, 0.35);
  color: var(--teal-750);
  background: white;
}

.display-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  border-top: 1px solid var(--line);
}

.display-row:first-of-type {
  border-top: 0;
}

.display-row > span {
  color: var(--ink-soft);
  font-weight: 850;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 7px;
}

.stepper button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-height: 34px;
  border-radius: 10px;
}

.stepper strong {
  min-width: 26px;
  text-align: center;
}

.theme-swatches {
  display: flex;
  gap: 8px;
}

.theme-swatches button {
  width: 30px;
  height: 30px;
  border: 2px solid transparent;
  border-radius: 999px;
}

.theme-swatches button.active {
  border-color: var(--teal-750);
  box-shadow: 0 0 0 4px rgba(10, 139, 128, 0.11);
}

.theme-light {
  background: #fffef9;
}

.theme-mist {
  background: #dff2e6;
}

.theme-night {
  background: #0c2422;
}

.download-grid button {
  min-height: 38px;
  background: rgba(255, 255, 255, 0.68);
}

#downloads.collapsed .download-grid {
  display: none;
}

.download-icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  min-height: 36px;
  border-radius: 999px;
  color: var(--teal-750);
  background: white;
}

.license-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  max-width: 320px;
  padding: 13px 15px;
  border: 1px solid rgba(10, 139, 128, 0.2);
  border-radius: 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 44px rgba(8, 47, 43, 0.18);
  font-size: 14px;
  font-weight: 850;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

body.theme-mist {
  background:
    linear-gradient(135deg, rgba(240, 182, 56, 0.12), transparent 30%),
    #dcefe5;
}

body.theme-mist .scripture-stage {
  background: #fbfff9;
}

body.theme-night {
  color: #eef8f1;
  background: #081716;
}

body.theme-night .library-panel,
body.theme-night .study-rail .panel-card,
body.theme-night .study-card {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(9, 40, 37, 0.82);
}

body.theme-night .scripture-stage {
  border-color: rgba(255, 255, 255, 0.13);
  background: #fffef9;
}

body.theme-night .book-row:not(.active),
body.theme-night .panel-title h2,
body.theme-night .display-row > span,
body.theme-night .study-card-title h2,
body.theme-night .study-card p {
  color: #e8f8f4;
}

body.theme-night .select-row,
body.theme-night .library-tabs button,
body.theme-night .chapter-grid button,
body.theme-night .show-all,
body.theme-night .bookmark-row,
body.theme-night .tool-grid button,
body.theme-night .download-grid button,
body.theme-night .note-card textarea,
body.theme-night .study-card textarea,
body.theme-night .arc-options button,
body.theme-night .arc-row {
  color: #e8f8f4;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
}

body.theme-night .footnote-popover {
  border-color: rgba(255, 255, 255, 0.14);
  color: #e8f8f4;
  background: rgba(9, 40, 37, 0.96);
}

body.theme-night .footnote-popover p,
body.theme-night .footnote-meta strong {
  color: #e8f8f4;
}

body.footnotes-hidden .study-rail #footnotes {
  display: none;
}

body.footnotes-hidden .footnote-marker {
  display: none;
}

@media (max-width: 1260px) {
  .topbar {
    grid-template-columns: 250px minmax(220px, 1fr) auto;
  }

  .topnav {
    grid-column: 1 / 3;
    grid-row: 2;
    justify-content: flex-start;
  }

  .reader-shell {
    grid-template-columns: 300px minmax(430px, 1fr);
  }

  .study-rail {
    grid-column: 1 / 3;
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
    overflow: visible;
    padding: 18px;
  }
}

@media (max-width: 900px) {
  .topbar {
    position: relative;
    grid-template-columns: 1fr auto;
    min-height: 0;
  }

  .passage-search,
  .topnav {
    grid-column: 1 / 3;
  }

  .topnav {
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .reader-shell {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 12px;
  }

  .library-panel {
    position: static;
    max-height: none;
    margin: 0;
  }

  .study-rail {
    grid-column: auto;
    grid-template-columns: 1fr;
    padding: 0;
  }

  .scripture-stage {
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 34px 18px 112px;
  }

  .study-reader {
    grid-template-columns: 1fr;
  }

  .study-inspector {
    position: static;
    max-height: none;
    padding-bottom: 0;
    overflow: visible;
  }

  .reader-heading {
    flex-direction: column;
  }

  .floating-controls {
    position: static;
    flex-wrap: wrap;
    width: 100%;
    margin: 0 0 24px;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 12px;
  }

  .brand strong {
    font-size: 21px;
  }

  .brand small,
  .passage-search kbd {
    display: none;
  }

  .passage-search {
    grid-template-columns: auto 1fr;
  }

  .topnav {
    gap: 13px;
  }

  .topnav a {
    font-size: 13px;
    padding: 0 3px;
  }

  .reader-heading h1 {
    font-size: 40px;
  }

  .reader-heading p {
    font-size: 18px;
  }

  .verse {
    grid-template-columns: 32px 1fr;
    gap: 8px;
    padding: 10px 12px;
  }

  .chapter-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .segmented {
    grid-template-columns: 1fr;
  }

  .arc-row {
    grid-template-columns: 28px 1fr;
  }

  .arc-row em {
    grid-column: 2;
  }

  .tool-grid,
  .download-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  .topbar,
  .library-panel,
  .study-rail,
  .reader-tools,
  .floating-controls {
    display: none;
  }

  .reader-shell {
    display: block;
    background: white;
  }

  .scripture-stage {
    border: 0;
    padding: 0;
  }

  .scripture-page,
  .reader-heading {
    max-width: none;
  }
}
