:root {
  color-scheme: light;
  --ink: #1b2528;
  --muted: #5f6f73;
  --subtle: #eef3f1;
  --paper: #fff;
  --warm: #f7f4ef;
  --line: #d8dedb;
  --accent: #007da5;
  --accent-dark: #005a78;
  --accent-soft: #e2f2f6;
  --gold: #9b6b2f;
  --danger: #8d3d35;
  --good: #2f6b4f;
  --shadow: 0 16px 38px rgba(20, 34, 38, 0.12);
  --shell: min(1180px, calc(100% - 32px));
  --radius: 8px;
  --sans: "Source Sans 3", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: #f8faf9;
  line-height: 1.55;
}

body[data-theme="light"] {
  background: #f8f8f6;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --ink: #eef7f9;
  --muted: #a8bdc3;
  --subtle: #17262b;
  --paper: #102026;
  --warm: #0d171b;
  --line: #2a444b;
  --accent: #49b9df;
  --accent-dark: #87d8f0;
  --accent-soft: #173846;
  --gold: #dfb46f;
  --danger: #f08d82;
  --good: #8bd4ac;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
  background: #0b1417;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 8px clamp(14px, 4vw, 36px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 14px rgba(21, 37, 42, 0.06);
  backdrop-filter: blur(14px);
}

body[data-theme="dark"] .site-header {
  background: rgba(13, 23, 27, 0.96);
  box-shadow: 0 2px 18px rgba(0, 0, 0, 0.28);
}

body[data-theme="dark"] .hero-ministry {
  background: #0b1417;
}

body[data-theme="dark"] .hero-ministry img {
  opacity: 0.36;
}

body[data-theme="dark"] .hero-ministry::after {
  background:
    linear-gradient(90deg, rgba(11, 20, 23, 0.98) 0%, rgba(11, 20, 23, 0.9) 42%, rgba(11, 20, 23, 0.32) 76%),
    linear-gradient(0deg, rgba(11, 20, 23, 0.72), rgba(11, 20, 23, 0));
}

body[data-theme="dark"] .lead,
body[data-theme="dark"] .boundary-line,
body[data-theme="dark"] .screen-header p {
  color: var(--muted);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand-copy {
  display: grid;
  line-height: 1.1;
  font-weight: 800;
}

.brand-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.topnav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.topnav button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  padding: 9px 12px;
  font-weight: 700;
}

.topnav button:hover,
.topnav button:focus-visible {
  background: var(--subtle);
  outline: none;
}

.topnav svg,
.tile-icon svg,
.home-action svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: square;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.app-shell {
  width: 100%;
  margin: 0;
  padding: 0 0 56px;
}

.hero-ministry {
  position: relative;
  min-height: min(760px, calc(100svh - 68px));
  display: grid;
  align-items: end;
  overflow: hidden;
  background: #d9e3df;
}

.hero-ministry img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center right;
}

.hero-ministry::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(248, 250, 249, 0.96) 0%, rgba(248, 250, 249, 0.86) 34%, rgba(248, 250, 249, 0.18) 67%),
    linear-gradient(0deg, rgba(27, 37, 40, 0.28), rgba(27, 37, 40, 0));
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: var(--shell);
  margin: 0 auto;
  padding: clamp(42px, 8vw, 96px) 0 clamp(34px, 6vw, 70px);
}

.hero-copy {
  max-width: 650px;
}

.hero-copy h1 {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: clamp(2.75rem, 8vw, 6.4rem);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: 0;
}

.lead {
  max-width: 620px;
  color: #34454a;
  font-size: clamp(1.06rem, 2vw, 1.32rem);
}

