:root {
  --ink: #17251f;
  --ink-soft: #53625b;
  --forest: #243a32;
  --forest-deep: #192c26;
  --olive: #66774b;
  --olive-soft: #e7eadc;
  --rust: #a65332;
  --rust-soft: #f4e7df;
  --paper: #fffdf8;
  --canvas: #f3efe6;
  --line: #ddd7ca;
  --line-strong: #c9c1b2;
  --success: #347054;
  --danger: #a23f35;
  --warning: #aa7628;
  --shadow: 0 16px 45px rgba(42, 48, 37, 0.08);
  --radius-large: 22px;
  --radius-medium: 14px;
  --radius-small: 9px;
  --content-width: 1380px;
  --control-gap: 0.75rem;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 8% -10%, rgba(166, 83, 50, 0.09), transparent 28rem),
    radial-gradient(circle at 92% 12%, rgba(102, 119, 75, 0.1), transparent 32rem),
    var(--canvas);
}

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

button,
select {
  cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(166, 83, 50, 0.35);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  color: white;
  background: var(--forest-deep);
  border-radius: var(--radius-small);
  transform: translateY(-160%);
  transition: transform 150ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  color: white;
  background: linear-gradient(115deg, var(--forest-deep), var(--forest) 66%, #354c3f);
  box-shadow: 0 8px 28px rgba(25, 44, 38, 0.16);
}

.header-inner,
.status-inner,
.collection-inner,
.account-inner,
.study-session-inner {
  width: min(calc(100% - 2.5rem), var(--content-width));
  margin-inline: auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  gap: 2rem;
  padding-block: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: var(--forest-deep);
  background: #e7ddc3;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50% 50% 45% 45%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 700;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.3);
}

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

.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  letter-spacing: 0.01em;
}

.brand small {
  margin-top: 0.12rem;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.scope-note {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-menu-button,
.mobile-navigation-heading,
.navigation-backdrop {
  display: none;
}

.account-control {
  position: relative;
}

.account-menu-button {
  min-height: 42px;
  max-width: 220px;
  padding: 0.55rem 0.85rem;
  overflow: hidden;
  color: white;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-button:hover {
  background: rgba(255, 255, 255, 0.18);
}

.account-popover {
  position: absolute;
  z-index: 100;
  top: calc(100% + 0.55rem);
  right: 0;
  width: min(370px, calc(100vw - 1.5rem));
  padding: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-medium);
  box-shadow: 0 18px 50px rgba(7, 20, 16, 0.3);
}

.account-popover-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.account-popover-close,
.mobile-navigation-close {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  color: inherit;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 1.35rem;
}

.collection-strip {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 20, 16, 0.2);
}

.collection-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-height: 36px;
  gap: 0.45rem 1.35rem;
  padding-block: 0.45rem;
}

.collection-metric {
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.75rem;
  font-weight: 750;
  white-space: nowrap;
}

.study-session-strip {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 253, 248, 0.12);
}

.login-form,
.password-change-form,
.account-session {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}

.login-form label,
.password-change-form label {
  display: grid;
  gap: 0.35rem;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 800;
}

.login-form input,
.password-change-form input {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  color: var(--forest-deep);
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.password-change-form p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.5;
}

.account-session {
  padding: 0.75rem;
  background: var(--olive-soft);
  border-radius: var(--radius-small);
}

.account-session span {
  color: var(--forest-deep);
  font-size: 0.78rem;
  font-weight: 800;
}

.account-message {
  display: block;
  margin-top: 0.75rem;
  color: var(--ink-soft);
  font-size: 0.75rem;
  line-height: 1.45;
}

.account-message.is-error {
  color: var(--danger);
}

.study-session-inner {
  display: grid;
  grid-template-columns: auto minmax(190px, 330px) minmax(0, 1fr) auto;
  min-height: 54px;
  align-items: center;
  gap: 0.65rem;
  padding-block: 0.45rem;
}

.study-session-label {
  color: #f0e7d3;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.study-session-inner .active-study-field {
  min-width: 0;
}

.study-session-inner .active-study-field select {
  min-height: 44px;
  color: var(--forest-deep);
  background: #fffdf8;
  border-color: rgba(255, 255, 255, 0.24);
}

.active-study-summary {
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-button {
  min-height: 38px;
  padding: 0.5rem 0.75rem;
  color: white;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 800;
}

.session-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

.main-navigation {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 20, 16, 0.12);
}

.main-navigation-inner {
  display: flex;
  width: min(calc(100% - 2.5rem), var(--content-width));
  margin-inline: auto;
  gap: 0.25rem;
}

.mobile-navigation-heading {
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
}

.main-nav-button {
  min-height: 44px;
  padding: 0.55rem 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  font-size: 0.78rem;
  font-weight: 800;
}

.main-nav-button:hover,
.main-nav-button.is-active {
  color: white;
  border-bottom-color: #e7ddc3;
}

.status-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-height: 36px;
  gap: 0.45rem 1.35rem;
  padding-block: 0.45rem;
}

.status-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.75rem;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: currentColor;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.status-item.is-ready {
  color: #b8e3c9;
}

.status-item.is-error {
  color: #ffc0b7;
}

.status-item.is-checking .status-dot {
  animation: pulse 1.2s ease-in-out infinite;
}

.app-shell {
  width: min(calc(100% - 2.5rem), var(--content-width));
  margin: 1.75rem auto 2.5rem;
}

.view-help-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.65rem;
}

.help-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem 0.45rem 0.5rem;
  color: var(--forest-deep);
  background: #fffdf8;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: 0 5px 16px rgba(25, 44, 38, 0.1);
}

.help-button:hover {
  color: var(--rust);
  border-color: #b9927f;
}

