:root {
  color-scheme: dark;
  --rb-bg: #0f1116;
  --rb-fg: #e5e7eb;
  --rb-muted: #94a3b8;
  --rb-accent: #ffd957;
  --rb-line: #2a2e36;
  --rb-line-strong: #1f2834;
  --rb-header-bg: rgba(20, 22, 28, 0.98);
  --rb-header-inner-bg: rgba(30, 32, 38, 0.98);
  --rb-panel-bg: #0d1218;
  --rb-panel-elevated-bg: #0f151c;
  --rb-panel-border: #1f2834;
  --rb-input-bg: #0b1118;
  --rb-input-border: #2a3850;
  --rb-input-border-weak: #2a2e36;
  --rb-input-focus: #32517a;
  --rb-toast-bg: #182230;
  --rb-toast-border: #2a3850;
  --rb-overlay-bg: rgba(8, 12, 17, 0.76);
  --rb-fab-bg: rgba(13, 18, 24, 0.8);
  --rb-table-border: #223144;
  --rb-surface-hover: rgba(255, 255, 255, 0.05);
  --rb-verse-no-color: #cbd5e1;
  --rb-highlight-bg: rgba(255, 217, 87, 0.28);
  --rb-highlight-fg: #111827;
  --rb-auth-modal-bg: #0d1218;
  --rb-auth-modal-border: #1f2834;
  --rb-auth-link-color: #8bb4ff;
  --rb-auth-message-error: #fca5a5;
  --rb-auth-message-info: #8be9c7;
  --rb-searchbar-bg: var(--rb-header-inner-bg);
  --rb-search-border: #2a2e36;
  --rb-search-input-bg: #0b0d12;
  --rb-search-input-border: #2a2e36;
  --rb-search-input-color: #e5e7eb;
  --rb-search-focus: #3b82f6;
  --rb-search-advanced-border: #475569;
  --rb-search-advanced-color: #94a3b8;
  --rb-search-result-bg: #0b0d12;
  --rb-search-result-border: #2a2e36;
  --rb-search-result-hover: #11141b;
  --rb-search-result-ref: #93c5fd;
  --rb-verse-empty-color: rgba(233, 238, 243, 0.55);
  --rb-translation-header-height-base: 56px;
  --rb-translation-header-height: var(--rb-translation-header-height-base);
  --rb-translation-header-bg: var(--rb-panel-elevated-bg);
  --rb-translation-header-border: var(--rb-line);
  --rb-miko-panel-bg: rgba(11, 16, 32, 0.95);
  --rb-miko-surface: rgba(255, 255, 255, 0.05);
  --rb-miko-text: #eaf0ff;
  --rb-miko-subtext: #aab6ff;
  --rb-miko-accent: #6366f1;
  --rb-miko-accent-2: #22d3ee;
  --rb-miko-border: rgba(255, 255, 255, 0.08);
  --rb-miko-log-bg: rgba(255, 255, 255, 0.05);
  --rb-miko-assistant-bubble: rgba(99, 102, 241, 0.12);
  --rb-miko-user-bubble: #f8fafc;
  --rb-miko-user-border: rgba(15, 23, 42, 0.06);
  --rb-miko-user: #111827;
  --rb-miko-input-bg: rgba(3, 9, 30, 0.6);
  --rb-miko-input-border: rgba(255, 255, 255, 0.16);
  --rb-miko-input-focus-border: rgba(99, 102, 241, 0.6);
  --rb-miko-input-focus-ring: rgba(99, 102, 241, 0.25);
  --rb-miko-input-color: #eaf0ff;
  --rb-miko-link: #facc15;
  --rb-miko-spinner: #9fb0ff;
  --rb-miko-header-text: #f0f4ff;
  --rb-safe-top: max(env(safe-area-inset-top, 0px), 0px);
  --rb-safe-right: max(env(safe-area-inset-right, 0px), 0px);
  --rb-safe-bottom: max(env(safe-area-inset-bottom, 0px), 0px);
  --rb-safe-left: max(env(safe-area-inset-left, 0px), 0px);
  --rb-viewport-w: 100vw;
  /* レイヤー順（本文 < ナビ < 検索 < みこと < メニュー） */
  --z-nav: 1200;
  --z-search: 1600;
  --z-mikoto: 2000;
  --z-menu: 4000;
  /* ★追加：メニューを最上位に */
}

