:root {
  --paper: #ffffff;
  --panel: #f7f8fa;
  --panel-dark: #e6e9ee;
  --paper-strong: #ffffff;
  --ink: #2e2a24;
  --muted: #68717c;
  --muted-ink: #68717c;
  --line: #d8dde5;
  --rule: #d8dde5;
  --blue: #416a94;
  --blue-soft: #e8f0f7;
  --amber: #a9652f;
  --amber-soft: #f5e7d7;
  --green: #5e843e;
  --red: #984a3a;
  --chi-0: #d99b55;
  --chi-1: #b96b2f;
  --chi-2: #7f421f;
  --chi-3: #4d2618;
  --chi-4: #24120f;
  --chi-alt-0: #8fb3c9;
  --chi-alt-1: #587f9d;
  --chi-alt-2: #315d7b;
  --chi-alt-3: #1f3f5a;
  --chi-alt-4: #102438;
  --par-0: #416a94;
  --par-1: #345a82;
  --par-2: #29496d;
  --par-3: #213a57;
  --par-4: #182a41;
  --inc-0: #5e843e;
  --inc-1: #4e7637;
  --inc-2: #41672e;
  --inc-3: #365628;
  --inc-4: #233b1f;
  --pivot-0: #9a78b4;
  --pivot-1: #805fa0;
  --pivot-2: #744b95;
  --pivot-3: #573573;
  --pivot-4: #3e2456;
  --contrast-0: #c9705b;
  --contrast-1: #b65a49;
  --contrast-2: #984a3a;
  --contrast-3: #7e392f;
  --contrast-4: #5e2a25;
  --rep-0: #777e7a;
  --rep-1: #646b67;
  --rep-2: #525955;
  --rep-3: #383d3b;
  --rep-4: #222624;
  --shadow: 0 18px 45px rgba(52, 44, 32, 0.11);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
}

body {
  margin: 0;
  min-width: 320px;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.site-shell {
  min-height: 100vh;
}

.topbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  min-height: 64px;
  padding: 12px clamp(18px, 4vw, 56px);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
}

.brand {
  align-items: center;
  display: inline-flex;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--ink);
  border-radius: 6px;
  color: var(--paper-strong);
  display: inline-flex;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 700;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.brand-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 700;
}

.nav-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.nav-link,
.primary-button,
.secondary-button,
.icon-button {
  align-items: center;
  border-radius: 6px;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 38px;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-link {
  color: var(--muted);
  padding: 8px 10px;
}

.nav-link:hover {
  background: rgba(49, 95, 145, 0.08);
  color: var(--blue);
}

.primary-button {
  background: var(--blue);
  border: 1px solid var(--blue);
  color: white;
  gap: 8px;
  padding: 10px 14px;
}

.primary-button:hover {
  transform: translateY(-1px);
}

.secondary-button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  gap: 8px;
  padding: 10px 14px;
}

.secondary-button:hover,
.icon-button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.home-hero {
  display: grid;
  gap: clamp(28px, 5vw, 58px);
  grid-template-columns: minmax(0, 1.03fr) minmax(320px, 0.97fr);
  min-height: calc(100vh - 64px);
  padding: clamp(38px, 7vw, 86px) clamp(18px, 5vw, 76px) 42px;
}

.hero-copy {
  align-self: center;
  max-width: 760px;
}

.eyebrow {
  color: var(--amber);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 14px;
  text-transform: uppercase;
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(46px, 7vw, 94px);
  line-height: 0.96;
  margin: 0;
}

.hero-copy p {
  color: var(--muted);
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.55;
  margin: 24px 0 0;
  max-width: 660px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.pattern-board {
  align-self: center;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-height: 520px;
  overflow: hidden;
  padding: clamp(18px, 3vw, 30px);
}

.board-heading {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding-bottom: 18px;
}

.board-heading h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  margin: 0;
}

.board-heading p,
.source-note {
  color: var(--muted);
  line-height: 1.5;
  margin: 6px 0 0;
}

.verse-map {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.map-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 38px 1fr;
}