.help-button-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: white;
  background: var(--forest);
  border-radius: 50%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
}

.help-dialog {
  width: min(720px, calc(100% - 2rem));
  max-height: min(84vh, 820px);
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: #fffdf8;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-large);
  box-shadow: 0 24px 70px rgba(16, 34, 28, 0.3);
}

.help-dialog::backdrop {
  background: rgba(19, 31, 27, 0.58);
  backdrop-filter: blur(2px);
}

.help-dialog-shell {
  max-height: min(84vh, 820px);
  padding: 1.25rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

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

.help-dialog-heading h2 {
  margin: 0.15rem 0 0;
  color: var(--forest-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 4vw, 2rem);
}

.help-dialog-close {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  color: var(--forest-deep);
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 1.35rem;
}

.help-dialog-introduction {
  margin: 1rem 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

.help-content {
  display: grid;
  gap: 0.85rem;
}

.help-section {
  padding: 0.9rem 1rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
}

.help-section h3 {
  margin: 0 0 0.65rem;
  color: var(--forest-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
}

.help-list {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) minmax(0, 1fr);
  gap: 0.6rem 0.85rem;
  margin: 0;
}

.help-list dt {
  color: var(--forest);
  font-size: 0.8rem;
  font-weight: 850;
}

.help-list dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.55;
}

.help-dialog-done {
  width: 100%;
  margin-top: 1rem;
}

.study-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.85fr);
  gap: 1.25rem;
  align-items: start;
}

.reader-card,
.reference-card,
.concordance-card,
.bible-search-card {
  min-width: 0;
  background: rgba(255, 253, 248, 0.96);
  border: 1px solid rgba(201, 193, 178, 0.75);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow);
}

.reader-card,
.reference-card {
  min-height: 540px;
}

.reader-card {
  overflow: hidden;
}

.reference-card {
  position: sticky;
  top: 1.25rem;
  max-height: calc(100vh - 2.5rem);
  padding: 1.5rem;
  overflow-y: auto;
}

.concordance-card {
  padding: 1.65rem;
}

.bible-search-card {
  padding: 1.65rem;
}

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

.reader-heading {
  padding: 1.55rem 1.65rem 1rem;
}

.reader-chapter-heading {
  margin-top: 0.35rem !important;
  color: var(--ink-soft) !important;
  font-size: clamp(1rem, 2vw, 1.25rem) !important;
  font-family: inherit !important;
  font-weight: 750;
}

.section-heading h1,
.section-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--forest-deep);
  line-height: 1.12;
}

.section-heading h1 {
  font-size: clamp(1.7rem, 4vw, 2.3rem);
}

.section-heading h2 {
  font-size: clamp(1.45rem, 3vw, 1.85rem);
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--rust);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-description {
  max-width: 52ch;
  margin: 0.5rem 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.chapter-navigation {
  display: flex;
  gap: var(--control-gap);
}

.reading-history {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 1.65rem 0.9rem;
  padding: 0.5rem 0.55rem 0.5rem 0.75rem;
  color: var(--ink-soft);
  background: rgba(231, 234, 220, 0.62);
  border: 1px solid rgba(174, 185, 155, 0.62);
  border-radius: var(--radius-small);
}

.reading-history-label {
  color: var(--forest);
  font-size: 0.75rem;
  font-weight: 800;
}

.reading-history-status {
  margin-right: auto;
  font-size: 0.7rem;
}

.reading-history-buttons {
  display: flex;
  gap: 0.6rem;
}

.history-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.65rem;
  color: var(--forest);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 800;
}

.history-button:hover:not(:disabled) {
  color: var(--rust);
  border-color: #b9927f;
}

.icon-button,
.secondary-button {
  min-height: 40px;
  padding: 0.55rem 0.8rem;
  color: var(--forest);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  font-size: 0.82rem;
  font-weight: 700;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.icon-button:hover:not(:disabled),
.secondary-button:hover:not(:disabled) {
  background: var(--olive-soft);
  border-color: #aeb99b;
  transform: translateY(-1px);
}

.passage-controls {
  display: grid;
  grid-template-columns: minmax(150px, 1.55fr) minmax(100px, 0.8fr) minmax(92px, 0.65fr) minmax(92px, 0.65fr) auto;
  align-items: end;
  gap: 0.7rem;
  padding: 0 1.65rem 1.35rem;
  border-bottom: 1px solid var(--line);
}

.passage-search-panel {
  display: grid;
  gap: 0.7rem;
  margin: 0.9rem 1.65rem;
  padding: 0.9rem 1rem;
  background: rgba(231, 234, 220, 0.48);
  border: 1px solid rgba(174, 185, 155, 0.62);
  border-radius: var(--radius-small);
}

.passage-search-panel > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.passage-search-panel > div:first-child strong {
  color: var(--forest-deep);
  font-size: 0.84rem;
}

.passage-search-panel > div:first-child span {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.passage-search-form,
.bible-search-form {
  display: flex;
  align-items: center;
  gap: var(--control-gap);
}

.passage-search-form .search-field,
.bible-search-form .search-field {
  flex: 1;
}

.passage-search-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.7rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  font-size: 0.76rem;
}

.passage-search-navigation {
  display: flex;
  flex: 0 0 auto;
  gap: var(--control-gap);
}

.field {
  display: grid;
  min-width: 0;
  gap: 0.35rem;
}

.field > span,
.field > label {
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.03em;
}

.field-book {
  position: relative;
  z-index: 10;
}

.book-combobox {
  position: relative;
}

.field input,
.field select,
.search-field input {
  width: 100%;
  min-height: 44px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field input,
.field select {
  padding: 0.65rem 0.75rem;
}

.field input:hover,
.field select:hover,
.search-field input:hover {
  border-color: #9f998c;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-field input:focus {
  border-color: var(--rust);
  box-shadow: 0 0 0 3px rgba(166, 83, 50, 0.1);
}

.book-options {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.4rem);
  right: 0;
  left: 0;
  max-height: min(45vh, 330px);
  padding: 0.35rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-medium);
  box-shadow: 0 16px 36px rgba(25, 44, 38, 0.18);
}