@supports (width: 100dvw) {
  :root {
    --rb-viewport-w: 100dvw;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

:root[data-theme="light"] {
  color-scheme: light;
  --rb-bg: #f5f6fa;
  --rb-fg: #1f2937;
  --rb-muted: #5f6c80;
  --rb-line: #d0d7e2;
  --rb-line-strong: #b5becd;
  --rb-header-bg: rgba(255, 255, 255, 0.94);
  --rb-header-inner-bg: rgba(255, 255, 255, 0.97);
  --rb-panel-bg: #ffffff;
  --rb-panel-elevated-bg: #f5f7fb;
  --rb-panel-border: #d0d7e2;
  --rb-input-bg: #ffffff;
  --rb-input-border: #c5d0dd;
  --rb-input-border-weak: #d0d7e2;
  --rb-input-focus: #2563eb;
  --rb-toast-bg: #ffffff;
  --rb-toast-border: #d0d7e2;
  --rb-overlay-bg: rgba(15, 23, 42, 0.35);
  --rb-fab-bg: rgba(248, 250, 255, 0.92);
  --rb-table-border: #d7dce6;
  --rb-surface-hover: rgba(15, 23, 42, 0.06);
  --rb-verse-no-color: #64748b;
  --rb-auth-modal-bg: #ffffff;
  --rb-auth-modal-border: #d0d7e2;
  --rb-auth-link-color: #2563eb;
  --rb-auth-message-error: #b91c1c;
  --rb-auth-message-info: #047857;
  --rb-searchbar-bg: rgba(255, 255, 255, 0.97);
  --rb-search-border: #d0d7e2;
  --rb-search-input-bg: #ffffff;
  --rb-search-input-border: #cbd5e1;
  --rb-search-input-color: #1f2937;
  --rb-search-focus: #2563eb;
  --rb-search-advanced-border: #cbd5e1;
  --rb-search-advanced-color: #475569;
  --rb-search-result-bg: #ffffff;
  --rb-search-result-border: #d4d9e2;
  --rb-search-result-hover: #eef2ff;
  --rb-search-result-ref: #2563eb;
  --rb-verse-empty-color: rgba(148, 163, 184, 0.7);
  --rb-translation-header-bg: rgba(255, 255, 255, 0.96);
  --rb-translation-header-border: #d4d9e2;
  --rb-highlight-bg: rgba(255, 236, 140, 0.88);
  --rb-highlight-fg: #111827;
  --rb-miko-panel-bg: rgba(248, 250, 255, 0.97);
  --rb-miko-surface: rgba(226, 232, 255, 0.72);
  --rb-miko-text: #1f2937;
  --rb-miko-subtext: #4c5a7d;
  --rb-miko-accent: #4f46e5;
  --rb-miko-accent-2: #0ea5e9;
  --rb-miko-border: rgba(148, 163, 184, 0.32);
  --rb-miko-log-bg: rgba(231, 237, 255, 0.7);
  --rb-miko-assistant-bubble: #e2e8ff;
  --rb-miko-user-bubble: #eef2ff;
  --rb-miko-user-border: rgba(148, 163, 184, 0.45);
  --rb-miko-user: #0f172a;
  --rb-miko-input-bg: #ffffff;
  --rb-miko-input-border: #cbd5e1;
  --rb-miko-input-focus-border: #2563eb;
  --rb-miko-input-focus-ring: rgba(37, 99, 235, 0.25);
  --rb-miko-input-color: #1f2937;
  --rb-miko-link: #b45309;
  --rb-miko-spinner: #64748b;
  --rb-miko-header-text: #1f2a4a;
}

:root[data-theme="auto"] {
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] {
    color-scheme: light;
    --rb-bg: #f5f6fa;
    --rb-fg: #1f2937;
    --rb-muted: #5f6c80;
    --rb-line: #d0d7e2;
    --rb-line-strong: #b5becd;
    --rb-header-bg: rgba(255, 255, 255, 0.94);
    --rb-header-inner-bg: rgba(255, 255, 255, 0.97);
    --rb-panel-bg: #ffffff;
    --rb-panel-elevated-bg: #f5f7fb;
    --rb-panel-border: #d0d7e2;
    --rb-input-bg: #ffffff;
    --rb-input-border: #c5d0dd;
    --rb-input-border-weak: #d0d7e2;
    --rb-input-focus: #2563eb;
    --rb-toast-bg: #ffffff;
    --rb-toast-border: #d0d7e2;
    --rb-overlay-bg: rgba(15, 23, 42, 0.35);
    --rb-fab-bg: rgba(248, 250, 255, 0.92);
    --rb-table-border: #d7dce6;
    --rb-verse-no-color: #64748b;
    --rb-auth-modal-bg: #ffffff;
    --rb-auth-modal-border: #d0d7e2;
    --rb-auth-link-color: #2563eb;
    --rb-auth-message-error: #b91c1c;
    --rb-auth-message-info: #047857;
    --rb-searchbar-bg: rgba(255, 255, 255, 0.97);
    --rb-search-border: #d0d7e2;
    --rb-search-input-bg: #ffffff;
    --rb-search-input-border: #cbd5e1;
    --rb-search-input-color: #1f2937;
    --rb-search-focus: #2563eb;
    --rb-search-advanced-border: #cbd5e1;
    --rb-search-advanced-color: #475569;
    --rb-search-result-bg: #ffffff;
    --rb-search-result-border: #d4d9e2;
    --rb-search-result-hover: #eef2ff;
    --rb-search-result-ref: #2563eb;
    --rb-verse-empty-color: rgba(148, 163, 184, 0.7);
    --rb-translation-header-bg: rgba(255, 255, 255, 0.96);
    --rb-translation-header-border: #d4d9e2;
    --rb-highlight-bg: rgba(255, 236, 140, 0.88);
    --rb-highlight-fg: #111827;
    --rb-miko-panel-bg: rgba(248, 250, 255, 0.97);
    --rb-miko-surface: rgba(226, 232, 255, 0.72);
    --rb-miko-text: #1f2937;
    --rb-miko-subtext: #4c5a7d;
    --rb-miko-accent: #4f46e5;
    --rb-miko-accent-2: #0ea5e9;
    --rb-miko-border: rgba(148, 163, 184, 0.32);
    --rb-miko-log-bg: rgba(231, 237, 255, 0.7);
    --rb-miko-assistant-bubble: #e2e8ff;
    --rb-miko-user-bubble: #eef2ff;
    --rb-miko-user-border: rgba(148, 163, 184, 0.45);
    --rb-miko-user: #0f172a;
    --rb-miko-input-bg: #ffffff;
    --rb-miko-input-border: #cbd5e1;
    --rb-miko-input-focus-border: #2563eb;
    --rb-miko-input-focus-ring: rgba(37, 99, 235, 0.25);
    --rb-miko-input-color: #1f2937;
    --rb-miko-link: #b45309;
    --rb-miko-spinner: #64748b;
    --rb-miko-header-text: #1f2a4a;
  }
}

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--rb-bg);
  color: var(--rb-fg);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Noto Sans JP", sans-serif;
}

