:root {
  color-scheme: light;
  --ink: #1d2428;
  --muted: #657176;
  --line: #d9dedb;
  --paper: #fbfaf7;
  --panel: #ffffff;
  --panel-alt: #f2f5f1;
  --accent: #2f6f73;
  --accent-strong: #1e5357;
  --gold: #b9822c;
  --rose: #995b5b;
  --green: #47704b;
  --shadow: 0 10px 28px rgba(29, 36, 40, 0.07);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
}

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

.app-header {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(290px, 360px) auto;
  align-items: center;
  gap: clamp(18px, 3vw, 42px);
  padding: 17px clamp(16px, 3vw, 38px);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #fbfaf7 100%);
}

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

.brand-logo {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 5px 12px rgba(90, 62, 0, 0.18);
}

.brand-copy {
  min-width: 0;
}

.brand-copy h1 {
  max-width: none;
  font-size: clamp(1.55rem, 2.5vw, 2.25rem);
  letter-spacing: -0.025em;
  line-height: 1;
}

.brand-copy p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
}

.header-utilities {
  display: flex;
  align-items: center;
  align-self: start;
  gap: 12px;
}

.header-utility-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 13px;
  background: #fff;
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
}

.header-utility-button:hover,
.header-utility-button:focus-visible {
  border-color: rgba(47, 111, 115, 0.45);
  background: #f7fbf9;
}

.header-utility-button:focus-visible {
  outline: 3px solid rgba(47, 111, 115, 0.17);
  outline-offset: 1px;
}

.home-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.home-button:hover,
.home-button:focus-visible {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #fff;
}

.site-language-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-alt);
}

.site-language-switch button {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
}

.site-language-switch button:hover,
.site-language-switch button:focus-visible {
  background: #fff;
  color: var(--ink);
}

.site-language-switch button:focus-visible {
  outline: 3px solid rgba(47, 111, 115, 0.17);
  outline-offset: 1px;
}

.site-language-switch button[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 7px rgba(30, 83, 87, 0.2);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.75rem, 3.5vw, 3.1rem);
  line-height: 1.02;
  letter-spacing: 0;
  max-width: 780px;
}

h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
}

.header-actions {
  display: grid;
  gap: 5px;
  min-width: min(330px, 100%);
}

.search-label,
.summary-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

input[type="search"] {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input[type="search"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 111, 115, 0.15);
}

.layout {
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
  gap: 16px;
  padding: 16px clamp(16px, 3vw, 38px) 34px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(18px, 4vw, 48px) 24px;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.site-footer p {
  margin: 0;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}

.footer-meta a {
  color: var(--accent-strong);
  font-weight: 800;
  text-underline-offset: 3px;
}

.footer-meta a:hover,
.footer-meta a:focus-visible {
  color: var(--accent);
}

.copyright-dialog,
.about-dialog,
.feedback-dialog {
  width: min(620px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(29, 36, 40, 0.28);
}

.copyright-dialog::backdrop,
.about-dialog::backdrop,
.feedback-dialog::backdrop {
  background: rgba(29, 36, 40, 0.52);
  backdrop-filter: blur(2px);
}

.about-dialog {
  width: min(780px, calc(100% - 32px));
}

.copyright-card {
  display: grid;
  gap: 16px;
  padding: 28px;
}

.copyright-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.copyright-heading .eyebrow {
  margin-bottom: 4px;
}

.copyright-heading h2 {
  font-size: 1.55rem;
  line-height: 1.12;
}

.copyright-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.62;
}

.permission-callout {
  padding: 14px 16px;
  border: 1px solid rgba(47, 111, 115, 0.22);
  border-left: 3px solid var(--accent);
  border-radius: 0 9px 9px 0;
  background: #f4f8f6;
}

.permission-callout h3 {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 0.92rem;
}

.permission-callout p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.58;
}

.about-card {
  display: grid;
  gap: 16px;
  padding: 28px;
}

.about-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.about-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.about-brand img {
  flex: 0 0 46px;
  filter: drop-shadow(0 5px 9px rgba(30, 83, 87, 0.14));
}

.about-heading .eyebrow {
  margin-bottom: 4px;
}

