* { box-sizing: border-box; margin: 0; padding: 0; }

:root,
:root[data-theme="classic"][data-mode="light"] {
  color-scheme: light;
  --page-bg: #ffffff;
  --text-color: #212529;
  --header-bg: #ffffff;
  --header-text: #007bff;
  --header-border: rgba(59,153,224,0.2);
  --header-shadow: rgba(59,153,224,0.14);
  --button-bg: rgba(0,123,255,0.08);
  --button-hover-bg: rgba(0,123,255,0.16);
  --button-primary-bg: #007bff;
  --button-primary-hover-bg: #0069d9;
  --button-primary-text: #ffffff;
  --chip-bg: #eef7ff;
  --chip-text: #0f4c81;
  --subheader-bg: #f8fbff;
  --position-text: #3b99e0;
  --pane-border: #d6e9f8;
  --surface-border: #e4f0fa;
  --control-muted: #5d7891;
  --control-active-bg: #007bff;
  --control-active-text: #ffffff;
  --reader-accent: #007bff;
  --verse-ref: #3b99e0;
  --split-hover-bg: rgba(0,123,255,0.05);
  --loader-pill-bg: rgba(255,255,255,0.96);
  --loader-pill-shadow: rgba(59,153,224,0.14);
  --error-text: #b42318;
  --popup-bg: #ffffff;
  --popup-border: rgba(59,153,224,0.28);
  --popup-shadow: rgba(59,153,224,0.2);
  --modal-backdrop: rgba(15,76,129,0.28);
  --modal-bg: #ffffff;
  --modal-text: #212529;
  --modal-muted: #526a7f;
  --modal-hover-bg: #eef7ff;
  --input-bg: #ffffff;
  --focus-ring: rgba(0,123,255,0.22);
  --focus-border: #007bff;
  --danger-bg: #fff0f0;
  --danger-border: #e3a5a5;
  --danger-text: #8b1e1e;
  --accent-bg: #007bff;
  --accent-hover-bg: #0069d9;
  --accent-text: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-mode]) {
    color-scheme: dark;
    --page-bg: #071522;
    --text-color: #e7f1fb;
    --header-bg: #0b1f33;
    --header-text: #67b7ff;
    --header-border: #1d4f78;
    --header-shadow: rgba(0,0,0,0.45);
    --button-bg: rgba(103,183,255,0.12);
    --button-hover-bg: rgba(103,183,255,0.22);
    --button-primary-bg: #2f9bff;
    --button-primary-hover-bg: #67b7ff;
    --button-primary-text: #04111f;
    --chip-bg: rgba(103,183,255,0.12);
    --chip-text: #d7ecff;
    --subheader-bg: #0f2740;
    --position-text: #8bc8ff;
    --pane-border: #183a58;
    --surface-border: #1d4f78;
    --control-muted: #9cb7cc;
    --control-active-bg: #2f9bff;
    --control-active-text: #04111f;
    --reader-accent: #67b7ff;
    --verse-ref: #8bc8ff;
    --split-hover-bg: rgba(103,183,255,0.07);
    --loader-pill-bg: rgba(7,21,34,0.94);
    --loader-pill-shadow: rgba(0,0,0,0.34);
    --error-text: #ffb4ab;
    --popup-bg: #0b1f33;
    --popup-border: #1d4f78;
    --popup-shadow: rgba(0,0,0,0.52);
    --modal-backdrop: rgba(2,8,15,0.72);
    --modal-bg: #0f2740;
    --modal-text: #e7f1fb;
    --modal-muted: #b8d4ea;
    --modal-hover-bg: #173b5d;
    --input-bg: #071522;
    --focus-ring: rgba(103,183,255,0.28);
    --focus-border: #67b7ff;
    --danger-bg: #3a1717;
    --danger-border: #8f3f3f;
    --danger-text: #ffc4c4;
    --accent-bg: #2f9bff;
    --accent-hover-bg: #67b7ff;
    --accent-text: #04111f;
  }
}

:root[data-theme="classic"][data-mode="dark"] {
  color-scheme: dark;
  --page-bg: #071522;
  --text-color: #e7f1fb;
  --header-bg: #0b1f33;
  --header-text: #67b7ff;
  --header-border: #1d4f78;
  --header-shadow: rgba(0,0,0,0.45);
  --button-bg: rgba(103,183,255,0.12);
  --button-hover-bg: rgba(103,183,255,0.22);
  --button-primary-bg: #2f9bff;
  --button-primary-hover-bg: #67b7ff;
  --button-primary-text: #04111f;
  --chip-bg: rgba(103,183,255,0.12);
  --chip-text: #d7ecff;
  --subheader-bg: #0f2740;
  --position-text: #8bc8ff;
  --pane-border: #183a58;
  --surface-border: #1d4f78;
  --control-muted: #9cb7cc;
  --control-active-bg: #2f9bff;
  --control-active-text: #04111f;
  --reader-accent: #67b7ff;
  --verse-ref: #8bc8ff;
  --split-hover-bg: rgba(103,183,255,0.07);
  --loader-pill-bg: rgba(7,21,34,0.94);
  --loader-pill-shadow: rgba(0,0,0,0.34);
  --error-text: #ffb4ab;
  --popup-bg: #0b1f33;
  --popup-border: #1d4f78;
  --popup-shadow: rgba(0,0,0,0.52);
  --modal-backdrop: rgba(2,8,15,0.72);
  --modal-bg: #0f2740;
  --modal-text: #e7f1fb;
  --modal-muted: #b8d4ea;
  --modal-hover-bg: #173b5d;
  --input-bg: #071522;
  --focus-ring: rgba(103,183,255,0.28);
  --focus-border: #67b7ff;
  --danger-bg: #3a1717;
  --danger-border: #8f3f3f;
  --danger-text: #ffc4c4;
  --accent-bg: #2f9bff;
  --accent-hover-bg: #67b7ff;
  --accent-text: #04111f;
}

:root[data-theme="parchment"][data-mode="light"] {
  color-scheme: light;
  --page-bg: #f7f2e9;
  --text-color: #2c1a0e;
  --header-bg: #1c0f00;
  --header-text: #d4a054;
  --header-border: #5a3a10;
  --header-shadow: rgba(0,0,0,0.4);
  --button-bg: rgba(212,160,84,0.15);
  --button-hover-bg: rgba(212,160,84,0.3);
  --button-primary-bg: #d4a054;
  --button-primary-hover-bg: #e0b36c;
  --button-primary-text: #1c0f00;
  --chip-bg: rgba(247,228,195,0.08);
  --chip-text: #f7e4c3;
  --subheader-bg: #2a1500;
  --position-text: #c8922a;
  --pane-border: #c8a878;
  --surface-border: #e0d0b8;
  --control-muted: #8a6030;
  --control-active-bg: #d4a054;
  --control-active-text: #1c0f00;
  --reader-accent: #8a4000;
  --verse-ref: #b8860b;
  --split-hover-bg: rgba(180,130,60,0.06);
  --loader-pill-bg: rgba(247,242,233,0.94);
  --loader-pill-shadow: rgba(44,26,14,0.12);
  --error-text: #9f1d1d;
  --popup-bg: #1c0f00;
  --popup-border: #5a3a10;
  --popup-shadow: rgba(0,0,0,0.5);
  --modal-backdrop: rgba(28,15,0,0.58);
  --modal-bg: #fffaf2;
  --modal-text: #2c1a0e;
  --modal-muted: #5f4526;
  --modal-hover-bg: #f1e2ca;
  --input-bg: #ffffff;
  --focus-ring: rgba(31,111,104,0.28);
  --focus-border: #1f6f68;
  --danger-bg: #fff0f0;
  --danger-border: #e3a5a5;
  --danger-text: #8b1e1e;
  --accent-bg: #1f6f68;
  --accent-hover-bg: #185a54;
  --accent-text: #fffaf2;
}

:root[data-theme="parchment"][data-mode="dark"] {
  color-scheme: dark;
  --page-bg: #16110b;
  --text-color: #f2dfc0;
  --header-bg: #0d0905;
  --header-text: #ddb56f;
  --header-border: #6f512a;
  --header-shadow: rgba(0,0,0,0.58);
  --button-bg: rgba(221,181,111,0.13);
  --button-hover-bg: rgba(221,181,111,0.24);
  --button-primary-bg: #ddb56f;
  --button-primary-hover-bg: #ecc887;
  --button-primary-text: #120c06;
  --chip-bg: rgba(246,222,184,0.1);
  --chip-text: #f7e4c3;
  --subheader-bg: #130d07;
  --position-text: #d0a15a;
  --pane-border: #49351f;
  --surface-border: #4d3820;
  --control-muted: #a98655;
  --control-active-bg: #ddb56f;
  --control-active-text: #120c06;
  --reader-accent: #e0a85b;
  --verse-ref: #d6a34d;
  --split-hover-bg: rgba(221,181,111,0.08);
  --loader-pill-bg: rgba(22,17,11,0.94);
  --loader-pill-shadow: rgba(0,0,0,0.36);
  --error-text: #ff9b9b;
  --popup-bg: #0d0905;
  --popup-border: #6f512a;
  --popup-shadow: rgba(0,0,0,0.62);
  --modal-backdrop: rgba(5,3,2,0.72);
  --modal-bg: #21170e;
  --modal-text: #f2dfc0;
  --modal-muted: #d2b27f;
  --modal-hover-bg: #332515;
  --input-bg: #130d07;
  --focus-ring: rgba(72,178,166,0.28);
  --focus-border: #48b2a6;
  --danger-bg: #3a1717;
  --danger-border: #8f3f3f;
  --danger-text: #ffc4c4;
  --accent-bg: #2f8f84;
  --accent-hover-bg: #3aa99d;
  --accent-text: #fffaf2;
}

body { background: var(--page-bg); font-family: 'Georgia','Times New Roman',serif; color: var(--text-color); height: 100vh; overflow: hidden; }

#app { display: flex; flex-direction: column; height: 100vh; }