.map-tag {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--blue);
  display: inline-flex;
  font-weight: 800;
  height: 38px;
  justify-content: center;
}

.map-text {
  border-left: 4px solid var(--line);
  color: var(--muted);
  line-height: 1.55;
  padding: 8px 0 8px 14px;
}

.map-row.is-active .map-tag {
  background: var(--blue-soft);
  border-color: #b7cde2;
}

.map-row.is-active .map-text {
  border-color: var(--blue);
  color: var(--ink);
}

.feature-band {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 26px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 34px clamp(18px, 5vw, 76px) 56px;
}

.feature h3 {
  font-size: 17px;
  margin: 0 0 8px;
}

.feature p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.doc-page {
  margin: 0 auto;
  max-width: 1120px;
  padding: clamp(28px, 5vw, 64px) clamp(18px, 4vw, 42px) 70px;
}

.doc-hero {
  border-bottom: 1px solid var(--line);
  padding-bottom: 28px;
}

.doc-hero h1 {
  font-size: clamp(42px, 6vw, 76px);
}

.doc-hero p {
  color: var(--muted);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.6;
  margin: 20px 0 0;
  max-width: 820px;
}

.doc-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 28px;
}

.doc-panel,
.doc-section {
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(18px, 3vw, 26px);
}

.doc-section {
  margin-top: 24px;
}

.doc-panel h2,
.doc-section h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(24px, 3vw, 34px);
  margin: 0 0 12px;
}

.doc-panel p,
.doc-section p,
.doc-panel li,
.doc-section li {
  color: var(--muted);
  line-height: 1.65;
}

.doc-panel ul,
.doc-panel ol,
.doc-section ul,
.doc-section ol {
  margin: 12px 0 0;
  padding-left: 22px;
}

.doc-page code {
  background: #f4f6f8;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  font-size: 0.92em;
  padding: 1px 5px;
}

.doc-page pre {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  line-height: 1.55;
  margin: 16px 0 0;
  overflow-x: auto;
  padding: 16px;
}

.doc-page pre code {
  background: transparent;
  border: 0;
  color: inherit;
  display: block;
  font-size: 13px;
  padding: 0;
  white-space: pre;
}

.doc-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  overflow: hidden;
}

.doc-table > div {
  display: grid;
  gap: 14px;
  grid-template-columns: 160px minmax(0, 1fr);
  padding: 12px 14px;
}

.doc-table > div + div {
  border-top: 1px solid var(--line);
}

.doc-table strong {
  color: var(--ink);
}

.bot-section {
  border-left: 5px solid var(--blue);
}

.validator-section {
  border-left: 5px solid var(--green);
}

.validator-label {
  color: var(--ink);
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-top: 18px;
  text-transform: uppercase;
}

.validator-input {
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
  margin-top: 8px;
  min-height: 280px;
  padding: 14px;
  resize: vertical;
  width: 100%;
}

.validator-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(65, 106, 148, 0.14);
  outline: none;
}

.validator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.validator-output {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  line-height: 1.55;
  margin-top: 14px;
  padding: 14px;
}

.validator-output strong {
  color: var(--ink);
  display: block;
  margin-bottom: 4px;
}

.validator-output ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.validator-output li span {
  color: var(--ink);
  font-weight: 800;
}

.validator-output.is-idle {
  background: #f8fafc;
}

.validator-output.is-valid {
  background: #f3f8ef;
  border-color: rgba(94, 132, 62, 0.45);
}

.validator-output.has-warnings {
  background: #fff9ef;
  border-color: rgba(169, 101, 47, 0.4);
}

.validator-output.has-errors {
  background: #fff6f4;
  border-color: rgba(152, 74, 58, 0.38);
}

.reader-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 330px;
  min-height: calc(100vh - 64px);
}

.sidebar,
.notes-panel {
  border-color: var(--line);
  padding: 22px;
}

.sidebar {
  border-right: 1px solid var(--line);
}

.notes-panel {
  border-left: 1px solid var(--line);
}