header.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--rb-header-bg);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rb-line);
  padding-top: var(--rb-safe-top);
}

header.topbar .wrap {
  max-width: none;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px calc(12px + var(--rb-safe-right)) 8px calc(12px + var(--rb-safe-left));
}

.topbar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.grow {
  min-width: 0;
}

.topbar-center {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  min-width: 0;
}

.topbar-center select {
  width: min(240px, 100%);
}

.topbar-display-settings {
  width: min(260px, 100%);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}

#rb-searchbar {
  z-index: var(--z-search);
}

.select,
.btn {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--rb-input-border);
  background: var(--rb-input-bg);
  color: var(--rb-fg);
}

.btn {
  cursor: pointer;
}

.btn[disabled] {
  opacity: .45;
  cursor: not-allowed;
}

.select:focus,
.btn:focus {
  outline: 2px solid var(--rb-input-focus);
}

.brand {
  font-weight: 650;
  letter-spacing: .02em;
  margin-right: 0;
  color: inherit;
  text-decoration: none;
}

.brand:focus-visible {
  outline: 2px solid var(--rb-input-focus);
  outline-offset: 4px;
}

/* 本文の下余白は search-panel.css で上書き済み (#chapterMount { padding-bottom: 220px !important; }) */
main {
  padding: 16px 12px 96px;
}

/* 余計な幅を占めるので廃止したい
.panel {
  max-width: 1100px;
  margin: 8px auto;
  padding: 10px 12px;
  border: 1px solid var(--rb-panel-border);
  border-radius: 12px;
  background: var(--rb-panel-bg);
}
*/

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-top: 4px;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.row::-webkit-scrollbar {
  display: none;
}

.row>* {
  flex: 0 0 auto;
}

.row select {
  min-width: 120px;
}

.row select[data-role="chapter-select"],
.row select[data-role="verse-select"] {
  width: clamp(64px, 12vw, 88px);
  min-width: 0;
}

@media (max-width: 640px) {
  .topbar-wrap {
    gap: 8px;
  }

  .topbar-center select {
    width: min(200px, 100%);
  }

  .row {
    gap: 8px;
  }
}

@media (max-width: 520px) {
  header.topbar .rb-user-email {
    padding-right: 0;
    gap: 4px;
  }

  header.topbar .rb-user-email::before {
    content: "👤";
    font-size: 1rem;
  }

  header.topbar .rb-user-email-status {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
  }

  header.topbar .rb-user-email-address {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
  }

}

body.rb-bookmarks-open {
  overflow: hidden;
}

.rb-bookmarks {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.rb-bookmarks[hidden] {
  display: none !important;
}

.rb-bookmarks.is-open {
  display: flex;
}

.rb-bookmarks-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.rb-bookmarks-panel {
  position: relative;
  width: min(560px, 94vw);
  max-height: 86vh;
  border-radius: 16px;
  overflow: hidden;
  background: var(--rb-panel-bg);
  color: var(--rb-fg);
  border: 1px solid var(--rb-panel-border);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.rb-bookmarks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--rb-panel-border);
  gap: 12px;
}

.rb-bookmarks-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.rb-bookmarks-close {
  min-width: 40px;
  height: 36px;
  font-size: 1.2rem;
}

.rb-bookmarks-info {
  padding: 12px 20px;
  font-size: 0.9rem;
  color: var(--rb-muted);
  border-bottom: 1px solid var(--rb-panel-border);
  line-height: 1.6;
}

.rb-bookmarks-status {
  padding: 8px 20px;
  font-size: 0.95rem;
  min-height: 1.2em;
}

.rb-bookmarks-empty {
  padding: 24px 20px;
  text-align: center;
  font-size: 1rem;
  color: var(--rb-muted);
}

.rb-bookmarks-empty[hidden] {
  display: none !important;
}

.rb-bookmarks-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1 1 auto;
}

.rb-bookmark-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--rb-panel-border);
}