.global-header {
  background: var(--header-bg); color: var(--header-text);
  padding: 0.48rem 0.75rem;
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0.8rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px var(--header-shadow); z-index: 10;
}
.global-brand {
  min-width: 0; display: inline-flex; align-items: center;
  padding-right: 0.75rem; border-right: 1px solid var(--header-border);
}
.global-title {
  letter-spacing: 0.18em; font-size: 0.86rem; text-transform: uppercase;
  min-width: 0; white-space: nowrap; font-weight: 850;
}
.mobile-nav-toggle {
  display: none;
  width: 2rem; height: 2rem;
  border: 1px solid var(--header-border); border-radius: 6px;
  background: color-mix(in srgb, var(--button-bg) 70%, transparent);
  color: var(--header-text); cursor: pointer;
  padding: 0; flex-shrink: 0;
}
.mobile-nav-toggle:hover,
.mobile-nav-toggle:focus-visible,
.mobile-nav-toggle.active {
  background: var(--button-hover-bg); outline: none;
}
.mobile-nav-icon {
  position: relative; display: block;
  width: 0.92rem; height: 2px; margin: 0 auto;
  border-radius: 999px; background: currentColor;
  transition: background 0.14s ease;
}
.mobile-nav-icon::before,
.mobile-nav-icon::after {
  content: ''; position: absolute; left: 0;
  width: 0.92rem; height: 2px; border-radius: 999px;
  background: currentColor; transition: transform 0.14s ease, top 0.14s ease;
}
.mobile-nav-icon::before { top: -0.34rem; }
.mobile-nav-icon::after { top: 0.34rem; }
.mobile-nav-toggle.active .mobile-nav-icon { background: transparent; }
.mobile-nav-toggle.active .mobile-nav-icon::before {
  top: 0; transform: rotate(45deg);
}
.mobile-nav-toggle.active .mobile-nav-icon::after {
  top: 0; transform: rotate(-45deg);
}
.header-actions {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 0.42rem; min-width: 0; flex-wrap: wrap;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.header-group {
  display: inline-flex; align-items: center; gap: 0.32rem; min-width: 0;
  padding: 0.12rem;
  border: 1px solid color-mix(in srgb, var(--header-border) 58%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--button-bg) 58%, transparent);
  opacity: 0.18;
  transition: opacity 0.16s ease;
}
.header-theme-group,
.header-social-group,
.header-reader-group,
.header-account-group { flex-shrink: 0; }
.global-header:hover .header-group,
.global-header:focus-within .header-group {
  opacity: 1;
}
.header-account-group {
  opacity: 1;
}
.header-account-group .login-btn,
.header-account-group .account-link {
  opacity: 0;
  pointer-events: none;
}
.header-account-group .account-link {
  max-width: 0;
  padding-left: 0;
  padding-right: 0;
  border-width: 0;
}
.header-account-group:hover .login-btn,
.header-account-group:focus-within .login-btn,
.header-account-group:hover .account-link,
.header-account-group:focus-within .account-link {
  opacity: 1;
  pointer-events: auto;
}
.header-account-group:hover .account-link,
.header-account-group:focus-within .account-link {
  max-width: 5rem;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
  border-width: 1px;
}
.add-pane-btn,
.login-btn,
.search-toggle-btn,
.friends-toggle-btn {
  background: transparent; border: 1px solid transparent;
  color: var(--header-text); padding: 0.3rem 0.62rem; cursor: pointer;
  border-radius: 4px; font-size: 0.76rem;
  opacity: 0.52;
  transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.add-pane-btn:hover,
.add-pane-btn:focus-visible,
.login-btn:hover,
.login-btn:focus-visible,
.search-toggle-btn:hover,
.search-toggle-btn:focus-visible,
.search-toggle-btn.active,
.friends-toggle-btn:hover,
.friends-toggle-btn:focus-visible,
.friends-toggle-btn.active {
  background: var(--button-hover-bg); opacity: 1;
}
.login-btn {
  background: var(--button-primary-bg); color: var(--button-primary-text); border-color: var(--button-primary-bg);
  font-weight: 700;
}
.login-btn:hover { background: var(--button-primary-hover-bg); }
.account-chip {
  display: flex; align-items: center; gap: 0.45rem; min-width: 0;
  max-width: min(42vw, 17rem);
  border: 0; border-radius: 999px;
  background: transparent; color: var(--chip-text);
  padding: 0.08rem 0.08rem 0.08rem 0.45rem;
  font-size: 0.76rem;
}
.account-name {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.account-profile-link {
  color: inherit; text-decoration: none;
}
.account-profile-link:hover { text-decoration: underline; }
.account-link {
  flex-shrink: 0; border: 1px solid transparent;
  background: transparent; color: var(--header-text);
  border-radius: 999px; padding: 0.16rem 0.45rem;
  font-size: 0.7rem; cursor: pointer; opacity: 0.52;
  max-width: 5rem; overflow: hidden; white-space: nowrap;
  transition: background 0.15s, opacity 0.15s, max-width 0.16s ease, padding 0.16s ease, border-width 0.16s ease;
}
.account-link:hover,
.account-link:focus-visible { background: var(--button-hover-bg); opacity: 1; }
.reader-link,
.features-brand {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 1.75rem; border: 1px solid transparent;
  border-radius: 4px; background: transparent; color: var(--header-text);
  padding: 0.28rem 0.65rem; font-size: 0.76rem; font-weight: 700;
  text-decoration: none; line-height: 1.1; white-space: nowrap;
  font-family: inherit; cursor: pointer; opacity: 0.52;
  transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
}
.reader-link:hover,
.reader-link:focus-visible,
.reader-link.active,
.features-brand:hover,
.features-brand:focus-visible { background: var(--button-hover-bg); opacity: 1; }
.icon-reader-link {
  width: 1.85rem; min-width: 1.85rem; padding-inline: 0;
  font-size: 0.86rem; line-height: 1;
}
.page-fullscreen-btn.active {
  background: var(--control-active-bg); color: var(--control-active-text);
}
.reader-link-primary {
  background: var(--button-primary-bg); border-color: var(--button-primary-bg);
  color: var(--button-primary-text);
}
.reader-link-primary:hover { background: var(--button-primary-hover-bg); }

.layer-menu {
  position: relative; flex-shrink: 0;
}
.layer-dropdown {
  position: absolute; right: 0; top: calc(100% + 0.35rem); z-index: 82;
  width: min(15rem, 84vw); overflow: hidden;
  border: 1px solid var(--header-border); border-radius: 6px;
  background: var(--popup-bg); color: var(--text-color);
  box-shadow: 0 8px 24px var(--popup-shadow);
}
.layer-dropdown-section + .layer-dropdown-section {
  border-top: 1px solid var(--surface-border);
}
.layer-dropdown-title {
  padding: 0.52rem 0.65rem 0.28rem;
  color: var(--control-muted); font-size: 0.68rem; font-weight: 850; text-transform: uppercase;
}
.layer-dropdown-item {
  width: 100%; min-height: 2.1rem; border: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 0.7rem;
  background: transparent; color: inherit; padding: 0.42rem 0.65rem;
  cursor: pointer; font: inherit; font-size: 0.76rem; text-align: left;
}
.layer-dropdown-item:hover,
.layer-dropdown-item.active { background: var(--button-bg); color: var(--header-text); }
.layer-dropdown-item span:last-child {
  flex-shrink: 0; color: var(--control-muted); font-size: 0.66rem; font-weight: 800;
}
.layer-dropdown-item.active span:last-child { color: var(--header-text); }

.tool-menu {
  position: relative; flex-shrink: 0;
}
.friends-menu {
  position: relative; flex-shrink: 0;
}
.friends-dropdown {
  position: absolute; right: 0; top: calc(100% + 0.35rem); z-index: 85;
  width: min(18rem, 88vw); max-height: min(26rem, 78vh); overflow: auto;
  border: 1px solid var(--header-border); border-radius: 6px;
  background: var(--popup-bg); color: var(--text-color);
  box-shadow: 0 8px 24px var(--popup-shadow);
  padding: 0.55rem;
}
.friends-search-input {
  width: 100%; min-height: 2rem; border: 1px solid var(--pane-border);
  border-radius: 4px; background: var(--input-bg); color: var(--text-color);
  padding: 0.35rem 0.45rem; font: inherit; font-size: 0.76rem;
}
.friend-row {
  width: 100%; min-height: 2.1rem; border: 0; border-bottom: 1px solid var(--surface-border);
  display: flex; align-items: center; justify-content: space-between; gap: 0.7rem;
  background: transparent; color: inherit; padding: 0.42rem 0.15rem;
  cursor: pointer; font: inherit; font-size: 0.76rem; text-align: left;
}
.friend-row:hover { background: var(--button-bg); color: var(--header-text); }
.friend-row:disabled { cursor: default; opacity: 0.65; }
.friend-row-static {
  cursor: default; display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
}
.friend-row-static:hover { background: transparent; color: inherit; }
.friend-row span:last-child {
  flex-shrink: 0; color: var(--control-muted); font-size: 0.66rem; font-weight: 750;
}
.friend-profile-link {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: inherit; text-decoration: none; font-weight: 750;
}
.friend-profile-link:hover { text-decoration: underline; }
.friend-action {
  flex-shrink: 0; border: 1px solid var(--pane-border); border-radius: 4px;
  background: var(--button-bg); color: var(--header-text);
  padding: 0.22rem 0.45rem; cursor: pointer;
  font: inherit; font-size: 0.66rem; font-weight: 800;
}
.friend-action:hover { background: var(--button-hover-bg); }
.friend-action:disabled { opacity: 0.6; cursor: wait; }
.friend-highlight-toggle {
  min-width: 4.25rem; border-color: var(--surface-border);
  color: var(--control-muted);
}
.friend-highlight-toggle.active {
  border-color: var(--accent-bg); background: var(--button-bg); color: var(--header-text);
}
.friends-section-title {
  margin-top: 0.7rem; padding-top: 0.55rem; border-top: 1px solid var(--surface-border);
  color: var(--control-muted); font-size: 0.68rem; font-weight: 800; text-transform: uppercase;
}
.friends-message {
  padding: 0.55rem 0.1rem; color: var(--control-muted);
  font-size: 0.74rem; line-height: 1.35;
}
.friends-message.error { color: var(--error-text); }
.tool-dropdown {
  position: absolute; right: 0; top: calc(100% + 0.35rem); z-index: 80;
  width: min(13rem, 82vw); overflow: hidden;
  border: 1px solid var(--header-border); border-radius: 6px;
  background: var(--popup-bg); color: var(--text-color);
  box-shadow: 0 8px 24px var(--popup-shadow);
}
.tool-dropdown-item {
  width: 100%; min-height: 2.25rem; border: 0; border-bottom: 1px solid var(--surface-border);
  display: flex; align-items: center; justify-content: space-between; gap: 0.7rem;
  background: transparent; color: inherit; padding: 0.45rem 0.6rem;
  cursor: pointer; font: inherit; font-size: 0.76rem; text-align: left;
}
.tool-dropdown-item:last-child { border-bottom: 0; }
.tool-dropdown-item:hover,
.tool-dropdown-item.active { background: var(--button-bg); color: var(--header-text); }
.tool-dropdown-state {
  flex-shrink: 0; color: var(--control-muted); font-size: 0.66rem; font-weight: 750;
}

.theme-picker {
  display: flex; align-items: center; gap: 0.28rem; min-width: 0;
}
.theme-select {
  min-height: 1.75rem; max-width: 7rem;
  border: 1px solid var(--header-border); border-radius: 4px;
  background: var(--button-bg); color: var(--header-text);
  padding: 0.2rem 0.35rem; font: inherit; font-size: 0.74rem;
  opacity: 0.56; transition: opacity 0.15s, background 0.15s;
}
.theme-select:disabled { opacity: 0.72; cursor: default; }
.theme-select:hover,
.theme-select:focus { opacity: 1; }
.theme-select:focus {
  outline: 2px solid var(--button-hover-bg);
  outline-offset: 1px;
}
.theme-select-mode { max-width: 5.8rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.panes-container { position: relative; display: flex; flex: 1; overflow: hidden; min-height: 0; }

.profile-page {
  min-height: 100vh; background: var(--page-bg); color: var(--text-color);
  padding: clamp(1rem, 3vw, 2rem); overflow: auto;
}
.profile-header {
  max-width: 1120px; margin: 0 auto 1rem;
  display: grid; gap: 1rem;
}
.profile-back {
  width: fit-content; min-height: 1.75rem; display: inline-flex; align-items: center;
  border: 1px solid var(--header-border); border-radius: 4px;
  background: var(--button-bg); color: var(--header-text);
  padding: 0.28rem 0.65rem; font-size: 0.76rem; font-weight: 750;
  text-decoration: none;
}
.profile-back:hover { background: var(--button-hover-bg); }
.profile-identity {
  display: flex; align-items: center; gap: 1rem; min-width: 0;
}
.profile-avatar {
  width: clamp(3.25rem, 8vw, 5rem); aspect-ratio: 1; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--reader-accent); color: var(--accent-text);
  font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 900;
}
.profile-heading { min-width: 0; }
.profile-heading h1 {
  margin: 0; color: var(--header-text);
  font-size: clamp(2rem, 5vw, 4rem); line-height: 0.95; letter-spacing: 0;
}
.profile-heading p {
  margin: 0.35rem 0 0; color: var(--control-muted);
  font-size: clamp(0.95rem, 2vw, 1.2rem); font-weight: 750;
}
.profile-description {
  max-width: 52rem; margin: 0; color: var(--text-color);
  line-height: 1.55; font-size: 0.96rem;
}
.profile-edit-band {
  max-width: 1120px; margin: 0 auto 1rem;
  display: grid; grid-template-columns: minmax(12rem, 1fr) minmax(16rem, 2fr) auto auto;
  gap: 0.7rem; align-items: end;
  border: 1px solid var(--pane-border); border-radius: 8px;
  background: var(--subheader-bg); padding: 0.8rem;
}
.profile-edit-field { display: grid; gap: 0.25rem; min-width: 0; }
.profile-edit-field span {
  color: var(--control-muted); font-size: 0.7rem; font-weight: 850; text-transform: uppercase;
}
.profile-edit-field input,
.profile-edit-field textarea {
  width: 100%; min-width: 0; border: 1px solid var(--pane-border); border-radius: 4px;
  background: var(--input-bg); color: var(--text-color);
  padding: 0.42rem 0.5rem; font: inherit; font-size: 0.82rem;
}
.profile-edit-field textarea { resize: vertical; line-height: 1.45; }
.profile-save-btn {
  min-height: 2rem; border: 0; border-radius: 4px;
  background: var(--accent-bg); color: var(--accent-text);
  padding: 0.42rem 0.75rem; cursor: pointer; font: inherit; font-size: 0.76rem; font-weight: 850;
}
.profile-save-message {
  color: var(--control-muted); font-size: 0.72rem; font-weight: 750;
}
.profile-status {
  max-width: 1120px; margin: 1rem auto; padding: 1rem;
  border: 1px solid var(--pane-border); border-radius: 8px;
  background: var(--subheader-bg); color: var(--control-muted); text-align: center;
}
.profile-status-error { color: var(--error-text); }
.profile-stats-grid {
  max-width: 1120px; margin: 0 auto 1rem;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem;
}
.profile-stat {
  min-width: 0; border: 1px solid var(--pane-border); border-radius: 8px;
  background: var(--subheader-bg); padding: 0.85rem;
}
.profile-stat span {
  display: block; color: var(--control-muted); font-size: 0.7rem; font-weight: 850; text-transform: uppercase;
}
.profile-stat strong {
  display: block; margin-top: 0.28rem; color: var(--header-text);
  font-size: clamp(1.25rem, 3vw, 2rem); line-height: 1; overflow-wrap: anywhere;
}
.profile-stat em {
  display: block; margin-top: 0.15rem; color: var(--control-muted); font-size: 0.72rem; font-style: normal;
}
.profile-activity-layout {
  max-width: 1120px; margin: 0 auto 1rem;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(18rem, 0.75fr); gap: 0.75rem;
}
.profile-panel {
  min-width: 0; border: 1px solid var(--pane-border); border-radius: 8px;
  background: var(--subheader-bg); padding: 0.9rem;
}
.profile-panel-header {
  display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; margin-bottom: 0.75rem;
}
.profile-panel-header h2 {
  margin: 0; color: var(--header-text); font-size: 1rem; letter-spacing: 0;
}
.profile-panel-header span {
  color: var(--control-muted); font-size: 0.72rem; font-weight: 750; white-space: nowrap;
}
.profile-contribution-panel {
  --contribution-cell: 0.72rem;
  --contribution-gap: 0.22rem;
  --contribution-level-0: var(--button-bg);
  --contribution-level-1: color-mix(in srgb, var(--reader-accent) 22%, var(--page-bg));
  --contribution-level-2: color-mix(in srgb, var(--reader-accent) 45%, var(--page-bg));
  --contribution-level-3: color-mix(in srgb, var(--reader-accent) 72%, var(--page-bg));
  --contribution-level-4: var(--reader-accent);
  --contribution-border-1: color-mix(in srgb, var(--reader-accent) 35%, var(--surface-border));
  --contribution-border-2: color-mix(in srgb, var(--reader-accent) 58%, var(--surface-border));
  --contribution-border-3: color-mix(in srgb, var(--reader-accent) 78%, var(--surface-border));
  max-width: 1120px; margin: 0 auto 1rem;
}
.contribution-board {
  overflow-x: auto; padding-bottom: 0.15rem;
}
.contribution-months {
  display: grid;
  grid-template-columns: repeat(var(--contribution-weeks), var(--contribution-cell));
  gap: var(--contribution-gap);
  min-width: max-content;
  margin-left: 2.55rem; margin-bottom: 0.32rem;
  color: var(--control-muted); font-size: 0.74rem; font-weight: 750;
}
.contribution-months span {
  min-width: 0; overflow: visible; white-space: nowrap;
}
.contribution-body {
  display: flex; align-items: flex-start; gap: 0.55rem; min-width: max-content;
}
.contribution-weekdays {
  width: 2rem; flex: 0 0 2rem;
  display: grid; grid-template-rows: repeat(7, var(--contribution-cell));
  gap: var(--contribution-gap);
  color: var(--control-muted); font-size: 0.72rem; font-weight: 750; line-height: var(--contribution-cell);
}
.contribution-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, var(--contribution-cell));
  gap: var(--contribution-gap);
  min-width: max-content;
}
.contribution-cell {
  width: var(--contribution-cell); height: var(--contribution-cell);
  border-radius: 3px; border: 1px solid var(--surface-border);
  background: var(--contribution-level-0); flex: 0 0 var(--contribution-cell);
}
.contribution-cell.level-1 { background: var(--contribution-level-1); border-color: var(--contribution-border-1); }
.contribution-cell.level-2 { background: var(--contribution-level-2); border-color: var(--contribution-border-2); }
.contribution-cell.level-3 { background: var(--contribution-level-3); border-color: var(--contribution-border-3); }
.contribution-cell.level-4 { background: var(--contribution-level-4); border-color: var(--contribution-level-4); }
.contribution-cell.future { opacity: 0.35; }
.contribution-footer {
  display: flex; justify-content: flex-end; align-items: center; gap: 0.32rem;
  min-width: max-content; margin-top: 0.65rem;
  color: var(--control-muted); font-size: 0.76rem; font-weight: 750;
}
.book-activity-row { display: grid; gap: 0.28rem; margin-top: 0.6rem; }
.book-activity-meta {
  display: flex; justify-content: space-between; gap: 1rem;
  color: var(--text-color); font-size: 0.82rem; font-weight: 750;
}
.book-activity-bar,
.visibility-meter,
.color-strip {
  width: 100%; height: 0.6rem; overflow: hidden; border-radius: 999px;
  background: var(--button-bg);
}
.book-activity-bar span,
.visibility-meter span,
.color-strip span {
  display: block; height: 100%;
}
.book-activity-bar span { background: var(--reader-accent); }
.visibility-meter { display: flex; margin-top: 0.5rem; }
.visibility-public { background: var(--accent-bg); }
.visibility-private { background: var(--control-muted); }
.visibility-legend {
  display: flex; justify-content: space-between; gap: 1rem;
  margin: 0.45rem 0 0.8rem; color: var(--control-muted); font-size: 0.74rem; font-weight: 750;
}
.color-strip { display: flex; }
.profile-recent-panel { max-width: 1120px; margin: 0 auto; }
.profile-highlight-row {
  display: grid; grid-template-columns: 0.55rem minmax(0, 1fr); gap: 0.65rem;
  padding: 0.75rem 0; border-top: 1px solid var(--surface-border);
}
.profile-highlight-row:first-of-type { border-top: 0; }
.profile-highlight-swatch { width: 0.55rem; border-radius: 999px; }
.profile-highlight-row strong { display: block; color: var(--header-text); font-size: 0.82rem; }
.profile-highlight-row p {
  margin: 0.18rem 0; color: var(--text-color); font-size: 0.84rem; line-height: 1.45;
}
.profile-highlight-row div > span {
  color: var(--control-muted); font-size: 0.7rem; font-weight: 750; text-transform: capitalize;
}
.profile-empty {
  padding: 0.75rem 0; color: var(--control-muted); font-size: 0.82rem;
}