.about-heading h2 {
  font-size: 1.55rem;
  line-height: 1.12;
}

.about-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.65;
}

.about-card .about-lead {
  padding: 12px 14px;
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  background: var(--panel-alt);
  color: var(--accent-strong);
  font-size: 1rem;
  font-weight: 800;
}

.about-section {
  display: grid;
  gap: 9px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.about-section h3 {
  margin: 0;
  color: var(--accent-strong);
  font-size: 1rem;
  line-height: 1.3;
}

.about-section > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.64;
}

.about-provenance {
  display: grid;
  gap: 10px;
  margin: 0;
}

.about-provenance > div {
  display: grid;
  grid-template-columns: minmax(150px, 0.36fr) minmax(0, 1fr);
  gap: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--panel-alt);
}

.about-provenance dt {
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 850;
  line-height: 1.45;
}

.about-provenance dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.58;
}

.about-limitations {
  padding: 15px 16px;
  border: 1px solid rgba(185, 133, 47, 0.25);
  border-left: 3px solid var(--gold);
  border-radius: 0 9px 9px 0;
  background: #fbf8ef;
}

.about-references {
  display: grid;
  gap: 14px;
  margin: 0;
  padding-left: 22px;
}

.about-references li {
  padding-left: 4px;
  color: var(--muted);
}

.about-references p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.56;
}

.about-reference-links {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-top: 5px;
}

.about-reference-links a {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  text-underline-offset: 3px;
}

.about-reference-links a:hover,
.about-reference-links a:focus-visible {
  color: var(--accent);
}

.feedback-form {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.feedback-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.feedback-heading h2 {
  font-size: 1.7rem;
}

.dialog-close {
  display: grid;
  flex: 0 0 38px;
  place-items: center;
  min-height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.45rem;
  line-height: 1;
}

.feedback-privacy,
.feedback-status {
  margin: 0;
}

.feedback-field {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.feedback-field small {
  color: var(--muted);
  font-weight: 600;
}

.feedback-field input,
.feedback-field select,
.feedback-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
  font-weight: 500;
}

.feedback-field textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.45;
}

.feedback-field input:focus,
.feedback-field select:focus,
.feedback-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 111, 115, 0.15);
}

.feedback-privacy {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.feedback-status {
  min-height: 1.2em;
  font-size: 0.88rem;
  font-weight: 800;
}

.feedback-status[data-state="success"] {
  color: var(--green);
}

.feedback-status[data-state="error"] {
  color: var(--rose);
}

.feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.feedback-actions button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.feedback-actions button[type="submit"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.feedback-actions button:disabled {
  cursor: wait;
  opacity: 0.68;
}

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

.book-panel,
.diagram-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.book-panel {
  align-self: start;
  max-height: calc(100vh - 36px);
  overflow: hidden;
  position: sticky;
  top: 18px;
}

.panel-heading,
.diagram-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

#availableCount {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.index-toggle {
  display: none;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: #fff;
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
}

.testament-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-alt);
}

.tab {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
}

.tab.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.book-index {
  max-height: calc(100vh - 140px);
  overflow: auto;
  padding: 8px;
}

.book-group {
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
}

.book-group:last-child {
  border-bottom: 0;
}

.chronology-index-group {
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid rgba(47, 111, 115, 0.28);
  border-radius: 8px;
  background: #f1f8f5;
}

.chronology-index-group .book-title {
  color: var(--accent-strong);
}

.old-testament-group {
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid #dfe3e1;
  border-radius: 8px;
  background: #f3f4f2;
}

.old-testament-title {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 10px;
  color: #7e888c;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 900;
  list-style: none;
}

.old-testament-title::-webkit-details-marker {
  display: none;
}

.old-testament-title::before {
  width: 8px;
  height: 8px;
  border-right: 2px solid #9da5a8;
  border-bottom: 2px solid #9da5a8;
  content: "";
  transform: rotate(-45deg);
  transition: transform 120ms ease;
}

.old-testament-group[open] > .old-testament-title::before {
  transform: rotate(45deg);
}

