:root {
  color-scheme: light;
  --topbar-height: 64px;
  --bg: #f8faf7;
  --surface: #ffffff;
  --surface-soft: #f1f5ef;
  --text: #191b1f;
  --muted: #626b73;
  --border: #d7ddd4;
  --accent: #176b5b;
  --accent-strong: #0f4d42;
  --accent-soft: #dff1eb;
  --warn: #a15c13;
  --warn-soft: #fff1d8;
  --danger: #a53d3d;
  --danger-soft: #ffe5e2;
  --info: #365f91;
  --info-soft: #e6eef8;
  --shadow: 0 12px 28px rgba(33, 38, 42, 0.08);
  --radius: 8px;
  --app-font-size: 16px;
  --editor-font-size: var(--app-font-size);
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

body.dark {
  color-scheme: dark;
  --bg: #171816;
  --surface: #20221f;
  --surface-soft: #2b2e29;
  --text: #f2f4ef;
  --muted: #b8beb5;
  --border: #3b4038;
  --accent: #68c7ae;
  --accent-strong: #9be1cf;
  --accent-soft: #173d35;
  --warn: #f2bd65;
  --warn-soft: #3c2b12;
  --danger: #ff9a90;
  --danger-soft: #401d1b;
  --info: #9ec2f0;
  --info-soft: #1e3148;
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
}

body[data-theme-color="blue"] {
  --bg: #f7faff;
  --surface-soft: #eef5ff;
  --border: #d4deef;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #dbeafe;
}

body[data-theme-color="slate"] {
  --bg: #f8fafc;
  --surface-soft: #f1f5f9;
  --border: #d9e1ea;
  --accent: #475569;
  --accent-strong: #334155;
  --accent-soft: #e2e8f0;
}

body[data-theme-color="rose"] {
  --bg: #fff8fa;
  --surface-soft: #fff0f4;
  --border: #ead2da;
  --accent: #be3f5f;
  --accent-strong: #9f2f4b;
  --accent-soft: #ffe4ec;
}

body[data-theme-color="amber"] {
  --bg: #fffaf2;
  --surface-soft: #fff3dd;
  --border: #eadabd;
  --accent: #a15c13;
  --accent-strong: #7c4308;
  --accent-soft: #fff1d8;
}

body.dark[data-theme-color="blue"] {
  --bg: #151923;
  --surface-soft: #20283a;
  --border: #34415d;
  --accent: #8ab4ff;
  --accent-strong: #bed3ff;
  --accent-soft: #1e335d;
}

body.dark[data-theme-color="slate"] {
  --bg: #15171b;
  --surface-soft: #262c35;
  --border: #475569;
  --accent: #cbd5e1;
  --accent-strong: #f1f5f9;
  --accent-soft: #334155;
}

body.dark[data-theme-color="rose"] {
  --bg: #1c1418;
  --surface-soft: #35212a;
  --border: #573446;
  --accent: #ff9ab1;
  --accent-strong: #ffc1d0;
  --accent-soft: #542032;
}

body.dark[data-theme-color="amber"] {
  --bg: #1b1710;
  --surface-soft: #302617;
  --border: #5a4120;
  --accent: #f2bd65;
  --accent-strong: #ffe0a3;
  --accent-soft: #3c2b12;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

html {
  height: 100%;
  font-size: var(--app-font-size);
  overflow: hidden;
}

body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: 0;
}

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

button,
.button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.48rem 0.75rem;
  background: var(--surface-soft);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  white-space: nowrap;
}

button:hover,
.button:hover {
  border-color: var(--accent);
}

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

.primary {
  background: var(--accent);
  color: #ffffff;
}

.primary:hover {
  background: var(--accent-strong);
}

.secondary {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.ghost {
  background: transparent;
  border-color: var(--border);
}

.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

label {
  display: grid;
  gap: 0.28rem;
  color: var(--muted);
  font-size: 0.86rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 0.55rem 0.65rem;
}

textarea {
  resize: vertical;
  white-space: pre-wrap;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
.button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 30%, transparent);
  outline-offset: 1px;
}

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

h1 {
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
  line-height: 1.2;
}

h2 {
  margin-bottom: 0.55rem;
  font-size: 1rem;
}

h3 {
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}

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

.context-project-note {
  margin: 0 0 0.25rem;
  color: var(--text);
  font-weight: 700;
}

.context-project-note + p {
  margin-top: 0;
}

.eyebrow {
  margin-bottom: 0.25rem;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  max-width: min(420px, calc(100vw - 2rem));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 0.8rem 1rem;
}

.app-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(18, 24, 28, 0.28);
  padding: 1rem;
}

.app-modal {
  display: grid;
  gap: 1rem;
  width: min(520px, 100%);
  max-height: min(720px, calc(100vh - 2rem));
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
  padding: 1rem;
}

.app-modal h2 {
  margin: 0;
  font-size: 1.1rem;
}

.modal-actions {
  display: flex;
  gap: 0.55rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.module-registry-modal {
  width: min(980px, calc(100vw - 2rem));
}

.module-registry-loading,
.module-registry-refreshing {
  display: grid;
  gap: 0.45rem;
}

.admin-project-loading {
  display: grid;
  gap: 0.55rem;
  max-width: 520px;
  padding: 0.25rem 0;
}

.admin-project-progress {
  width: min(420px, 100%);
}

.module-registry-refreshing {
  color: var(--muted);
  font-size: 0.9rem;
}

.module-registry-progress {
  position: relative;
  height: 5px;
  overflow: hidden;
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent-soft) 50%, var(--surface-soft));
}

.module-registry-progress span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  border-radius: inherit;
  background: var(--accent);
  animation: module-progress-slide 1.05s ease-in-out infinite;
}

@keyframes module-progress-slide {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(250%);
  }
}

.download-registry-module.downloading {
  width: 136px;
  min-height: 44px;
  cursor: wait;
}

.module-download-progress {
  position: relative;
  display: block;
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent-soft) 65%, var(--surface));
}

.module-download-progress span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 45%;
  border-radius: inherit;
  background: var(--accent);
  animation: module-progress-slide 1.05s ease-in-out infinite;
}

.module-registry-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) minmax(160px, 0.75fr) minmax(160px, 0.75fr) auto;
  align-items: end;
  gap: 0.75rem;
}

.module-registry-toolbar label {
  min-width: 0;
}

.module-registry-language-filter {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

.module-registry-language-filter > span {
  color: var(--muted);
  font-size: 0.9rem;
}

.module-language-combobox {
  position: relative;
}

.module-language-options {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  display: grid;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 0.25rem;
}

.module-language-option {
  width: 100%;
  justify-content: flex-start;
  min-height: 34px;
  border-color: transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.module-language-option:hover,
.module-language-option.selected {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.module-language-empty {
  padding: 0.45rem 0.55rem;
}

@media (max-width: 760px) {
  .module-registry-toolbar {
    grid-template-columns: 1fr;
  }
}

.module-registry-list {
  display: grid;
  gap: 0.55rem;
}

.module-registry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 0.75rem;
}

.module-registry-row.downloaded {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
}

.module-registry-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.module-registry-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.module-registry-row p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.module-kind-badge,
.module-language-badge,
.downloaded-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.downloaded-badge {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.comparison-backdrop {
  place-items: stretch;
}

.comparison-modal {
  width: min(980px, calc(100vw - 2rem));
  align-self: center;
  justify-self: center;
}

.modal-icon-actions {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.comparison-layout {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 0.75rem;
  min-height: 280px;
}

.comparison-module-panel {
  display: grid;
  align-content: start;
  gap: 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 0.65rem;
}

.comparison-module-panel h3 {
  margin: 0 0 0.1rem;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.comparison-module-list {
  gap: 0.45rem;
}

.comparison-study-row {
  border-top: 1px solid var(--border);
  margin-top: 0.15rem;
  padding: 0.55rem 0.2rem 0.1rem;
}

.comparison-study-row + .comparison-study-row {
  border-top: 0;
  margin-top: 0;
  padding-top: 0.1rem;
}

.comparison-module-row {
  min-height: 34px;
}

.comparison-module-panel.hidden {
  display: none;
}

.comparison-module-panel.hidden + .comparison-body {
  grid-column: 1 / -1;
}

.comparison-body {
  display: grid;
  gap: 0.65rem;
  align-content: start;
  overflow: auto;
}

.comparison-row {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 0.7rem;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.comparison-row:hover {
  border-color: var(--accent);
}

.comparison-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.comparison-row.copy-selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface-soft));
  box-shadow: inset 3px 0 0 var(--accent);
}

.comparison-row-title {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text);
  font-weight: 800;
  font-size: 0.9rem;
}

.comparison-verse-text {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.5rem;
  align-items: start;
  padding: 0.25rem 0;
}

.comparison-verse-text + .comparison-verse-text {
  border-top: 1px solid var(--border);
}

.comparison-verse-text small {
  color: var(--muted);
  font-weight: 800;
  text-align: right;
}

.comparison-gap {
  color: var(--muted);
  padding: 0.1rem 0 0.1rem 2.5rem;
}

.login-shell {
  height: 100vh;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.login-panel {
  width: min(720px, 100%);
  display: grid;
  gap: 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: clamp(1rem, 4vw, 2rem);
}

.stack {
  display: grid;
  gap: 0.85rem;
}

.workspace-login-choice,
.seed-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.demo-toggle-row {
  margin: 0;
}

.demo-toggle-row input[type="checkbox"] {
  appearance: none;
  width: 2.9rem;
  height: 1.55rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--muted);
  cursor: pointer;
  position: relative;
  flex: 0 0 auto;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.demo-toggle-row input[type="checkbox"]::before {
  content: "";
  position: absolute;
  width: 1.05rem;
  height: 1.05rem;
  left: 0.2rem;
  top: 50%;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
  transform: translateY(-50%);
  transition: transform 0.18s ease;
}

.demo-toggle-row input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent-strong);
}

.demo-toggle-row input[type="checkbox"]:checked::before {
  transform: translate(1.34rem, -50%);
}

.compact-form {
  border-top: 1px solid var(--border);
  margin-top: 0.25rem;
  padding-top: 0.75rem;
}

.seed-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 0.8rem;
}

.seed-box p {
  margin: 0.25rem 0;
  font-family: var(--mono);
  font-size: 0.9rem;
}

.danger-zone {
  border-color: color-mix(in srgb, #c2410c 45%, var(--border));
}

.brand-title {
  margin: 0;
  font-size: clamp(1.95rem, 5.7vw, 3.35rem);
  line-height: 1;
}

.brand-title + .muted {
  margin-top: 1.2rem;
}

.brand-title sup,
.brand-mark sup {
  margin-left: 0.08em;
  font-size: 0.42em;
  letter-spacing: 0;
  vertical-align: super;
}

.app-shell {
  height: 100vh;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto auto minmax(220px, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  padding: 0.75rem 1rem;
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: max-content;
}

.brand-mark {
  font-size: 1.05rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface));
  padding: 0.08rem 0.45rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.tabs {
  display: flex;
  gap: 0.35rem;
  min-width: 0;
  overflow: visible;
}

.tab {
  min-width: 0;
  padding-left: 0.7rem;
  padding-right: 0.7rem;
  background: transparent;
  border-color: transparent;
}

.icon-tab {
  position: relative;
  width: 44px;
  min-width: 44px;
  height: 42px;
  min-height: 42px;
  padding: 0;
}

.nav-icon {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.top-actions {
  position: relative;
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.workspace-context-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  overflow: hidden;
}

.context-picker-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.05rem;
  min-width: 0;
  max-width: 18rem;
  height: 42px;
  border-color: transparent;
  background: transparent;
  padding: 0.18rem 0.55rem;
  text-align: left;
}

.context-picker-button:hover,
.context-picker-button:focus-visible {
  border-color: var(--border);
  background: var(--surface-soft);
}

.context-picker-button strong,
.context-picker-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-picker-button strong {
  font-size: 0.92rem;
  line-height: 1.05;
}

.context-picker-label {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1;
}

.project-context-button {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent) 26%, transparent);
}