.eyebrow,
.step-label,
.mini-label {
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.boundary-line {
  max-width: 620px;
  margin-top: 20px;
  padding-left: 14px;
  border-left: 4px solid var(--accent);
  color: #34454a;
}

.home-band,
.home-section,
.screen {
  width: var(--shell);
  margin: 0 auto;
}

.home-band {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: -34px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.home-action {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 104px;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  padding: 18px;
  text-align: left;
}

.home-action:last-child {
  border-right: 0;
}

.home-action:hover,
.home-action:focus-visible {
  background: var(--accent-soft);
  outline: none;
}

.home-action strong,
.tile-copy strong {
  display: block;
  margin-bottom: 3px;
}

.home-action span,
.tile-copy span {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
}

.home-section {
  padding: clamp(34px, 6vw, 70px) 0 0;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 20px;
}

.section-heading h2 {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.ministry-grid,
.pathway-grid,
.line-grid,
.reflection-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.ministry-tile,
.pathway-card,
.line-card,
.movement-row,
.reflection-box,
.session-row,
.return-panel,
.word-stat,
.soft-panel,
.notice {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.ministry-tile {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 18px;
  min-height: 210px;
}

.tile-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  color: var(--accent);
  background: var(--subtle);
}

.home-questions {
  display: grid;
  gap: 8px;
  max-width: 860px;
}

.home-questions details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 0;
}

.home-questions summary {
  cursor: pointer;
  padding: 16px 18px;
  font-weight: 800;
}

.home-questions p {
  margin: 0;
  padding: 0 18px 18px;
  color: var(--muted);
}

.home-cta-band {
  background: var(--accent);
  color: #fff;
  margin-top: 44px;
  padding: 28px 0;
}

.home-cta-band > div {
  width: var(--shell);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.home-cta-band h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.home-cta-band p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.82);
}

.library-screen {
  gap: 26px;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.library-tile {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 206px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  padding: 18px;
  text-align: left;
}

.library-tile.feature {
  background: linear-gradient(135deg, var(--accent-soft), #fff);
  border-color: rgba(0, 125, 165, 0.28);
}

body[data-theme="dark"] .library-tile.feature {
  background: linear-gradient(135deg, var(--accent-soft), var(--paper));
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
}

button.library-tile:hover,
button.library-tile:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 10px 26px rgba(0, 125, 165, 0.13);
  outline: none;
}

.library-tile strong {
  font-size: 1.18rem;
}

.library-tile span:not(.tile-icon) {
  color: var(--muted);
}

.reader-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: clamp(18px, 4vw, 28px);
  box-shadow: var(--shadow);
}

.reader-preview h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
}

.reader-preview p {
  max-width: 760px;
  color: var(--muted);
}

.section-heading.compact {
  margin-bottom: 12px;
}

.section-heading.compact h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.scripture-app {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr) 330px;
  min-height: calc(100svh - 68px);
  background: #f8faf9;
}

body[data-theme="dark"] .scripture-app {
  background: #0b1417;
}

.scripture-sidebar,
.study-panel {
  position: sticky;
  top: 68px;
  align-self: start;
  height: calc(100svh - 68px);
  overflow: auto;
  background: #fff;
  border-right: 1px solid var(--line);
}

body[data-theme="dark"] .scripture-sidebar,
body[data-theme="dark"] .study-panel {
  background: var(--paper);
}

.study-panel {
  border-right: 0;
  border-left: 1px solid var(--line);
  padding: 14px;
}

.scripture-sidebar-head {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.scripture-sidebar-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 2rem;
}

.scripture-sidebar-head p:last-child {
  margin: 4px 0 0;
  color: var(--muted);
}

.book-group {
  padding: 12px 10px 14px;
  border-bottom: 1px solid var(--line);
}

.book-group h3 {
  margin: 0 8px 8px;
  color: var(--accent-dark);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.book-button,
.chapter-grid button {
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
}

.book-button {
  display: block;
  width: 100%;
  padding: 10px 8px;
  text-align: left;
  font-weight: 800;
}

.book-button:hover,
.book-button:focus-visible,
.book-button[aria-pressed="true"],
.chapter-grid button:hover,
.chapter-grid button:focus-visible,
.chapter-grid button[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent-dark);
  outline: none;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  padding: 0 6px 8px;
}

.chapter-grid button {
  min-height: 34px;
  padding: 6px 0;
  font-weight: 700;
}

.scripture-reader {
  min-width: 0;
  padding: clamp(18px, 4vw, 42px);
}

.reader-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.reader-toolbar h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
}

.reader-actions {
  display: flex;
  gap: 8px;
}

.chapter-text {
  max-width: 760px;
  margin: 0 auto;
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2vw, 1.42rem);
  line-height: 1.72;
}