@media (max-width: 760px) {
  .profile-edit-band,
  .profile-stats-grid,
  .profile-activity-layout {
    grid-template-columns: 1fr;
  }
  .profile-edit-band { align-items: stretch; }
  .profile-panel-header {
    align-items: flex-start; flex-direction: column; gap: 0.25rem;
  }
  .profile-panel-header span { white-space: normal; }
  .profile-contribution-panel {
    --contribution-cell: 0.64rem;
    --contribution-gap: 0.18rem;
  }
}

.pane-shell {
  position: relative; flex: 1 1 0; min-width: 0; min-height: 0;
  display: flex; border-right: 1px solid var(--pane-border);
}
.pane-shell:last-child { border-right: none; }
.pane-shell.target-pane-shell {
  z-index: 1;
}
.pane-shell.target-locked-pane-shell {
  z-index: 1;
}
.pane-shell.target-pane-shell .pane-header { border-bottom: 2px solid var(--focus-border); }
.pane-shell.target-locked-pane-shell .pane-header { border-bottom-color: var(--reader-accent); }
.pane-shell.dragging { opacity: 0.58; }
.pane-shell.drag-over::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0;
  width: 3px; z-index: 20; background: var(--button-primary-bg);
  box-shadow: 0 0 0 1px var(--button-primary-text);
}
.pane-shell.drag-over.drop-after::before { left: auto; right: 0; }
.pane-shell.fullscreen-pane-shell {
  position: absolute; inset: 0; z-index: 700; width: 100%; min-width: 0;
  flex: none; border-right: 0; background: var(--page-bg);
  box-shadow: 0 0 0 1px var(--pane-border);
}
.bible-pane { flex: 1; width: 100%; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.pane-shell:last-child .bible-pane { border-right: none; }

.search-pane-shell {
  flex: 0 0 clamp(22rem, 30vw, 30rem); min-width: 20rem; min-height: 0;
  display: flex;
  background: var(--page-bg);
}
.passage-list-shell {
  flex-basis: clamp(17rem, 22vw, 22rem);
  min-width: 16rem;
}
.notes-pane-shell {
  flex-basis: clamp(20rem, 27vw, 28rem);
  min-width: 18rem;
}

.text-search-pane {
  flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column;
  color: var(--text-color); background: var(--page-bg);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.text-search-header {
  display: flex; align-items: center; justify-content: flex-start; gap: 0.75rem;
  padding: 0.72rem 0.85rem; border-bottom: 1px solid var(--surface-border);
  background: var(--subheader-bg); color: var(--header-text); flex-shrink: 0;
}
.text-search-title-group { flex: 1; min-width: 0; display: grid; gap: 0.15rem; }
.text-search-title-group h2 { font-size: 0.95rem; line-height: 1.1; letter-spacing: 0; color: var(--header-text); }
.text-search-title-group p { font-size: 0.72rem; color: var(--control-muted); }
.text-search-drag-handle { flex-shrink: 0; }
.text-search-header-btn,
.text-search-close {
  width: 1.9rem; height: 1.9rem; border: 1px solid var(--header-border);
  border-radius: 4px; background: var(--button-bg); color: var(--header-text);
  cursor: pointer; line-height: 1; flex-shrink: 0;
}
.text-search-header-btn {
  font-size: 0.8rem;
}
.text-search-header-btn.active {
  background: var(--control-active-bg); color: var(--control-active-text);
}
.text-search-header-btn:hover,
.text-search-close:hover { background: var(--button-hover-bg); }
.text-search-form {
  display: grid; gap: 0.65rem; padding: 0.85rem; flex-shrink: 0;
  border-bottom: 1px solid var(--surface-border); background: var(--page-bg);
}
.text-search-input-row { display: flex; gap: 0.35rem; min-width: 0; }
.text-search-input {
  width: 100%; min-width: 0; height: 2.2rem; border: 1px solid var(--surface-border);
  border-radius: 4px; background: var(--input-bg); color: var(--text-color);
  padding: 0.35rem 0.55rem; font: inherit; font-size: 0.86rem;
}
.text-search-input:focus {
  outline: 2px solid var(--focus-ring); border-color: var(--focus-border);
}
.text-search-submit,
.text-search-load-more {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.38rem;
  min-height: 2.2rem; border: 1px solid var(--button-primary-bg); border-radius: 4px;
  background: var(--button-primary-bg); color: var(--button-primary-text);
  padding: 0 0.7rem; font-size: 0.78rem; font-weight: 750; cursor: pointer;
}
.text-search-submit:hover,
.text-search-load-more:hover { background: var(--button-primary-hover-bg); }
.text-search-submit:disabled,
.text-search-load-more:disabled { opacity: 0.58; cursor: default; }
.text-search-mode {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--surface-border); border-radius: 4px; overflow: hidden;
}
.text-search-segment {
  min-height: 2rem; border: 0; border-right: 1px solid var(--surface-border);
  background: var(--input-bg); color: var(--control-muted); cursor: pointer;
  font: inherit; font-size: 0.78rem; font-weight: 700;
}
.text-search-segment:last-child { border-right: 0; }
.text-search-segment.active { background: var(--control-active-bg); color: var(--control-active-text); }
.text-search-translations { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.translation-chip {
  min-height: 1.8rem; border: 1px solid var(--surface-border); border-radius: 4px;
  background: var(--input-bg); color: var(--control-muted); cursor: pointer;
  padding: 0.22rem 0.48rem; font-size: 0.72rem; font-weight: 750;
}
.translation-chip.active {
  border-color: var(--control-active-bg); background: var(--button-bg); color: var(--header-text);
}
.text-search-presets { display: flex; gap: 0.35rem; }
.text-search-presets button {
  min-height: 1.75rem; border: 1px solid var(--surface-border); border-radius: 4px;
  background: var(--button-bg); color: var(--header-text); cursor: pointer;
  padding: 0.2rem 0.55rem; font-size: 0.72rem; font-weight: 700;
}
.text-search-presets button:hover { background: var(--button-hover-bg); }
.text-search-results {
  flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start;
}
.text-search-message {
  padding: 1.25rem 0.85rem; color: var(--control-muted); font-size: 0.82rem; line-height: 1.4;
}
.text-search-loading {
  display: flex; align-items: center; gap: 0.52rem;
}
.text-search-spinner {
  width: 0.9rem; height: 0.9rem; flex: 0 0 0.9rem;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: biblify-spin 0.72s linear infinite;
}
.text-search-error { color: var(--error-text); }
.text-search-result {
  display: grid; gap: 0.38rem; width: 100%; min-width: 0; text-align: left;
  border: 0; border-bottom: 1px solid var(--surface-border); background: transparent;
  color: var(--text-color); cursor: pointer; padding: 0.72rem 0.85rem; font: inherit;
}
.text-search-result:hover { background: var(--split-hover-bg); }
.text-search-result-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  color: var(--reader-accent); font-size: 0.78rem; font-weight: 800; line-height: 1.2;
}
.result-translation {
  flex-shrink: 0; border: 1px solid var(--surface-border); border-radius: 4px;
  color: var(--control-muted); padding: 0.1rem 0.32rem; font-size: 0.65rem;
}
.text-search-result-text { color: var(--text-color); font-family: Georgia, 'Times New Roman', serif; line-height: 1.55; }
.text-search-result-text mark,
.strongs-occurrence-text mark {
  border-radius: 2px; padding: 0 0.08rem;
}
.text-search-result-text mark.match-strong,
.strongs-occurrence-text mark.match-strong {
  background: var(--reader-accent); color: var(--accent-text);
}
.text-search-result-text mark.match-subtle,
.strongs-occurrence-text mark.match-subtle {
  background: var(--button-bg); color: var(--reader-accent);
  box-shadow: inset 0 -1px 0 var(--reader-accent);
}
.text-search-score { color: var(--control-muted); font-size: 0.68rem; font-weight: 700; }
.text-search-footer {
  padding: 0.7rem 0.85rem; border-top: 1px solid var(--surface-border);
  background: var(--subheader-bg); flex-shrink: 0;
}
.text-search-load-more { width: 100%; }

.passage-list-form { gap: 0.45rem; }
.passage-list-error {
  color: var(--error-text); font-size: 0.78rem; line-height: 1.35;
}
.passage-list-items {
  flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start;
}
.passage-list-item {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: stretch; min-width: 0; border-bottom: 1px solid var(--surface-border);
  background: transparent;
}
.passage-list-item:hover { background: var(--split-hover-bg); }
.passage-list-item.dragging { opacity: 0.58; }
.passage-list-item.drag-over::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0;
  height: 3px; z-index: 5; background: var(--button-primary-bg);
}
.passage-list-item.drag-over.drop-after::before { top: auto; bottom: 0; }
.passage-list-drag-handle,
.passage-list-remove {
  width: 2.15rem; border: 0; background: transparent; color: var(--control-muted);
  cursor: pointer; font: inherit; font-size: 0.72rem;
}
.passage-list-drag-handle { cursor: grab; }
.passage-list-drag-handle:active { cursor: grabbing; }
.passage-list-remove:hover,
.passage-list-drag-handle:hover { color: var(--header-text); background: var(--button-bg); }
.passage-list-open {
  min-width: 0; border: 0; background: transparent; color: var(--text-color);
  display: grid; gap: 0.18rem; align-content: center;
  padding: 0.68rem 0.2rem; cursor: pointer; font: inherit; text-align: left;
}
.passage-list-label {
  min-width: 0; color: var(--reader-accent); font-size: 0.86rem;
  font-weight: 800; line-height: 1.2; overflow: hidden; text-overflow: ellipsis;
}
.passage-list-subtitle {
  min-width: 0; color: var(--control-muted); font-size: 0.72rem; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis;
}