.outside-project-context-button {
  color: color-mix(in srgb, var(--muted) 88%, var(--text));
  font-style: italic;
}

.context-picker-backdrop {
  align-items: flex-start;
  justify-content: flex-start;
  background: transparent;
  pointer-events: auto;
}

.context-picker-modal {
  width: min(650px, calc(100vw - 1.5rem));
  max-height: min(640px, calc(100vh - var(--topbar-height) - 1rem));
  overflow: auto;
  margin: calc(var(--topbar-height) + 0.6rem) auto 0;
}

.context-picker-modal[style] {
  position: fixed;
  left: var(--context-picker-left);
  top: var(--context-picker-top);
  width: var(--context-picker-width);
  margin: 0;
}

.context-picker-body {
  display: grid;
  gap: 1rem;
}

.context-picker-list {
  display: grid;
  gap: 0.35rem;
}

.context-picker-list-item {
  justify-content: flex-start;
  gap: 0.55rem;
  min-height: 42px;
  text-align: left;
}

.context-picker-list-item.selected,
.chapter-selection-tile.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
}

.context-book-grid {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.context-book-tile.outside-project-book {
  background: var(--surface);
  color: color-mix(in srgb, var(--muted) 86%, var(--text));
  font-style: italic;
}

.chapter-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(3.2rem, 1fr));
  gap: 0.35rem;
}

.chapter-selection-tile {
  min-height: 40px;
  padding: 0.35rem;
}

.chapter-selection-tile.outside-project-chapter {
  background: var(--surface);
  color: color-mix(in srgb, var(--muted) 86%, var(--text));
  font-style: italic;
}

.icon-button {
  position: relative;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
}

.password-reset-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.03em;
}

.password-input-wrap {
  position: relative;
  display: block;
}

.password-input-wrap input {
  width: 100%;
  padding-right: 3rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  transform: translateY(-50%);
}

.password-toggle .password-eye-hide {
  display: none;
}

.password-toggle.password-visible .password-eye-show {
  display: none;
}

.password-toggle.password-visible .password-eye-hide {
  display: block;
}

.compact-icon-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
}

.icon-text-button {
  position: relative;
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 0.7rem;
  font-family: var(--mono);
}

.icon-text-button .nav-icon {
  width: 18px;
  height: 18px;
}

.bell-icon {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notification-button {
  color: var(--text);
}

.notification-button.has-unread {
  color: var(--accent-strong);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: var(--accent-soft);
}

.notification-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--danger);
  color: #ffffff;
  padding: 0 4px;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 14px;
  text-align: center;
}

.theme-toggle {
  position: relative;
  height: 42px;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

.theme-sun,
.theme-moon {
  width: 18px;
  text-align: center;
  color: var(--accent-strong);
}

.theme-track {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #8b908d;
  padding: 3px;
  transition: background 160ms ease;
}

.theme-track span {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  transition: transform 160ms ease;
}

.theme-toggle.on .theme-track {
  background: var(--accent);
}

.theme-toggle.on .theme-track span {
  transform: translateX(16px);
}

.version-compare-toggle {
  position: relative;
  height: 36px;
  min-height: 36px;
  padding: 0 0.45rem;
}

.version-compare-toggle .nav-icon {
  width: 18px;
  height: 18px;
  color: var(--accent-strong);
}

.notification-wrap {
  position: relative;
}

.notification-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  z-index: 40;
  width: min(520px, calc(100vw - 1.5rem));
  max-width: calc(100vw - 1.5rem);
  max-height: min(620px, calc(100vh - var(--topbar-height, 64px) - 1rem));
  overflow-x: hidden;
  overflow-y: auto;
  display: grid;
  gap: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 0.7rem;
}

.notification-menu-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.55rem;
}

.notification-menu-head .mark-all-notifications {
  grid-column: 1 / -1;
  justify-self: stretch;
  white-space: normal;
}

.mini-toggle-row {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.mini-toggle-row input {
  width: auto;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 2fr) repeat(3, minmax(150px, 1fr)) auto;
  gap: 0.75rem;
  align-items: end;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 0.85rem 1rem;
}

.toolbar-actions {
  display: contents;
}

.project-context-select {
  background-color: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
}

.outside-project-context-select {
  color: color-mix(in srgb, var(--muted) 84%, var(--text));
  font-style: italic;
}

.reader-scope-select option.project-option,
.project-context-select option.project-option {
  background-color: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--text);
  font-weight: 700;
}

.reader-scope-select option.outside-project-option {
  background-color: var(--surface);
  color: color-mix(in srgb, var(--muted) 82%, var(--surface));
  font-style: italic;
}

.export-scope-control {
  min-width: 0;
}

.toolbar-export-buttons,
.chapter-history-actions,
.chapter-bulk-actions {
  display: grid;
  gap: 0.25rem;
}

.toolbar-export-buttons > div,
.chapter-history-actions > div,
.chapter-bulk-actions > div {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.toolbar-export-buttons {
  justify-self: end;
}

.toolbar-export-buttons > div {
  flex-wrap: nowrap;
}

.project-management-actions {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  width: min(520px, 100%);
}

.project-management-actions select {
  min-width: 0;
}

.export-panel {
  display: grid;
  gap: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
}

.export-help-list {
  display: grid;
  gap: 0.25rem;
  margin: 0.45rem 0 0.8rem;
}

.export-help-list p {
  margin: 0;
}

.inline-progress {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
}

.export-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
}

.export-panel-head h2 {
  margin-bottom: 0.2rem;
}

.export-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.export-panel textarea {
  min-height: 220px;
  max-height: 42vh;
  resize: vertical;
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre;
}

.notifications {
  display: grid;
  gap: 0.4rem;
  padding: 0.75rem 1rem 0;
}

.notification {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--info-soft);
  padding: 0.55rem 0.7rem;
  color: var(--text);
}

.notification > div:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.notification.read {
  background: var(--surface);
  color: var(--muted);
}

.notification.unread {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
}

.notification small {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
}