.book-option {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.7rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 8px;
  text-align: left;
}

.book-option:hover,
.book-option.is-active {
  background: var(--olive-soft);
}

.book-option-name {
  font-weight: 750;
}

.book-option-aliases {
  color: var(--ink-soft);
  font-size: 0.68rem;
  white-space: nowrap;
}

.book-options-empty {
  padding: 0.85rem 0.75rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.4;
}

.primary-button {
  min-height: 44px;
  padding: 0.68rem 1.1rem;
  color: white;
  background: var(--rust);
  border: 1px solid var(--rust);
  border-radius: var(--radius-small);
  font-weight: 800;
  box-shadow: 0 7px 15px rgba(166, 83, 50, 0.17);
  transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.primary-button:hover:not(:disabled) {
  background: #91462b;
  transform: translateY(-1px);
  box-shadow: 0 9px 18px rgba(166, 83, 50, 0.22);
}

.panel-message {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  gap: 0.75rem;
  padding: 1.5rem;
  color: var(--ink-soft);
  text-align: center;
}

.panel-message.is-quiet {
  min-height: 100px;
  background: linear-gradient(135deg, rgba(231, 234, 220, 0.55), transparent);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-medium);
  font-size: 0.9rem;
}

.panel-message.is-error {
  color: var(--danger);
  background: #fff5f3;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--rust);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.passage-list {
  padding: 0.8rem 1.65rem 1.8rem;
}

.verse-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 0.8rem;
  padding: 0.8rem 0.5rem;
  border-bottom: 1px solid rgba(221, 215, 202, 0.65);
  border-radius: var(--radius-small);
  transition: background 150ms ease;
}

.verse-row:last-child {
  border-bottom: 0;
}

.verse-row:hover,
.verse-row.is-selected {
  background: rgba(231, 234, 220, 0.56);
}

.verse-row.is-study-selected {
  background: rgba(244, 231, 223, 0.72);
  box-shadow: inset 3px 0 var(--rust);
}

.verse-row.is-search-match {
  background: rgba(245, 226, 158, 0.2);
  box-shadow: inset 3px 0 #c28b28;
}

.verse-row.is-active-search-match {
  background: rgba(245, 226, 158, 0.42);
  box-shadow: inset 4px 0 var(--rust);
}

.verse-text mark,
.bible-search-result-card mark {
  padding: 0.05em 0.12em;
  color: inherit;
  background: #f4d983;
  border-radius: 3px;
}

.verse-inline-references {
  grid-column: 2 / 3;
  margin-top: -0.25rem;
}

.verse-inline-reference-links {
  display: flex;
  flex-wrap: wrap;
  column-gap: 0.85rem;
  row-gap: 0.15rem;
}

.verse-inline-reference {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--rust);
  font-size: 0.76rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.verse-inline-reference:hover,
.verse-inline-reference:focus-visible {
  color: var(--forest);
}

.verse-number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  margin-top: 0.12rem;
  color: var(--rust);
  background: var(--rust-soft);
  border: 0;
  border-radius: 50%;
  font-size: 0.76rem;
  font-weight: 850;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

.verse-number:hover,
.verse-row.is-selected .verse-number {
  color: white;
  background: var(--rust);
  transform: scale(1.05);
}

.verse-text {
  min-width: 0;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.02rem, 1.5vw, 1.13rem);
  line-height: 1.68;
  overflow-wrap: anywhere;
}

.verse-actions {
  display: grid;
  width: 76px;
  align-self: start;
  gap: 0.6rem;
}

.verse-select-button,
.verse-bookmark-button {
  display: grid;
  width: 100%;
  min-height: 40px;
  padding: 0.4rem 0.55rem;
  place-items: center;
  align-self: start;
  color: var(--ink-soft);
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  font-size: 0.7rem;
  font-weight: 900;
}

.verse-select-button:hover,
.verse-select-button[aria-pressed="true"] {
  color: white;
  background: var(--success);
  border-color: var(--success);
}

.verse-bookmark-button:hover,
.verse-bookmark-button[aria-pressed="true"] {
  color: white;
  background: var(--rust);
  border-color: var(--rust);
}

.scripture-bookmark-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.scripture-bookmark-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
}

.scripture-bookmark-open {
  min-width: 0;
  flex: 1;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  text-align: left;
}

.scripture-bookmark-open strong {
  color: var(--rust);
}

.scripture-bookmark-open p {
  margin: 0.35rem 0 0;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.55;
}