.notes-form {
  display: grid; gap: 0.65rem; padding: 0.85rem; flex-shrink: 0;
  border-bottom: 1px solid var(--surface-border); background: var(--page-bg);
}
.notes-scope-row {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--surface-border); border-radius: 4px; overflow: hidden;
}
.notes-scope-btn {
  min-width: 0; min-height: 2rem; border: 0; border-right: 1px solid var(--surface-border);
  background: var(--input-bg); color: var(--control-muted); cursor: pointer;
  font: inherit; font-size: 0.72rem; font-weight: 750; padding: 0 0.25rem;
}
.notes-scope-btn:last-child { border-right: 0; }
.notes-scope-btn.active { background: var(--control-active-bg); color: var(--control-active-text); }
.notes-scope-btn:disabled { opacity: 0.45; cursor: default; }
.notes-target {
  display: grid; gap: 0.18rem; min-width: 0;
  padding: 0.58rem 0.62rem; border: 1px solid var(--surface-border); border-radius: 4px;
  background: var(--subheader-bg);
}
.notes-target strong {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--reader-accent); font-size: 0.82rem; line-height: 1.2;
}
.notes-target span {
  color: var(--control-muted); font-size: 0.72rem; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.notes-markdown-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.22rem;
  padding: 0.32rem; border: 1px solid var(--surface-border); border-radius: 4px;
  background: var(--subheader-bg);
}
.notes-markdown-btn {
  min-width: 1.75rem; height: 1.55rem; border: 1px solid var(--surface-border); border-radius: 3px;
  background: var(--input-bg); color: var(--header-text);
  padding: 0 0.38rem; font: inherit; font-size: 0.68rem; font-weight: 850; cursor: pointer;
}
.notes-markdown-btn:hover,
.notes-markdown-btn:focus-visible {
  background: var(--button-hover-bg); outline: none; border-color: var(--focus-border);
}
.notes-markdown-btn-italic { font-style: italic; }
.notes-textarea {
  width: 100%; min-width: 0; resize: vertical; min-height: 7rem; max-height: 18rem;
  border: 1px solid var(--surface-border); border-radius: 4px;
  background: var(--input-bg); color: var(--text-color);
  padding: 0.58rem 0.62rem; font: inherit; font-size: 0.92rem; line-height: 1.5;
}
.notes-textarea:focus,
.notes-select:focus {
  outline: 2px solid var(--focus-ring); border-color: var(--focus-border);
}
.notes-markdown-preview {
  max-height: 12rem; overflow-y: auto;
  border: 1px solid var(--surface-border); border-radius: 4px;
  background: var(--input-bg); padding: 0.58rem 0.62rem;
}
.notes-controls {
  display: flex; align-items: center; justify-content: flex-end; gap: 0.45rem; min-width: 0;
}
.notes-select-label { min-width: 0; margin-right: auto; }
.notes-select {
  height: 2.2rem; min-width: 6.6rem; border: 1px solid var(--surface-border); border-radius: 4px;
  background: var(--input-bg); color: var(--text-color);
  padding: 0 0.45rem; font: inherit; font-size: 0.78rem; font-weight: 750;
}
.notes-secondary-btn,
.notes-login-btn {
  min-height: 2rem; border: 1px solid var(--surface-border); border-radius: 4px;
  background: var(--button-bg); color: var(--header-text);
  padding: 0.32rem 0.62rem; font: inherit; font-size: 0.74rem; font-weight: 750; cursor: pointer;
}
.notes-secondary-btn:hover,
.notes-login-btn:hover { background: var(--button-hover-bg); }
.notes-secondary-btn:disabled { opacity: 0.58; cursor: default; }
.notes-save-btn { min-width: 4.6rem; }
.notes-login-btn { width: 100%; min-height: 2.25rem; }
.notes-list {
  flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start;
}
.notes-item {
  display: grid; gap: 0.45rem; min-width: 0;
  padding: 0.78rem 0.85rem; border-bottom: 1px solid var(--surface-border);
  border-left: 3px solid transparent;
  background: transparent; cursor: pointer;
}
.notes-item:hover { background: var(--split-hover-bg); }
.notes-item:focus-visible {
  outline: 2px solid var(--focus-ring); outline-offset: -2px;
  background: var(--split-hover-bg);
}
.notes-item-mine { border-left-color: var(--reader-accent); }
.notes-item-friend { border-left-color: #14b8a6; }
.notes-item-heading {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.5rem;
  min-width: 0;
}
.notes-item-meta {
  display: flex; align-items: center; gap: 0.4rem; min-width: 0;
}
.notes-reference {
  min-width: 0; border: 0; background: transparent; color: var(--reader-accent);
  padding: 0; text-align: left; font: inherit; font-size: 0.82rem; font-weight: 850;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer;
}
.notes-reference:disabled { cursor: default; opacity: 0.8; }
.notes-owner-chip {
  min-width: 0; max-width: 7.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 1px solid var(--surface-border); border-radius: 999px;
  padding: 0.16rem 0.45rem; font-size: 0.66rem; line-height: 1.1; font-weight: 850;
}
.notes-owner-chip-mine {
  background: var(--button-bg); border-color: color-mix(in srgb, var(--reader-accent) 42%, var(--surface-border));
  color: var(--reader-accent);
}
.notes-owner-chip-friend {
  background: color-mix(in srgb, #14b8a6 12%, var(--page-bg)); border-color: color-mix(in srgb, #14b8a6 42%, var(--surface-border));
  color: color-mix(in srgb, #0f766e 82%, var(--text-color));
}
.notes-item-meta span {
  color: var(--control-muted); font-size: 0.68rem; font-weight: 750;
  text-transform: capitalize; white-space: nowrap;
}
.notes-item-body {
  color: var(--text-color); font-size: 0.92rem; line-height: 1.55;
  overflow-wrap: anywhere;
}
.notes-item-body.collapsed {
  max-height: 8.8rem; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent);
  mask-image: linear-gradient(to bottom, #000 72%, transparent);
}
.notes-rendered {
  color: var(--text-color); font-size: 0.92rem; line-height: 1.55;
}
.notes-rendered > * + * { margin-top: 0.48rem; }
.notes-rendered h1,
.notes-rendered h2,
.notes-rendered h3,
.notes-rendered h4,
.notes-rendered h5,
.notes-rendered h6 {
  color: var(--header-text); line-height: 1.25; font-weight: 850;
}
.notes-rendered h1 { font-size: 1.15rem; }
.notes-rendered h2 { font-size: 1.08rem; }
.notes-rendered h3,
.notes-rendered h4,
.notes-rendered h5,
.notes-rendered h6 { font-size: 1rem; }
.notes-rendered ul,
.notes-rendered ol {
  padding-left: 1.15rem;
}
.notes-rendered li + li { margin-top: 0.2rem; }
.notes-rendered blockquote {
  border-left: 3px solid var(--surface-border);
  padding-left: 0.68rem; color: var(--control-muted);
}
.notes-rendered code {
  border: 1px solid var(--surface-border); border-radius: 3px;
  background: var(--subheader-bg); color: var(--text-color);
  padding: 0.04rem 0.22rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
}
.notes-rendered pre {
  overflow-x: auto; border: 1px solid var(--surface-border); border-radius: 4px;
  background: var(--subheader-bg); padding: 0.58rem;
}
.notes-rendered pre code {
  display: block; border: 0; background: transparent; padding: 0; white-space: pre;
}
.notes-rendered a {
  color: var(--reader-accent); font-weight: 750; text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 0.16em;
}
.notes-expand-btn {
  justify-self: start; border: 0; background: transparent; color: var(--reader-accent);
  padding: 0.1rem 0; font: inherit; font-size: 0.72rem; font-weight: 850; cursor: pointer;
}
.notes-expand-btn:hover { color: var(--header-text); text-decoration: underline; }
.notes-item-actions {
  display: flex; justify-content: flex-end; gap: 0.42rem;
}
.notes-danger-btn {
  color: var(--danger-text);
}
.notes-modal-backdrop {
  position: fixed; inset: 0; z-index: 900;
  display: grid; place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: var(--modal-backdrop);
}
.notes-modal {
  width: min(54rem, 100%); max-height: min(82vh, 48rem);
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid var(--surface-border); border-radius: 8px;
  background: var(--modal-bg); color: var(--modal-text);
  box-shadow: 0 1.25rem 3rem var(--popup-shadow);
  overflow: hidden;
}
.notes-modal-header {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.9rem; align-items: start;
  padding: 1rem 1.15rem; border-bottom: 1px solid var(--surface-border);
  background: var(--subheader-bg);
}
.notes-modal-title-group {
  display: grid; gap: 0.42rem; min-width: 0;
}
.notes-modal-reference {
  font-size: 1rem;
}
.notes-modal-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem;
  color: var(--control-muted); font-size: 0.78rem; font-weight: 750;
  text-transform: capitalize;
}
.notes-modal-close {
  width: 2rem; height: 2rem; border: 1px solid var(--surface-border); border-radius: 4px;
  background: var(--button-bg); color: var(--header-text);
  font: inherit; font-size: 0.9rem; line-height: 1; cursor: pointer;
}
.notes-modal-close:hover,
.notes-modal-close:focus-visible {
  background: var(--button-hover-bg); outline: none; border-color: var(--focus-border);
}
.notes-modal-body {
  min-height: 0; overflow-y: auto;
  padding: clamp(1.1rem, 3vw, 1.8rem);
}
.notes-modal-body.notes-rendered {
  font-size: 1.06rem; line-height: 1.7;
}
.notes-modal-body.notes-rendered > * + * { margin-top: 0.72rem; }
.notes-modal-body.notes-rendered h1 { font-size: 1.55rem; }
.notes-modal-body.notes-rendered h2 { font-size: 1.36rem; }
.notes-modal-body.notes-rendered h3,
.notes-modal-body.notes-rendered h4,
.notes-modal-body.notes-rendered h5,
.notes-modal-body.notes-rendered h6 { font-size: 1.14rem; }
.notes-modal-actions {
  display: flex; justify-content: flex-end; gap: 0.45rem;
  padding: 0.82rem 1.15rem; border-top: 1px solid var(--surface-border);
  background: var(--page-bg);
}

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

.pane-header {
  background: var(--subheader-bg); color: var(--header-text);
  padding: 0.35rem 0.5rem;
  display: grid; gap: 0.32rem; flex-shrink: 0;
  position: relative;
}
.pane-location-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(7rem, 12rem);
  align-items: center; gap: 0.35rem; min-width: 0;
}
.pane-drag-handle {
  width: 1.55rem; height: 1.55rem; border: 1px solid var(--header-border);
  border-radius: 3px; background: var(--button-bg); color: var(--control-muted);
  cursor: grab; font-size: 0.72rem; line-height: 1; padding: 0;
  user-select: none;
}
.pane-drag-handle:hover { background: var(--button-hover-bg); color: var(--header-text); }
.pane-drag-handle:active { cursor: grabbing; }
.pane-position { font-size: 0.68rem; color: var(--position-text); font-style: italic; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.passage-search {
  display: flex; align-items: center; gap: 0.2rem;
  min-width: 0;
}
.passage-search-input {
  width: 100%; min-width: 0; height: 1.65rem;
  border: 1px solid var(--header-border); border-radius: 4px;
  background: var(--input-bg); color: var(--text-color);
  padding: 0.18rem 0.4rem; font: inherit; font-size: 0.72rem;
}
.passage-search-input:focus {
  outline: 2px solid var(--focus-ring);
  border-color: var(--focus-border);
}
.passage-search-btn {
  height: 1.65rem; min-width: 2.15rem;
  border: 1px solid var(--button-primary-bg); border-radius: 4px;
  background: var(--button-primary-bg); color: var(--button-primary-text);
  padding: 0 0.45rem; font-size: 0.7rem; font-weight: 700;
  cursor: pointer;
}
.passage-search-btn:hover { background: var(--button-primary-hover-bg); }
.passage-search-btn:disabled { opacity: 0.55; cursor: default; }
.pane-controls {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 0.34rem; flex-wrap: wrap; min-width: 0;
  align-content: center;
}
.pane-control-group {
  min-width: 0; min-height: 1.86rem;
  display: inline-flex; align-items: center; gap: 0.08rem;
  padding: 0.12rem;
  border: 1px solid color-mix(in srgb, var(--header-border) 72%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--button-bg) 44%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--page-bg) 62%, transparent);
}
.pane-control-group:focus-within {
  border-color: color-mix(in srgb, var(--focus-border) 62%, var(--header-border));
  box-shadow: 0 0 0 2px var(--focus-ring);
}
.pane-translation-control {
  padding: 0;
  overflow: hidden;
}
.pane-font-controls,
.pane-sync-controls {
  gap: 0.06rem;
}