.notification-actions {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

.notification-actions .icon-button {
  min-width: 34px;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
}

.notification-item {
  cursor: pointer;
}

.notification-item:hover {
  border-color: var(--accent);
}

.view {
  display: none;
  padding: 1rem;
}

.view.active {
  display: block;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(220px, 248px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  transition: grid-template-columns 220ms ease;
}

.layout-grid.strong-dictionary-open {
  grid-template-columns: minmax(220px, 248px) minmax(0, 1fr) minmax(260px, 340px);
}

.layout-grid > div {
  min-width: 0;
}

.layout-grid.comments-collapsed {
  grid-template-columns: 46px minmax(0, 1fr);
}

.layout-grid.comments-collapsed.strong-dictionary-open {
  grid-template-columns: 46px minmax(0, 1fr) minmax(260px, 340px);
}

.layout-grid.comments-collapsed .side-panel {
  position: sticky;
  top: calc(var(--topbar-height) + 0.25rem);
  z-index: 18;
  width: 46px;
  max-height: 46px;
  overflow: visible;
  padding: 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.layout-grid.comments-collapsed .side-panel + div {
  grid-column: 2;
}

.strong-side-panel {
  position: sticky;
  top: calc(var(--topbar-height) + 0.25rem);
  display: grid;
  gap: 0.65rem;
  max-height: calc(100vh - var(--topbar-height) - 1rem);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 0.75rem;
}

.strong-side-panel[hidden] {
  display: none;
}

.strong-side-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.5rem;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.55rem;
}

.strong-side-panel-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layout-grid.comments-collapsed .side-panel section {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-10px);
}

.layout-grid.comments-collapsed .panel-toggle {
  width: 46px;
  min-width: 46px;
  height: 46px;
  min-height: 46px;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  padding: 0;
  line-height: 1;
  color: var(--accent-strong);
  white-space: nowrap;
  background: var(--surface);
  border-color: var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.side-panel,
.panel,
.reader-page {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.side-panel {
  display: grid;
  gap: 1rem;
  align-self: start;
  position: sticky;
  top: calc(var(--topbar-height) + 0.25rem);
  max-height: calc(100vh - var(--topbar-height) - 1rem);
  overflow-x: visible;
  overflow-y: auto;
  scrollbar-gutter: stable;
  transition: padding 220ms ease;
}

.side-panel section {
  transition: opacity 180ms ease, transform 180ms ease;
}

.panel-toggle {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 18px;
  justify-items: center;
  min-height: 40px;
  border-color: var(--border);
  background: var(--surface-soft);
  color: var(--accent-strong);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.panel-toggle::after {
  display: block;
  width: 18px;
  height: 18px;
  content: "";
}

.panel-toggle-icon {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.layout-grid.comments-collapsed .panel-toggle span,
.settings-layout.settings-menu-collapsed .panel-toggle span {
  display: none;
}

.layout-grid.comments-collapsed .panel-toggle::after,
.settings-layout.settings-menu-collapsed .panel-toggle::after {
  display: none;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.8rem;
}

.editor-sticky-head {
  position: sticky;
  top: calc(var(--topbar-height) + 0.25rem);
  z-index: 14;
  margin: -0.35rem -0.35rem 0.8rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  padding: 0.55rem 0.35rem;
  backdrop-filter: blur(10px);
}

.chapter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: end;
}

.chapter-actions.editor-top-actions {
  align-items: center;
  justify-content: flex-end;
}

.editor-top-actions .chapter-bulk-actions,
.editor-top-actions #top-refresh-button {
  display: none;
}

.chapter-actions.project-management-actions {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 42px 42px;
  gap: 0.45rem;
  width: min(620px, 100%);
  max-width: 620px;
  flex: 1 1 420px;
}

.chapter-actions.project-management-actions select {
  width: 100%;
}

.chapter-actions label {
  width: 170px;
}

.chapter-actions .chapter-history-actions,
.chapter-actions .chapter-bulk-actions {
  width: auto;
}

.chapter-search-control {
  position: relative;
}

.chapter-search-control small {
  position: absolute;
  right: 0;
  top: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.chapter-status-control {
  display: grid;
  gap: 0.35rem;
  justify-items: center;
}

.chapter-status-buttons {
  display: inline-grid;
  grid-template-columns: repeat(3, 42px);
  width: max-content;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.verse-status-buttons {
  align-self: center;
  justify-self: center;
  grid-template-columns: repeat(3, 36px);
}

.chapter-status-button {
  width: 42px;
  height: 38px;
  min-height: 38px;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  padding: 0;
}

.verse-status-buttons .chapter-status-button {
  width: 36px;
  height: 34px;
  min-height: 34px;
}

.chapter-status-button:last-child {
  border-right: 0;
}

.chapter-status-button:hover:not(:disabled),
.chapter-status-button:focus-visible {
  background: var(--surface-soft);
  color: var(--accent);
}

.chapter-status-button.active {
  color: var(--text);
  box-shadow: inset 0 -2px 0 currentColor;
}

.chapter-status-button.active[data-chapter-status="draft"],
.chapter-status-button.active[data-verse-status="draft"] {
  background: #f2cccc;
  color: #7f1d1d;
}

.chapter-status-button.active[data-chapter-status="needs_review"],
.chapter-status-button.active[data-verse-status="needs_review"] {
  background: #efdba8;
  color: #7a4a08;
}

.chapter-status-button.active[data-chapter-status="approved"],
.chapter-status-button.active[data-verse-status="approved"] {
  background: #bfe0c4;
  color: #166534;
}

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

body.dark .chapter-status-button.active[data-chapter-status="draft"],
body.dark .chapter-status-button.active[data-verse-status="draft"] {
  background: #5a3030;
  color: #fecaca;
}

body.dark .chapter-status-button.active[data-chapter-status="needs_review"],
body.dark .chapter-status-button.active[data-verse-status="needs_review"] {
  background: #594b2b;
  color: #fde68a;
}

body.dark .chapter-status-button.active[data-chapter-status="approved"],
body.dark .chapter-status-button.active[data-verse-status="approved"] {
  background: #2e5038;
  color: #bbf7d0;
}

.text-marker-toggle {
  font-family: var(--mono);
  font-weight: 900;
  color: var(--muted);
}

.text-marker-toggle.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.text-marker-toggle > span {
  display: none;
}

.text-marker-toggle svg circle:nth-of-type(1),
.text-marker-toggle svg circle:nth-of-type(2) {
  fill: color-mix(in srgb, var(--surface) 72%, var(--accent-soft));
}

.text-marker-toggle svg circle:nth-of-type(3),
.text-marker-toggle svg circle:nth-of-type(4) {
  fill: currentColor;
}

.side-tool-stack {
  display: grid;
  gap: 0.65rem;
}

.side-tool-stack h2 {
  margin: 0;
  font-size: 1rem;
}

.side-tool-stack button,
.side-tool-stack .icon-text-button {
  width: 100%;
}

.side-tool-stack .icon-text-button {
  justify-content: center;
}

.tool-toggle-group {
  display: grid;
  gap: 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 0.55rem;
}

.tool-toggle-group h3 {
  margin: 0 0 0.1rem;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.tool-toggle-heading,
.comparison-module-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.tool-toggle-heading h3,
.comparison-module-panel-head h3 {
  margin: 0;
}

.tool-toggle-heading .icon-button,
.comparison-module-panel-head .icon-button {
  width: 34px;
  min-width: 34px;
}

.editor-column-list {
  display: grid;
  gap: 0.35rem;
}

.tool-toggle-row,
.pill-toggle-row,
.notification-toggle-row {
  justify-content: flex-start;
  gap: 0.55rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.editor-column-row {
  min-height: 32px;
  border-radius: calc(var(--radius) - 2px);
  padding: 0.1rem 0.2rem;
  transition: background 140ms ease, opacity 140ms ease, transform 140ms ease;
}

.editor-column-row.dragging {
  opacity: 0.5;
}

.editor-column-row.drag-over {
  background: color-mix(in srgb, var(--accent-soft) 70%, transparent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.editor-column-row.module-unavailable {
  opacity: 0.58;
}

.editor-column-row.module-unavailable input {
  cursor: not-allowed;
}

.drag-handle {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 800;
  line-height: 1;
  cursor: grab;
  user-select: none;
}

.editor-column-row:active .drag-handle {
  cursor: grabbing;
}

.tool-toggle-row input[type="checkbox"],
.pill-toggle-row input[type="checkbox"],
.notification-toggle-row input[type="checkbox"] {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  min-width: 38px;
  height: 22px;
  min-height: 22px;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: #858c8c;
  cursor: pointer;
  transition: background 140ms ease, box-shadow 140ms ease;
}

.tool-toggle-row input[type="checkbox"]::before,
.pill-toggle-row input[type="checkbox"]::before,
.notification-toggle-row input[type="checkbox"]::before {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  content: "";
  transition: transform 140ms ease;
}

.tool-toggle-row input[type="checkbox"]:checked,
.pill-toggle-row input[type="checkbox"]:checked,
.notification-toggle-row input[type="checkbox"]:checked {
  background: var(--accent);
}

.tool-toggle-row input[type="checkbox"]:checked::before,
.pill-toggle-row input[type="checkbox"]:checked::before,
.notification-toggle-row input[type="checkbox"]:checked::before {
  transform: translateX(16px);
}

.tool-toggle-row input[type="checkbox"]:focus-visible,
.pill-toggle-row input[type="checkbox"]:focus-visible,
.notification-toggle-row input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.tool-toggle-row input[type="checkbox"]:disabled,
.pill-toggle-row input[type="checkbox"]:disabled,
.notification-toggle-row input[type="checkbox"]:disabled,
.tool-toggle-row input[type="checkbox"]:checked:disabled,
.pill-toggle-row input[type="checkbox"]:checked:disabled,
.notification-toggle-row input[type="checkbox"]:checked:disabled {
  background: #c1c8c6;
  cursor: not-allowed;
  opacity: 0.72;
}

.tool-toggle-row input[type="checkbox"]:disabled::before,
.pill-toggle-row input[type="checkbox"]:disabled::before,
.notification-toggle-row input[type="checkbox"]:disabled::before {
  background: #f8faf9;
}

.save-indicator {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.45rem 0.65rem;
  color: var(--muted);
  white-space: nowrap;
}

.save-indicator span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--muted);
}

.save-indicator strong {
  font-size: 0.86rem;
  font-weight: 700;
}

.save-indicator.dirty span {
  background: var(--warn);
}

.save-indicator.saving span {
  background: var(--info);
  animation: pulse-dot 900ms ease-in-out infinite;
}

.save-indicator.saved span {
  background: var(--accent);
}

.save-indicator.error span {
  background: var(--danger);
}

.field-error {
  min-height: 1rem;
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 700;
}

.field-error:empty {
  display: none;
}

@keyframes pulse-dot {
  0%, 100% {
    opacity: 0.45;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

.verse-list {
  display: grid;
  gap: 1.05rem;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-x: contain;
  padding-bottom: 0.35rem;
  scrollbar-gutter: stable;
}

.editor-table {
  display: grid;
  row-gap: 1.05rem;
  min-width: var(--editor-min-width, calc(42px + var(--tbsfm-min-width) + var(--tbsfm-preview-min-width) + var(--mybible-min-width) + var(--mybible-preview-min-width) + var(--actions-min-width) + 2.5rem));
  --tbsfm-min-width: 220px;
  --tbsfm-preview-min-width: 220px;
  --mybible-min-width: 220px;
  --mybible-preview-min-width: 190px;
  --actions-min-width: 132px;
  --tbsfm-col: minmax(var(--tbsfm-min-width), 1.05fr);
  --tbsfm-preview-col: minmax(var(--tbsfm-preview-min-width), 1fr);
  --mybible-col: minmax(var(--mybible-min-width), 1.05fr);
  --mybible-preview-col: minmax(var(--mybible-preview-min-width), 0.95fr);
  --actions-col: minmax(var(--actions-min-width), 140px);
}

.verse-main {
  display: grid;
  grid-template-columns: var(--editor-grid-template, 42px var(--tbsfm-col) var(--tbsfm-preview-col) var(--mybible-col) var(--mybible-preview-col) var(--actions-col));
  gap: 0.75rem;
  align-items: stretch;
}

.editor-cell,
.preview-cell {
  display: flex;
  min-height: 0;
  flex-direction: column;
}

.editor-table.no-mybible {
  --tbsfm-min-width: 240px;
  --tbsfm-preview-min-width: 240px;
  --mybible-min-width: 0px;
  --mybible-preview-min-width: 0px;
  --tbsfm-col: minmax(var(--tbsfm-min-width), 1fr);
  --tbsfm-preview-col: minmax(var(--tbsfm-preview-min-width), 1fr);
  --mybible-col: 0;
  --mybible-preview-col: 0;
  --actions-col: minmax(var(--actions-min-width), 150px);
}

.editor-table.hide-tbsfm {
  --tbsfm-min-width: 0px;
  --tbsfm-col: 0;
}

.editor-table.hide-tbsfm-preview {
  --tbsfm-preview-min-width: 0px;
  --tbsfm-preview-col: 0;
}

.editor-table.hide-mybible-column {
  --mybible-min-width: 0px;
  --mybible-col: 0;
}

.editor-table.hide-mybible-preview {
  --mybible-preview-min-width: 0px;
  --mybible-preview-col: 0;
}

.verse-number {
  grid-column: 1;
  grid-row: 1;
}

.tbsfm-column {
  grid-column: var(--tbsfm-grid-column, 2);
  grid-row: 1;
}

.tbsfm-preview-column {
  grid-column: var(--tbsfm-preview-grid-column, 3);
  grid-row: 1;
}

.mybible-column {
  grid-column: var(--my-bible-grid-column, 4);
  grid-row: 1;
}

.strong-helper-column {
  grid-column: var(--strong-helper-grid-column, 5);
  grid-row: 1;
}

.mybible-preview-column {
  grid-column: var(--my-bible-preview-grid-column, 5);
  grid-row: 1;
}

.external-module-column {
  grid-row: 1;
}

.row-actions {
  grid-column: var(--actions-grid-column, 6);
  grid-row: 1;
}

.editor-table.hide-tbsfm .tbsfm-column,
.editor-table.hide-tbsfm-preview .tbsfm-preview-column,
.editor-table.hide-mybible-column .mybible-column,
.editor-table.hide-mybible-preview .mybible-preview-column {
  display: none;
}

.verse-row {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: opacity 160ms ease;
}

.verse-row.saving {
  opacity: 0.76;
}

.verse-row.search-match {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow);
}

.verse-row.search-dim {
  opacity: 0.45;
}

.search-hit {
  border-radius: 3px;
  background: color-mix(in srgb, var(--warn) 34%, transparent);
  color: inherit;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--warn) 34%, transparent);
}

body.dark .search-hit {
  background: color-mix(in srgb, var(--warn) 42%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--warn) 52%, transparent);
}

.verse-main {
  padding: 0.85rem;
}

.cell-label {
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.row-actions {
  display: grid;
  justify-items: center;
  justify-content: center;
  align-content: flex-start;
  gap: 0.35rem;
  padding-top: 1.45rem;
}

.verse-action-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
}

.row-actions .verse-action-icon-button {
  position: relative;
  flex: 0 0 40px;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
}

.row-actions .verse-action-icon-button .nav-icon {
  width: 20px;
  height: 20px;
}

.row-actions .mybible-logo-icon {
  fill: none;
  stroke-width: 1.8;
}

.row-actions .verse-status-buttons {
  display: inline-grid;
  width: auto;
  justify-self: center;
}

.row-actions small {
  justify-self: center;
  text-align: center;
}

.external-module-preview {
  min-height: 118px;
}

.strong-helper-body {
  display: grid;
  gap: 0.45rem;
  min-height: 118px;
  align-content: start;
}

.strong-helper-chips,
.strong-helper-invalid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.strong-helper-chip {
  min-height: 30px;
  border-color: color-mix(in srgb, var(--strong-color) 40%, var(--border));
  background: color-mix(in srgb, var(--strong-color) 12%, var(--surface));
  color: var(--strong-color);
  padding: 0.25rem 0.45rem;
  font-size: var(--strong-chip-size);
  font-style: var(--strong-font-style);
  font-weight: var(--strong-font-weight);
}

.strong-helper-complete {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.strong-helper-invalid {
  border-top: 1px solid var(--border);
  padding-top: 0.45rem;
}

.strong-helper-invalid span {
  border-radius: 999px;
  background: var(--danger-soft);
  color: var(--danger);
  padding: 0.18rem 0.45rem;
  font-size: var(--strong-invalid-size);
  font-weight: 800;
}

.external-module-text {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.02rem;
  line-height: 1.55;
}

.strong-number {
  color: var(--strong-color);
  font-family: var(--font);
  font-size: var(--strong-size);
  font-style: var(--strong-font-style);
  font-weight: var(--strong-font-weight);
  line-height: 0;
  vertical-align: super;
  cursor: help;
}

.strong-separator {
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.74em;
  font-weight: 700;
  vertical-align: super;
}

.strong-dictionary-entry {
  display: grid;
  gap: 0.25rem;
}

.strong-entry-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 34px 34px;
  gap: 0.35rem;
  align-items: center;
  min-width: 0;
}

.strong-dictionary-indicator {
  min-width: 0;
  max-width: 100%;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strong-history-spacer {
  display: block;
  width: 0;
  height: 0;
}

.strong-next-dictionary {
  min-width: 30px;
  min-height: 30px;
  width: 30px;
  height: 30px;
  padding: 0;
  justify-self: center;
  align-self: center;
}

.strong-search-usage {
  min-width: 30px;
  min-height: 30px;
  width: 30px;
  height: 30px;
  padding: 0;
  justify-self: center;
  align-self: center;
}

.strong-dictionary-entry p {
  margin: 0;
}

.strong-definition {
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.strong-definition p,
.strong-definition div,
.strong-definition ul,
.strong-definition ol {
  margin-block: 0.25rem;
}

.strong-definition-link {
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--strong-color);
  padding: 0;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.strong-history-back {
  justify-self: start;
  min-height: 30px;
  padding: 0.2rem 0.45rem;
}

.strong-dictionary-entry span,
.strong-dictionary-entry small {
  color: var(--muted);
}

.strong-popover {
  position: fixed;
  z-index: 80;
  display: grid;
  gap: 0.3rem;
  width: min(360px, calc(100vw - 24px));
  max-height: var(--strong-popover-max-height, min(640px, calc(100vh - 1.5rem)));
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
  padding: 0.75rem 0.85rem;
}

.strong-popover .strong-dictionary-entry {
  padding-right: 2.1rem;
}

.strong-popover p {
  margin: 0;
}

.strong-popover span,
.strong-popover small {
  color: var(--muted);
}

.strong-popover-close {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  min-width: 28px;
  min-height: 28px;
  width: 28px;
  height: 28px;
  padding: 0;
}

.strong-usage-modal {
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1120px, calc(100vw - 2rem));
  height: min(760px, calc(100dvh - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: hidden;
}

.strong-usage-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 1rem;
  min-height: 0;
  overflow: hidden;
}

.strong-usage-summary,
.strong-usage-results-wrap {
  min-height: 0;
  overflow: auto;
}

.strong-usage-summary {
  display: grid;
  align-content: start;
  gap: 0.8rem;
  border-right: 1px solid var(--border);
  padding: 0 1rem 1rem 0;
  scrollbar-gutter: stable;
}

.strong-usage-summary label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
}

.strong-usage-definition {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 0.7rem;
  max-height: min(42vh, 420px);
  overflow: auto;
}

.strong-usage-forms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-height: 180px;
  overflow: auto;
  padding: 0 0.35rem 1.25rem 0;
  scrollbar-gutter: stable;
}

.strong-usage-form {
  min-height: 32px;
  border-color: var(--border);
  background: var(--surface);
}

.strong-usage-form.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.strong-usage-form small {
  color: var(--muted);
}

.strong-usage-results-wrap {
  display: grid;
  align-content: start;
  gap: 0.65rem;
  min-height: 0;
}

.strong-usage-results-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
  padding-bottom: 0.35rem;
  background: var(--surface);
}

.strong-usage-results {
  display: grid;
  gap: 0.45rem;
  max-height: min(560px, calc(100vh - 250px));
  overflow: auto;
  padding-right: 0.15rem;
}

.strong-usage-row {
  position: relative;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 34px;
  gap: 0.7rem;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.65rem;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.strong-usage-row:hover {
  border-color: var(--accent);
}

.strong-usage-row.copy-selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 48%, var(--surface));
  box-shadow: inset 3px 0 0 var(--accent);
}

.strong-usage-row.return-highlight {
  border-color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent), 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.strong-usage-ref {
  color: var(--muted);
  font-weight: 800;
}

.strong-usage-go {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  opacity: 0;
  transition: opacity 140ms ease;
}

.strong-usage-row:hover .strong-usage-go {
  opacity: 1;
}

.reader-search-options-modal {
  width: min(720px, calc(100vw - 2rem));
}

.segmented-list {
  display: grid;
  gap: 0.4rem;
}

.book-scope-actions {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}

.reader-book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 0.35rem;
  max-height: 240px;
  overflow: auto;
}

.reader-book-choice {
  display: flex;
  flex-direction: row;
  gap: 0.25rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 0.3rem;
  color: var(--text);
  font-weight: 800;
}

.reader-book-choice input {
  width: auto;
}

.reader-search-options-popover-layer {
  position: fixed;
  inset: 0;
  z-index: 72;
  background: transparent;
}

.reader-search-options-popover {
  position: absolute;
  top: var(--popover-top);
  left: var(--popover-left);
  width: var(--popover-width);
  max-width: calc(100vw - 1.5rem);
  display: grid;
  gap: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 0.9rem;
}

.reader-search-options-popover::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 2rem;
  width: 14px;
  height: 14px;
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  transform: rotate(45deg);
}

.reader-search-options-popover .section-head {
  position: relative;
  z-index: 1;
}

.reader-search-options-close {
  width: 2.25rem;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  font-size: 1.35rem;
  line-height: 1;
}

.reader-search-option-stack,
.reader-search-mode-panel,
.compact-field {
  display: grid;
  gap: 0.5rem;
}

.compact-field > span {
  color: var(--muted);
  font-size: 0.82rem;
}

.reader-search-scope-row,
.strong-usage-scope-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.45rem;
  align-items: center;
}