body[data-reader-font="clean"] .chapter-text,
body[data-reader-font="clean"] .reader-toolbar h1,
body[data-reader-font="clean"] .study-card h2,
body[data-reader-font="clean"] .scripture-sidebar-head h2 {
  font-family: var(--sans);
}

.verse-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  width: 100%;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  padding: 5px 8px;
  text-align: left;
}

.verse-row:hover,
.verse-row:focus-visible,
.verse-row[aria-pressed="true"] {
  background: var(--accent-soft);
  outline: none;
}

.verse-row.highlighted {
  background: #fff4c9;
}

body[data-theme="dark"] .verse-row.highlighted {
  background: rgba(223, 180, 111, 0.22);
}

.verse-number {
  color: var(--accent-dark);
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 2.2;
}

.study-link {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent-dark) 48%, transparent);
  text-underline-offset: 0.16em;
  cursor: pointer;
}

.study-link:hover,
.study-link:focus-visible {
  color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.study-link-card {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: linear-gradient(180deg, var(--accent-soft), var(--paper));
}

.study-card {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 14px;
}

.study-card h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.65rem;
  line-height: 1.08;
}

.study-card p {
  margin: 0;
  color: var(--muted);
}

.compact-buttons {
  margin-top: 4px;
}

.compact-buttons .secondary,
.compact-buttons .primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.compact-buttons svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: square;
  stroke-linejoin: round;
}

.hero-actions,
.button-row,
.split-actions,
.timer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.timer-row {
  align-items: center;
  margin-top: 8px;
}

.timer-row strong {
  min-width: 76px;
  color: var(--accent-dark);
  font-size: 1.6rem;
}

.primary,
.secondary,
.ghost,
.danger,
.save-line {
  min-height: 44px;
  border-radius: 4px;
  padding: 11px 15px;
  font-weight: 800;
}

.primary,
.save-line {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}

.primary:hover,
.primary:focus-visible {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  outline: none;
}

.secondary,
.ghost {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}

.secondary:hover,
.secondary:focus-visible,
.ghost:hover,
.ghost:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.danger {
  border: 1px solid rgba(141, 61, 53, 0.42);
  color: var(--danger);
  background: var(--paper);
}

.screen {
  display: grid;
  gap: 18px;
  padding-top: clamp(24px, 5vw, 52px);
}

.screen-header {
  display: grid;
  gap: 10px;
  padding: 4px 0 8px;
}

.screen-header h1,
.screen-header h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 6vw, 4.7rem);
  line-height: 1;
  letter-spacing: 0;
}

.screen-header p {
  max-width: 780px;
  margin: 0;
  color: #40505a;
}

.pathway-card,
.line-card,
.movement-row,
.reflection-box,
.session-row,
.return-panel,
.word-stat,
.soft-panel,
.notice {
  padding: 16px;
}

.pathway-card {
  display: grid;
  gap: 8px;
  min-height: 176px;
  color: var(--ink);
  text-align: left;
}

.pathway-card:hover,
.pathway-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 8px 22px rgba(0, 125, 165, 0.12);
  outline: none;
}

.pathway-card h3,
.line-card h3,
.movement-row h3,
.session-row h3,
.return-panel h2 {
  margin: 0;
  line-height: 1.18;
}

.pathway-card p,
.line-card p,
.movement-row p,
.session-row p,
.return-panel p {
  margin: 0;
  color: var(--muted);
}

.return-panel {
  display: grid;
  gap: 14px;
  box-shadow: var(--shadow);
}

.return-panel h2 {
  font-family: var(--serif);
  font-size: clamp(1.45rem, 4vw, 2.2rem);
}

.custom-word-row,
.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 220px) auto;
  gap: 10px;
  align-items: end;
}

.search-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.search-row input,
.field,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
}

body[data-theme="dark"] .search-row input,
body[data-theme="dark"] .field,
body[data-theme="dark"] textarea,
body[data-theme="dark"] select,
body[data-theme="dark"] .chip,
body[data-theme="dark"] .selected-chip,
body[data-theme="dark"] .ladder-tab,
body[data-theme="dark"] .prayer-preview,
body[data-theme="dark"] .support-box {
  background: #0b171b;
  color: var(--ink);
  border-color: var(--line);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.orientation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 14px;
}