.old-testament-title:hover,
.old-testament-title:focus-visible {
  background: #eceeeb;
  color: #667176;
}

.old-testament-title span:last-child {
  font-size: 0.78rem;
  font-weight: 700;
}

.old-testament-books {
  padding: 0 10px 5px;
  border-top: 1px solid #dfe3e1;
}

.old-testament-books .book-group:last-child {
  border-bottom: 0;
}

.unavailable-book {
  padding: 0;
}

.unavailable-book > .book-title {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  margin-bottom: 0;
  padding: 9px 0;
  color: #99a1a4;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.unavailable-book > .book-title::-webkit-details-marker {
  display: none;
}

.unavailable-book > .book-title::before {
  width: 7px;
  height: 7px;
  border-right: 2px solid #aeb5b7;
  border-bottom: 2px solid #aeb5b7;
  content: "";
  transform: rotate(-45deg);
  transition: transform 120ms ease;
}

.unavailable-book > .book-title:hover,
.unavailable-book > .book-title:focus-visible {
  color: #7e888c;
}

.unavailable-book[open] > .book-title::before {
  transform: rotate(45deg);
}

.unavailable-book > .chapter-grid {
  padding-bottom: 12px;
}

.unavailable-book .chapter-button {
  border-color: #e3e6e4;
  background: #f5f6f4;
  color: #a4aaac;
}

.book-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 900;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(32px, 1fr));
  gap: 4px;
}

.chapter-button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
}

.chapter-button.available {
  border-color: rgba(47, 111, 115, 0.3);
  background: #e8f2ef;
  color: var(--accent-strong);
  font-weight: 900;
}

.special-chapter-button {
  grid-column: 1 / -1;
  min-height: 34px;
  padding: 0 10px;
}

.chapter-button.selected {
  border-color: var(--gold);
  background: #fff3d8;
  color: #6c430d;
}

.chapter-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.diagram-panel {
  min-width: 0;
}

.diagram-heading {
  display: grid;
  gap: 3px;
}

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

.diagram-kicker .eyebrow {
  margin-bottom: 0;
}

.translation-badge {
  display: inline-grid;
  place-items: center;
  min-height: 18px;
  border: 1px solid rgba(47, 111, 115, 0.25);
  border-radius: 999px;
  padding: 0 6px;
  background: #e8f2ef;
  color: var(--accent-strong);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.toolbar-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-alt);
}

.toolbar-buttons button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  padding: 0 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 750;
}

.toolbar-buttons button:hover,
.toolbar-buttons button:focus-visible {
  background: #fff;
  color: var(--ink);
}

.toolbar-buttons #compactToggle:not([aria-pressed="true"]) {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(27, 49, 43, 0.08);
}

.toolbar-buttons button[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
}