.reader-search-scope-row.has-book-picker,
.strong-usage-scope-row.has-book-picker {
  grid-template-columns: minmax(0, 1fr) auto;
}

.reader-book-picker-button,
.strong-usage-book-options {
  width: 2.75rem;
  min-width: 2.75rem;
  height: 2.75rem;
}

.reader-search-mode-panel h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.book-selection-modal {
  width: min(760px, calc(100vw - 1.5rem));
  max-height: min(760px, calc(100vh - 2rem));
}

.book-selection-backdrop {
  z-index: 88;
}

.book-selection-backdrop.anchored {
  display: block;
  background: transparent;
}

.book-selection-modal.anchored {
  position: absolute;
  top: var(--book-picker-top);
  left: var(--book-picker-left);
  width: var(--book-picker-width);
  max-height: min(760px, calc(100vh - var(--book-picker-top) - 1rem));
}

.book-selection-head {
  align-items: center;
  gap: 0.75rem;
}

.book-selection-head h2 {
  margin: 0;
  line-height: 2.75rem;
}

.book-selection-head-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  align-content: center;
  gap: 0.5rem;
  margin-left: auto;
}

.book-selection-view-toggle {
  width: 2.75rem;
  min-width: 2.75rem;
  height: 2.75rem;
}

.book-selection-head-actions .select-reader-books,
.book-selection-head-actions .book-selection-view-toggle,
.book-selection-head-actions .app-modal-close {
  height: 2.75rem;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  vertical-align: middle;
}

.book-selection-head-actions .app-modal-close,
.book-selection-head-actions .book-selection-view-toggle {
  width: 2.75rem;
  min-width: 2.75rem;
}

.book-selection-body {
  display: grid;
  gap: 1rem;
  max-height: min(560px, calc(100vh - 14rem));
  overflow: auto;
  padding-right: 0.25rem;
}

.book-selection-testament {
  display: grid;
  gap: 0.5rem;
}

.book-selection-testament h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.book-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.book-selection-grid.context-book-grid {
  grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
}

.book-selection-testament.custom-books .book-selection-grid {
  grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
}

.book-selection-list {
  display: grid;
  gap: 0.35rem;
}