.translation-select {
  height: 1.78rem; min-width: 4rem;
  border: 0; border-radius: 5px;
  background: transparent; color: var(--header-text);
  padding: 0 0.46rem; font: inherit; font-size: 0.68rem; font-weight: 750;
  cursor: pointer;
}
.translation-select:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}
.translation-fixed {
  display: inline-flex; align-items: center; justify-content: center;
  cursor: default; color: var(--control-muted); font-weight: 800;
}

.ctrl-btn {
  background: transparent; border: 0; color: var(--control-muted);
  width: 1.68rem; min-width: 1.68rem; height: 1.58rem;
  padding: 0; cursor: pointer; border-radius: 4px;
  font-size: 0.72rem; line-height: 1;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.ctrl-btn:hover,
.ctrl-btn:focus-visible {
  background: var(--button-bg); color: var(--header-text); outline: none;
}
.ctrl-btn.active {
  background: var(--control-active-bg); color: var(--control-active-text);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--header-shadow) 70%, transparent);
}
.ctrl-btn.chapter-toolbar-active {
  box-shadow: inset 0 -2px 0 var(--accent-text);
}
.target-btn {
  font-weight: 800;
  letter-spacing: 0;
}
.target-btn.locked {
  border-color: var(--reader-accent);
  box-shadow: inset 0 -2px 0 var(--reader-accent);
}
.strongs-toggle-btn {
  font-weight: 850;
}
.container-toggle-btn {
  font-weight: 850;
}
.toolbar-chapter-heading {
  position: absolute; inset: 0; z-index: 6;
  display: grid; place-items: center;
  background: var(--subheader-bg); color: var(--reader-accent);
  border-bottom: 1px solid var(--surface-border);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.88rem; font-weight: 800; letter-spacing: 0.22em;
  line-height: 1.1; text-transform: uppercase;
  pointer-events: none;
  transition: opacity 0.12s ease, visibility 0.12s ease;
}
.pane-header:hover .toolbar-chapter-heading,
.pane-header:has(.passage-search-input:focus) .toolbar-chapter-heading {
  opacity: 0; visibility: hidden;
}