.control-group {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.control-group label,
.panel-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

select,
input[type="search"] {
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  min-height: 42px;
  padding: 9px 10px;
  width: 100%;
}

.filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.filter-chip {
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  min-height: 34px;
  padding: 6px 11px;
}

.filter-chip.is-active {
  background: var(--amber-soft);
  border-color: var(--chi-0);
  color: var(--amber);
}

.rhet-legend {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 9px;
  margin-top: 22px;
  padding-top: 18px;
}

.legend-row {
  align-items: center;
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 10px;
  grid-template-columns: 38px 1fr;
}

.legend-mark {
  align-items: center;
  background: var(--paper-strong);
  border-radius: 6px;
  display: inline-flex;
  height: 20px;
  justify-content: center;
}

.legend-chi {
  border-bottom: 4px solid var(--chi-1);
}

.legend-par {
  border-bottom: 4px double var(--par-0);
}

.legend-rep {
  border-bottom: 3px dotted var(--rep-1);
}

.legend-pivot {
  color: var(--pivot-1);
  font-weight: 900;
}

.reader-main {
  background: var(--paper-strong);
  padding: clamp(22px, 4vw, 54px);
}

.chapter-header {
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  padding-bottom: 18px;
}

.chapter-kicker {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.chapter-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 4vw, 58px);
  line-height: 1;
  margin: 0;
}