.rb-bookmark-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
  cursor: pointer;
  border-radius: 10px;
  padding: 8px 12px;
  margin: -8px 0;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.rb-bookmark-title {
  font-weight: 600;
  font-size: 1.05rem;
  word-break: break-word;
}

.rb-bookmark-ref {
  color: var(--rb-muted);
  font-size: 0.92rem;
}

.rb-bookmark-snippet {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--rb-fg);
  opacity: 0.92;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.rb-bookmark-main:hover,
.rb-bookmark-main:focus-visible {
  background: var(--rb-surface-hover);
}

.rb-bookmark-main:focus-visible {
  outline: 2px solid var(--rb-accent);
  outline-offset: 2px;
}

.rb-bookmark-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: flex-start;
  align-items: flex-end;
  min-width: 112px;
  flex: 0 0 auto;
}

.rb-bookmark-actions .btn {
  width: 100%;
}

@media (max-width: 520px) {
  .rb-bookmarks-panel {
    width: min(94vw, 500px);
    max-height: 92vh;
  }

  .rb-bookmark-item {
    flex-direction: column;
    align-items: stretch;
  }

  .rb-bookmark-actions {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    min-width: 0;
  }

  .rb-bookmark-actions .btn {
    width: auto;
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  background: var(--rb-toast-bg);
  border: 1px solid var(--rb-toast-border);
  color: var(--rb-fg);
  padding: 8px 12px;
  border-radius: 10px;
  display: none;
  z-index: 9999;
}

/* ===== Glow (temporary) ===== */
.rb-highlight {
  outline: 2px solid rgba(255, 221, 87, .9);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .3);
  background: var(--rb-highlight-bg);
  color: var(--rb-highlight-fg);
  border-radius: 6px;
  transition: outline-color .2s ease-out, background-color .2s ease-out, color .2s ease-out;
}

/* ===== Marker (persistent) ===== */
.rb-verse.is-marked {
  position: relative;
  border-radius: 6px;
}

/* 7色：背景のみで視認性を確保 */
.rb-verse.is-marked.mark-yellow {
  background: rgba(255, 221, 87, .22) !important;
}

.rb-verse.is-marked.mark-green {
  background: rgba(126, 217, 87, .18) !important;
}

.rb-verse.is-marked.mark-blue {
  background: rgba(87, 165, 255, .18) !important;
}

.rb-verse.is-marked.mark-pink {
  background: rgba(255, 128, 171, .20) !important;
}

.rb-verse.is-marked.mark-purple {
  background: rgba(171, 128, 255, .18) !important;
}

.rb-verse.is-marked.mark-brown {
  background: rgba(199, 122, 69, .20) !important;
}

.rb-verse.is-marked.mark-gray {
  background: rgba(158, 158, 158, .24) !important;
}

/* --- persistent mark backgrounds (light, readable) --- */
.rb-verse[data-rb-mark="yellow"] {
  background-color: rgba(255, 235, 59, 0.28);
}

.rb-verse[data-rb-mark="green"] {
  background-color: rgba(76, 175, 80, 0.22);
}

.rb-verse[data-rb-mark="blue"] {
  background-color: rgba(33, 150, 243, 0.20);
}

.rb-verse[data-rb-mark="pink"] {
  background-color: rgba(244, 67, 54, 0.18);
}

.rb-verse[data-rb-mark="purple"] {
  background-color: rgba(156, 39, 176, 0.18);
}

.rb-verse[data-rb-mark="brown"] {
  background-color: rgba(199, 122, 69, 0.20);
}

.rb-verse[data-rb-mark="gray"] {
  background-color: rgba(158, 158, 158, 0.24);
}

/* 読みやすさ確保。長文のときは内側に少し余白 */
.rb-verse[data-rb-mark] {
  padding-inline: 2px;
  border-radius: 2px;
}

#rb-color-pop {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#rb-color-pop .rb-color-pop-close {
  align-self: flex-end;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #f8f8f8;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .12s ease, color .12s ease;
}

#rb-color-pop .rb-color-pop-close:hover,
#rb-color-pop .rb-color-pop-close:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  outline: none;
}

#rb-color-pop .rb-color-pop-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
}

#rb-color-pop .rb-color-pop-row.is-locked {
  opacity: 0.75;
}

#rb-color-pop .rb-color-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}

#rb-color-pop .rb-color-btn.is-disabled {
  opacity: 0.4;
  cursor: pointer;
  box-shadow: none;
}

#rb-color-pop .rb-color-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  width: 100%;
  align-items: center;
}

#rb-color-pop .rb-color-bookmark,
#rb-color-pop .rb-color-copy {
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  min-width: 140px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  text-align: center;
}

#rb-color-pop .rb-color-bookmark {
  border-color: #4c6ef5;
  background: #3b5bdb;
  color: #fff;
}

#rb-color-pop .rb-color-copy {
  border-color: #3c3c3c;
  background: #2b2b2b;
  color: #f8f8f8;
}

#rb-color-pop .rb-color-copy.is-success {
  border-color: #2f9e44;
  background: #37b24d;
  color: #fff;
}

#rb-color-pop .rb-color-copy.is-error {
  border-color: #c92a2a;
  background: #e03131;
  color: #fff;
}