.book-selection-tile {
  min-height: 2.25rem;
  border: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  color: var(--book-color, var(--text));
  padding: 0.25rem 0.3rem;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  transition: background 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.book-selection-list .book-selection-tile {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  min-height: 2.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: left;
}

.book-selection-tile:hover {
  background: var(--surface-soft);
}

.book-selection-tile.selected {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  box-shadow: inset 4px 0 0 var(--accent);
  color: var(--text);
}

.book-selection-tile small {
  color: var(--muted);
  font-weight: 700;
}

.book-category-law { --book-color: #6b64a8; }
.book-category-history { --book-color: #9a6a3b; }
.book-category-wisdom { --book-color: #1d9a51; }
.book-category-major-prophets { --book-color: #b44f6a; }
.book-category-minor-prophets { --book-color: #8a9630; }
.book-category-gospels { --book-color: #b65308; }
.book-category-acts { --book-color: #008c9b; }
.book-category-pauline { --book-color: #8a9200; }
.book-category-general { --book-color: #0b9e37; }
.book-category-revelation { --book-color: #b84047; }

.email-notification-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 0.9rem;
}

.email-notification-row .notification-toggle-row {
  margin: 0;
}

.email-notification-options {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.email-notification-options[hidden] {
  display: none;
}

.email-notification-options label {
  display: grid;
}

#email-notification-frequency {
  width: 10.5rem;
}

#daily-digest-time {
  width: 7.5rem;
}

.verse-comment-count-badge {
  position: absolute;
  top: -0.42rem;
  right: -0.42rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.18rem;
  height: 1.18rem;
  border-radius: 999px;
  border: 1px solid var(--surface);
  background: var(--accent);
  color: #fff;
  padding: 0 0.28rem;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.verse-comment-count-badge.urgent {
  background: var(--danger);
  color: #fff;
}

.row-actions small {
  color: var(--muted);
  font-size: 0.74rem;
}

.verse-detail {
  max-height: 0;
  overflow: hidden;
  border-top: 1px solid transparent;
  transition: max-height 220ms ease, border-color 220ms ease, padding-bottom 220ms ease;
}

.verse-row.expanded .verse-detail {
  max-height: none;
  overflow: visible;
  border-color: var(--border);
}

.verse-detail {
  padding: 0 0.75rem;
}

.verse-row.expanded .verse-detail {
  padding-bottom: 0.75rem;
}

.verse-insert {
  position: relative;
  height: 22px;
  display: grid;
  place-items: center;
  opacity: 0.3;
  transition: opacity 140ms ease;
}

.verse-insert:hover,
.verse-insert:focus-within {
  opacity: 1;
}

.insert-line {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  border-top: 1px dashed var(--border);
}

.add-verse-button {
  position: relative;
  z-index: 1;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  border-radius: 999px;
  padding: 0;
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  font-size: 1.15rem;
  line-height: 1;
}

.verse-detail-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.65rem;
}

.subtle-danger {
  min-height: 30px;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  font-size: 0.82rem;
}

.subtle-danger:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-soft);
}

.code-editor {
  position: relative;
  min-height: 118px;
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.code-editor pre,
.code-editor textarea {
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 118px;
  max-height: none;
  padding: 0.62rem;
  border: 0;
  border-radius: 0;
  font-family: var(--mono);
  font-size: var(--editor-font-size);
  line-height: 1.45;
  white-space: pre-wrap;
  overflow: auto;
}

.code-editor pre {
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: var(--text);
}

.code-editor textarea {
  position: relative;
  z-index: 1;
  background: transparent;
  color: transparent;
  caret-color: var(--text);
  resize: vertical;
}

.code-editor textarea:not(:focus) {
  overflow: hidden;
}

.code-editor textarea::selection {
  background: color-mix(in srgb, var(--accent) 26%, transparent);
  color: transparent;
}

.nbsp-marker {
  position: relative;
  display: inline-block;
  width: 1ch;
  min-height: 1em;
  border-radius: 3px;
  background: color-mix(in srgb, var(--warn) 14%, transparent);
  vertical-align: -0.08em;
}

.nbsp-marker::after {
  position: absolute;
  inset: 0;
  color: var(--warn);
  content: "∘";
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.nbsp-marker::after {
  content: "°";
}

.duplicate-space-marker,
.trailing-space-marker,
.tab-marker {
  position: relative;
  display: inline-block;
  min-height: 1em;
  border-radius: 3px;
  vertical-align: -0.08em;
}

.duplicate-space-marker {
  min-width: 1ch;
  background: color-mix(in srgb, var(--warn) 22%, transparent);
}

.trailing-space-marker {
  min-width: 1ch;
  background: color-mix(in srgb, var(--danger) 20%, transparent);
}

.linebreak-marker {
  color: var(--info);
  font-weight: 800;
  opacity: 0.85;
}

.tab-marker {
  width: 1.7em;
  background: color-mix(in srgb, var(--info) 16%, transparent);
  color: transparent;
}

.tab-marker::after {
  position: absolute;
  inset: 0;
  color: var(--info);
  content: "→";
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.bible-preview {
  min-height: 118px;
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fffefb;
  padding: 0.8rem 0.9rem;
  color: #080808;
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--editor-font-size);
  line-height: 1.5;
}

body.dark .bible-preview {
  background: #24231f;
  color: var(--text);
}

.bible-preview sup,
.reader-page sup {
  font-size: 0.58em;
  line-height: 0;
  vertical-align: super;
}

.bible-preview sup.strong-number,
.reader-page sup.strong-number {
  font-size: var(--strong-size);
  font-style: var(--strong-font-style);
  font-weight: var(--strong-font-weight);
}

.bible-preview-heading {
  margin: 0 0 0.3rem;
  color: inherit;
  font-family: inherit;
  font-size: 1.02em;
  font-weight: 700;
  line-height: 1.25;
}

.preview-notes {
  margin: 0.7rem 0 0;
  padding-left: 1.3rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.82rem;
  line-height: 1.35;
}

.preview-notes li {
  margin-top: 0.25rem;
  padding-left: 0.15rem;
}

.mybible-preview {
  white-space: normal;
}

.jesus-words {
  color: #b42318;
}

.jesus-words,
.jesus-words * {
  color: #b42318 !important;
}

body.dark .jesus-words {
  color: #ff9a90;
}

body.dark .jesus-words,
body.dark .jesus-words * {
  color: #ff9a90 !important;
}

.jesus-words .strong-number,
.jesus-words .strong-number * {
  color: var(--strong-color) !important;
}

.verse-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.verse-card.deleted {
  opacity: 0.7;
}

.stats-page {
  display: grid;
  gap: 1rem;
}

.stats-content,
.stats-books {
  display: grid;
  gap: 0.85rem;
}

.stats-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.stats-summary-card {
  display: grid;
  align-content: center;
  min-height: 96px;
}

.stats-progress {
  display: grid;
  gap: 0.45rem;
  min-width: 180px;
}

.stats-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--text);
}

.stats-progress-head span {
  color: var(--muted);
  font-weight: 700;
}

.stats-progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.stats-progress-track span {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  transition: width 180ms ease, background 180ms ease;
}

.stats-book-card {
  display: grid;
}

.stats-book-header {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1fr);
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
  padding: 0.85rem;
}

.stats-book-header h2 {
  margin: 0;
}

.stats-chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 0.45rem;
  padding: 0.85rem;
}

.stats-chapter-tile {
  min-width: 0;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-weight: 800;
  box-shadow: none;
}

.stats-chapter-tile:hover,
.stats-chapter-tile:focus-visible {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.stats-chapter-tile:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.stats-chapter-tile.status-draft {
  background: #f2cccc;
}

.stats-chapter-tile.status-needs_review,
.stats-chapter-tile.status-needs-review {
  background: #efdba8;
}

.stats-chapter-tile.status-approved {
  background: #bfe0c4;
}

body.dark .stats-chapter-tile.status-draft {
  background: #5a3030;
}

body.dark .stats-chapter-tile.status-needs_review,
body.dark .stats-chapter-tile.status-needs-review {
  background: #594b2b;
}

body.dark .stats-chapter-tile.status-approved {
  background: #2e5038;
}

.verse-header {
  display: grid;
  grid-template-columns: 62px minmax(130px, 1fr) minmax(140px, auto);
  gap: 0.7rem;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
  padding: 0.7rem;
}

.verse-number {
  display: grid;
  place-items: center;
  min-height: 42px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
}

.verse-meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.verse-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.verse-body {
  display: grid;
  gap: 0.85rem;
  padding: 0.8rem;
}

.field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.editor-field textarea {
  min-height: 120px;
  font-family: var(--mono);
  font-size: 0.92rem;
}

.highlight-box {
  min-height: 84px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 0.65rem;
  font-family: var(--mono);
  font-size: 0.88rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.marker {
  color: var(--info);
  font-weight: 700;
}

.supplied {
  color: var(--accent-strong);
  font-style: italic;
}

.note {
  color: var(--warn);
}

.mytag {
  color: var(--info);
  font-weight: 700;
}

.warning-list {
  display: grid;
  gap: 0.3rem;
  margin-top: 0.45rem;
}

.warning {
  border-radius: var(--radius);
  background: var(--warn-soft);
  color: var(--warn);
  padding: 0.45rem 0.55rem;
  font-size: 0.86rem;
}

.versions {
  display: grid;
  gap: 0.45rem;
  border-top: 1px solid var(--border);
  padding-top: 0.65rem;
}

.version-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
}

.version-row.current {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.comment-section {
  display: grid;
  gap: 0.6rem;
  border-top: 1px solid var(--border);
  padding-top: 0.65rem;
  max-height: min(760px, calc(100vh - 7rem));
  overflow: auto;
  overscroll-behavior: auto;
  padding-right: 0.2rem;
}

.comment-list {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.comment-list-inner {
  display: grid;
  gap: 0.5rem;
  animation: comment-list-in 160ms ease;
}

.load-comments-toggle {
  justify-self: start;
  min-height: 34px;
  margin-top: 0.15rem;
}

@keyframes comment-list-in {
  from {
    opacity: 0.6;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.comment {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 0.55rem;
  transition: box-shadow 180ms ease, border-color 180ms ease;
}

.comment.flash {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.comment p {
  margin-bottom: 0.25rem;
}

.comment small {
  color: var(--muted);
}

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: baseline;
}

.comment-actions {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.comment-meta .comment-actions {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  margin-top: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.comment-actions button {
  min-height: 30px;
  padding: 0.25rem 0.5rem;
  font-size: 0.82rem;
}

.comment-meta .comment-actions button.comment-link {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  color: var(--accent-strong);
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  box-shadow: none;
}

.comment-meta .comment-actions button.comment-delete-link {
  color: var(--danger);
}

.comment-form,
.version-comment-form {
  display: grid;
  gap: 0.45rem;
}

.comment-form.comment-form-open,
.version-comment-form:not(.comment-form-collapsed) {
  border: 1.5px solid color-mix(in srgb, var(--accent) 34%, var(--border));
  border-radius: calc(var(--radius) + 2px);
  background: color-mix(in srgb, var(--surface) 94%, var(--accent-soft));
  padding: 0.6rem;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--accent) 10%, transparent);
}

.comment-form-collapsed .comment-toolbar,
.comment-form-collapsed .rich-comment-editor,
.comment-form-collapsed button[type="submit"] {
  display: none;
}

.comment-form-open > .comment-form-prompt {
  display: none;
}

.rich-comment-editor {
  min-height: 92px;
  border: 1.5px solid color-mix(in srgb, var(--text) 18%, var(--border));
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.65rem;
  color: var(--text);
  line-height: 1.55;
  outline: none;
  overflow-wrap: anywhere;
}

.comment.compact .rich-comment-editor,
.comment.editing .rich-comment-editor {
  min-height: 82px;
}

.rich-comment-editor:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.rich-comment-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}

.rich-comment-editor img,
.comment-body img {
  display: block;
  max-width: 100%;
  max-height: 420px;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0.45rem 0;
  object-fit: contain;
}

.comment-body img {
  cursor: zoom-in;
}

.comment-image-lightbox-backdrop {
  background: color-mix(in srgb, #000 78%, transparent);
  z-index: 7000;
}

.comment-image-lightbox {
  position: relative;
  width: min(96vw, 1600px);
  max-width: 96vw;
  height: min(94vh, 1000px);
  max-height: 94vh;
  display: grid;
  place-items: center;
  padding: 3rem 1rem 1rem;
  background: color-mix(in srgb, var(--surface) 8%, #000);
  border-color: color-mix(in srgb, #fff 22%, transparent);
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.55);
}

.comment-image-lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 12px 60px rgba(0, 0, 0, 0.45);
}

.comment-image-lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  min-width: 42px;
  width: 42px;
  height: 42px;
  padding: 0;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text);
}

.rich-comment-editor img.selected {
  outline: 3px solid color-mix(in srgb, var(--accent) 78%, white);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 16%, transparent);
}

.rich-comment-editor img.resizing {
  user-select: none;
}

.comment-image-resize-handle {
  position: fixed;
  z-index: 6000;
  width: 18px;
  height: 18px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 2px 8px var(--shadow);
  cursor: nwse-resize;
}

.comment-image-resize-handle::after {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 7px;
  height: 7px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
}

.comment-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.35rem;
}

.comment-toolbar .icon-button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
}

.comment-toolbar .icon-button.active,
.comment-toolbar .icon-button[aria-pressed="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  color: var(--accent-strong);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 14%, transparent);
}

.comment-body {
  overflow-wrap: anywhere;
}

.comment-link-modal .comment-link-error {
  min-height: 1.1rem;
  color: var(--danger);
}

.comment-body p,
.comment-body ul,
.comment-body ol {
  margin: 0 0 0.35rem;
}

.comment-body ul,
.comment-body ol {
  padding-left: 1.25rem;
}

.comment-pill-link,
.comment-bible-link {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 0.08rem 0.45rem;
  font: inherit;
  line-height: 1.35;
  text-decoration: none;
  vertical-align: baseline;
}

.comment-bible-link {
  cursor: pointer;
}

.comment-pill-link:hover,
.comment-bible-link:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 65%, var(--surface));
}

.comment-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  align-items: center;
  margin-top: 0.45rem;
  position: relative;
}

.comment-meta .comment-reactions {
  display: inline-flex;
  margin-top: 0;
}

.comment-reaction {
  min-height: 30px;
  border-radius: 999px;
  padding: 0.14rem 0.42rem;
  gap: 0.22rem;
  font-size: 0.92rem;
  background: var(--surface);
}

.comment-meta .comment-reaction {
  min-height: 26px;
  padding: 0.08rem 0.38rem;
}

.comment-reaction small {
  color: var(--muted);
  font-size: 0.72rem;
}

.comment-reaction.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.comment-reaction-picker {
  position: relative;
  display: inline-flex;
}

.comment-reaction-add {
  min-height: 28px;
  border-radius: 999px;
  padding: 0.12rem 0.42rem;
  color: var(--muted);
  background: transparent;
  font-size: 0.88rem;
}

.comment-meta .comment-reaction-add {
  min-height: 24px;
  padding: 0 0.32rem;
}

.comment-reaction-add:hover,
.comment-reaction-add[aria-expanded="true"] {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.comment-reaction-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.35rem);
  z-index: 45;
  display: grid;
  grid-template-columns: repeat(8, 34px);
  gap: 0.24rem;
  width: max-content;
  max-width: min(92vw, 330px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 0.35rem;
  animation: comment-reaction-menu-in 120ms ease;
}

.comment-reaction-menu-item {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  font-size: 1.05rem;
}

.comment-reaction-menu-item:hover,
.comment-reaction-menu-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

@keyframes comment-reaction-menu-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.verse-conversations-panel {
  margin-top: 1rem;
}

.verse-conversations-panel .section-head {
  grid-template-columns: auto minmax(160px, 260px);
  align-items: start;
}

.verse-conversations-panel #comment-conversation-sort {
  width: min(260px, 100%);
  justify-self: end;
}

.verse-conversation-section {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.85rem;
  overflow: visible;
  overscroll-behavior: auto;
  padding-right: 0.2rem;
}

.verse-conversation-section h3 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-size: 1rem;
}