.chapter-tools {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.scripture {
  display: grid;
  gap: 12px;
}

.verse {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(58px, auto) minmax(0, 1fr);
  padding: 4px 0;
  text-align: left;
  width: 100%;
}

.verse:hover,
.verse.is-selected {
  background: #f5f8fb;
  border-color: var(--line);
}

.verse.is-annotated {
  border-left: 0;
}

.verse.verse-has-chi {
  margin-left: calc(var(--chi-indent-depth, 0) * 22px);
  width: calc(100% - (var(--chi-indent-depth, 0) * 22px));
}

.verse.verse-has-parallel {
  margin-left: 0;
  width: 100%;
}

.verse-number {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  padding-top: 5px;
}

.reader-rhet-stack {
  align-items: start;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 30px;
  padding-top: 1px;
}

.reader-rhet-unit {
  align-items: center;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: inline-flex;
  font-size: 12px;
  height: 28px;
  justify-content: center;
  min-width: 38px;
  padding: 3px 6px;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.reader-rhet-unit.is-paired {
  background: #eef4fa;
  border-color: var(--chi-0);
  transform: translateY(-1px);
}

.verse-text {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(19px, 1.8vw, 23px);
  line-height: 1.62;
}

.reader-rhet-text {
  padding-bottom: 0.05em;
}

.reader-pivot-mark {
  color: var(--pivot-1);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.82em;
  font-weight: 900;
  margin-right: 0.3em;
}

.search-mark {
  background: var(--amber-soft);
  border-radius: 4px;
  padding: 0 2px;
}

.note-card {
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 12px;
  padding: 14px;
}

.note-card.is-selected {
  border-color: #e0b15d;
  box-shadow: 0 8px 22px rgba(155, 106, 23, 0.12);
}

.note-type {
  color: var(--amber);
  font-size: 12px;
  font-weight: 800;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.note-card h3 {
  font-size: 17px;
  margin: 0 0 8px;
}

.note-card p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.anchor-list {
  color: var(--green);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.anchor-list span {
  background: #e8efe4;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 8px;
}

.empty-state {
  color: var(--muted);
  line-height: 1.55;
  margin-top: 12px;
}

.rhet-structure {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 16px;
  overflow: hidden;
}

.rhet-card-chi {
  border-left: 5px solid var(--chi-1);
}

.rhet-card-parallel {
  border-left: 5px double var(--par-0);
}

.rhet-header {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 14px;
}

.rhet-header h3 {
  font-size: 16px;
  line-height: 1.3;
  margin: 0 0 6px;
}

.rhet-header p {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.copy-citation,
.unit-citation {
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 800;
}

.copy-citation {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 9px;
}

.rhet-outline {
  display: grid;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 12px;
}

.rhet-unit {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  display: grid;
  gap: 8px;
  grid-template-columns: 42px minmax(72px, 0.7fr) minmax(0, 1.4fr);
  min-height: 42px;
  padding: 6px;
  transition: background 160ms ease, border-color 160ms ease;
}

.rhet-unit.depth-1 {
  margin-left: 18px;
}

.rhet-unit.depth-2 {
  margin-left: 36px;
}

.rhet-unit.depth-3 {
  margin-left: 54px;
}

.rhet-unit.depth-4 {
  margin-left: 72px;
}

.rhet-unit.rhet-center {
  background: rgba(128, 95, 160, 0.12);
  border-color: #d8c4e4;
}

.rhet-unit.is-selected,
.rhet-unit.is-paired {
  background: #eef4fa;
  border-color: var(--chi-0);
}

.unit-citation {
  height: 30px;
  padding: 4px 6px;
}

.unit-ref {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.unit-text {
  color: var(--ink);
  line-height: 1.35;
}

.rhet-mark {
  border-radius: 0.15em;
  text-decoration-line: underline;
  text-decoration-color: var(--rhet-color, currentColor);
  text-underline-offset: 0.16em;
  text-decoration-thickness: 0.08em;
}

.rhet-chi.depth-0 {
  text-decoration-color: var(--chi-0);
  text-decoration-thickness: 0.06em;
}

.rhet-chi.depth-1 {
  text-decoration-color: var(--chi-1);
  text-decoration-thickness: 0.07em;
}

.rhet-chi.depth-2 {
  text-decoration-color: var(--chi-2);
  text-decoration-thickness: 0.08em;
}

.rhet-chi.depth-3 {
  text-decoration-color: var(--chi-3);
  text-decoration-thickness: 0.09em;
}

.rhet-chi.depth-4,
.rhet-chi.rhet-center {
  text-decoration-color: var(--chi-4);
  text-decoration-style: double;
  text-decoration-thickness: 0.08em;
}

.rhet-chi.nest-1.depth-0 {
  text-decoration-color: var(--chi-alt-0);
}

.rhet-chi.nest-1.depth-1 {
  text-decoration-color: var(--chi-alt-1);
}

.rhet-chi.nest-1.depth-2 {
  text-decoration-color: var(--chi-alt-2);
}

.rhet-chi.nest-1.depth-3 {
  text-decoration-color: var(--chi-alt-3);
}

.rhet-chi.nest-1.depth-4,
.rhet-chi.nest-1.rhet-center {
  text-decoration-color: var(--chi-alt-4);
}

.rhet-mark.rhet-chi,
.rhet-mark.rhet-par {
  text-decoration-color: var(--rhet-color, currentColor);
}

.rhet-par {
  text-decoration-color: var(--rhet-color, var(--par-0));
  text-decoration-thickness: 0.08em;
}

.rhet-par.rel-syn {
  text-decoration-style: solid;
}

.rhet-par.rel-ant {
  text-decoration-color: var(--contrast-1);
  text-decoration-style: dashed;
}

.rhet-par.rel-synthetic {
  border-bottom: 2px solid var(--par-0);
  text-decoration-style: solid;
}

.rhet-par.rel-comparative {
  text-decoration-style: wavy;
}

.rhet-label {
  color: var(--ink);
  display: inline-block;
  font-variant-numeric: tabular-nums;
  min-width: 2.25em;
}

.rhet-label.chi {
  border-bottom: 0.16em solid var(--rhet-color, var(--chi-0));
  color: var(--rhet-label-color, var(--chi-3));
}

.rhet-label.chi.depth-0 {
  border-bottom-color: var(--chi-0);
  color: var(--chi-0);
}

.rhet-label.chi.depth-1 {
  border-bottom-color: var(--chi-1);
  color: var(--chi-1);
}

.rhet-label.chi.depth-2 {
  border-bottom-color: var(--chi-2);
  color: var(--chi-2);
}

.rhet-label.chi.depth-3 {
  border-bottom-color: var(--chi-3);
  color: var(--chi-3);
}

.rhet-label.chi.depth-4,
.rhet-label.chi.rhet-center {
  border-bottom-color: var(--chi-4);
  color: var(--chi-4);
}

.rhet-label.chi.nest-0.rhet-center {
  border-bottom-color: var(--chi-4);
  color: var(--chi-4);
}

.rhet-label.chi.nest-1.depth-0 {
  border-bottom-color: var(--chi-alt-0);
  color: var(--chi-alt-2);
}

.rhet-label.chi.nest-1.depth-1 {
  border-bottom-color: var(--chi-alt-1);
  color: var(--chi-alt-2);
}

.rhet-label.chi.nest-1.depth-2 {
  border-bottom-color: var(--chi-alt-2);
  color: var(--chi-alt-3);
}

.rhet-label.chi.nest-1.depth-3 {
  border-bottom-color: var(--chi-alt-3);
  color: var(--chi-alt-3);
}

.rhet-label.chi.nest-1.depth-4,
.rhet-label.chi.nest-1.rhet-center {
  border-bottom-color: var(--chi-alt-4);
  color: var(--chi-alt-4);
}

.rhet-label.chi {
  border-bottom-color: var(--rhet-color, var(--chi-0));
  color: var(--rhet-label-color, var(--chi-3));
}

.reader-rhet-unit.rhet-label.chi[style],
.unit-citation.rhet-label.chi[style] {
  border-bottom-color: var(--rhet-color, var(--chi-0));
  color: var(--rhet-label-color, var(--chi-3));
}

.rhet-label.parallel {
  border-bottom: 0.2em double var(--par-0);
  color: var(--par-2);
}

.rhet-label.parallel {
  border-bottom-color: var(--rhet-color, var(--par-0));
  color: var(--rhet-label-color, var(--par-2));
}

.rhet-label .center,
.rhet-center .unit-citation,
.rhet-center.rhet-mark {
  color: var(--pivot-2);
  font-weight: 800;
}

.rhet-center .unit-citation {
  border-color: var(--pivot-1);
}

.rhet-unit.rhet-center .unit-text::before {
  color: var(--pivot-1);
  content: "◆ ";
  font-weight: 800;
}

.confidence-mark {
  color: var(--pivot-2);
  font-weight: 900;
}

.unit-rel {
  background: #f4f6f8;
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  grid-column: 2 / 4;
  justify-self: start;
  padding: 4px 7px;
}

.rhet-card-chi .unit-rel {
  color: var(--chi-2);
}

.rhet-card-parallel .unit-rel {
  color: var(--par-2);
}

.structure-note {
  border-top: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
  padding: 12px 14px 14px;
}

.mobile-panel-toggle {
  display: none;
}

@media (max-width: 1120px) {
  .reader-shell {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .notes-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-actions {
    width: 100%;
  }

  .nav-link,
  .primary-button,
  .secondary-button {
    flex: 1;
  }

  .home-hero,
  .feature-band,
  .reader-shell {
    grid-template-columns: 1fr;
  }

  .home-hero {
    min-height: 0;
  }

  .pattern-board {
    min-height: 0;
  }

  .sidebar,
  .notes-panel {
    border-left: 0;
    border-right: 0;
  }

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

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

  .doc-table > div {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .nav-actions {
    flex-wrap: wrap;
  }

  .hero-actions,
  .chapter-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .verse {
    grid-template-columns: minmax(42px, auto) minmax(0, 1fr);
    padding: 4px 0;
  }

  .verse.verse-has-chi {
    margin-left: calc(var(--chi-indent-depth, 0) * 10px);
    width: calc(100% - (var(--chi-indent-depth, 0) * 10px));
  }

  .reader-main {
    padding-left: 18px;
    padding-right: 18px;
  }

  .rhet-unit {
    grid-template-columns: 38px 1fr;
  }

  .unit-text,
  .unit-rel {
    grid-column: 2;
  }

  .rhet-unit.depth-1,
  .rhet-unit.depth-2,
  .rhet-unit.depth-3,
  .rhet-unit.depth-4 {
    margin-left: 10px;
  }
}