#rb-color-pop .rb-color-bookmark[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

#rb-color-pop .rb-color-bookmark.is-disabled {
  opacity: 0.32;
  cursor: pointer;
  background: rgba(59, 91, 219, 0.35);
  border-color: rgba(76, 110, 245, 0.55);
  color: rgba(255, 255, 255, 0.9);
}

#rb-color-pop .rb-color-clear {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid #444;
  background: #222;
  color: #eee;
  cursor: pointer;
  white-space: nowrap;
  margin-left: auto;
  height: 40px;
  min-width: 96px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#rb-color-pop .rb-color-clear.is-disabled {
  opacity: 0.45;
  cursor: pointer;
}

#rb-color-pop .rb-color-login {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 19, 26, 0.9);
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.5;
}

#rb-color-pop .rb-color-login-text {
  flex: 1 1 auto;
}

#rb-color-pop .rb-color-login-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #4c6ef5;
  background: #3b5bdb;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

#rb-color-pop .rb-color-login-btn:hover,
#rb-color-pop .rb-color-login-btn:focus-visible {
  filter: brightness(1.05);
  outline: none;
}

:root[data-theme="light"] #rb-color-pop .rb-color-login {
  border-color: rgba(100, 116, 139, 0.4);
  background: rgba(248, 250, 255, 0.95);
  color: #1f2937;
}

@media (max-width: 520px) {
  #rb-color-pop .rb-color-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  #rb-color-pop .rb-color-copy,
  #rb-color-pop .rb-color-clear {
    justify-self: stretch;
    text-align: center;
  }
}

/* ===== Marker Extract Overlay ===== */
.rb-marker-extract {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.rb-marker-extract[hidden] {
  display: none !important;
}

.rb-marker-extract.is-open {
  display: flex;
}

.rb-marker-extract-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.rb-marker-extract-panel {
  position: relative;
  width: min(720px, 94vw);
  max-height: 88vh;
  border-radius: 16px;
  overflow: hidden;
  background: var(--rb-panel-bg);
  color: var(--rb-fg);
  border: 1px solid var(--rb-panel-border);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
}

.rb-marker-extract-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--rb-line);
  background: color-mix(in srgb, var(--rb-panel-bg) 80%, var(--rb-bg));
}

.rb-marker-extract-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 650;
}

.rb-marker-extract-close {
  padding-inline: 14px;
}