.ctrl-sep { width: 1px; height: 14px; background: var(--header-border); flex-shrink: 0; margin: 0 0.04rem; }
.font-label {
  min-width: 1.8rem; height: 1.42rem;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--control-muted); font-size: 0.6rem; font-weight: 800;
  border-inline: 1px solid color-mix(in srgb, var(--header-border) 74%, transparent);
}
.close-btn {
  width: 1.76rem; min-width: 1.76rem; height: 1.76rem;
  border: 1px solid color-mix(in srgb, var(--header-border) 72%, transparent);
  border-radius: 6px; background: color-mix(in srgb, var(--button-bg) 34%, transparent);
  color: var(--control-muted); cursor: pointer; font-size: 0.86rem; line-height: 1;
  padding: 0; transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.close-btn:hover,
.close-btn:focus-visible {
  background: var(--button-hover-bg); border-color: var(--header-border);
  color: var(--header-text); outline: none;
}

.sync-btn {
  background: transparent; border: 0; color: var(--control-muted);
  width: 1.48rem; min-width: 1.48rem; height: 1.58rem;
  padding: 0; cursor: pointer; border-radius: 4px;
  font-size: 0.65rem; font-weight: bold; line-height: 1;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.sync-btn:hover,
.sync-btn:focus-visible {
  background: var(--button-bg); color: var(--header-text); outline: none;
}
.sync-btn.active {
  box-shadow: 0 1px 2px color-mix(in srgb, var(--header-shadow) 70%, transparent);
}
.sync-btn.sync-A.active { background: #3b82f6; color: white; }
.sync-btn.sync-B.active { background: #22c55e; color: white; }
.sync-btn.sync-C.active { background: #f97316; color: white; }
.sync-btn.sync-none.active { background: color-mix(in srgb, var(--header-border) 82%, transparent); color: var(--header-text); }

@media (max-width: 760px) {
  .pane-location-row { grid-template-columns: minmax(0, 1fr); }
  .pane-drag-handle { display: none; }
  .passage-search { grid-column: 1 / -1; }
  .pane-controls { justify-content: flex-start; }
  .pane-action-controls,
  .pane-sync-controls {
    display: none;
  }
  .container-toggle-btn {
    display: none;
  }
  .toolbar-chapter-heading {
    pointer-events: auto;
    cursor: text;
    touch-action: manipulation;
  }
  .search-pane-shell {
    position: fixed; inset: 0; z-index: 450; width: 100%; min-width: 0;
    height: 100vh; border-right: 0; flex: none;
  }
  .text-search-drag-handle { display: none; }
  .text-search-pane { height: 100vh; }
}

.scroll-container {
  flex: 1; min-height: 0; overflow-y: scroll; overflow-anchor: none;
  position: relative;
  padding: 0 1.5rem; font-size: 0.97rem; line-height: 1.9;
}
.scroll-container.container-mode-container {
  padding-left: max(1.5rem, calc((100% - 50rem) / 2));
  padding-right: max(1.5rem, calc((100% - 50rem) / 2));
}
.chapter-heading {
  text-align: center; padding: 1.2rem 0 0.6rem;
  color: var(--reader-accent); font-size: 0.8rem; letter-spacing: 0.3em;
  text-transform: uppercase; font-weight: bold; display: block;
}
.sticky-chapter-headings .chapter-heading {
  position: sticky; top: 0; z-index: 3;
  background: var(--page-bg);
  box-shadow: 0 1px 0 var(--surface-border);
}
.verse { display: inline; }
.verse.note-selectable-verse .verse-text { cursor: pointer; }
.verse.note-selected-verse .verse-ref {
  color: var(--reader-accent);
}
.verse-note-stack {
  display: inline-flex; align-items: center;
  position: relative; margin: 0 0.28rem 0 0.06rem;
  vertical-align: 0.12em; isolation: isolate;
}
.verse-note-stack-single { height: 0.98rem; }
.verse-note-stack-multiple {
  display: inline-grid; height: 1.16rem; z-index: 4;
}
.verse-note-badge {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.18rem;
  min-width: 2.15rem; max-width: 7.4rem; height: 1.02rem; margin: 0;
  border: 1px solid color-mix(in srgb, var(--surface-border) 68%, var(--page-bg));
  border-radius: 999px;
  background: var(--page-bg); color: var(--control-muted);
  padding: 0 0.42rem;
  font: 850 0.52rem/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  white-space: nowrap;
  cursor: pointer; opacity: 0.96;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--page-bg) 86%, transparent),
    0 0.08rem 0.2rem color-mix(in srgb, var(--header-shadow) 42%, transparent);
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.18s ease;
}
.verse-note-badge-label {
  min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
.verse-note-badge-count {
  display: inline-grid; place-items: center;
  min-width: 0.66rem; height: 0.66rem; padding: 0 0.12rem;
  border-radius: 999px; background: color-mix(in srgb, var(--page-bg) 92%, transparent); color: currentColor;
  font-size: 0.44rem; line-height: 1;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 22%, transparent);
}
.verse-note-stack-multiple .verse-note-badge {
  grid-area: 1 / 1;
  transform: translateX(var(--note-badge-stack-x)) translateY(var(--note-badge-stack-y));
}
.verse-note-stack-multiple:hover,
.verse-note-stack-multiple:focus-within {
  z-index: 40;
}
.verse-note-stack-multiple:hover .verse-note-badge,
.verse-note-stack-multiple:focus-within .verse-note-badge {
  opacity: 1;
  transform: translateX(0) translateY(var(--note-badge-list-y));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--page-bg) 86%, transparent),
    0 0.35rem 0.85rem color-mix(in srgb, var(--header-shadow) 70%, transparent);
}
.verse-note-badge:hover,
.verse-note-badge:focus-visible {
  opacity: 1; outline: none; border-color: var(--focus-border);
  color: var(--header-text); background: var(--button-hover-bg);
}
.verse-note-badge-mine {
  background: color-mix(in srgb, var(--reader-accent) 13%, var(--page-bg));
  border-color: color-mix(in srgb, var(--reader-accent) 58%, var(--surface-border));
  color: var(--reader-accent);
}
.verse-note-badge-friend {
  border-color: color-mix(in srgb, #14b8a6 58%, var(--surface-border));
  color: color-mix(in srgb, #0f766e 90%, var(--text-color));
  background: color-mix(in srgb, #14b8a6 16%, var(--page-bg));
}
.strongs-annotations-visible .verse-note-stack {
  display: inline-grid;
  grid-template-rows: minmax(1.05em, auto) auto;
  align-items: end;
  vertical-align: baseline;
  height: auto;
  margin: 0 0.34em 0.12em 0.08em;
}
.strongs-annotations-visible .verse-note-stack::before {
  content: '';
  grid-area: 1 / 1;
  min-height: 1.05em;
}
.strongs-annotations-visible .verse-note-stack .verse-note-badge {
  grid-area: 2 / 1;
}
.strongs-annotations-visible .verse-note-stack-multiple .verse-note-badge {
  grid-area: 2 / 1;
}
.strongs-annotations-visible .verse-note-stack-multiple:hover .verse-note-badge,
.strongs-annotations-visible .verse-note-stack-multiple:focus-within .verse-note-badge {
  transform: translateX(var(--note-badge-stack-x)) translateY(var(--note-badge-stack-y));
}
.verse-ref {
  font-size: 0.72em; color: var(--verse-ref); font-weight: bold;
  vertical-align: super; letter-spacing: 0.03em;
  margin-left: 0.4em; margin-right: 0.1em;
}
.verse-text { display: inline; }
.verse-text em { font-style: italic; }
.strongs-mode {
  line-height: 2.35;
}
.strongs-verse-text {
  display: inline;
}
.strongs-token {
  display: inline-grid; grid-template-rows: auto auto; align-items: end;
  justify-items: center; row-gap: 0.16em;
  vertical-align: baseline; max-width: min(100%, 12rem);
  margin: 0 0.1em 0.12em;
  line-height: 1.18;
  text-align: center;
}
.strongs-token-meta {
  display: inline-flex; flex-direction: column; align-items: center; gap: 0.36em;
  max-width: 100%;
  color: var(--reader-accent);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.48em; line-height: 1.08;
  text-align: center;
  white-space: normal;
}
.strongs-token-word,
.strongs-token-number {
  display: block; max-width: 9rem; overflow-wrap: anywhere;
  letter-spacing: 0;
}
.strongs-token-word {
  color: var(--control-muted); font-size: 1.14em; font-style: italic; font-weight: 650;
}
.strongs-token-number {
  color: var(--reader-accent); font-weight: 850;
}
.strongs-token-text {
  display: block;
  color: var(--text-color);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1em; line-height: 1.45;
}
.strongs-token-placeholder {
  visibility: hidden;
}
.strongs-token-button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.strongs-token-button:hover .strongs-token-text,
.strongs-token-button:focus-visible .strongs-token-text,
.strongs-token-button.selected .strongs-token-text {
  color: var(--reader-accent);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}
.strongs-token-button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 3px;
}

.strongs-detail-panel {
  flex: 0 0 auto;
  min-height: 0;
  max-height: min(52vh, 31rem);
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--surface-border);
  background: var(--subheader-bg);
  color: var(--text-color);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.strongs-detail-header {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.62rem 0.75rem 0.52rem;
}
.strongs-detail-title-group {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.18rem;
}
.strongs-detail-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  min-width: 0;
}
.strongs-selected-text {
  color: var(--text-color);
  font-size: 0.92rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}
.strongs-selected-number {
  color: var(--reader-accent);
  font-size: 0.82rem;
  font-weight: 850;
}
.strongs-selected-word {
  color: var(--control-muted);
  font-size: 0.8rem;
  font-style: italic;
  font-weight: 650;
}
.strongs-detail-definition {
  color: var(--control-muted);
  font-size: 0.72rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.strongs-detail-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.strongs-detail-action,
.strongs-detail-close {
  border: 1px solid var(--header-border);
  background: var(--button-bg);
  color: var(--header-text);
  font: inherit;
  font-size: 0.72rem;
  line-height: 1;
  min-height: 1.7rem;
  border-radius: 4px;
  cursor: pointer;
}
.strongs-detail-action {
  padding: 0.35rem 0.55rem;
  font-weight: 750;
}
.strongs-detail-close {
  width: 1.7rem;
  padding: 0;
}
.strongs-detail-action:hover,
.strongs-detail-close:hover {
  background: var(--button-hover-bg);
}
.strongs-detail-status {
  padding: 0.75rem;
  color: var(--control-muted);
  font-size: 0.76rem;
  line-height: 1.35;
}
.strongs-detail-error {
  color: var(--error-text);
}
.strongs-detail-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.52rem;
  padding: 0 0.75rem 0.75rem;
  overflow: hidden;
}
.strongs-finder-grid {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(2.65rem, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--surface-border);
  background: var(--surface-border);
}
.strongs-finder-book-btn {
  min-width: 0;
  min-height: 1.48rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  border: 0;
  background: var(--page-bg);
  color: var(--control-muted);
  font: inherit;
  font-size: 0.66rem;
  line-height: 1;
  padding: 0.18rem 0.18rem;
}
.strongs-finder-book-btn.filled {
  color: var(--text-color);
  cursor: pointer;
  font-weight: 750;
}
.strongs-finder-book-btn:disabled {
  cursor: default;
  opacity: 0.58;
}
.strongs-finder-book-btn.active {
  background: var(--control-active-bg);
  color: var(--control-active-text);
}
.strongs-finder-book-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.strongs-finder-count {
  flex: 0 0 auto;
  color: var(--danger-text);
  font-size: 0.62rem;
  font-weight: 850;
}
.strongs-finder-book-btn.active .strongs-finder-count {
  color: var(--control-active-text);
}
.strongs-chapter-strip {
  flex: 0 0 auto;
  display: flex;
  gap: 0.3rem;
  overflow-x: auto;
  padding-bottom: 0.06rem;
}
.strongs-chip-button {
  flex: 0 0 auto;
  min-height: 1.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  border: 1px solid var(--header-border);
  border-radius: 4px;
  background: var(--page-bg);
  color: var(--header-text);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 750;
  padding: 0.28rem 0.45rem;
  cursor: pointer;
}
.strongs-chip-button.active {
  background: var(--control-active-bg);
  border-color: var(--control-active-bg);
  color: var(--control-active-text);
}
.strongs-chip-count {
  color: var(--danger-text);
  font-size: 0.66rem;
}
.strongs-chip-button.active .strongs-chip-count {
  color: var(--control-active-text);
}
.strongs-occurrence-summary {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--control-muted);
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.2;
}
.strongs-occurrence-list {
  flex: 1 1 auto;
  min-height: 4.5rem;
  overflow-y: auto;
  display: grid;
  gap: 0.34rem;
  padding-right: 0.12rem;
}
.strongs-occurrence-item {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(5rem, 0.42fr) minmax(3.4rem, 0.28fr) minmax(0, 1fr);
  align-items: baseline;
  gap: 0.55rem;
  border: 1px solid var(--surface-border);
  border-radius: 4px;
  background: var(--page-bg);
  color: var(--text-color);
  font: inherit;
  font-size: 0.76rem;
  line-height: 1.28;
  padding: 0.45rem 0.52rem;
  text-align: left;
  cursor: pointer;
}
.strongs-occurrence-item:hover,
.strongs-occurrence-item:focus-visible {
  border-color: var(--focus-border);
  outline: none;
  background: var(--button-bg);
}
.strongs-occurrence-ref {
  color: var(--reader-accent);
  font-weight: 800;
  white-space: nowrap;
}
.strongs-occurrence-fragment {
  color: var(--control-muted);
  font-style: italic;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.strongs-occurrence-text {
  min-width: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  .strongs-detail-panel {
    max-height: 56vh;
  }
  .strongs-occurrence-item {
    grid-template-columns: 1fr;
    gap: 0.18rem;
  }
}

.split-mode.container-mode-fluid { padding: 0; }
.split-mode.container-mode-container {
  padding-left: max(1.5rem, calc((100% - 50rem) / 2));
  padding-right: max(1.5rem, calc((100% - 50rem) / 2));
}
.split-mode .verse { display: block; padding: 0.28rem 1.5rem; }
.split-mode.container-mode-container .verse { padding-left: 0; padding-right: 0; }
.split-mode .verse:hover { background: var(--split-hover-bg); }
.split-mode .verse-ref { font-size: 0.72em; vertical-align: baseline; margin-left: 0; margin-right: 0.4rem; }
.split-mode.strongs-mode .verse { padding-top: 0.58rem; padding-bottom: 0.58rem; }

.align-left { text-align: left; }
.align-center { text-align: center; }
.align-right { text-align: right; }

.verse-text mark {
  position: relative; background: var(--hl); color: #111111; border-radius: 2px;
}
.saved-highlight-mark {
  cursor: pointer; outline-offset: 2px;
  box-shadow: inset 0 -2px 0 rgba(17,17,17,0.22);
}
.saved-highlight-mark.own-highlight-mark {
  box-shadow: inset 0 -2px 0 var(--header-text), 0 0 0 1px rgba(17,17,17,0.16);
}
.saved-highlight-mark.friend-highlight-mark {
  opacity: 0.68;
  box-shadow: inset 0 -1px 0 rgba(17,17,17,0.14);
}
.saved-highlight-mark.friend-highlight-mark:hover,
.saved-highlight-mark.friend-highlight-mark:focus-visible {
  opacity: 0.92;
}
.saved-highlight-mark::after {
  content: attr(data-owner);
  position: absolute; left: 0; bottom: calc(100% + 0.16rem); z-index: 8;
  max-width: min(12rem, 70vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 0.12rem 0.34rem;
  border: 1px solid var(--pane-border); border-radius: 999px;
  background: var(--popup-bg); color: var(--header-text);
  box-shadow: 0 4px 14px var(--popup-shadow);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.68rem; font-weight: 850; line-height: 1.15;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.12rem);
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
}
.saved-highlight-mark.own-highlight-mark::after {
  border-color: var(--accent-bg); background: var(--accent-bg); color: var(--accent-text);
}
.saved-highlight-mark:hover::after,
.saved-highlight-mark:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.saved-highlight-mark:hover { outline: 1px solid rgba(17,17,17,0.35); }

.load-indicator { text-align: center; padding: 1rem; color: var(--control-muted); font-size: 0.75rem; letter-spacing: 0.1em; }
.load-indicator::after {
  content: ''; display: inline-block; width: 7px; height: 7px;
  border: 2px solid var(--verse-ref); border-top-color: transparent;
  border-radius: 50%; margin-left: 6px;
  animation: spin 0.7s linear infinite; vertical-align: middle;
}
.top-load-indicator {
  position: sticky; top: 0.35rem; z-index: 4;
  height: 0; padding: 0; overflow: visible; pointer-events: none;
  text-align: center;
}
.top-load-indicator .load-pill {
  display: inline-block; padding: 0.28rem 0.7rem;
  background: var(--loader-pill-bg); border: 1px solid var(--surface-border);
  border-radius: 999px; box-shadow: 0 2px 8px var(--loader-pill-shadow);
  color: var(--control-muted); font-size: 0.72rem; letter-spacing: 0.1em;
}
.top-load-indicator .load-pill::after {
  content: ''; display: inline-block; width: 7px; height: 7px;
  border: 2px solid var(--verse-ref); border-top-color: transparent;
  border-radius: 50%; margin-left: 6px;
  animation: spin 0.7s linear infinite; vertical-align: middle;
}
.measure-container {
  position: fixed; left: -10000px; top: 0;
  visibility: hidden; pointer-events: none;
  padding: 0 1.5rem; font-size: inherit; line-height: 1.9;
}
.measure-container.container-mode-container {
  padding-left: max(1.5rem, calc((100% - 50rem) / 2));
  padding-right: max(1.5rem, calc((100% - 50rem) / 2));
}
.measure-container.split-mode.container-mode-fluid { padding: 0; }
.measure-container.split-mode.container-mode-container {
  padding-left: max(1.5rem, calc((100% - 50rem) / 2));
  padding-right: max(1.5rem, calc((100% - 50rem) / 2));
}
.error-indicator { text-align: center; padding: 1rem; color: var(--error-text); font-size: 0.8rem; line-height: 1.4; }
.end-indicator { text-align: center; padding: 1rem; color: var(--control-muted); font-size: 0.7rem; letter-spacing: 0.15em; opacity: 0.6; }
@keyframes spin { to { transform: rotate(360deg); } }

.highlight-popup {
  position: fixed; background: var(--popup-bg); border: 1px solid var(--popup-border);
  border-radius: 8px; padding: 0.4rem 0.55rem;
  display: flex; gap: 0.35rem; align-items: center;
  z-index: 300; box-shadow: 0 4px 16px var(--popup-shadow);
  transform: translateX(-50%); user-select: none;
}
.highlight-popup-editor {
  width: min(13rem, calc(100vw - 1rem));
  flex-direction: column; align-items: stretch; gap: 0.5rem;
  transform: translate(-50%, -100%);
}
.highlight-popup::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--popup-border);
}
.highlight-popup-row { display: flex; gap: 0.35rem; align-items: center; }
.color-swatch { width: 20px; height: 20px; border-radius: 50%; cursor: pointer; border: 2px solid rgba(255,255,255,0.15); transition: transform 0.1s, border-color 0.1s; flex: 0 0 auto; }
.color-swatch:hover { transform: scale(1.25); border-color: white; }
.color-swatch.active { border-color: var(--header-text); transform: scale(1.14); }
.swatch-clear { font-size: 0.7rem; color: var(--header-text); cursor: pointer; padding: 0 0.15rem; opacity: 0.7; border: 0; background: transparent; }
.swatch-clear:hover { opacity: 1; }
.highlight-popup-grid {
  display: grid; grid-template-columns: 1fr; gap: 0.45rem;
}
.highlight-field {
  display: grid; gap: 0.18rem; min-width: 0;
  color: var(--header-text); font-size: 0.68rem; font-weight: 700;
}
.highlight-field-wide { grid-column: 1 / -1; }
.highlight-field select,
.highlight-field input {
  width: 100%; min-width: 0;
  border: 1px solid var(--pane-border); border-radius: 4px;
  background: var(--input-bg); color: var(--header-text);
  padding: 0.32rem 0.38rem; font: inherit; font-weight: 600;
}
.highlight-field input::placeholder { color: var(--control-muted); }
.highlight-field select:disabled,
.highlight-field input:disabled { opacity: 0.6; cursor: not-allowed; }
.highlight-popup-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; min-height: 1.6rem;
}
.highlight-save-btn {
  border: 0; border-radius: 4px; padding: 0.35rem 0.7rem;
  background: var(--accent-bg); color: white; cursor: pointer; font-size: 0.75rem; font-weight: 800;
}
.highlight-save-btn:disabled { opacity: 0.65; cursor: wait; }
.highlight-note-btn {
  border: 1px solid var(--pane-border); border-radius: 4px; padding: 0.34rem 0.62rem;
  background: var(--button-bg); color: var(--header-text); cursor: pointer;
  font-size: 0.75rem; font-weight: 800;
}
.highlight-note-btn:hover { background: var(--button-hover-bg); }
.highlight-note-btn:disabled { opacity: 0.65; cursor: wait; }
.highlight-error {
  min-width: 0; flex: 1; color: var(--error-text);
  font-size: 0.68rem; font-weight: 700; line-height: 1.25;
}