.notice strong {
  color: var(--danger);
}

.guard strong {
  color: var(--good);
}

.word-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: start;
}

.word-layer {
  margin-bottom: 18px;
}

.word-layer h2 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.chip-list,
.selected-list,
.ladder-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip,
.selected-chip,
.ladder-tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 8px 11px;
}

.chip:hover,
.chip:focus-visible,
.ladder-tab:hover,
.ladder-tab:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.chip[aria-pressed="true"],
.ladder-tab[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.selected-chip {
  background: var(--accent-soft);
}

.sticky-panel {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 12px;
}

.reflection-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.formula {
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 800;
}

.prayer-preview,
.support-box {
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
  white-space: pre-wrap;
}

.movement-list {
  display: grid;
  gap: 10px;
}

.movement-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 14px;
}

.support-box.blank {
  display: grid;
  place-items: center;
  min-height: 240px;
  color: var(--muted);
}

.word-bank {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.word-stat strong {
  display: block;
  font-size: 1.1rem;
}

.footer-note {
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 900px) {
  .site-header {
    align-items: stretch;
    flex-direction: column;
  }

  .topnav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .topnav button {
    justify-content: center;
  }

  .hero-ministry {
    min-height: auto;
  }

  .hero-ministry img {
    opacity: 0.42;
    object-position: center;
  }

  .hero-ministry::after {
    background: linear-gradient(90deg, rgba(248, 250, 249, 0.98), rgba(248, 250, 249, 0.84));
  }

  .home-band,
  .library-grid,
  .ministry-grid,
  .pathway-grid,
  .line-grid,
  .reflection-grid,
  .orientation,
  .word-layout,
  .movement-row,
  .custom-word-row,
  .word-bank,
  .home-cta-band > div,
  .reader-preview {
    grid-template-columns: 1fr;
  }

  .home-band {
    margin-top: 0;
  }

  .home-action {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .home-action:last-child {
    border-bottom: 0;
  }

  .sticky-panel {
    position: static;
  }

  .scripture-app {
    grid-template-columns: 1fr;
  }

  .scripture-sidebar,
  .study-panel {
    position: static;
    height: auto;
    max-height: none;
    border: 0;
    border-bottom: 1px solid var(--line);
  }

  .scripture-reader {
    padding: 18px 14px 28px;
  }

  .reader-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

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

  .chapter-text {
    font-size: 1.15rem;
  }
}

@media (max-width: 620px) {
  .brand-copy small,
  .topnav span {
    display: none;
  }

  .site-header {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .topnav {
    display: flex;
    gap: 2px;
  }

  .topnav button {
    min-width: 42px;
    padding: 8px;
  }

  .hero-inner {
    width: min(100% - 24px, 1180px);
  }

  .hero-copy h1 {
    font-size: clamp(2.35rem, 13vw, 4rem);
  }

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

/* ============================================================
   Scripture Reader v2 (USFM bundle)
   ============================================================ */

.scripture-loading {
  padding: 48px;
  text-align: center;
}

.scripture-loading .muted {
  color: var(--muted);
}

.chapter-subtitle {
  font-style: italic;
  color: var(--muted);
  font-size: 0.9em;
  margin: 4px 0 0;
}

/* Search box in sidebar */
.scripture-search {
  padding: 8px 0 12px;
  position: relative;
}

.scripture-search-input {
  width: 100%;
  font-size: 14px;
}

.scripture-search-results {
  margin-top: 8px;
  max-height: 320px;
  overflow-y: auto;
  font-size: 13px;
}

.search-results {
  list-style: none;
  padding: 0;
  margin: 0;
}

.search-result {
  border-bottom: 1px solid var(--line);
  padding: 6px 0;
}

.search-result:last-child {
  border-bottom: none;
}

.search-result a {
  display: block;
  color: var(--ink);
  text-decoration: none;
}

.search-result a:hover,
.search-result a:focus {
  background: var(--accent-soft);
}

.search-result strong {
  display: block;
  color: var(--accent-dark);
  font-size: 13px;
  margin-bottom: 2px;
}

.search-result .snippet {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

/* Book groups, chapter grid, select fallback */
.book-group {
  margin-bottom: 12px;
}

.book-group h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 8px 4px 4px;
}

.book-button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  padding: 6px 8px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}

.book-button[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 600;
}

.book-button:hover {
  background: var(--subtle);
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  margin: 4px 0 8px;
  padding-left: 8px;
}

.chapter-grid button {
  padding: 4px 0;
  font-size: 12px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
}

.chapter-grid button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--paper);
  border-color: var(--accent);
}

.chapter-select {
  width: 100%;
  margin: 4px 0 8px;
  padding: 4px;
  font-size: 13px;
  border-radius: 4px;
  border: 1px solid var(--line);
}

/* Verse row with optional bookmark star */
.verse-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 4px;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
}