.rb-marker-extract-controls {
  padding: 12px 20px;
  border-bottom: 1px solid var(--rb-line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.rb-marker-extract-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rb-marker-extract-color {
  --swatch: transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--rb-input-border);
  background: var(--rb-input-bg);
  cursor: pointer;
  font-size: 0.9rem;
  user-select: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.rb-marker-extract-color input[type="checkbox"] {
  accent-color: var(--swatch);
  margin: 0;
}

.rb-marker-extract-color-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.rb-marker-extract-color[data-color="yellow"] {
  --swatch: #FFDD57;
}

.rb-marker-extract-color[data-color="green"] {
  --swatch: #7ED957;
}

.rb-marker-extract-color[data-color="blue"] {
  --swatch: #57A5FF;
}

.rb-marker-extract-color[data-color="pink"] {
  --swatch: #FF80AB;
}

.rb-marker-extract-color[data-color="purple"] {
  --swatch: #AB80FF;
}

.rb-marker-extract-color[data-color="brown"] {
  --swatch: #C77A45;
}

.rb-marker-extract-color[data-color="gray"] {
  --swatch: #9E9E9E;
}

.rb-marker-extract-actions-inline {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.rb-marker-extract-body {
  flex: 1;
  overflow: auto;
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rb-marker-extract-status {
  font-size: 0.9rem;
  color: var(--rb-muted-fg, rgba(255, 255, 255, 0.65));
}

.rb-marker-extract-empty {
  padding: 32px 0;
  text-align: center;
  font-size: 0.95rem;
  color: var(--rb-muted-fg, rgba(255, 255, 255, 0.7));
}

.rb-marker-extract-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rb-marker-extract-item {
  --swatch: var(--rb-input-focus);
  border: 1px solid color-mix(in srgb, var(--swatch) 25%, transparent);
  border-left: 4px solid var(--swatch);
  border-radius: 12px;
  background: color-mix(in srgb, var(--rb-panel-bg) 92%, var(--swatch));
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.rb-marker-extract-item[data-color="yellow"] {
  --swatch: #FFDD57;
}

.rb-marker-extract-item[data-color="green"] {
  --swatch: #7ED957;
}

.rb-marker-extract-item[data-color="blue"] {
  --swatch: #57A5FF;
}

.rb-marker-extract-item[data-color="pink"] {
  --swatch: #FF80AB;
}

.rb-marker-extract-item[data-color="purple"] {
  --swatch: #AB80FF;
}

.rb-marker-extract-item[data-color="brown"] {
  --swatch: #C77A45;
}

.rb-marker-extract-item[data-color="gray"] {
  --swatch: #9E9E9E;
}

.rb-marker-extract-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.rb-marker-extract-book {
  font-weight: 650;
  font-size: 1rem;
}

.rb-marker-extract-ref {
  font-size: 0.95rem;
  color: var(--rb-muted-fg, rgba(255, 255, 255, 0.75));
}

.rb-marker-extract-text {
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.rb-marker-extract-note {
  font-size: 0.85rem;
  color: var(--rb-muted-fg, rgba(255, 255, 255, 0.7));
}

.rb-marker-extract-item-actions {
  display: flex;
  justify-content: flex-end;
}

.rb-marker-extract-jump {
  min-width: 120px;
}

@media (max-width: 520px) {
  .rb-marker-extract-panel {
    width: min(96vw, 520px);
    inset: auto 0 0 0;
    border-radius: 16px 16px 0 0;
  }

  .rb-marker-extract-header,
  .rb-marker-extract-controls,
  .rb-marker-extract-body {
    padding-inline: 16px;
  }

  .rb-marker-extract-item {
    padding: 12px 14px;
  }
}

body.rb-marker-extract-open {
  overflow: hidden;
}

.rb-parallel-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.rb-parallel-grid>* {
  min-width: 0;
}

.rb-parallel-cell {
  min-width: 280px;
}

.rb-parallel-cell .label {
  font-weight: 600;
  font-size: .9rem;
  opacity: .8;
  line-height: 0.2;
  margin-bottom: 4px;
}

.rb-parallel-cell .verse {
  line-height: 1.6;
}

.rb-parallel-cell .verse .vno {
  opacity: .6;
  margin-right: .4em;
}

table.rb-chapter {
  width: 100%;
  border-collapse: collapse;
  min-width: calc(4rem + 280px * var(--rb-col-count, 1));
}

table.rb-chapter th,
table.rb-chapter td {
  border: 1px solid var(--rb-table-border);
  padding: .5rem;
  vertical-align: top;
}

table.rb-chapter th {
  padding: .3rem .5rem;
}

table.rb-chapter td {
  padding: .5rem;
}

/* ===== Parallel Matrix (up to 6 translations) ===== */
.rb-matrix-grid {
  display: grid;
  gap: 12px;
  overflow-x: auto;
  padding: 0 12px 8px;
  box-sizing: border-box;
  scroll-padding-inline: 12px;
  grid-auto-rows: auto;
  position: relative;
}

.rb-chapter-section {
  padding: 14px 0 28px;
  border-bottom: 1px solid var(--rb-line);
  position: relative;
}

.rb-chapter-section:first-of-type {
  padding-top: 8px;
}

.rb-chapter-section:last-of-type {
  border-bottom: none;
  padding-bottom: 40px;
}

.rb-chapter-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  color: var(--rb-muted);
  text-align: center;
  cursor: default;
}

.rb-chapter-placeholder-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
}

.rb-chapter-placeholder-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--rb-fg);
}

.rb-chapter-placeholder-status {
  font-size: 0.85rem;
  color: var(--rb-muted);
}

.rb-chapter-placeholder--loading .rb-chapter-placeholder-status::after {
  content: '';
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-left: 0.5em;
  border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, 0.35);
  border-top-color: var(--rb-accent);
  animation: rb-chapter-spinner 1s linear infinite;
}

.rb-chapter-placeholder--error {
  cursor: pointer;
}

.rb-chapter-placeholder--error .rb-chapter-placeholder-title,
.rb-chapter-placeholder--error .rb-chapter-placeholder-status {
  color: #fca5a5;
}

.rb-chapter-placeholder--error:hover .rb-chapter-placeholder-status {
  text-decoration: underline;
}

@keyframes rb-chapter-spinner {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.rb-matrix-grid .cell {
  min-width: 280px;
  line-height: 1.6;
}

.rb-matrix-grid .head {
  font-weight: 600;
  font-size: .95rem;
  opacity: 1;
  margin: 0;
  display: flex;
  align-items: center;
  position: sticky;
  top: var(--rb-sticky-header-offset, 0px);
  box-sizing: border-box;
  min-height: var(--rb-translation-header-row-height, var(--rb-translation-header-height));
  max-height: var(--rb-translation-header-row-height, var(--rb-translation-header-height));
  height: var(--rb-translation-header-row-height, var(--rb-translation-header-height));
  padding: 10px 12px;
  background: var(--rb-translation-header-bg);
  color: var(--rb-muted);
  border-bottom: 1px solid var(--rb-translation-header-border);
  z-index: 3;
}

body.rb-has-translation-header .rb-matrix-grid .cell.head {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.rb-matrix-grid .vno {
  opacity: .6;
  margin-right: .4em;
}

@media (max-width: 480px) {
  .rb-matrix-grid .cell {
    min-width: 220px;
  }

  :root {
    --rb-translation-header-height-base: 64px;
  }
}

table.rb-chapter th[data-translation-code],
table.rb-chapter td.rb-verse-text {
  min-width: 280px;
}

table.rb-chapter th {
  position: sticky;
  top: var(--rb-sticky-header-offset, 0px);
  background: var(--rb-panel-elevated-bg);
  z-index: 1;
}

.rb-verse-no {
  width: 4rem;
  text-align: right;
  color: var(--rb-verse-no-color);
}

.rb-verse-text {
  line-height: 1.6;
}

.rb-verse {
  /* 上部固定の ①トップバー＋②翻訳ヘッダー の合計を避ける */
  scroll-margin-top: calc(var(--rb-sticky-header-offset, 0px) + var(--rb-translation-header-height, 0px) + 16px);
}

.rb-verse.rb-verse-flash .vtext {
  color: inherit;
  text-shadow: 0 0 6px rgba(255, 221, 87, 0.9), 0 0 18px rgba(255, 221, 87, 0.45);
}

.rb-empty {
  color: var(--rb-verse-empty-color);
  font-style: italic;
  text-align: center;
}

/* 検索結果の強調表示（検索パネル側） */
.rb-sp-results mark {
  background: var(--rb-accent);
  color: #000;
  padding: 0 .12em;
  border-radius: 2px;
}

/* 本文側の検索語マーク（フェードアウト無し、恒常表示） */
mark.rb-term {
  background: rgba(255, 217, 87, 0.9);
  color: #000;
  padding: 0 .1em;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .08) inset;
}

/* Mikoto panel border fix + 最前面化 */
.rb-miko-panel {
  border: none !important;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .48), 0 2px 8px rgba(0, 0, 0, .32), inset 0 0 0 1px rgba(255, 255, 255, .04);
  background: var(--rb-miko-bg, rgba(13, 18, 24, .88)) !important;
  overflow: hidden;
  z-index: var(--z-mikoto) !important;
}

.rb-miko-panel.is-closing,
.rb-miko-panel[aria-modal="false"][data-state="closed"] {
  transform: translateY(calc(100% + 3px)) !important;
}

.rb-miko-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .03);
}