.highlight-auth-backdrop {
  position: fixed; inset: 0; z-index: 610;
  display: grid; place-items: center; padding: 1rem;
  background: var(--modal-backdrop);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.highlight-auth-modal {
  width: min(100%, 390px); overflow: hidden;
  background: var(--modal-bg); color: var(--modal-text);
  border: 1px solid var(--pane-border); border-radius: 8px;
  box-shadow: 0 16px 44px rgba(0,0,0,0.38);
}
.highlight-auth-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--surface-border);
}
.highlight-auth-header h2 {
  font-size: 1rem; line-height: 1.2; font-weight: 750;
  letter-spacing: 0; color: var(--modal-text);
}
.highlight-auth-close {
  width: 2rem; height: 2rem; border: 1px solid transparent;
  border-radius: 50%; background: transparent; color: var(--control-muted);
  cursor: pointer; line-height: 1;
}
.highlight-auth-close:hover { background: var(--modal-hover-bg); color: var(--modal-text); }
.highlight-auth-body {
  display: grid; gap: 1rem; padding: 1rem;
}
.highlight-auth-body p {
  color: var(--modal-muted); font-size: 0.88rem; line-height: 1.45;
}
.highlight-auth-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem;
}
.highlight-auth-actions button {
  min-height: 40px; border-radius: 6px; padding: 0.45rem 0.7rem;
  font-size: 0.84rem; font-weight: 750; cursor: pointer;
}
.highlight-auth-primary {
  border: 1px solid var(--accent-bg); background: var(--accent-bg); color: var(--accent-text);
}
.highlight-auth-primary:hover { background: var(--accent-hover-bg); }
.highlight-auth-secondary {
  border: 1px solid var(--pane-border); background: var(--button-bg); color: var(--modal-text);
}
.highlight-auth-secondary:hover { background: var(--button-hover-bg); }