.verse-conversation-section h3 .chapter-status-button.static {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  cursor: default;
  pointer-events: none;
}

.verse-conversation-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 0.75rem;
}

.verse-conversation-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  gap: 0.5rem;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 0.55rem;
  min-width: 0;
}

.verse-conversation-card .open-verse-from-comments {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
}

.verse-conversation-card.has-unread {
  border-color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent);
}

.verse-conversation-number {
  display: grid;
  place-items: center;
  min-height: 34px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
  font-size: 0.92rem;
}

.verse-conversation-main {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.verse-conversation-card .comment-list {
  display: grid;
  gap: 0.4rem;
  max-height: 310px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-right: 0.2rem;
  min-width: 0;
}

.verse-conversation-card .comment {
  min-width: 0;
}

.verse-conversation-card .comment-body,
.verse-conversation-card .comment-meta {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.verse-conversation-card .comment-pill-link,
.verse-conversation-card .comment-bible-link {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.verse-conversation-card .comment img,
.verse-conversation-card .rich-comment-editor img {
  max-width: 100%;
  height: auto;
}

.verse-conversation-text {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (min-width: 1500px) {
  .verse-conversation-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.verse-conversation-versions {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.35rem 0.45rem;
}

.verse-conversation-versions summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.85rem;
}

.verse-conversation-version-list {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.verse-conversation-version {
  border-top: 1px solid var(--border);
  padding-top: 0.35rem;
}

.verse-conversation-version.current small {
  color: var(--accent-strong);
  font-weight: 800;
}

.verse-conversation-version pre {
  margin: 0.2rem 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.8rem;
}

.verse-conversation-comment-form {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.verse-conversation-comment-form .rich-comment-editor {
  min-height: 88px;
}

.comment-form-prompt,
.verse-conversation-comment-prompt {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  text-align: left;
  padding: 0.55rem 0.7rem;
  font: inherit;
  cursor: pointer;
}

.comment-form-prompt .nav-icon,
.verse-conversation-comment-prompt .nav-icon {
  width: 17px;
  height: 17px;
  color: var(--accent-strong);
  flex: 0 0 auto;
}

.comment-form-prompt:hover,
.comment-form-prompt:focus-visible,
.verse-conversation-comment-prompt:hover,
.verse-conversation-comment-prompt:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
  outline: none;
}

.versions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.versions-head h3 {
  margin: 0;
}

.version-compare {
  display: grid;
  gap: 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem;
}

.version-compare header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.version-compare small {
  display: block;
  color: var(--muted);
}

.diff-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 0.6rem;
}

.diff-box h4,
.previous-comments h4 {
  margin: 0 0 0.35rem;
  font-size: 0.86rem;
}

.diff-text {
  font-family: var(--mono);
  font-size: 0.86rem;
  white-space: pre-wrap;
}

.plain-version pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.86rem;
  white-space: pre-wrap;
}

.diff-text ins {
  background: #bcebd2;
  color: #0f4d2f;
  text-decoration: none;
}

.diff-text del {
  background: #ffd6d1;
  color: #94312b;
  text-decoration: line-through;
}

body.dark .diff-text ins {
  background: #17492d;
  color: #adf0c8;
}

body.dark .diff-text del {
  background: #56201d;
  color: #ffbbb4;
}

.previous-comments {
  max-height: 0;
  overflow: hidden;
  transition: max-height 180ms ease;
}

.previous-comments.open {
  max-height: min(760px, calc(100vh - 7rem));
  overflow: auto;
  overscroll-behavior: auto;
  padding-right: 0.2rem;
}

.reader-page {
  max-width: 1180px;
  margin: 0 auto;
}

.reader-layout-grid {
  display: grid;
  grid-template-columns: minmax(220px, 248px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  transition: grid-template-columns 220ms ease;
}

.reader-layout-grid.strong-dictionary-open {
  grid-template-columns: minmax(220px, 248px) minmax(0, 1fr) minmax(260px, 340px);
}

.reader-layout-grid.reader-tools-collapsed {
  grid-template-columns: 46px minmax(0, 1fr);
}

.reader-layout-grid.reader-tools-collapsed.strong-dictionary-open {
  grid-template-columns: 46px minmax(0, 1fr) minmax(260px, 340px);
}

.reader-layout-grid .reader-page {
  position: relative;
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
}

.reader-side-panel {
  min-width: 0;
  overflow-x: hidden;
}

.reader-side-panel .side-tool-stack,
.reader-side-panel .tool-toggle-group,
.reader-side-panel .editor-column-list {
  min-width: 0;
  max-width: 100%;
}

.reader-side-panel .tool-toggle-row {
  min-width: 0;
  gap: 0.45rem;
  align-items: flex-start;
}

.reader-side-panel .tool-toggle-row span {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.35;
}

.reader-side-panel .editor-column-row {
  padding-inline: 0.1rem;
}

.reader-side-panel .drag-handle {
  width: 0.85rem;
  text-align: center;
}

.reader-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.reader-nav-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.reader-layout-grid.reader-tools-collapsed .reader-side-panel {
  width: 46px;
  max-height: 46px;
  overflow: visible;
  padding: 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.reader-layout-grid.reader-tools-collapsed .reader-side-panel section {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-10px);
}

.reader-layout-grid.reader-tools-collapsed .reader-side-panel .panel-toggle {
  width: 46px;
  min-width: 46px;
  height: 46px;
  min-height: 46px;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  padding: 0;
  background: var(--surface);
  border-color: var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.reader-layout-grid.reader-tools-collapsed .reader-side-panel .panel-toggle span,
.reader-layout-grid.reader-tools-collapsed .reader-side-panel .panel-toggle::after {
  display: none;
}

.search-with-filter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 0.4rem;
  align-items: end;
}

.reader-side-panel .chapter-search-control {
  display: grid;
  gap: 0.35rem;
}

.reader-side-panel.reader-history-mode .side-tool-stack:first-of-type {
  display: none;
}

.reader-side-panel .chapter-search-control > span {
  order: 0;
}

.reader-side-panel #reader-search-summary {
  position: static;
  order: 1;
  display: block;
  max-width: 100%;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.reader-side-panel .search-with-filter {
  order: 2;
}

.reader-side-panel #reader-search-count {
  position: static;
  order: 3;
  display: block;
  line-height: 1.3;
}

.reader-side-panel .chapter-search-control.history-scope-only .search-with-filter,
.reader-side-panel .chapter-search-control.history-scope-only #reader-search-summary,
.reader-side-panel .chapter-search-control.history-scope-only #reader-search-count {
  display: none;
}

.reader-history-search-scope {
  order: initial;
  display: grid;
  gap: 0.35rem;
}

.reader-history-search-scope > span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.2;
}

.reader-history-search-scope-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.4rem;
  align-items: center;
}

.reader-history-search-scope-row.has-book-picker {
  grid-template-columns: minmax(0, 1fr) 40px;
}

.reader-side-panel .chapter-search-control:not(.history-scope-only) .reader-history-search-scope {
  display: none;
}

.reader-history-search-scope select {
  width: 100%;
}

.reader-history-search-scope .icon-button {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
}

#reader-history-export-docx {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
  font-family: inherit;
  padding: 0.58rem 0.7rem;
}

.search-with-filter .icon-button {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
}

.reader-selection-actions {
  position: sticky;
  top: calc(var(--topbar-height) + 0.25rem);
  z-index: 12;
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  align-items: center;
  min-height: 42px;
  margin-bottom: 0.65rem;
  padding: 0.35rem;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
}

.reader-selection-actions[hidden] {
  display: none;
}

.reader-verses {
  display: grid;
  gap: 0.65rem;
}

.reader-verses.single {
  display: block;
  column-count: 2;
  column-gap: 3.5rem;
}

.reader-verses.parallel,
.reader-verses.stacked {
  display: grid;
  gap: 0.65rem;
}

.reader-verse-item {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  gap: 0.65rem;
  align-items: start;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.35rem 0.35rem 0.35rem 0;
  break-inside: avoid;
}

.reader-verse-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: var(--radius) 0 0 var(--radius);
  background: transparent;
}

.reader-verses.single .reader-verse-item {
  display: inline-grid;
  width: 100%;
  margin-bottom: 0.25rem;
}

.reader-verse-item:hover {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
  background: color-mix(in srgb, var(--accent-soft) 38%, transparent);
}

.reader-verse-item.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 55%, transparent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.reader-verse-item.selected::before {
  background: var(--accent);
}

.reader-verse-item.return-highlight {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 58%, transparent);
  box-shadow: inset 4px 0 0 var(--accent), 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.reader-verse-item.return-highlight::before {
  background: var(--accent);
}

.reader-verse-item.search-match {
  background: color-mix(in srgb, var(--warn-soft) 55%, transparent);
}

.reader-verse-item.search-match.selected {
  background: color-mix(in srgb, var(--accent-soft) 52%, var(--warn-soft));
}

.reader-module-grid {
  min-width: 0;
}

.reader-verses.parallel.reader-cols-2 .reader-module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.reader-verses.parallel.reader-cols-3 .reader-module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.reader-verses.parallel.reader-cols-4 .reader-module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.reader-verses.stacked .reader-module-grid {
  display: grid;
  gap: 0.55rem;
}

.reader-module {
  min-width: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.55;
}

.reader-module h3 {
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.reader-verses.stacked .reader-module {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.7rem;
  background: var(--surface);
}

.reader-verses.history-compare {
  display: grid;
  gap: 0.65rem;
}

.history-compare-verse {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
}

.history-date-field input {
  width: 100%;
  min-width: 0;
}

.history-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.history-side {
  min-width: 0;
}

.history-text,
.history-text pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.reader-verses.history-compare .history-text,
.reader-verses.history-compare .history-text pre,
.reader-verses.history-compare .diff-text {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.55;
}

.reader-verses.history-compare .history-text pre {
  margin: 0;
 }

.history-text del {
  background: #ffd9d9;
  color: #9f1d1d;
  text-decoration: none;
}

.history-text ins {
  background: #c8f3dc;
  color: #075c35;
  text-decoration: none;
}

.history-publisher-mentions {
  grid-column: 2;
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-soft) 45%, transparent);
}

.history-publisher-mentions h4 {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
}