.toolbar-buttons button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.language-zh .diagram-panel {
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

.summary-strip {
  display: grid;
  border-bottom: 1px solid var(--line);
}

.summary-strip > div {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  background: #fff;
}

.summary-strip strong {
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.4;
}

.diagram {
  padding: 14px;
}

.diagram.special-page {
  padding: 0;
}

.special-page-frame {
  display: block;
  width: 100%;
  height: clamp(620px, 76vh, 920px);
  border: 0;
  border-radius: 0 0 8px 8px;
  background: #f7f4ea;
}

.diagram-loading {
  display: grid;
  min-height: 220px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--panel-alt);
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.diagram-load-error {
  color: var(--rose);
}

.thought-section {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.section-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 9px 10px;
  background: var(--panel-alt);
  border-bottom: 1px solid var(--line);
}

.verse-range {
  display: inline-grid;
  place-items: center;
  min-width: 60px;
  min-height: 30px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 900;
}

.section-header h3 {
  margin-bottom: 3px;
  font-size: 0.9rem;
}

.section-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.section-header .section-textual-basis {
  margin-top: 5px;
  color: var(--accent-strong);
  font-family: Georgia, "Times New Roman", serif;
}

.clause-list {
  display: grid;
  gap: 5px;
  padding: 10px;
  background: #fff;
}

.clause {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-height: 34px;
  padding: 6px 8px;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: #fbfcfa;
}

.clause[data-role="ground"] {
  border-left-color: var(--gold);
}

.clause[data-role="result"] {
  border-left-color: var(--green);
}

.clause[data-role="prayer"] {
  border-left-color: var(--rose);
}

.mechanical-section .clause-list {
  gap: 0;
  padding: 14px 10px;
}

.mechanical-section .clause {
  grid-template-columns: 52px minmax(0, 1fr);
  min-height: 0;
  padding: 2px 10px;
  border-left: 0;
  border-radius: 0;
  background: transparent;
}

.mechanical-section .text {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.35;
}

.mechanical-section .ref:empty {
  visibility: hidden;
}

.mechanical-section .clause.indent-1 {
  margin-left: 34px;
}

.mechanical-section .clause.indent-2 {
  margin-left: 68px;
}

.mechanical-section .clause.indent-3 {
  margin-left: 102px;
}

.mechanical-section .clause.indent-4 {
  margin-left: 136px;
}

.mechanical-tree {
  overflow-x: auto;
  padding: 16px 12px 20px;
  background: #fff;
}

.tree-node {
  display: flex;
  align-items: flex-start;
  min-width: max-content;
}

.tree-node-content {
  display: grid;
  align-content: start;
  min-width: max-content;
}

.tree-phrase {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 3px 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.4;
  white-space: nowrap;
}

.tree-ref {
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 900;
}

.tree-note {
  color: var(--rose);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.78rem;
  font-style: italic;
  font-weight: 700;
  white-space: nowrap;
}

.greek-annotation {
  box-sizing: border-box;
  width: min(430px, calc(100vw - 92px));
  margin: 2px 0 8px;
  padding: 8px 10px;
  border-left: 3px solid var(--gold);
  border-radius: 0 7px 7px 0;
  background: #f8f5ec;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  white-space: normal;
}

.greek-annotation-header {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 9px;
  align-items: baseline;
}

.greek-annotation-label {
  color: #725c1d;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.greek-annotation-phrase {
  color: var(--accent-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
  font-weight: 700;
}

.greek-annotation-grammar {
  margin-top: 4px;
  color: var(--rose);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.35;
}

.greek-annotation p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.diagram.compact .greek-annotation,
.diagram.compact .section-textual-basis {
  display: none;
}

.tree-children {
  display: flex;
  flex-direction: column;
  gap: 1px;
  position: relative;
  margin: 2px 0 2px 25px;
  padding: 4px 0;
}

.tree-children::before {
  position: absolute;
  top: 13px;
  bottom: 13px;
  left: -15px;
  border-left: 2px solid var(--ink);
  content: "";
}

.tree-children > .tree-node::before {
  width: 15px;
  height: 1px;
  margin-top: 16px;
  margin-left: -15px;
  border-top: 2px solid var(--ink);
  content: "";
}

.tree-children > .tree-node:only-child::before {
  border-top-left-radius: 3px;
}

.clause.indent-1 {
  margin-left: 28px;
}

.clause.indent-2 {
  margin-left: 56px;
}

.clause.indent-3 {
  margin-left: 84px;
}

.ref {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.text {
  line-height: 1.45;
}

.role {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

@media (max-width: 900px) {
  .app-header,
  .layout {
    display: grid;
  }

  .app-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 16px;
  }

  .header-actions {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px 12px 26px;
  }

  .book-panel {
    position: static;
    max-height: none;
  }

  .index-toggle {
    display: block;
  }

  .book-panel.mobile-index-collapsed .testament-tabs,
  .book-panel.mobile-index-collapsed .book-index {
    display: none;
  }

  .book-index {
    max-height: 260px;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 14px;
  }

  .app-header {
    grid-template-columns: 1fr;
    padding: 13px 12px;
  }

  .brand-logo {
    flex-basis: 54px;
    width: 54px;
    height: 54px;
  }

  .header-utilities {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    flex-wrap: wrap;
  }

  .header-actions {
    grid-row: 3;
  }

  .site-language-switch button {
    min-height: 28px;
    padding-inline: 10px;
    font-size: 0.68rem;
  }

  .about-card {
    padding: 20px;
  }

  .copyright-card {
    padding: 20px;
  }

  .about-brand img {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
  }

  .about-heading h2 {
    font-size: 1.3rem;
  }

  .about-provenance > div {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .copyright-heading h2 {
    font-size: 1.3rem;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .footer-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    white-space: normal;
  }

  h1 {
    max-width: 340px;
    font-size: 1.55rem;
    line-height: 1.06;
  }

  h2 {
    font-size: 1.05rem;
  }

  .eyebrow {
    margin-bottom: 3px;
    font-size: 0.65rem;
  }

  .search-label {
    font-size: 0.7rem;
  }

  input[type="search"] {
    min-height: 36px;
    font-size: 0.82rem;
  }

  .panel-heading {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
  }

  #availableCount {
    font-size: 0.67rem;
  }

  .diagram-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px;
    padding: 10px 12px;
  }

  .testament-tabs {
    padding: 6px 8px;
  }

  .tab {
    min-height: 34px;
    font-size: 0.75rem;
  }

  .book-index {
    max-height: 230px;
    padding: 6px 8px;
  }

  .book-group {
    padding: 7px 0;
  }

  .old-testament-title {
    min-height: 36px;
    padding: 0 8px;
    font-size: 0.78rem;
  }

  .old-testament-title span:last-child {
    font-size: 0.66rem;
  }

  .old-testament-books {
    padding-inline: 8px;
  }

  .unavailable-book > .book-title {
    padding: 7px 0;
  }

  .book-title {
    margin-bottom: 5px;
    font-size: 0.78rem;
  }

  .chapter-grid {
    grid-template-columns: repeat(auto-fill, minmax(30px, 1fr));
    gap: 4px;
  }

  .chapter-button {
    min-height: 34px;
    font-size: 0.72rem;
  }

  .toolbar-buttons {
    align-self: end;
    width: auto;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .toolbar-buttons > button {
    flex: 0 0 auto;
  }

  .toolbar-buttons button {
    min-height: 34px;
    border: 1px solid var(--line);
    padding: 0 10px;
    background: #fff;
    border-radius: 7px;
    color: var(--accent-strong);
    font-size: 0.78rem;
    font-weight: 800;
  }

  .translation-badge {
    min-height: 16px;
    padding-inline: 5px;
    font-size: 0.57rem;
  }

  .summary-strip > div {
    gap: 2px;
    padding: 9px 11px;
  }

  .summary-label {
    font-size: 0.66rem;
  }

  .summary-strip strong {
    font-size: 0.8rem;
    line-height: 1.38;
  }

  .diagram {
    padding: 8px;
  }

  .diagram.special-page {
    padding: 0;
  }

  .special-page-frame {
    height: max(600px, calc(100dvh - 230px));
    min-height: 600px;
  }

  .thought-section {
    margin-bottom: 8px;
    border-radius: 6px;
  }

  .section-header {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 7px;
    padding: 7px 8px;
  }

  .verse-range {
    min-width: 52px;
    min-height: 26px;
    font-size: 0.7rem;
  }

  .section-header h3 {
    margin-bottom: 2px;
    font-size: 0.82rem;
  }

  .section-header p {
    font-size: 0.7rem;
    line-height: 1.3;
  }

  .clause-list {
    gap: 4px;
    padding: 7px;
  }

  .clause {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 6px;
    min-height: 30px;
    padding: 5px 6px;
    font-size: 0.82rem;
  }

  .mechanical-section .clause-list {
    padding: 10px 7px;
  }

  .mechanical-section .clause {
    grid-template-columns: 42px minmax(0, 1fr);
    padding-inline: 5px;
  }

  .mechanical-section .text,
  .tree-phrase {
    font-size: 0.9rem;
  }

  .mechanical-tree {
    padding: 11px 8px 14px;
  }

  .tree-children {
    margin-left: 20px;
  }

  .tree-ref,
  .tree-note,
  .ref,
  .role {
    font-size: 0.68rem;
  }

  .feedback-form {
    padding: 20px 18px;
  }

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

  .clause.indent-1,
  .clause.indent-2,
  .clause.indent-3,
  .clause.indent-4 {
    margin-left: 0;
  }
}