.reference-source {
  margin: 0.7rem 0 1rem;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.reference-count {
  padding: 0.3rem 0.55rem;
  color: var(--forest);
  background: var(--olive-soft);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
}

.reference-list {
  display: grid;
  gap: 0.65rem;
}

.reference-item {
  width: 100%;
  padding: 0.85rem 0.9rem;
  color: inherit;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  text-align: left;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.reference-item:hover {
  border-color: #aeb99b;
  box-shadow: 0 7px 18px rgba(42, 48, 37, 0.07);
  transform: translateY(-1px);
}

.reference-code,
.result-reference {
  color: var(--rust);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.03em;
}

.reference-item p {
  display: -webkit-box;
  margin: 0.4rem 0 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.9rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.diagnostics {
  display: grid;
  gap: 0.45rem;
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.diagnostics details {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.diagnostics summary {
  padding: 0.45rem 0;
  cursor: pointer;
  font-weight: 750;
}

.diagnostics pre {
  max-height: 180px;
  margin: 0.4rem 0;
  padding: 0.75rem;
  overflow: auto;
  color: #35423c;
  background: #f2efe7;
  border-radius: var(--radius-small);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.concordance-heading {
  align-items: center;
}

.search-form {
  display: flex;
  width: min(100%, 560px);
  gap: var(--control-gap);
}

.search-field {
  min-width: 0;
  flex: 1;
}

.search-field input {
  padding: 0.7rem 0.9rem;
}

.concordance-method-note {
  display: grid;
  gap: 0.35rem;
  margin-top: 1.25rem;
  padding: 0.9rem 1rem;
  color: var(--ink-soft);
  background: linear-gradient(135deg, rgba(231, 234, 220, 0.72), rgba(255, 255, 255, 0.35));
  border: 1px solid var(--line);
  border-left: 4px solid var(--olive);
  border-radius: var(--radius-small);
  font-size: 0.86rem;
  line-height: 1.55;
}

.concordance-method-note strong {
  color: var(--forest);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.concordance-method-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.concordance-method-help {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  padding: 0;
  color: white;
  background: var(--forest);
  border: 0;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 900;
}

.concordance-method-help:hover,
.concordance-method-help:focus-visible {
  background: var(--forest-deep);
}

.concordance-method-note p {
  margin: 0;
}

.search-summary {
  margin-top: 0;
  padding: 0.75rem 0.9rem;
  color: var(--ink-soft);
  background: var(--olive-soft);
  border-radius: var(--radius-small);
  font-size: 0.86rem;
}

.concordance-card > .panel-message {
  margin-top: 1.25rem;
}

.text-button {
  padding: 0;
  color: var(--rust);
  background: transparent;
  border: 0;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.concordance-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.bible-search-heading {
  align-items: end;
}

.bible-search-form {
  width: min(100%, 620px);
}

.bible-search-card > .search-summary,
.bible-search-card > .panel-message {
  margin-top: 1.25rem;
}

.bible-search-results {
  display: grid;
  gap: 1.4rem;
  margin-top: 1.25rem;
}

.bible-search-book-group {
  display: grid;
  gap: 0.9rem;
}

.bible-search-book-group > h2 {
  margin: 0;
  padding-bottom: 0.55rem;
  color: var(--forest-deep);
  border-bottom: 2px solid var(--olive);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.4rem, 3vw, 1.8rem);
}

.bible-search-chapter-group {
  display: grid;
  gap: 0.65rem;
}

.bible-search-chapter-group > h3 {
  margin: 0;
  color: var(--rust);
  font-size: 0.84rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bible-search-chapter-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.bible-search-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 1.25rem;
}

.result-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.7rem;
  padding: 1rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
}

.result-card p {
  grid-column: 1 / -1;
  margin: 0;
  color: #35423c;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.55;
}

.result-positions {
  align-self: start;
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.result-open {
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: 0.15rem;
  padding: 0;
  color: var(--forest);
  background: transparent;
  border: 0;
  font-size: 0.76rem;
  font-weight: 800;
}

.result-open:hover {
  color: var(--rust);
  text-decoration: underline;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.pagination span {
  min-width: 110px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  text-align: center;
}

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

.study-context-bar,
.path-lesson-bar,
.followed-reference-bar,
.verse-selection-bar {
  display: flex;
  align-items: end;
  gap: 0.65rem;
  margin: 0 1.65rem 0.9rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
}

.study-context-bar {
  background: rgba(244, 231, 223, 0.45);
}

.verse-selection-bar {
  align-items: center;
  justify-content: space-between;
  color: var(--forest);
  background: #f7f1e7;
  border-color: #d8c5a8;
}

.verse-selection-bar > strong {
  font-size: 0.82rem;
}

.verse-selection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--control-gap);
}

.active-study-field {
  display: grid;
  min-width: 180px;
  flex: 1;
  gap: 0.3rem;
}

.active-study-field span,
.path-lesson-kicker {
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.active-study-field select {
  width: 100%;
  min-height: 42px;
  padding: 0.55rem 0.65rem;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.path-lesson-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  color: var(--forest);
  background: var(--olive-soft);
  border-color: #bdc7aa;
}

.path-lesson-heading {
  min-width: 0;
}

.path-lesson-resources {
  display: grid;
  grid-column: 1 / -1;
  width: 100%;
  gap: 0.55rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(83, 99, 66, 0.22);
}

.path-resource-group {
  display: grid;
  gap: 0.3rem;
}

.path-resource-label {
  color: var(--ink-soft);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.path-resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.path-resource-button {
  min-height: 38px;
  padding: 0.45rem 0.65rem;
  color: var(--forest);
  background: white;
  border: 1px solid #aebc99;
  border-radius: 8px;
  font-weight: 800;
}

.path-resource-button:hover {
  border-color: var(--forest);
}

.path-curated-text p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.55;
}

.followed-reference-bar {
  align-items: center;
  justify-content: space-between;
  color: var(--ink-soft);
  background: var(--rust-soft);
  border-color: #dbbdae;
  font-size: 0.78rem;
}

.path-lesson-bar strong,
.path-lesson-kicker {
  display: block;
}

.path-lesson-actions,
.card-actions,
.inline-actions,
.form-actions,
.workspace-heading-actions,
.reference-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--control-gap);
}

.note-card > .card-actions,
.saved-item-card > .card-actions {
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.today-path-button {
  min-height: 44px;
}

.search-summary-row {
  display: flex;
  align-items: end;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.search-summary-row .search-summary {
  flex: 1;
}

.compact-button {
  min-height: 38px;
  padding: 0.45rem 0.65rem;
  font-size: 0.74rem;
  box-shadow: none;
}

.danger-button {
  min-height: 40px;
  padding: 0.5rem 0.7rem;
  color: var(--danger);
  background: #fff7f5;
  border: 1px solid #dfb7b0;
  border-radius: var(--radius-small);
  font-weight: 800;
}

.danger-button:hover {
  color: white;
  background: var(--danger);
}

.reference-open {
  width: 100%;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  text-align: left;
}

.reference-actions {
  justify-content: flex-end;
  margin-top: 0.7rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}

.workspace-page {
  min-height: 500px;
  padding: 1.65rem;
  background: rgba(255, 253, 248, 0.96);
  border: 1px solid rgba(201, 193, 178, 0.75);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow);
}

.page-heading,
.workspace-heading,
.path-detail-heading,
.saved-item-heading,
.note-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.page-heading h1,
.workspace-heading h1,
.path-detail-heading h1 {
  margin: 0;
  color: var(--forest-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.page-heading p,
.workspace-heading p,
.path-detail-heading p {
  max-width: 70ch;
  margin: 0.45rem 0 0;
  color: var(--ink-soft);
  line-height: 1.5;
}

.study-groups,
.path-detail,
.review-grid {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.4rem;
}

.discovery-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(2, minmax(150px, 0.65fr)) auto;
  align-items: end;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding: 1rem;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
}

.study-discovery-controls {
  grid-template-columns: minmax(230px, 1.5fr) repeat(3, minmax(140px, 0.65fr)) auto;
}

.discovery-controls .field {
  min-width: 0;
}

.discovery-controls input,
.discovery-controls select {
  width: 100%;
}

.discovery-clear {
  min-height: 44px;
  white-space: nowrap;
}

.discovery-summary {
  min-height: 1.25rem;
  margin: 0.6rem 0 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.study-discovery-results {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.1rem;
}

.discovery-result-section {
  display: grid;
  gap: 0.75rem;
}

.discovery-result-section h2 {
  margin: 0;
  color: var(--forest-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
}

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

.discovery-note-card {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
  padding: 1rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
}

.discovery-note-card p {
  margin: 0;
  color: var(--ink);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.discovery-note-card small {
  color: var(--ink-soft);
}

.path-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.path-metadata-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.25rem 0.55rem;
  color: var(--forest-deep);
  background: var(--olive-soft);
  border: 1px solid #bdc7aa;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
}

.data-management {
  margin-top: 1.5rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
}

.data-management > summary {
  min-height: 52px;
  padding: 0.9rem 1rem;
  color: var(--forest-deep);
  cursor: pointer;
  font-weight: 850;
}

.data-management-body {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  gap: 1.25rem;
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--line);
}

.data-management-body > div {
  min-width: 0;
  padding-top: 1rem;
}

.data-management h2,
.data-management h3 {
  margin: 0 0 0.5rem;
  color: var(--forest-deep);
  font-family: Georgia, "Times New Roman", serif;
}

.data-management p {
  margin: 0 0 0.9rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.restore-panel {
  padding-left: 1.25rem;
  border-left: 1px solid var(--line);
}

.restore-warning {
  padding: 0.75rem;
  background: #fff6e9;
  border: 1px solid #e9cf9f;
  border-radius: var(--radius-small);
}

.restore-file-field {
  margin-bottom: 0.75rem;
}

.restore-file-field input {
  padding: 0.45rem;
}

.restore-message {
  min-height: 70px;
  margin-top: 0.75rem;
}

.restore-preview {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--paper-deep);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-medium);
}

.restore-counts {
  display: grid;
  gap: 0.35rem;
  margin: 0.8rem 0;
}

.restore-count-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}

.restore-count-row span {
  color: var(--ink-soft);
  text-align: right;
}

.restore-confirmation {
  margin: 1rem 0;
}

.study-group h2,
.workspace-panel h2,
.path-section h2,
.review-card h2 {
  margin: 0 0 0.75rem;
  color: var(--forest-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
}

.study-card-list,
.path-list,
.note-list,
.saved-list {
  display: grid;
  gap: 0.75rem;
}

.study-card-list,
.path-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.study-card,
.path-card,
.note-card,
.saved-item-card,
.review-card {
  min-width: 0;
  padding: 1rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
}

.study-card,
.path-card {
  display: grid;
  align-content: start;
  gap: 0.85rem;
}

.study-card h3,
.path-card h2,
.saved-item-card h3 {
  margin: 0;
  color: var(--forest-deep);
  font-family: Georgia, "Times New Roman", serif;
}

.study-card-source,
.study-card-counts,
.path-card p {
  margin: 0.3rem 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.study-card small {
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.empty-copy {
  margin: 0;
  padding: 1rem;
  color: var(--ink-soft);
  background: rgba(243, 239, 230, 0.55);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-small);
}

progress {
  width: 100%;
  height: 10px;
  overflow: hidden;
  accent-color: var(--success);
  border: 0;
  border-radius: 999px;
}

.path-card-stats {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.path-detail-heading {
  margin-top: 1rem;
}

.path-overall-progress {
  height: 14px;
}

.path-introduction {
  padding: 1rem 1.1rem;
  background: #f7f1e7;
  border: 1px solid #d8c5a8;
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-medium);
}

.path-introduction h2 {
  margin: 0 0 0.45rem;
  color: var(--forest-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
}

.path-introduction p {
  max-width: 78ch;
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.65;
}

.path-current-lesson {
  color: var(--forest);
  font-weight: 700;
  margin-bottom: 0;
}

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

.book-progress-item {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  color: var(--ink-soft);
  background: var(--olive-soft);
  border-radius: 8px;
  font-size: 0.74rem;
}

.path-section {
  padding-top: 0.5rem;
}

.path-book {
  margin-bottom: 0.55rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
}

.path-book summary {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  list-style: none;
}

.path-book summary::-webkit-details-marker {
  display: none;
}

.path-book summary span {
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.path-lesson-list {
  border-top: 1px solid var(--line);
}

.path-lesson-row {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(221, 215, 202, 0.65);
}

.path-lesson-row:last-child {
  border-bottom: 0;
}

.path-lesson-row.is-complete > span {
  color: var(--ink-soft);
  text-decoration: line-through;
}

.workspace-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 1.3rem;
  border-bottom: 1px solid var(--line);
}

.workspace-tab {
  min-height: 46px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  font-weight: 800;
}

.workspace-tab:hover,
.workspace-tab.is-active {
  color: var(--rust);
  border-bottom-color: var(--rust);
}

.workspace-panel {
  padding-top: 1.25rem;
}

.workspace-message {
  min-height: 90px;
}

.workspace-source {
  padding: 1.2rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
}

.saved-item-heading h2,
.saved-item-heading h3 {
  margin: 0;
}

.provenance-badge {
  flex: 0 0 auto;
  padding: 0.3rem 0.5rem;
  color: var(--forest);
  background: var(--olive-soft);
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
}

.provenance-badge.is-tsk {
  color: var(--rust);
  background: var(--rust-soft);
}

.saved-verse {
  margin: 0.7rem 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.6;
}

.saved-verse sup {
  color: var(--rust);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.65rem;
  font-weight: 800;
}

.note-form {
  display: grid;
  grid-template-columns: minmax(160px, 0.35fr) minmax(0, 1fr);
  gap: 0.8rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: rgba(231, 234, 220, 0.45);
  border: 1px solid #c9d0b9;
  border-radius: var(--radius-medium);
}

.note-draft-status {
  grid-column: 1 / -1;
  min-height: 1.1rem;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.note-word-research {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
}

.note-word-research legend {
  padding: 0 0.35rem;
  color: var(--forest-deep);
  font-weight: 800;
}

.note-word-research > p:first-of-type {
  margin: 0 0 0.75rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.5;
}

.note-word-controls {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto auto auto;
  align-items: end;
  gap: var(--control-gap);
}

.note-word-controls button {
  min-height: 44px;
}

.note-research-message {
  min-height: 1.1rem;
  margin: 0.65rem 0 0;
  color: var(--ink-soft);
  font-size: 0.74rem;
}

.note-research-message.is-error {
  color: var(--danger);
}

.ai-use-notice {
  margin: 0.8rem 0 0;
  padding: 0.7rem 0.8rem;
  color: var(--ink-soft);
  background: rgba(220, 190, 121, 0.14);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-small);
  font-size: 0.72rem;
  line-height: 1.5;
}

.note-research-results,
.note-dictionary-links {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.65rem;
}

.word-explanation-card {
  display: grid;
  gap: 0.6rem;
  padding: 0.9rem;
  background: white;
  border: 1px solid var(--line);
  border-left: 4px solid var(--rust);
  border-radius: var(--radius-small);
}

.word-explanation-card h4,
.word-explanation-card p {
  margin: 0;
}

.word-explanation-card small {
  color: var(--ink-soft);
  line-height: 1.45;
}

.word-explanation-card button {
  justify-self: start;
  margin-top: 0.35rem;
}

.ai-provenance-badge {
  justify-self: start;
  padding: 0.2rem 0.45rem;
  color: white;
  background: var(--rust);
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
}

.note-research-summary {
  margin: 0;
  color: var(--forest);
  font-size: 0.78rem;
  font-weight: 750;
}

.note-concordance-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.note-dictionary-citation {
  display: grid;
  gap: 0.4rem;
  padding: 0.75rem;
  background: white;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-small);
}

.note-dictionary-citation p {
  margin: 0;
}

.dictionary-sense-meta {
  color: var(--ink-soft);
  font-size: 0.7rem;
  line-height: 1.45;
}

.dictionary-sense-meta a {
  color: var(--rust);
  font-weight: 700;
}

.dictionary-provenance {
  display: inline-block;
  padding: 0.16rem 0.38rem;
  color: var(--forest-deep);
  background: var(--olive-soft);
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 800;
}

.dictionary-provenance-curated {
  color: #72401f;
  background: var(--rust-soft);
}

.note-dictionary-links h4 {
  margin: 0.2rem 0 0;
  color: var(--forest-deep);
  font-size: 0.82rem;
}

.note-dictionary-links {
  padding-top: 0.2rem;
}

.note-body-field {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.field textarea {
  width: 100%;
  padding: 0.7rem 0.75rem;
  resize: vertical;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  line-height: 1.5;
}

.check-field {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.4;
}

.check-field input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  accent-color: var(--rust);
}

.note-card p,
.review-note p {
  margin: 0.65rem 0;
  white-space: pre-wrap;
  line-height: 1.55;
}

.note-card-heading small {
  color: var(--ink-soft);
}

.reference-chip,
.saved-word-button,
.review-link {
  padding: 0;
  color: var(--rust);
  background: transparent;
  border: 0;
  font-weight: 800;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.saved-list + h2 {
  margin-top: 1.5rem;
}

.saved-word-list {
  display: grid;
  gap: 0.5rem;
}

.saved-word-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
}

.saved-word-item small {
  color: var(--ink-soft);
  font-size: 0.7rem;
}

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

.review-card:first-child {
  grid-column: 1 / -1;
}

.review-row,
.review-note {
  display: grid;
  gap: 0.3rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}

.review-row:last-child,
.review-note:last-child {
  border-bottom: 0;
}

.review-row small,
.review-note small {
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.user-create-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(150px, 0.55fr) auto;
  align-items: end;
  gap: 0.85rem;
  padding: 1rem;
  background: var(--olive-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
}

.new-user-result {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--rust-soft);
  border: 1px solid rgba(166, 83, 50, 0.28);
  border-radius: var(--radius-medium);
}

.new-user-result p {
  margin: 0.35rem 0 0.75rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.5;
}

.access-code-row {
  display: flex;
  gap: var(--control-gap);
}

.access-code-row input {
  min-width: 0;
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.user-list {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.user-card {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(260px, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
}

.user-card-identity,
.user-card-details {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.user-card-actions,
.user-edit-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--control-gap);
}

.current-user-label {
  font-weight: 800;
}

.user-edit-form {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 0.45fr) auto;
  align-items: end;
  gap: 0.75rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.user-card small,
.user-password-state {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.user-role-badge {
  padding: 0.28rem 0.5rem;
  color: var(--forest-deep);
  background: var(--olive-soft);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
}

.site-footer {
  width: min(calc(100% - 2.5rem), var(--content-width));
  margin: 0 auto 2rem;
  color: var(--ink-soft);
  font-size: 0.73rem;
  line-height: 1.5;
  text-align: center;
}

.footer-status {
  margin-top: 0.85rem;
  padding-inline: 0.75rem;
  color: white;
  background: var(--forest-deep);
  border-radius: var(--radius-small);
}

.site-footer .status-inner {
  width: 100%;
  justify-content: center;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 1rem;
  bottom: 1rem;
  width: min(calc(100% - 2rem), 420px);
  padding: 0.9rem 1rem;
  color: white;
  background: var(--danger);
  border-radius: var(--radius-medium);
  box-shadow: 0 12px 30px rgba(60, 20, 17, 0.25);
  font-size: 0.85rem;
}

.toast.is-success {
  background: var(--success);
}

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

[hidden] {
  display: none !important;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

@media (max-width: 980px) {
  .study-grid {
    grid-template-columns: 1fr;
  }

  .reference-card {
    position: static;
    max-height: none;
    min-height: 300px;
  }

  .passage-controls {
    grid-template-columns: 1.5fr 0.8fr 0.7fr 0.7fr;
  }

  .passage-controls .primary-button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .header-inner,
  .status-inner,
  .collection-inner,
  .study-session-inner,
  .app-shell,
  .site-footer {
    width: min(calc(100% - 1.25rem), var(--content-width));
  }

  .view-help-toolbar {
    margin-bottom: 0.5rem;
  }

  .help-dialog {
    width: calc(100% - 1rem);
    max-height: calc(100dvh - 1rem);
  }

  .help-dialog-shell {
    max-height: calc(100dvh - 1rem);
    padding: 1rem;
  }

  .help-list {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .help-list dd:not(:last-child) {
    margin-bottom: 0.6rem;
  }

  .header-inner {
    min-height: 76px;
    gap: 0.6rem;
  }

  .brand {
    min-width: 0;
    flex: 1 1 auto;
    gap: 0.55rem;
  }

  .brand > span:last-child {
    min-width: 0;
  }

  .brand strong {
    overflow: hidden;
    font-size: 1.25rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand-mark,
  .header-actions {
    flex: 0 0 auto;
  }

  .scope-note {
    display: none;
  }

  .header-actions {
    gap: 0.6rem;
  }

  .header-menu-button {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 9px;
    font-size: 1.15rem;
  }

  .account-menu-button {
    min-height: 44px;
    max-width: 118px;
  }

  .account-popover {
    position: fixed;
    top: 68px;
    right: 0.625rem;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .brand small {
    display: none;
  }

  .status-inner {
    gap: 0.4rem 0.85rem;
  }

  .study-session-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.4rem;
    padding-block: 0.55rem;
  }

  .study-session-label,
  .active-study-summary {
    display: none;
  }

  .study-session-inner .active-study-field select,
  .session-button {
    min-height: 44px;
  }

  .main-navigation {
    position: fixed;
    z-index: 90;
    inset: 0 auto 0 0;
    width: min(82vw, 320px);
    overflow-y: auto;
    background: var(--forest-deep);
    border: 0;
    box-shadow: 14px 0 36px rgba(7, 20, 16, 0.32);
    transform: translateX(-110%);
    transition: transform 180ms ease;
  }

  .main-navigation.is-open {
    transform: translateX(0);
  }

  .mobile-navigation-heading {
    display: flex;
  }

  .main-navigation-inner {
    display: flex;
    width: 100%;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0 0.65rem 1rem;
  }

  .main-nav-button {
    width: 100%;
    min-height: 48px;
    padding: 0.7rem 0.85rem;
    border-bottom: 0;
    border-left: 3px solid transparent;
    border-radius: 7px;
    font-size: 0.82rem;
    text-align: left;
  }

  .main-nav-button:hover,
  .main-nav-button.is-active {
    background: rgba(255, 255, 255, 0.1);
    border-bottom-color: transparent;
    border-left-color: #e7ddc3;
  }

  .navigation-backdrop:not([hidden]) {
    position: fixed;
    z-index: 80;
    inset: 0;
    display: block;
    background: rgba(7, 20, 16, 0.55);
  }

  body.mobile-navigation-open {
    overflow: hidden;
  }

  .app-shell {
    margin-top: 0.75rem;
    gap: 0.75rem;
  }

  .user-create-form {
    grid-template-columns: 1fr;
  }

  .user-card,
  .user-edit-form {
    grid-template-columns: 1fr;
  }

  .user-card-identity,
  .user-card-details {
    align-items: flex-start;
    flex-direction: column;
  }

  .user-card-actions,
  .user-edit-actions {
    justify-content: flex-start;
  }

  .access-code-row {
    flex-direction: column;
  }

  .reader-card,
  .reference-card,
  .concordance-card,
  .bible-search-card,
  .workspace-page {
    border-radius: 16px;
  }

  .reader-heading,
  .reference-card,
  .concordance-card,
  .bible-search-card,
  .workspace-page {
    padding: 1.1rem;
  }

  .reader-heading {
    padding-bottom: 0.85rem;
  }

  .button-label {
    display: none;
  }

  .icon-button {
    min-width: 40px;
  }

  .passage-controls {
    grid-template-columns: 1.45fr 0.75fr;
    padding: 0 1.1rem 1.1rem;
  }

  .passage-search-panel {
    margin-inline: 1.1rem;
  }

  .passage-search-panel > div:first-child,
  .passage-search-status {
    align-items: stretch;
    flex-direction: column;
  }

  .passage-search-form,
  .bible-search-form {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .passage-search-form .secondary-button,
  .bible-search-form .primary-button,
  .bible-search-form .secondary-button {
    min-height: 44px;
  }

  .passage-search-navigation {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reading-history {
    margin: 0 1.1rem 0.8rem;
  }

  .reading-history-status {
    display: none;
  }

  .reading-history-buttons {
    margin-left: auto;
  }

  .history-button {
    min-height: 44px;
  }

  .study-context-bar,
  .path-lesson-bar,
  .followed-reference-bar,
  .verse-selection-bar {
    margin: 0 1.1rem 0.8rem;
  }

  .study-context-bar {
    align-items: stretch;
  }

  .study-context-bar .secondary-button {
    min-height: 44px;
  }

  .path-lesson-bar {
    grid-template-columns: minmax(0, 1fr);
    align-items: flex-start;
  }

  .followed-reference-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .verse-selection-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .verse-selection-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .verse-selection-actions .text-button {
    min-height: 40px;
    grid-column: 1 / -1;
  }

  .followed-reference-bar .secondary-button {
    min-height: 44px;
  }

  .path-lesson-actions {
    width: 100%;
  }

  .path-lesson-actions .text-button {
    min-height: 44px;
  }

  .path-resource-button {
    min-height: 44px;
  }

  .path-lesson-actions .secondary-button {
    min-height: 44px;
  }

  .field-verse {
    grid-row: 2;
  }

  .passage-controls .primary-button {
    grid-row: 3;
  }

  .passage-list {
    padding: 0.65rem 0.85rem 1.2rem;
  }

  .verse-row {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 0.5rem;
    padding-inline: 0.25rem;
  }

  .verse-number {
    width: 30px;
    height: 30px;
  }

  .verse-actions {
    width: 68px;
  }

  .verse-select-button,
  .verse-bookmark-button {
    min-height: 44px;
    padding-inline: 0.35rem;
    font-size: 0.64rem;
  }

  .scripture-bookmark-card {
    align-items: stretch;
    flex-direction: column;
  }

  .concordance-heading {
    display: grid;
  }

  .search-form {
    width: 100%;
  }

  .search-summary-row {
    align-items: stretch;
    flex-direction: column;
  }

  .concordance-results {
    grid-template-columns: 1fr;
  }

  .bible-search-heading {
    display: grid;
  }

  .bible-search-chapter-results {
    grid-template-columns: 1fr;
  }

  .page-heading,
  .workspace-heading,
  .path-detail-heading,
  .saved-item-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-heading-actions {
    width: 100%;
  }

  .workspace-heading-actions .secondary-button {
    min-height: 44px;
    flex: 1;
  }

  .study-card-list,
  .path-list,
  .discovery-result-list,
  .review-grid {
    grid-template-columns: 1fr;
  }

  .discovery-controls,
  .study-discovery-controls {
    grid-template-columns: 1fr;
  }

  .discovery-controls .field,
  .discovery-clear {
    width: 100%;
  }

  .data-management-body {
    grid-template-columns: 1fr;
  }

  .restore-panel {
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .restore-count-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.15rem;
  }

  .restore-count-row span {
    text-align: left;
  }

  .review-card:first-child {
    grid-column: auto;
  }

  .card-actions .compact-button,
  .inline-actions .compact-button,
  .danger-button.compact-button {
    min-height: 44px;
  }

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

  .note-form {
    grid-template-columns: 1fr;
  }

  .note-word-controls {
    grid-template-columns: 1fr 1fr;
    row-gap: 0.75rem;
  }

  .note-word-controls .field {
    grid-column: 1 / -1;
    margin-bottom: 0.35rem;
  }

  #clearNoteWordResearch {
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: 0.65rem;
  }

  .note-body-field {
    grid-column: auto;
    grid-row: auto;
  }

  .path-lesson-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .path-lesson-row .inline-actions {
    width: 100%;
  }

  .path-lesson-row .compact-button {
    flex: 1;
  }

  .saved-word-item {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .saved-word-item small {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 390px) {
  .note-word-controls {
    grid-template-columns: 1fr;
  }

  .note-word-controls .field {
    grid-column: auto;
  }
  .login-form {
    grid-template-columns: 1fr;
  }

  .status-item {
    font-size: 0.68rem;
  }

  .pagination {
    gap: 0.6rem;
  }

  .secondary-button {
    padding-inline: 0.55rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