body.dark .history-text del {
  background: color-mix(in srgb, #ff6b6b 32%, transparent);
  color: #ffb3b3;
}

body.dark .history-text ins {
  background: color-mix(in srgb, #32d583 28%, transparent);
  color: #a8f0c6;
}

.notice.warning {
  border: 1px solid color-mix(in srgb, #d58a00 45%, var(--border));
  border-radius: var(--radius);
  background: color-mix(in srgb, #ffd166 20%, var(--surface));
  padding: 0.7rem 0.85rem;
  color: var(--text);
}

.reader-verse {
  display: inline-grid;
  width: 100%;
  grid-template-columns: 34px 1fr;
  gap: 0.65rem;
  align-items: baseline;
  margin-bottom: 0.55rem;
  break-inside: avoid;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.5;
}

.reader-number {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.58em;
  text-align: right;
  padding-top: 0.35rem;
}

.reader-go-verse {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.reader-verse-item:hover .reader-go-verse,
.reader-verse-item.selected .reader-go-verse {
  opacity: 1;
  transform: translateX(0);
}

.reader-note {
  margin-top: 0.4rem;
  border-left: 3px solid var(--warn);
  padding-left: 0.55rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

#settings-profile .two-column {
  align-items: stretch;
}

#settings-profile .panel {
  height: 100%;
}

.comments-page {
  display: grid;
  gap: 1rem;
}

.workspace-comments-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.workspace-comment-panel {
  display: grid;
  gap: 0.75rem;
}

.workspace-comment-panel.scoped-comment-panel {
  max-height: min(820px, calc(100vh - 7rem));
  overflow: auto;
  overscroll-behavior: auto;
  align-content: start;
  padding-right: 0.9rem;
}

.workspace-comment-panel > .comment-list {
  max-height: min(760px, calc(100vh - 7rem));
  overflow: auto;
  overscroll-behavior: auto;
  padding-right: 0.2rem;
}

.workspace-comment-panel h2 {
  margin: -0.35rem 0 0;
}

.import-card-grid {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.import-card-grid .panel {
  display: grid;
  align-content: start;
  gap: 0.45rem;
}

.import-card-grid .context-project-note {
  margin-bottom: 0;
}

.import-card-grid .context-project-note + .muted {
  margin-bottom: 0.2rem;
}

.import-card-grid textarea {
  min-height: 260px;
}

.import-progress-status {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.import-progress-status[hidden] {
  display: none;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(190px, 230px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  transition: grid-template-columns 220ms ease;
}

.settings-layout.settings-menu-collapsed {
  grid-template-columns: 42px minmax(0, 1fr);
}

.settings-menu {
  position: sticky;
  top: calc(var(--topbar-height) + 0.75rem);
  display: grid;
  gap: 0.75rem;
  max-height: calc(100vh - var(--topbar-height) - 1.5rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 0.75rem;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.settings-menu-body {
  display: grid;
  gap: 0.45rem;
  transition: opacity 180ms ease, transform 180ms ease;
}

.settings-menu-group {
  display: grid;
  gap: 0.2rem;
}

.settings-jump,
.settings-menu-title,
.settings-menu-item {
  justify-content: flex-start;
  width: 100%;
}

.settings-menu-title {
  border-color: transparent;
  background: transparent;
  color: var(--text);
  font-weight: 850;
  padding-inline: 0.15rem;
}

.settings-menu-item {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.92rem;
  padding: 0.22rem 0.15rem 0.22rem 1rem;
}

.settings-menu-item::before {
  content: "•";
  margin-right: 0.35rem;
  color: var(--accent-strong);
}

.settings-layout.settings-menu-collapsed .settings-menu {
  position: sticky;
  top: calc(var(--topbar-height) + 0.75rem);
  width: 46px;
  max-height: 46px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.settings-layout.settings-menu-collapsed .settings-menu-body {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-10px);
}

.settings-layout.settings-menu-collapsed .panel-toggle {
  width: 46px;
  min-width: 46px;
  height: 46px;
  min-height: 46px;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  padding: 0;
  line-height: 1;
  color: var(--accent-strong);
  white-space: nowrap;
  background: var(--surface);
  border-color: var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.settings-content,
.settings-section {
  display: grid;
  gap: 1rem;
}

.settings-section {
  scroll-margin-top: 6.5rem;
}

#settings-project-create,
#settings-project-import,
#settings-mybible-modules {
  margin-top: 1.35rem;
}

.settings-export-row {
  display: grid;
  grid-template-columns: minmax(150px, 220px) auto;
  gap: 0.55rem;
  align-items: end;
  justify-content: start;
}

.settings-export-buttons {
  display: grid;
  gap: 0.25rem;
}

.settings-export-buttons > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.control-spacer {
  min-height: 1.1rem;
  color: transparent;
  font-size: 0.86rem;
  line-height: 1.1;
}

.shortcut-grid {
  margin-bottom: 0;
}

.workspace-panel {
  display: grid;
  gap: 1rem;
  max-width: none;
}

.module-list {
  display: grid;
  gap: 0.55rem;
}

.module-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) max-content;
  gap: 0.5rem;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 0.55rem;
}

.module-row > div:first-child {
  display: grid;
  gap: 0.15rem;
}

.module-row small {
  color: var(--muted);
}

.module-row .module-row-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  justify-content: flex-end;
}

.module-row-actions .icon-button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
}

.module-import-form {
  margin-top: 0.85rem;
}

.module-online-actions {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.strong-settings-panel {
  display: grid;
  gap: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 0.75rem;
}

.strong-settings-panel h2 {
  margin: 0;
  font-size: 1rem;
}

.strong-settings-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: end;
}

.strong-color-picker {
  flex: 0 1 auto;
  min-width: 250px;
}

.strong-style-picker {
  flex: 0 0 auto;
  min-width: 96px;
}

.compact-range-row {
  flex: 1 1 280px;
  min-width: 240px;
}

.strong-source-field {
  flex: 1 1 220px;
}

.strong-source-ot-field {
  min-width: 200px;
}

.strong-source-nt-field {
  min-width: 200px;
}

.strong-source-field:not(.strong-source-ot-field):not(.strong-source-nt-field) {
  flex-basis: 320px;
}

.strong-color-picker,
.strong-style-picker {
  display: grid;
  gap: 0.35rem;
}

.strong-color-picker > span,
.strong-style-picker > span {
  color: var(--muted);
  font-size: 0.88rem;
}

.strong-color-row,
.strong-style-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: nowrap;
}

button.strong-color-swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  padding: 4px;
}

.strong-color-swatch span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
}

.strong-color-swatch.active {
  border-color: var(--text);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--text);
}

.strong-color-swatch[data-strong-color-choice="#1f6feb"] span {
  background: #1f6feb;
}

.strong-color-swatch[data-strong-color-choice="#0f766e"] span {
  background: #0f766e;
}

.strong-color-swatch[data-strong-color-choice="#7c3aed"] span {
  background: #7c3aed;
}

.strong-color-swatch[data-strong-color-choice="#b91c1c"] span {
  background: #b91c1c;
}

.strong-color-swatch[data-strong-color-choice="#334155"] span {
  background: #334155;
}

.strong-style-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.strong-style-button.italic {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 500;
}

.strong-style-button.active {
  border-color: color-mix(in srgb, var(--strong-color) 60%, var(--border));
  background: color-mix(in srgb, var(--strong-color) 14%, var(--surface));
  color: var(--strong-color);
}

.strong-display-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.strong-display-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text);
  font-size: 0.92rem;
  cursor: pointer;
}

.strong-display-toggle input[type="checkbox"] {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  min-width: 46px;
  height: 26px;
  min-height: 26px;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: #858c8c;
  cursor: pointer;
  transition: background 140ms ease, box-shadow 140ms ease;
}

.strong-display-toggle input[type="checkbox"]::before {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  content: "";
  transition: transform 140ms ease;
}

.strong-display-toggle input[type="checkbox"]:checked {
  background: var(--accent);
}

.strong-display-toggle input[type="checkbox"]:checked::before {
  transform: translateX(20px);
}

.strong-display-toggle input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.compact-range-row {
  grid-template-columns: minmax(120px, auto) minmax(90px, 1fr) auto;
}

.workspace-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 0.9rem;
  align-items: end;
}

.report {
  display: grid;
  gap: 0.4rem;
}

.report-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55rem;
}

.report-item.ok {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.report-item.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.user-list {
  display: grid;
  gap: 0.55rem;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem;
}

.deleted-users-panel {
  border-top: 1px solid var(--border);
  margin-top: 0.45rem;
  padding-top: 0.45rem;
}

.deleted-users-panel summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
}

.deleted-users-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.reset-link-box {
  position: relative;
  display: grid;
  gap: 0.35rem;
  margin-top: 0.55rem;
  padding-right: 2.1rem;
}

.reset-link-box input {
  font-family: var(--mono);
  font-size: 0.82rem;
}

.close-reset-link {
  position: absolute;
  top: 0;
  right: 0;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.admin-toolbar > span {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.book-picker {
  display: grid;
  gap: 0.75rem;
  max-height: 340px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  background: var(--surface);
  user-select: none;
  -webkit-user-select: none;
}

.project-book-section {
  display: grid;
  gap: 0.45rem;
}

.project-book-section h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.project-book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
  gap: 0.45rem;
}

.book-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  min-height: 3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.45rem;
  color: var(--book-color, var(--text));
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, color 140ms ease;
  user-select: none;
  -webkit-user-select: none;
}

.book-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.book-option:hover {
  background: var(--surface-soft);
}

.book-option.selected {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  box-shadow: inset 4px 0 0 var(--accent);
  color: var(--text);
}

.book-option span {
  display: grid;
  gap: 0.12rem;
}

.book-option small,
.member-row small,
.chapter-chip small {
  color: var(--muted);
}

.admin-project-panel {
  display: grid;
  gap: 1rem;
}

.section-head.compact {
  align-items: center;
}

.admin-project-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 1rem;
}

.admin-project-grid.compact {
  grid-template-columns: minmax(0, 1fr);
}

.admin-subsection {
  display: grid;
  gap: 0.65rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.admin-subsection h2 {
  margin: 0;
  font-size: 1rem;
}

.admin-inline-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.55rem;
  align-items: end;
}

.admin-inline-form label {
  display: grid;
  gap: 0.25rem;
}

.admin-book-list,
.member-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.admin-book-list {
  display: grid;
}

.admin-book-row {
  display: grid;
  gap: 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem;
}

.chapter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.chapter-chip {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  padding: 0.16rem 0.35rem 0.16rem 0.5rem;
  font-size: 0.82rem;
}

.chapter-chip button {
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  border-radius: 999px;
  padding: 0;
  background: transparent;
  color: var(--muted);
}

.member-row {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent-soft) 35%, var(--surface));
  padding: 0.3rem 0.35rem 0.3rem 0.65rem;
}

.member-row .icon-button {
  min-width: 28px;
  width: 28px;
  min-height: 28px;
  height: 28px;
}

.deleted-items-panel {
  display: grid;
  gap: 0.75rem;
}

.deleted-head-actions {
  display: flex;
  gap: 0.55rem;
  align-items: end;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.project-tree-node {
  border-left: 1px solid var(--border);
  margin-left: 0.2rem;
  padding-left: 0.75rem;
}

.project-tree-node summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.5rem 0.65rem;
  cursor: pointer;
}

.project-tree-node summary small {
  color: var(--muted);
}

.tree-children {
  display: grid;
  gap: 0.5rem;
  padding: 0.5rem 0 0.45rem 0.35rem;
}

.tree-children .text-link {
  justify-self: start;
  border: 0;
  padding: 0.15rem 0;
  color: var(--muted);
  text-align: left;
}

.tree-children .text-link:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.tree-actions {
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
}

.tree-icon {
  position: relative;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  border-radius: 999px;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
}

.tree-form {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 0.5rem;
}

.tree-code {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 0.55rem;
  font-family: var(--mono);
  font-size: 0.9rem;
}

.tree-comment {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 0.5rem;
}

.tree-comment p {
  margin: 0 0 0.25rem;
}

.deleted-tree-list {
  display: grid;
  gap: 0.55rem;
}

.deleted-retention-form {
  display: grid;
  grid-template-columns: minmax(140px, 210px) auto;
  gap: 0.45rem;
  align-items: end;
}

.deleted-retention-form input {
  min-height: 38px;
}

.deleted-retention-form button {
  min-height: 38px;
}

.deleted-group {
  display: grid;
  gap: 0.45rem;
  border-top: 1px solid var(--border);
  padding-top: 0.65rem;
}

.deleted-group h2 {
  margin: 0;
  font-size: 1rem;
}