/* ==== Marker UI ===================================================== */

td.rb-marker-cell {
  cursor: pointer;
  position: relative;
}

td.rb-marker-cell:focus-visible {
  outline: 2px solid var(--rb-accent);
  outline-offset: 2px;
}

tr.rb-marker-row td {
  background: color-mix(in srgb, var(--rb-fg) 6%, transparent);
  box-shadow: inset 4px 0 0 color-mix(in srgb, var(--rb-fg) 12%, transparent);
  transition: background-color .15s ease;
}

tr.rb-marker-row td:first-child {
  font-weight: 600;
}

.rb-marker-popover {
  position: fixed;
  z-index: 3500;
  background: var(--rb-panel-elevated-bg);
  border: 1px solid var(--rb-panel-border);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
  padding: 12px;
  min-width: 220px;
  color: var(--rb-fg);
  display: none;
}

.rb-marker-popover[data-open="true"] {
  display: block;
}

.rb-marker-popover h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 600;
}

.rb-marker-note {
  margin: 0 0 8px;
  font-size: 0.85rem;
  opacity: .75;
}

.rb-marker-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rb-marker-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 8px 10px;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}

.rb-marker-option:hover,
.rb-marker-option:focus-visible {
  background: color-mix(in srgb, var(--rb-fg) 8%, transparent);
  border-color: color-mix(in srgb, var(--rb-fg) 18%, transparent);
  outline: none;
}

.rb-marker-option.is-active {
  background: color-mix(in srgb, var(--rb-fg) 16%, transparent);
  border-color: color-mix(in srgb, var(--rb-fg) 26%, transparent);
}

.rb-marker-swatch {
  width: 16px;
  height: 16px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, .35);
  flex: 0 0 auto;
}

.rb-marker-label {
  flex: 1 1 auto;
  text-align: left;
}

.rb-marker-clear {
  margin-top: 10px;
  width: 100%;
  border-radius: 10px;
  border: 1px dashed color-mix(in srgb, var(--rb-fg) 24%, transparent);
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 7px 10px;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}

.rb-marker-clear:hover,
.rb-marker-clear:focus-visible {
  background: color-mix(in srgb, var(--rb-fg) 8%, transparent);
  border-color: color-mix(in srgb, var(--rb-fg) 32%, transparent);
  outline: none;
}

.rb-marker-clear[disabled] {
  opacity: .5;
  cursor: not-allowed;
}

.rb-marker-popover[data-busy="true"] {
  opacity: .6;
  pointer-events: none;
}

/* === Auth Modal === */
body.rb-auth-open {
  overflow: hidden;
}

.rb-auth-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--rb-overlay-bg);
  z-index: calc(var(--z-menu) + 200);
}

.rb-auth-overlay[hidden] {
  display: none;
}

.rb-auth-modal {
  width: min(360px, 100%);
  background: var(--rb-auth-modal-bg);
  color: var(--rb-fg);
  border: 1px solid var(--rb-auth-modal-border);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  padding: 24px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

.rb-auth-title {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
}

.rb-auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  appearance: none;
  border: none;
  background: none;
  color: inherit;
  font-size: 20px;
  padding: 4px;
  cursor: pointer;
  line-height: 1;
}

.rb-auth-close:focus-visible {
  outline: 2px solid var(--rb-input-focus);
  outline-offset: 2px;
}

.rb-auth-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--rb-muted);
}