.update-toast {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 500;
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--popup-bg); border: 1px solid var(--popup-border); color: var(--chip-text);
  padding: 0.75rem 0.85rem; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.update-toast p { font-size: 0.82rem; line-height: 1.3; }
.update-toast button {
  border: 1px solid var(--button-primary-bg); background: var(--button-primary-bg); color: var(--button-primary-text);
  border-radius: 4px; padding: 0.35rem 0.65rem; cursor: pointer;
  font-size: 0.78rem; font-weight: 700;
}
.update-toast button:disabled { opacity: 0.65; cursor: wait; }

.login-backdrop {
  position: fixed; inset: 0; z-index: 600;
  display: grid; place-items: center; padding: 1rem;
  background: var(--modal-backdrop);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.login-modal {
  width: min(100%, 360px); overflow: hidden;
  background: var(--modal-bg); color: var(--modal-text);
  border: 1px solid var(--pane-border); border-radius: 8px;
  box-shadow: 0 16px 44px rgba(0,0,0,0.38);
}
.login-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--surface-border);
}
.login-modal-header h2 {
  font-size: 1rem; line-height: 1.2; font-weight: 750;
  letter-spacing: 0; color: var(--modal-text);
}
.login-close {
  width: 2rem; height: 2rem; border: 1px solid transparent;
  border-radius: 50%; background: transparent; color: var(--control-muted);
  cursor: pointer; line-height: 1;
}
.login-close:hover { background: var(--modal-hover-bg); color: var(--modal-text); }
.login-close:disabled { opacity: 0.5; cursor: wait; }
.login-form { padding: 1rem; }
.login-field { display: grid; gap: 0.35rem; margin-bottom: 0.85rem; }
.login-field span {
  color: var(--modal-muted); font-size: 0.78rem; font-weight: 700;
}
.login-input {
  width: 100%; min-height: 42px; border: 1px solid var(--pane-border);
  border-radius: 6px; background: var(--input-bg); color: var(--modal-text);
  padding: 0.48rem 0.6rem; font: inherit;
}
.login-input:focus {
  outline: 2px solid var(--focus-ring);
  border-color: var(--focus-border);
}
.login-error {
  margin-bottom: 0.85rem; padding: 0.58rem 0.65rem;
  border: 1px solid var(--danger-border); border-radius: 6px;
  background: var(--danger-bg); color: var(--danger-text);
  font-size: 0.78rem; line-height: 1.35;
}
.login-submit {
  width: 100%; min-height: 42px; border: 1px solid var(--accent-bg);
  border-radius: 6px; background: var(--accent-bg); color: var(--accent-text);
  font-size: 0.86rem; font-weight: 750; cursor: pointer;
}
.login-submit:hover { background: var(--accent-hover-bg); }
.login-submit:disabled { opacity: 0.65; cursor: wait; }

.features-page {
  height: 100vh; overflow-y: auto; overflow-x: hidden;
  background: var(--page-bg); color: var(--text-color);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.features-header { position: sticky; top: 0; flex-wrap: wrap; }
.features-header .header-actions {
  flex: 0 1 auto; flex-wrap: wrap; max-width: 100%;
}
.features-brand {
  flex: 1 1 8rem; justify-content: flex-start; border-color: transparent;
  background: transparent; padding-left: 0; letter-spacing: 0.2em;
  text-transform: uppercase; font-size: 0.9rem;
}
.features-main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto; padding: 2.25rem 0 3.5rem;
}
.features-intro {
  display: grid; gap: 1rem; padding-bottom: 2rem;
  border-bottom: 1px solid var(--surface-border);
}
.features-kicker,
.feature-eyebrow {
  color: var(--reader-accent); font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.16em; text-transform: uppercase;
}
.features-intro h1 {
  max-width: 760px; font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1; letter-spacing: 0; color: var(--text-color);
}
.features-lede {
  max-width: 780px; color: var(--control-muted);
  font-size: clamp(1rem, 2vw, 1.22rem); line-height: 1.55;
}
.features-actions {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem;
  margin-top: 0.2rem;
}
.features-overview-image {
  width: 100%; aspect-ratio: 16 / 7; object-fit: cover; object-position: left top;
  border: 1px solid var(--surface-border); border-radius: 8px;
  box-shadow: 0 10px 30px var(--header-shadow); background: var(--subheader-bg);
}
.feature-gallery {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem; padding: 2rem 0;
}
.feature-card {
  display: grid; grid-template-rows: auto 1fr;
  overflow: hidden; border: 1px solid var(--surface-border);
  border-radius: 8px; background: var(--subheader-bg);
  box-shadow: 0 8px 22px var(--header-shadow);
}
.feature-card-image {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: left top;
  border-bottom: 1px solid var(--surface-border); background: var(--page-bg);
}
.feature-card-copy {
  display: grid; gap: 0.7rem; align-content: start; padding: 1rem;
}
.feature-card h2,
.feature-band h2 {
  color: var(--text-color); font-size: 1.28rem; line-height: 1.18; letter-spacing: 0;
}
.feature-card p:not(.feature-eyebrow) {
  color: var(--control-muted); line-height: 1.5; font-size: 0.95rem;
}
.feature-card ul,
.supporting-feature-list {
  list-style: none; display: grid; gap: 0.45rem;
}
.feature-card li,
.supporting-feature-list li {
  position: relative; padding-left: 1.1rem; color: var(--text-color);
  line-height: 1.4; font-size: 0.9rem;
}
.feature-card li::before,
.supporting-feature-list li::before {
  content: ''; position: absolute; left: 0; top: 0.54em;
  width: 0.42rem; height: 0.42rem; border-radius: 50%;
  background: var(--reader-accent);
}
.feature-band {
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 1.25rem; align-items: start;
  padding: 1.25rem; border: 1px solid var(--surface-border);
  border-radius: 8px; background: var(--subheader-bg);
}
.supporting-feature-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 1200px) {
  .features-brand { flex-basis: 100%; min-height: auto; }
  .features-header .header-actions {
    flex: 1 1 100%; justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .global-header {
    grid-template-columns: 1fr; align-items: start; gap: 0.42rem;
    padding: 0.45rem 0.65rem;
  }
  .global-brand {
    width: 100%; justify-content: space-between; padding-right: 0;
    border-right: 0; padding-bottom: 0.32rem; border-bottom: 1px solid var(--header-border);
  }
  .global-title { flex: 0 1 auto; letter-spacing: 0.14em; }
  .header-actions { justify-content: flex-start; gap: 0.35rem; }
  .header-group { gap: 0.22rem; }
  .reader-header {
    gap: 0;
  }
  .reader-header .global-brand {
    align-items: center;
    padding-bottom: 0;
    border-bottom: 0;
  }
  .mobile-nav-toggle {
    display: inline-grid; place-items: center;
  }
  .reader-main-nav {
    display: none;
    width: 100%; min-width: 0;
    padding-top: 0.48rem;
  }
  .reader-main-nav.open {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.42rem;
  }
  .reader-main-nav .header-group {
    width: 100%; opacity: 1;
    padding: 0.28rem; gap: 0.3rem;
    align-items: stretch; justify-content: flex-start;
  }
  .reader-main-nav .header-theme-group .theme-picker {
    width: 100%;
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.32rem;
  }
  .reader-main-nav .theme-select {
    width: 100%; max-width: none; opacity: 1;
  }
  .reader-main-nav .header-social-group,
  .reader-main-nav .header-reader-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .reader-main-nav .header-reader-group {
    grid-template-columns: minmax(0, 1fr) 2rem;
  }
  .reader-main-nav .friends-menu,
  .reader-main-nav .layer-menu,
  .reader-main-nav .tool-menu {
    width: 100%; min-width: 0;
  }
  .reader-main-nav .friends-menu-open,
  .reader-main-nav .layer-menu-open,
  .reader-main-nav .tool-menu-open {
    grid-column: 1 / -1;
  }
  .reader-main-nav .reader-link,
  .reader-main-nav .add-pane-btn,
  .reader-main-nav .login-btn,
  .reader-main-nav .search-toggle-btn,
  .reader-main-nav .friends-toggle-btn {
    width: 100%; opacity: 1;
  }
  .reader-main-nav .icon-reader-link {
    width: 2rem; min-width: 2rem; padding-inline: 0;
  }
  .reader-main-nav .add-pane-btn {
    display: none;
  }
  .reader-main-nav .tool-dropdown,
  .reader-main-nav .friends-dropdown,
  .reader-main-nav .layer-dropdown {
    position: static;
    width: 100%; max-width: 100%;
    margin-top: 0.32rem;
    box-shadow: none;
  }
  .reader-main-nav .header-account-group .login-btn,
  .reader-main-nav .header-account-group .account-link {
    opacity: 1; pointer-events: auto;
  }
  .reader-main-nav .header-account-group .account-link {
    max-width: 5rem;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
    border-width: 1px;
  }
  .reader-main-nav .account-chip {
    width: 100%; max-width: none;
  }
  .add-pane-btn,
  .login-btn,
  .reader-link,
  .search-toggle-btn { padding: 0.3rem 0.5rem; font-size: 0.74rem; }
  .theme-select { max-width: 4.9rem; font-size: 0.7rem; }
  .theme-select-mode { max-width: 5.25rem; }
  .account-chip { max-width: 38vw; padding-left: 0.5rem; }
  .account-link { padding-inline: 0.35rem; }
  .features-main { width: min(100% - 1rem, 1180px); padding-top: 1.4rem; }
  .features-header .header-actions { justify-content: flex-start; }
  .features-overview-image { aspect-ratio: 4 / 3; }
  .feature-gallery,
  .feature-band,
  .supporting-feature-list { grid-template-columns: 1fr; }
  .feature-band { padding: 1rem; }
}