.verse-row:hover {
  background: var(--subtle);
}

.verse-row[aria-pressed="true"] {
  background: var(--accent-soft);
}

.verse-row.highlighted {
  background: rgba(255, 240, 180, 0.45);
}

body[data-theme="dark"] .verse-row.highlighted {
  background: rgba(255, 220, 100, 0.12);
}

.verse-number {
  flex: 0 0 32px;
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  padding-top: 2px;
}

.verse-text {
  flex: 1;
  line-height: 1.6;
}

/* Footnote marker */
.fn-ref {
  color: var(--accent);
  cursor: help;
  font-size: 0.75em;
  font-weight: 600;
  padding: 0 2px;
  position: relative;
  vertical-align: super;
  line-height: 0;
}

.fn-ref:hover,
.fn-ref:focus {
  text-decoration: underline;
}

.fn-ref::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  font-weight: normal;
  white-space: pre-wrap;
  max-width: 360px;
  width: max-content;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms;
  z-index: 100;
}

.fn-ref:hover::after,
.fn-ref:focus::after {
  opacity: 1;
}

/* Cross-reference link */
.xref {
  color: var(--accent-dark);
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: pointer;
}

.xref:hover,
.xref:focus {
  text-decoration: underline;
  background: var(--accent-soft);
}

.verse-text-static .xref {
  /* Same as .xref but for the static selected-passage display */
}

/* Bookmark star */
.verse-bookmark {
  flex: 0 0 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--muted);
  padding: 0 4px;
  line-height: 1;
}

.verse-bookmark:hover,
.verse-bookmark:focus {
  color: var(--gold);
}

.verse-bookmark.is-bookmarked {
  color: var(--gold);
}

/* Selected passage panel */
.footnotes-panel,
.xrefs-panel {
  margin-top: 10px;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  background: var(--subtle);
}

.footnotes-panel summary,
.xrefs-panel summary {
  cursor: pointer;
  color: var(--accent-dark);
  font-weight: 500;
  padding: 2px 0;
}

.footnotes-panel ol,
.xrefs-panel ol {
  margin: 6px 0 0;
  padding-left: 20px;
}

.footnotes-panel li,
.xrefs-panel li {
  margin: 4px 0;
  color: var(--muted);
}

.fn-ref-label {
  font-weight: 600;
  color: var(--accent-dark);
  margin-right: 4px;
}

/* Bookmarks screen */
.bookmarks-screen {
  max-width: 720px;
  margin: 0 auto;
}

.bookmark-panel {
  list-style: none;
  padding: 0;
  margin: 24px 0;
}

.bookmark-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
  background: var(--paper);
}

.bookmark-ref a {
  color: var(--accent-dark);
  font-weight: 600;
  text-decoration: none;
}

.bookmark-ref a:hover,
.bookmark-ref a:focus {
  text-decoration: underline;
}

.bookmark-label {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--ink);
}

.bookmark-card .muted {
  font-size: 12px;
  color: var(--muted);
  margin: 2px 0 0;
}

/* Dark-theme coverage for new components */
body[data-theme="dark"] .scripture-search-results {
  color: var(--ink);
}

body[data-theme="dark"] .fn-ref::after {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
}

body[data-theme="dark"] .bookmark-card {
  background: var(--paper);
}

body[data-theme="dark"] .chapter-grid button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--ink);
}

body[data-theme="dark"] .verse-row[aria-pressed="true"] {
  background: var(--accent-soft);
}