.rb-auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rb-auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.rb-auth-field input {
  appearance: none;
  border-radius: 10px;
  border: 1px solid var(--rb-input-border);
  background: var(--rb-input-bg);
  color: var(--rb-fg);
  padding: 10px 12px;
  font-size: 14px;
}

.rb-auth-field input:focus {
  outline: 2px solid var(--rb-input-focus);
  outline-offset: 0;
}

.rb-auth-message {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

.rb-auth-message[data-type="error"] {
  color: var(--rb-auth-message-error);
}

.rb-auth-message[data-type="info"] {
  color: var(--rb-auth-message-info);
}

.rb-auth-submit {
  align-self: flex-end;
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  background: #ffd957;
  color: #141414;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform .15s ease;
}

.rb-auth-submit:disabled {
  opacity: .65;
  cursor: progress;
  transform: none;
}

.rb-auth-submit:not(:disabled):active {
  transform: scale(.98);
}

.rb-auth-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.rb-auth-link {
  appearance: none;
  border: none;
  background: none;
  color: var(--rb-auth-link-color);
  padding: 0;
  text-align: left;
  cursor: pointer;
  font-size: inherit;
}

.rb-auth-link[hidden] {
  display: none;
}

.rb-auth-link:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.rb-auth-overlay[data-busy="true"] {
  cursor: progress;
}

.rb-auth-overlay[data-busy="true"] * {
  cursor: inherit;
}

@media (max-width: 480px) {
  .rb-auth-modal {
    padding: 20px 18px 18px;
    border-radius: 14px;
  }
}

/* === Markers === */
.rb-verse.is-marked {
  border-radius: 6px;
  position: relative;
}

/* palette */
.mark-yellow {
  background: rgba(255, 221, 87, .22) !important;
}

.mark-green {
  background: rgba(126, 217, 87, .18) !important;
}

.mark-blue {
  background: rgba(87, 165, 255, .18) !important;
}

.mark-pink {
  background: rgba(255, 128, 171, .20) !important;
}

.mark-purple {
  background: rgba(171, 128, 255, .18) !important;
}

.mark-brown {
  background: rgba(199, 122, 69, .20) !important;
}

.mark-gray {
  background: rgba(158, 158, 158, .24) !important;
}

/* === Re-Bible: persistent markers === */
.rb-verse[data-rb-mark="yellow"] {
  outline: 2px solid rgba(255, 221, 87, .9);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25);
}

.rb-verse[data-rb-mark="green"] {
  outline: 2px solid rgba(126, 217, 87, .9);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25);
}

.rb-verse[data-rb-mark="blue"] {
  outline: 2px solid rgba(87, 165, 255, .9);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25);
}

.rb-verse[data-rb-mark="pink"] {
  outline: 2px solid rgba(255, 128, 171, .9);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25);
}

.rb-verse[data-rb-mark="purple"] {
  outline: 2px solid rgba(171, 128, 255, .9);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25);
}

.rb-verse[data-rb-mark="brown"] {
  outline: 2px solid rgba(199, 122, 69, .9);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25);
}

.rb-verse[data-rb-mark="gray"] {
  outline: 2px solid rgba(158, 158, 158, .9);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25);
}

/* 既存スキンが参照する想定の色変数だけ定義（背景や影の形状は触らない） */
.rb-verse[data-rb-mark="yellow"] {
  --rb-mark-color: #FFDD57;
}

.rb-verse[data-rb-mark="green"] {
  --rb-mark-color: #7ED957;
}

.rb-verse[data-rb-mark="blue"] {
  --rb-mark-color: #57A5FF;
}

.rb-verse[data-rb-mark="pink"] {
  --rb-mark-color: #FF80AB;
}

.rb-verse[data-rb-mark="purple"] {
  --rb-mark-color: #AB80FF;
}

.rb-verse[data-rb-mark="brown"] {
  --rb-mark-color: #C77A45;
}

.rb-verse[data-rb-mark="gray"] {
  --rb-mark-color: #9E9E9E;
}


/* ===== Sticky重なり 恒久対策（トップバー＋翻訳ヘッダーを常に避ける） ===== */

/* ① JS が流し込む --rb-sticky-header-offset と既存の
      --rb-translation-header-height を合算した総オフセット */
:root {
  --rb-total-sticky-offset: calc(var(--rb-sticky-header-offset, 0px) + var(--rb-translation-header-height, 0px));
}

/* ② 先頭で本文がヘッダー裏に潜らないよう、章マウント直下に擬似スペーサーを常時挿入
      （並列グリッド／テーブル表示の両方をカバー） */
#chapterMount::before,
.rb-matrix-grid::before,
table.rb-chapter::before {
  content: "";
  display: block;
  height: 15em;
}

/* ③ ハッシュ遷移・scrollIntoView の時も確実に避ける（念のため） */
.rb-verse {
  scroll-margin-top: calc(var(--rb-total-sticky-offset) + 16px);
}

/* ④ 翻訳ヘッダーはトップバー分だけで固定（既に定義があっても後勝ちで同値） */
.rb-matrix-grid .head {
  position: sticky;
  top: var(--rb-sticky-header-offset, 0px);
  z-index: 3;
}