.deleted-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.45rem 0.55rem;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 0.5fr) auto;
  gap: 0.7rem;
}

.toggle-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-size: 1rem;
}

.toggle-row input {
  width: auto;
}

.toggle-row small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.theme-picker {
  display: grid;
  gap: 0.65rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.language-picker {
  display: grid;
  gap: 0.65rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.language-choice-row {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  flex-wrap: wrap;
}

.language-choice {
  position: relative;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 3px;
  background: var(--surface);
  box-shadow: none;
}

.language-choice:hover {
  border-color: var(--text);
}

.language-choice.active {
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 5px var(--text);
}

.flag-icon {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--text) 18%, transparent);
  border-radius: inherit;
}

.flag-en {
  background:
    linear-gradient(32deg, transparent 0 43%, #ffffff 43% 48%, #c8102e 48% 52%, #ffffff 52% 57%, transparent 57%),
    linear-gradient(-32deg, transparent 0 43%, #ffffff 43% 48%, #c8102e 48% 52%, #ffffff 52% 57%, transparent 57%),
    linear-gradient(to right, transparent 0 40%, #ffffff 40% 45%, #c8102e 45% 55%, #ffffff 55% 60%, transparent 60%),
    linear-gradient(to bottom, transparent 0 35%, #ffffff 35% 42%, #c8102e 42% 58%, #ffffff 58% 65%, transparent 65%),
    #012169;
}

.flag-sk {
  background: linear-gradient(to bottom, #ffffff 0 33.33%, #0b4ea2 33.33% 66.66%, #ee1c25 66.66% 100%);
}

.flag-sk::before {
  position: absolute;
  top: 26%;
  left: 29%;
  width: 30%;
  height: 42%;
  border: 1px solid #ffffff;
  border-radius: 45% 45% 52% 52%;
  background: #ee1c25;
  content: "";
}

.flag-sk::after {
  position: absolute;
  top: 34%;
  left: 39%;
  width: 10%;
  height: 24%;
  background:
    linear-gradient(90deg, transparent 33%, #ffffff 33% 67%, transparent 67%),
    linear-gradient(0deg, transparent 41%, #ffffff 41% 59%, transparent 59%);
  content: "";
}

.theme-swatch-row {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  flex-wrap: wrap;
}

button.theme-swatch {
  position: relative;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 3px;
  background: var(--surface);
  box-shadow: none;
}

button.theme-swatch:hover {
  border-color: var(--text);
}

button.theme-swatch.active {
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 5px var(--text);
}

.theme-swatch-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.theme-swatch[data-theme-choice="green"] .theme-swatch-fill {
  background: #176b5b;
}

.theme-swatch[data-theme-choice="blue"] .theme-swatch-fill {
  background: #2563eb;
}

.theme-swatch[data-theme-choice="slate"] .theme-swatch-fill {
  background: #475569;
}

.theme-swatch[data-theme-choice="rose"] .theme-swatch-fill {
  background: #be3f5f;
}

.theme-swatch[data-theme-choice="amber"] .theme-swatch-fill {
  background: #a15c13;
}

.range-row {
  margin-top: 0.25rem;
  grid-template-columns: minmax(150px, 0.7fr) minmax(120px, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  color: var(--text);
  font-size: 1rem;
}

.range-row input {
  padding: 0;
}

.range-row output {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  justify-self: end;
}

.guide ul,
.panel ul {
  margin: 0;
  padding-left: 1.2rem;
}

.faq-list {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  overflow: hidden;
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--accent-strong);
  background: var(--surface);
  font-weight: 700;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-answer {
  padding: 0 1rem 1rem;
  color: var(--muted);
  line-height: 1.55;
}

.faq-answer p {
  margin: 0;
}

.setup-guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: auto;
}

.setup-guide-overlay:not(.has-highlight) {
  background: rgba(15, 23, 42, 0.58);
}

.setup-guide-highlight {
  position: fixed;
  z-index: 9001;
  border: 2px solid var(--accent);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.58), 0 18px 50px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  transition: left 0.18s ease, top 0.18s ease, width 0.18s ease, height 0.18s ease;
}

.setup-guide-card {
  position: fixed;
  z-index: 9002;
  width: min(360px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.24);
}

.setup-guide-card h2 {
  margin: 0.2rem 0 0.55rem;
  font-size: 1.2rem;
}

.setup-guide-card p {
  margin: 0 0 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.setup-guide-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.setup-guide-spacer {
  flex: 1;
}

body.setup-guide-open {
  overflow: hidden;
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .stats-summary-grid,
  .stats-book-header {
    grid-template-columns: 1fr;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.5rem 0.65rem;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .tabs {
    grid-column: 2;
    grid-row: 1;
  }

  .top-actions {
    grid-column: 3;
    grid-row: 1;
  }

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

  .context-picker-button {
    max-width: none;
    flex: 1 1 0;
  }
}

@media (max-width: 760px) {
  .history-compare-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
  }

  .brand {
    display: none;
  }

  .tabs {
    grid-column: 1;
  }

  .workspace-context-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    order: 3;
  }

  .context-picker-button {
    max-width: none;
    flex: 1 1 0;
  }

  .top-actions {
    grid-column: 2;
  }

  .toolbar-actions {
    display: none;
  }

  .export-panel-head {
    display: grid;
  }

  .export-panel-actions {
    justify-content: flex-start;
  }

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

  .layout-grid,
  .reader-layout-grid,
  .settings-layout,
  .two-column,
  .field-grid,
  .workspace-comments-grid,
  .admin-project-grid {
    grid-template-columns: 1fr;
  }

  .layout-grid.comments-collapsed {
    grid-template-columns: 1fr;
  }

  .reader-layout-grid.reader-tools-collapsed,
  .reader-layout-grid.strong-dictionary-open,
  .reader-layout-grid.reader-tools-collapsed.strong-dictionary-open {
    grid-template-columns: 1fr;
  }

  .layout-grid .side-panel {
    position: fixed;
    top: calc(var(--topbar-height) + 0.75rem);
    left: 0.7rem;
    z-index: 18;
    width: min(310px, calc(100vw - 1.4rem));
    max-height: calc(100vh - var(--topbar-height) - 1.5rem);
    overflow: auto;
  }

  .layout-grid.comments-collapsed .side-panel {
    position: fixed;
    top: calc(var(--topbar-height) + 0.75rem);
    left: 0.7rem;
    z-index: 80;
    width: 46px;
    min-height: 0;
    max-height: 46px;
    overflow: visible;
  }

  .layout-grid .side-panel + div,
  .layout-grid.comments-collapsed .side-panel + div {
    grid-column: 1;
    grid-row: 1;
  }

  .layout-grid.comments-collapsed .side-panel + div {
    padding-left: 58px;
  }

  .side-panel {
    max-height: calc(100vh - var(--topbar-height) - 1.5rem);
  }

  .reader-layout-grid .reader-side-panel {
    position: fixed;
    top: calc(var(--topbar-height) + 0.75rem);
    left: 0.7rem;
    z-index: 18;
    width: min(310px, calc(100vw - 1.4rem));
    max-height: calc(100vh - var(--topbar-height) - 1.5rem);
    overflow-x: hidden;
    overflow-y: auto;
  }

  .reader-layout-grid.reader-tools-collapsed .reader-side-panel {
    position: fixed;
    top: calc(var(--topbar-height) + 0.75rem);
    left: 0.7rem;
    z-index: 80;
    width: 46px;
    min-height: 0;
    max-height: 46px;
    overflow: visible;
  }

  .reader-layout-grid .reader-side-panel + .reader-page,
  .reader-layout-grid.reader-tools-collapsed .reader-side-panel + .reader-page {
    grid-column: 1;
    grid-row: 1;
  }

  .reader-layout-grid.reader-tools-collapsed .reader-side-panel + .reader-page {
    padding-left: 58px;
  }

  .settings-menu {
    position: fixed;
    top: calc(var(--topbar-height) + 0.75rem);
    left: 0.7rem;
    z-index: 18;
    width: min(310px, calc(100vw - 1.4rem));
    max-height: calc(100vh - var(--topbar-height) - 1.5rem);
    overflow: auto;
  }

  .settings-layout.settings-menu-collapsed .settings-menu {
    width: 46px;
    min-height: 0;
    max-height: 46px;
    overflow: visible;
  }

  .settings-layout.settings-menu-collapsed {
    grid-template-columns: 1fr;
  }

  .settings-layout .settings-menu + .settings-content,
  .settings-layout.settings-menu-collapsed .settings-menu + .settings-content {
    grid-column: 1;
    grid-row: 1;
  }

  .cell-label {
    display: block;
  }

  .verse-list {
    overflow-x: visible;
    padding-bottom: 0;
    scrollbar-gutter: auto;
  }

  .editor-table {
    min-width: 0;
    width: 100%;
  }

  .strong-settings-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .strong-color-picker,
  .strong-style-picker,
  .compact-range-row,
  .strong-source-ot-field,
  .strong-source-nt-field {
    grid-column: 1;
  }

  .strong-source-field {
    grid-row: auto;
  }

  .editor-sticky-head {
    top: calc(var(--topbar-height) + 0.2rem);
  }

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

  .editor-cell,
  .preview-cell,
  .strong-helper-column,
  .external-module-column,
  .row-actions {
    grid-column: 2 !important;
    grid-row: auto;
  }

  .reader-verses {
    column-count: 1;
  }

  .reader-verses.single {
    column-count: 1;
  }

  .reader-verses.parallel.reader-cols-2 .reader-module-grid,
  .reader-verses.parallel.reader-cols-3 .reader-module-grid,
  .reader-verses.parallel.reader-cols-4 .reader-module-grid,
  .strong-usage-layout {
    grid-template-columns: 1fr;
  }

  .strong-usage-summary {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 1rem;
  }

  .reader-search-options-popover {
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
  }

  .reader-search-options-popover::before {
    display: none;
  }

  .book-selection-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .workspace-settings-grid,
  .range-row,
  .module-row {
    grid-template-columns: 1fr;
  }

  .range-row output {
    justify-self: start;
  }

  .view,
  .toolbar,
  .topbar {
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }

  .toolbar,
  .inline-form,
  .admin-inline-form,
  .settings-export-row {
    grid-template-columns: 1fr;
  }

  .workspace-context-actions {
    gap: 0.25rem;
  }

  .context-picker-button {
    padding-left: 0.4rem;
    padding-right: 0.4rem;
  }

  .context-picker-button strong {
    font-size: 0.82rem;
  }

  .book-selection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .context-book-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .email-notification-row,
  .email-notification-options {
    align-items: flex-start;
  }

  .editor-sticky-head {
    align-items: flex-end;
    gap: 0.45rem;
    margin-left: -0.2rem;
    margin-right: -0.2rem;
    padding-left: 0.2rem;
    padding-right: 0.2rem;
  }

  .editor-sticky-head h1 {
    display: none;
  }

  .editor-sticky-head .eyebrow {
    display: none;
  }

  .editor-top-actions {
    gap: 0.45rem;
    justify-content: flex-end;
  }

  .editor-top-actions .save-indicator {
    margin-left: auto;
  }

  .verse-header {
    grid-template-columns: 48px 1fr;
  }

  .verse-main {
    grid-template-columns: 1fr;
  }

  .verse-number,
  .editor-cell,
  .preview-cell,
  .external-module-column,
  .strong-helper-column,
  .row-actions {
    grid-column: 1 !important;
    grid-row: auto;
  }

  .verse-tools {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .reader-verse {
    grid-template-columns: 34px 1fr;
  }

  .reader-verse-item,
  .strong-usage-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .reader-go-verse,
  .strong-usage-go {
    grid-column: 2;
    opacity: 1;
    justify-self: end;
  }
}
