/* scripture.how reader static CSS; dynamic rules remain inline in source order. */
/* 문단 시작(¶ pilcrow) — 원본 조판의 문단 구분 재현. ::before 라 DOM 텍스트 미포함(offset-map 무영향).
   텍스트 흐름에 자연스럽게 inline 삽입되며 절 첫 단어 앞에 위치. */
#scripture-viewer .scripture-passage-text[data-paragraph-start="1"]::before {
    content: "¶";
    margin-right: 0.2em;
    color: rgba(120, 113, 108, 0.85);
    font-weight: 600;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-passage-text[data-paragraph-start="1"]::before {
    color: rgba(168, 162, 158, 0.9);
}
/* ⚙ 토글 off — 전부 평이 (¶ 포함) */
#scripture-viewer[data-emphasis-display="off"] .scripture-emphasis {
    font-weight: inherit !important;
    font-family: inherit !important;
    font-style: inherit !important;
}
#scripture-viewer[data-emphasis-display="off"] .scripture-passage-text[data-paragraph-start="1"]::before {
    content: none;
}
#scripture-viewer .scripture-original-translation-highlight {
    border-radius: 0.25rem;
    background: #e0f2fe;
    color: #0c4a6e;
    box-shadow: 0 0 0 2px #38bdf8 inset;
    padding: 0.05rem 0.12rem;
    transition: background 0.16s ease, box-shadow 0.16s ease;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-original-translation-highlight {
    background: #075985;
    color: #e0f2fe;
    box-shadow: 0 0 0 2px #38bdf8 inset;
}
/* 낮은 confidence(불확실) 정렬 — 점선 + 연한색으로 "확실하지 않음" 표시 */
#scripture-viewer .scripture-original-translation-highlight--low {
    background: #f0f9ff;
    color: #475569;
    box-shadow: none;
    outline: 1px dashed #7dd3fc;
    outline-offset: -1px;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-original-translation-highlight--low {
    background: #0c4a6e;
    color: #bae6fd;
    box-shadow: none;
    outline: 1px dashed #38bdf8;
    outline-offset: -1px;
}
/* 성경용어 사전 — 본문 점선밑줄(의미색 배경/글자색과 채널 분리) + 토글 + 팝업 */
#scripture-viewer .scripture-term-link {
    text-decoration-line: underline;
    text-decoration-style: var(--scripture-dictionary-underline-style);
    text-underline-offset: var(--scripture-dictionary-underline-offset);
    text-decoration-thickness: var(--scripture-dictionary-underline-thickness);
    text-decoration-color: var(--scripture-dictionary-underline-color);
    cursor: pointer;
}
#scripture-viewer[data-edit-mode="1"] .scripture-term-link {
    cursor: text;
    pointer-events: none;
}
#scripture-viewer[data-edit-mode="1"][data-annotations="hidden"] .scripture-term-link {
    cursor: pointer;
    pointer-events: auto;
}
#scripture-viewer .scripture-term-link--low {
    text-decoration-style: dashed;
    opacity: 0.85;
}
body:not(.term-highlight-on) #scripture-viewer .scripture-term-link {
    text-decoration: none;
    cursor: inherit;
    pointer-events: none;
}
/* 사전 강조를 끄면 term 스팬이 pointer-events:none 이 되는데, 하이라이트 스팬은 그 **안에**
   중첩되므로 클릭이 통째로 죽는다. 하이라이트/메모 아이콘만 클릭을 되살린다. (formal 260712-1702) */
body:not(.term-highlight-on) #scripture-viewer .scripture-term-link .scripture-highlight,
body:not(.term-highlight-on) #scripture-viewer .scripture-term-link .scripture-highlight-note-marker {
    pointer-events: auto;
}
.scripture-term-toggle {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 50;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid #cbd5e1;
    border-radius: 9999px;
    background: #ffffff;
    color: #0f172a;
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    cursor: pointer;
}
body:not(.term-highlight-on) .scripture-term-toggle {
    color: #94a3b8;
}
.scripture-reader-annotation-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    margin: 0;
    width: min(42rem, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    overflow: hidden;
    border: none;
    border-radius: 0.5rem;
    padding: 0;
    box-shadow: 0 18px 60px rgba(15, 23, 42, 0.28);
}
.scripture-reader-annotation-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
}
.scripture-term-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    margin: 0;
    height: fit-content;
    max-height: calc(100% - 2rem);
    overflow: auto;
    border: none;
    border-radius: 0.75rem;
    padding: 0;
    max-width: 28rem;
    width: calc(100% - 2rem);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}
.scripture-term-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
}
.scripture-term-dialog__inner {
    position: relative;
    padding: 1.25rem 1.25rem 1rem;
}
.scripture-term-dialog__close {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    border: none;
    background: transparent;
    font-size: 1rem;
    cursor: pointer;
    color: #64748b;
}
.scripture-content-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    margin: 0;
    width: min(42rem, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    overflow: hidden;
    border: none;
    border-radius: 0.5rem;
    padding: 0;
    background: #ffffff;
    color: #1c1917;
    box-shadow: 0 18px 60px rgba(15, 23, 42, 0.28);
}
.scripture-content-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
}
.scripture-original-token-dialog {
    width: min(34rem, calc(100vw - 24px));
}
.scripture-term-dialog {
    width: min(28rem, calc(100vw - 2rem));
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
}
.scripture-term-dialog__inner {
    padding: 0;
    width: 100%;
}
.scripture-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    border-bottom: 1px solid #e7e5e4;
    padding: 1rem 5rem 1rem 1.25rem;
}
/* 모바일: 헤더가 가로 flex 라 제목과 탭 줄이 나란히 놓이고, 좁은 폭에서 제목이 3줄로 접히며
   탭까지 어지럽게 감긴다. 세로로 쌓고 탭은 가로 스크롤로 한 줄에 유지한다. (2026-07-12) */
@media (max-width: 639px) {
    .scripture-dialog-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding-right: 4.5rem;
    }
    .scripture-nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .scripture-nav-tabs::-webkit-scrollbar {
        display: none;
    }
    .scripture-nav-tabs > button {
        flex: none;
    }
}
.scripture-dialog-body {
    max-height: 70vh;
    overflow-y: auto;
    padding: 1rem 1.25rem;
}
.scripture-dialog-close,
.scripture-term-dialog__close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    flex: none;
    margin-left: 0;
    border: none;
    border-radius: 0.375rem;
    background: transparent;
    padding: 0.25rem 0.5rem;
    color: #78716c;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25rem;
    cursor: pointer;
}
.scripture-dialog-close:hover,
.scripture-term-dialog__close:hover {
    background: #f5f5f4;
    color: #292524;
}
.scripture-term-dialog__eyebrow {
    color: #b45309;
    font-size: 0.75rem;
    font-weight: 700;
}

.scripture-term-card__head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.scripture-term-card__headword {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
}
.scripture-term-card__badge {
    font-size: 0.7rem;
    font-weight: 700;
    color: #0369a1;
    background: #e0f2fe;
    border-radius: 9999px;
    padding: 0.1rem 0.5rem;
}
.scripture-term-card__meaning {
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: #475569;
}
.scripture-term-card__summary {
    margin-top: 0.6rem;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #1e293b;
}
.scripture-term-card__body {
    margin-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
    padding-top: 0.75rem;
    color: #334155;
}
.scripture-term-card__body p {
    margin: 0.55rem 0;
    font-size: 0.9rem;
    line-height: 1.7;
    color: inherit;
}
.scripture-term-card__body ul,
.scripture-term-card__body ol {
    margin: 0.7rem 0 0.7rem 1.25rem;
    font-size: 0.9rem;
    line-height: 1.65;
}
.scripture-term-card__row {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #334155;
}
.scripture-term-card__label {
    font-weight: 700;
    color: #64748b;
}
.scripture-term-card__more {
    display: inline-block;
    margin-top: 0.85rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #0ea5e9;
    text-decoration: none;
}
/* 다크 테마 팝업 (뷰어 data-scripture-theme=dark 시 JS 가 클래스 부여) */
.scripture-term-dialog--dark {
    background: #101827;
}
.scripture-term-dialog--dark .scripture-term-card__headword {
    color: #f8fafc;
}
.scripture-term-dialog--dark .scripture-term-card__summary {
    color: #e2e8f0;
}
.scripture-term-dialog--dark .scripture-term-card__body {
    border-top-color: #334155;
    color: #e2e8f0;
}
.scripture-term-dialog--dark .scripture-term-card__meaning,
.scripture-term-dialog--dark .scripture-term-card__row {
    color: #cbd5e1;
}
.scripture-term-dialog--dark .scripture-term-card__label {
    color: #94a3b8;
}
.scripture-term-dialog--dark .scripture-term-dialog__close {
    color: #94a3b8;
}
.scripture-term-dialog--dark .scripture-term-card__badge {
    background: #0c4a6e;
    color: #bae6fd;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-brand-header,
#scripture-viewer[data-scripture-theme="dark"] .scripture-topbar {
    border-color: #1e293b;
    background: rgba(11, 18, 32, 0.97);
    color: #f8fafc;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-brand-logo,
#scripture-viewer[data-scripture-theme="dark"] .scripture-brand-name,
#scripture-viewer[data-scripture-theme="dark"] .scripture-nav-trigger,
#scripture-viewer[data-scripture-theme="dark"] .scripture-chapter-nav,
#scripture-viewer[data-scripture-theme="dark"] .scripture-settings-trigger {
    color: #f8fafc;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-brand-subtitle,
#scripture-viewer[data-scripture-theme="dark"] .scripture-brand-subtitle {
    color: #94a3b8;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-location-picker,
#scripture-viewer[data-scripture-theme="dark"] .scripture-chapter-nav:not(.scripture-chapter-nav--next),
#scripture-viewer[data-scripture-theme="dark"] .scripture-settings-trigger {
    border-color: #334155;
    background: #111827;
    box-shadow: none;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-brand-mark,
#scripture-viewer[data-scripture-theme="dark"] .scripture-chapter-nav--next {
    background: #f8fafc;
    border-color: #f8fafc;
    color: #111827;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-feature-verse-card {
    border-color: rgba(148, 163, 184, 0.34);
    background: rgba(15, 23, 42, 0.82);
    color: #f8fafc;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-feature-verse-label {
    background: #f8fafc;
    color: #0f172a;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-feature-verse-link {
    color: #67e8f9;
    border-left-color: rgba(103, 232, 249, 0.34);
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-nav-trigger:hover,
#scripture-viewer[data-scripture-theme="dark"] .scripture-chapter-nav:not(.scripture-chapter-nav--next):hover,
#scripture-viewer[data-scripture-theme="dark"] .scripture-settings-trigger:hover {
    background: #1e293b;
    color: #fbbf24;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-chapter-nav--next:hover {
    background: #e2e8f0;
    border-color: #e2e8f0;
    color: #111827;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-text-panel {
    background: #0b1220;
    border-color: #1e293b;
    color: #e5e7eb;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-passage {
    color: #dbeafe;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-passage:hover {
    background: rgb(146 64 14 / 0.16);
    border-color: rgb(245 158 11 / 0.45);
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-passage.is-selected {
    background: rgb(245 158 11 / 0.18);
    border-color: #fbbf24;
    box-shadow: 0 0 0 1px rgb(251 191 36 / 0.22), inset 3px 0 0 #fbbf24;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-verse-copy-button {
    border-color: #fbbf24;
    background: #111827;
    color: #fde68a;
    box-shadow: 0 8px 20px rgb(0 0 0 / 0.26);
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-verse-copy-button:hover {
    background: #fbbf24;
    color: #111827;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-verse-clear-button {
    border-color: #475569;
    background: #111827;
    color: #cbd5e1;
    box-shadow: 0 8px 20px rgb(0 0 0 / 0.24);
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-verse-clear-button:hover {
    border-color: #94a3b8;
    background: #334155;
    color: #ffffff;
}
#scripture-viewer[data-scripture-theme="dark"] .bg-stone-50\/80,
#scripture-viewer[data-scripture-theme="dark"] .bg-amber-50 {
    background-color: #111827 !important;
}
#scripture-viewer[data-scripture-theme="dark"] .border-amber-200,
#scripture-viewer[data-scripture-theme="dark"] .border-amber-300,
#scripture-viewer[data-scripture-theme="dark"] .border-amber-500 {
    border-color: #92400e !important;
}
#scripture-viewer[data-scripture-theme="dark"] .text-amber-950,
#scripture-viewer[data-scripture-theme="dark"] .text-amber-900,
#scripture-viewer[data-scripture-theme="dark"] .text-amber-800,
#scripture-viewer[data-scripture-theme="dark"] .text-amber-700 {
    color: #fbbf24 !important;
}
#scripture-viewer[data-scripture-theme="dark"] .hover\:bg-amber-100:hover,
#scripture-viewer[data-scripture-theme="dark"] .hover\:bg-amber-50:hover {
    background-color: #1e293b !important;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-text-panel .bg-white,
#scripture-viewer[data-scripture-theme="dark"] .scripture-text-panel .bg-stone-50,
#scripture-viewer[data-scripture-theme="dark"] .scripture-text-panel .bg-stone-50\/80 {
    background-color: #111827 !important;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-text-panel .text-stone-950,
#scripture-viewer[data-scripture-theme="dark"] .scripture-text-panel .text-stone-900,
#scripture-viewer[data-scripture-theme="dark"] .scripture-text-panel .text-stone-800,
#scripture-viewer[data-scripture-theme="dark"] .scripture-text-panel .text-stone-700 {
    color: #f8fafc !important;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-text-panel .text-stone-600,
#scripture-viewer[data-scripture-theme="dark"] .scripture-text-panel .text-stone-500 {
    color: #cbd5e1 !important;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-note-guide {
    border-color: #334155;
    background: #0f172a;
    box-shadow: none;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-note-guide-title {
    color: #f8fafc;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-note-guide-copy {
    color: #94a3b8;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-guide-action {
    border-color: #334155 !important;
    background: #0f172a !important;
    color: #cbd5e1 !important;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-guide-action:hover {
    border-color: #64748b !important;
    background: #1e293b !important;
    color: #f8fafc !important;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-guide-action--edit {
    border-color: #f8fafc !important;
    background: #f8fafc !important;
    color: #111827 !important;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-structure-summary-row > summary {
    border-color: #334155;
    background: #0f172a;
    color: #f8fafc;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-structure-summary-row > summary:hover {
    border-color: #f59e0b;
    background: #111827;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-structure-summary-content {
    border-color: #334155;
    background: #111827;
    color: #e2e8f0;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-inline-commentary-view,
#scripture-viewer[data-scripture-theme="dark"] [data-inline-note-editor-box],
#scripture-viewer[data-scripture-theme="dark"] .scripture-verse-discussions {
    border-color: #334155;
    box-shadow: none;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-side-thread-card {
    border-color: #334155;
    background: #0f172a;
    color: #e2e8f0;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-side-thread-card[data-side-thread-kind="discussion"] {
    border-color: #78350f;
    background: #231a10;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-side-thread-card[data-side-thread-kind="commentary"] {
    border-color: #1e3a8a;
    background: #101c33;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-side-thread-rail {
    border-color: #334155;
    background: #111827;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-side-thread-controls {
    border-bottom-color: #334155;
    background: transparent;
    box-shadow: none;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-side-thread-filter {
    background: transparent;
    color: #94a3b8;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-side-thread-filter:hover {
    background: rgba(148, 163, 184, 0.08);
    color: #f8fafc;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-side-thread-filter[aria-pressed="true"] {
    background: transparent;
    color: #fde68a;
    box-shadow: none;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-side-thread-filter[aria-pressed="true"]::after {
    background: #f59e0b;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-reading-toolbar {
    border-bottom-color: #1e293b;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-reading-footer {
    border-top-color: #1e293b;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-read-chip {
    border-color: #334155;
    background: #111827;
    color: #cbd5e1;
    box-shadow: none;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-read-chip:hover {
    border-color: #64748b;
    background: #1e293b;
    color: #ffffff;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-read-chip.is-read {
    border-color: #10b981 !important;
    background: rgba(16, 185, 129, 0.16) !important;
    color: #86efac !important;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-read-chip--top:not(.is-read) {
    border-color: #334155 !important;
    background: #111827 !important;
    color: #cbd5e1 !important;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-read-chip--top:not(.is-read):hover {
    border-color: #64748b !important;
    background: #1e293b !important;
    color: #ffffff !important;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-read-chip--top::before {
    border-color: #64748b;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-read-chip--top.is-read::before {
    border-color: #10b981;
    background-color: #10b981;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-toolbar-icon-button {
    border-color: #334155;
    background: #111827;
    color: #e2e8f0;
    box-shadow: none;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-toolbar-icon-button:hover {
    border-color: #64748b;
    background: #1e293b;
    color: #ffffff;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-side-thread-label {
    color: #e2e8f0;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-side-thread-card[data-side-thread-kind="discussion"] .scripture-side-thread-label {
    color: #fbbf24;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-side-thread-card[data-side-thread-kind="commentary"] .scripture-side-thread-label {
    color: #93c5fd;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-side-thread-preview {
    color: #94a3b8;
}
/* 다크 토글 규칙에 [data-discussion-side-supported="1"] 을 포함해 기본(라이트) 규칙보다
   특이도를 높인다 — 기본 규칙이 소스상 뒤에 있어 동특이도면 다크가 진다(흰 pill 화, 2026-07-15). */
#scripture-viewer[data-scripture-theme="dark"][data-discussion-side-supported="1"] .scripture-side-panel-toggle {
    border-color: #334155;
    background: #0f172a;
    color: #e2e8f0;
}
#scripture-viewer[data-scripture-theme="dark"][data-discussion-side-supported="1"] .scripture-side-panel-toggle:hover {
    border-color: #64748b;
    background: #111827;
    color: #ffffff;
}
#scripture-viewer[data-scripture-theme="dark"][data-discussion-layout="side"][data-discussion-side-supported="1"] .scripture-side-panel-toggle {
    border-color: #f8fafc;
    background: #f8fafc;
    color: #0f172a;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-verse-discussion-popover {
    border-color: #334155;
    background: #0f172a;
    color: #e2e8f0;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-verse-discussion-popover a,
#scripture-viewer[data-scripture-theme="dark"] .scripture-verse-discussion-popover-card {
    background: #111827;
    color: #e2e8f0;
}
#scripture-viewer .scripture-heading-block {
    border-color: var(--scripture-heading-border);
    margin-left: 0;
    /* 배지 박스 왼쪽을 구절 본문 첫 글자('태')와 세로 정렬. 0.2rem=오른쪽/0.6rem=왼쪽 → 0.4rem(≈중간) + 2px 우측 미세보정. (260707 확정) */
    padding-left: calc(36px + 0.6rem + 1px);
    padding-right: 0.5rem;
}
#scripture-viewer .scripture-heading-body {
    min-width: 0;
}
#scripture-viewer .scripture-heading-title {
    display: inline-flex;
    align-items: center;
    background: var(--scripture-heading-bg);
    color: var(--scripture-heading-fg);
    padding: 0.25rem 0.6rem;
    font-size: 0.875rem;
    line-height: 1.35;
    font-weight: 800;
    border-radius: 0.125rem;
}
/* 시편 표제 — 원문 유래 콘텐츠(자체 번역). 소제목보다 약한 위계로, 본문 바로 위에 붙는다.
   괄호는 데이터가 아니라 표시 규칙이라 CSS 로 부착한다(검색·번역 오염 방지). */
#scripture-viewer .scripture-superscription {
    margin: 0 0 0.25rem;
}
/* 구절 하이라이트(형광펜) — 개인 표시. 배경색만 바꾸고 **글자색은 건드리지 않는다**(inherit).
   글자색을 손대면 라이트/다크 어느 한쪽에서 대비가 무너진다.
   겹칠 때는 좁은 범위가 안쪽 span 이라 그 색이 위에 보인다(형광펜 덧칠의 직관).
   (formal 260712-1702) */
#scripture-viewer .scripture-highlight {
    border-radius: 0.125rem;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}
/* 실제 형광펜처럼 채도 있는 색. 라이트/다크 같은 색을 쓰되, 하이라이트 **안쪽 글자만** 어둡게
   고정한다 — 다크 테마의 밝은 본문색이 진한 형광색 위로 오면 읽을 수 없기 때문이다.
   (진한 색 위에 검은 글씨 = 형광펜의 실제 물리적 성질과도 같다) */
#scripture-viewer .scripture-highlight,
#scripture-viewer .scripture-highlight * {
    color: #1c1917 !important;
}
#scripture-viewer .scripture-highlight--yellow { background-color: #ffe066; }
#scripture-viewer .scripture-highlight--coral  { background-color: #ff8a65; }
#scripture-viewer .scripture-highlight--blue   { background-color: #6ecff6; }
#scripture-viewer .scripture-highlight--green  { background-color: #a5d6a7; }
#scripture-viewer .scripture-highlight--purple { background-color: #c5b3ec; }
#scripture-viewer .scripture-highlight[data-scripture-highlight] {
    cursor: pointer;
}
/* 색 선택 팔레트 — 드래그한 어구 위(공간 없으면 아래)에 뜬다. 터치 타깃 ≥ 44px. */
.scripture-highlight-palette {
    position: absolute;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem;
    border-radius: 0.75rem;
    border: 1px solid #d6d3d1;
    background: #ffffff;
    box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.25);
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-highlight-palette {
    border-color: #334155;
    background: #101827;
}
.scripture-highlight-palette[hidden] {
    display: none;
}
/* 모바일: 선택 근처에는 안드로이드/iOS 의 선택 툴바(복사·번역·공유)가 떠서 팔레트를 덮는다.
   → 화면 하단에 고정한다. (formal 260712-1702) */
.scripture-highlight-panel--sheet {
    position: fixed;
    left: 50%;
    right: auto;
    top: auto;
    bottom: max(1rem, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100vw - 1.5rem);
    flex-wrap: wrap;
    justify-content: center;
    z-index: 70;
}
.scripture-highlight-swatch {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.5rem;
    border: 1px solid rgb(0 0 0 / 0.12);
    cursor: pointer;
}
.scripture-highlight-swatch:hover,
.scripture-highlight-swatch:focus-visible {
    outline: 2px solid #0ea5e9;
    outline-offset: 1px;
}
.scripture-highlight-action {
    min-height: 2.75rem;
    padding: 0 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #d6d3d1;
    background: transparent;
    color: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-highlight-action {
    border-color: #334155;
}
.scripture-highlight-action--primary {
    background: #0f766e;
    border-color: #0f766e;
    color: #ffffff;
}
.scripture-highlight-action[hidden] {
    display: none;
}
.scripture-highlight-action:disabled,
.scripture-highlight-swatch:disabled {
    cursor: wait;
    opacity: 0.55;
}
/* 저장·실패 상태를 화면과 스크린리더에 함께 알린다. */
.scripture-highlight-status {
    position: fixed;
    left: 50%;
    bottom: max(1rem, env(safe-area-inset-bottom));
    z-index: 80;
    max-width: min(32rem, calc(100vw - 2rem));
    transform: translateX(-50%);
    padding: 0.75rem 1rem;
    border: 1px solid #d6d3d1;
    border-radius: 0.75rem;
    background: #ffffff;
    color: #1c1917;
    box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.25);
    font-size: 0.875rem;
    font-weight: 700;
    text-align: center;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-highlight-status {
    border-color: #334155;
    background: #101827;
    color: #f8fafc;
}
.scripture-highlight-status[hidden] {
    display: none;
}
/* 메모가 있는 하이라이트 뒤에 붙는 쪽지 아이콘(윗첨자) — 각주와 같은 시각 언어. */
#scripture-viewer .scripture-highlight-note-marker {
    display: inline-flex;
    align-items: center;
    vertical-align: super;
    margin-left: 0.125rem;
    padding: 0;
    border: 0;
    background: none;
    color: #0f766e;
    cursor: pointer;
    line-height: 1;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-highlight-note-marker {
    color: #5eead4;
}
#scripture-viewer .scripture-highlight-note-marker:hover,
#scripture-viewer .scripture-highlight-note-marker:focus-visible {
    opacity: 0.7;
}
/* 메모 편집기 — 평문 한두 줄. 서식 도구가 없다(성경노트/설교노트와 역할 분리). */
.scripture-highlight-note-editor {
    position: absolute;
    z-index: 60;
    width: min(22rem, calc(100vw - 2rem));
    padding: 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid #d6d3d1;
    background: #ffffff;
    box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.25);
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-highlight-note-editor {
    border-color: #334155;
    background: #101827;
}
.scripture-highlight-note-editor[hidden] {
    display: none;
}
.scripture-highlight-note-field {
    width: 100%;
    padding: 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid #d6d3d1;
    background: transparent;
    color: inherit;
    font-size: 0.875rem;
    line-height: 1.6;
    resize: vertical;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-highlight-note-field {
    border-color: #334155;
}
.scripture-highlight-note-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
#scripture-viewer .scripture-verse-action--highlight {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    border-radius: 0.25rem;
    cursor: pointer;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-verse-action--highlight {
    background: #4a3d12;
    color: #fde68a;
    border-color: #6b5518;
}
/* 표제는 클릭하면 원어 카드가 열리는 버튼이지만, 본문 흐름을 해치지 않도록 버튼 기본 외형을 지운다.
   색은 본문 색을 상속받아 옅게(opacity) 쓴다 — 라이트/다크 어느 테마에서도 대비가 유지된다.
   (--scripture-heading-fg 는 어두운 배지 위 '흰 글씨'용이라 여기에 쓰면 호버 시 글자가 사라진다.) */
#scripture-viewer .scripture-superscription-text {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
    font-size: 0.8125rem;
    line-height: 1.6;
    font-style: italic;
    color: inherit;
    opacity: 0.72;
    cursor: pointer;
}
#scripture-viewer .scripture-superscription-text:hover,
#scripture-viewer .scripture-superscription-text:focus-visible {
    opacity: 1;
    text-decoration: underline;
    text-underline-offset: 3px;
}
/* CJK 여는 괄호 〔 는 글자 상자 왼쪽 절반이 비어 있어(반각 공백) 그대로 두면 본문보다 오른쪽으로
   밀려 보인다. 첫 줄만 그만큼 당겨 괄호의 획이 절 본문 시작선에 맞도록 한다(줄바꿈 줄은 그대로). */
#scripture-viewer .scripture-superscription[data-bracket='lenticular'] .scripture-superscription-text {
    text-indent: -0.5em;
}
#scripture-viewer .scripture-superscription[data-bracket='lenticular'] .scripture-superscription-text::before {
    content: '〔';
}
#scripture-viewer .scripture-superscription[data-bracket='lenticular'] .scripture-superscription-text::after {
    content: '〕';
}
#scripture-viewer .scripture-superscription[data-bracket='square'] .scripture-superscription-text::before {
    content: '[ ';
}
#scripture-viewer .scripture-superscription[data-bracket='square'] .scripture-superscription-text::after {
    content: ' ]';
}
#scripture-viewer .scripture-parallel-ref-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--scripture-parallel-border);
    border-radius: 0.25rem;
    background: var(--scripture-parallel-bg);
    color: var(--scripture-parallel-fg);
    padding: 0.125rem 0.375rem;
    font-weight: 700;
}
#scripture-viewer .scripture-parallel-ref-chip:hover {
    border-color: var(--scripture-parallel-hover-border);
    background: var(--scripture-parallel-hover-bg);
}
#scripture-viewer .scripture-heading-column-link {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--scripture-heading-column-border);
    border-radius: 0.375rem;
    background: var(--scripture-heading-column-bg);
    color: var(--scripture-heading-column-fg);
    padding: 0.375rem 0.625rem;
    font-weight: 800;
}
#scripture-viewer .scripture-heading-column-link:hover {
    border-color: var(--scripture-heading-column-hover-border);
    background: var(--scripture-heading-column-hover-bg);
}
#scripture-viewer .scripture-heading-typing-link {
    display: inline-flex;
    width: 1.5rem;
    height: 1.5rem;
    align-items: center;
    justify-content: center;
    border: 1px solid #5eead4;
    border-radius: 0.375rem;
    background: #f0fdfa;
    color: #0f766e;
}
#scripture-viewer .scripture-heading-typing-link:hover {
    border-color: #14b8a6;
    background: #ccfbf1;
    color: #115e59;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-heading-typing-link {
    border-color: #115e59;
    background: #042f2e;
    color: #5eead4;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-heading-typing-link:hover {
    border-color: #2dd4bf;
    background: #115e59;
    color: #ccfbf1;
}
#scripture-viewer .scripture-heading-note {
    border: 0;
    border-left: 4px solid var(--scripture-inline-note-border);
    border-radius: 0.375rem;
    background: var(--scripture-inline-note-bg);
    color: inherit;
    padding: var(--scripture-inline-note-padding-y) var(--scripture-inline-note-padding-x) !important;
}
#scripture-viewer .scripture-heading-body > .scripture-heading-note {
    box-sizing: border-box;
    width: 100%;
    margin-left: 0 !important;
    margin-right: 0 !important;
}
#scripture-viewer .scripture-note-guide {
    border-color: #e7e5e4;
    background: #ffffff;
    box-shadow: none;
}
#scripture-viewer .scripture-note-guide-title {
    color: #1c1917;
    letter-spacing: 0;
}
#scripture-viewer .scripture-note-guide-copy {
    color: #78716c;
}
#scripture-viewer .scripture-note-login-cta {
    display: inline-flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    border: 1px solid #0369a1;
    border-radius: 0.75rem;
    background: #0369a1;
    color: #ffffff !important;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 900;
    line-height: 1.25rem;
    text-decoration: none;
    box-shadow: 0 12px 24px rgb(12 74 110 / 0.18);
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
#scripture-viewer .scripture-note-login-cta:hover {
    border-color: #075985;
    background: #075985;
    color: #ffffff !important;
    transform: translateY(-1px);
}
#scripture-viewer .scripture-note-login-cta:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}
#scripture-viewer .scripture-note-login-cta svg {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
}
@media (min-width: 640px) {
    #scripture-viewer .scripture-note-login-cta {
        width: auto;
    }
}
#scripture-viewer .scripture-guide-action {
    border-color: #e7e5e4 !important;
    background: #ffffff !important;
    color: #57534e !important;
    box-shadow: 0 1px 1px rgb(28 25 23 / 0.03);
}
#scripture-viewer .scripture-guide-action:hover {
    border-color: #a8a29e !important;
    background: #f5f5f4 !important;
    color: #1c1917 !important;
}
#scripture-viewer .scripture-guide-action--edit {
    border-color: #1c1917 !important;
    background: #1c1917 !important;
    color: #ffffff !important;
}
#scripture-viewer .scripture-guide-action--edit:hover {
    border-color: #44403c !important;
    background: #44403c !important;
    color: #ffffff !important;
}
/* 편집 affordance 표준 디자인 (2026-06-16): 권한 있는 사용자에게 "여기는 편집 가능" 일관 amber 시각 언어. 모드 토글 폐지의 짝.
   점선/실선은 버튼 자신의 border 유틸리티에 맡김 — 추가(create)=border-dashed, 편집(modify)=실선. */
#scripture-viewer .scripture-edit-affordance {
    border-color: #fcd34d !important;
    background: #fffbeb !important;
    color: #78350f !important;
}
#scripture-viewer .scripture-edit-affordance:hover {
    border-color: #f59e0b !important;
    background: #fef3c7 !important;
    color: #78350f !important;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-edit-affordance {
    border-color: #b45309 !important;
    background: rgba(120, 53, 15, 0.18) !important;
    color: #fcd34d !important;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-edit-affordance:hover {
    border-color: #f59e0b !important;
    background: rgba(120, 53, 15, 0.30) !important;
    color: #fde68a !important;
}
/* 현재 성경노트 select-box: 카테고리 버튼(흰색 중립)과 약간 다른 옅은 fill (2026-06-17) */
#scripture-viewer .scripture-notebook-pill {
    border-color: #d6d3d1 !important;
    background: #f5f5f4 !important;
    color: #292524 !important;
}
#scripture-viewer .scripture-notebook-pill:hover {
    border-color: #a8a29e !important;
    background: #e7e5e4 !important;
    color: #1c1917 !important;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-notebook-pill {
    border-color: #57534e !important;
    background: #292524 !important;
    color: #f5f5f4 !important;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-notebook-pill:hover {
    border-color: #78716c !important;
    background: #44403c !important;
    color: #fafaf9 !important;
}
/* 색상의미 관리 2탭 — 밑줄형 탭으로 명확히 (2026-06-17). 다이얼로그는 항상 라이트라 다크 변형 불필요 */
#scripture-viewer .scripture-stdef-tab {
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    color: #78716c;
    font-weight: 700;
    background: transparent;
}
#scripture-viewer .scripture-stdef-tab:hover {
    color: #44403c;
    border-bottom-color: #d6d3d1;
}
#scripture-viewer .scripture-stdef-tab[aria-selected="true"] {
    color: #1c1917;
    border-bottom-color: #1c1917;
}
#scripture-viewer .scripture-stdef-langbtn[aria-selected="true"] {
    background: #1c1917;
    color: #ffffff;
    border-color: #1c1917;
}
/* 색상의미 정의 — 팔레트 표시 토글 스위치 + 삭제 버튼 (2026-06-17) */
#scripture-viewer .scripture-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}
#scripture-viewer .scripture-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}
#scripture-viewer .scripture-toggle .scripture-toggle-track {
    position: relative;
    flex-shrink: 0;
    width: 2.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    background: #d6d3d1;
    transition: background 0.15s ease;
}
#scripture-viewer .scripture-toggle .scripture-toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1rem;
    height: 1rem;
    border-radius: 9999px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease;
}
#scripture-viewer .scripture-toggle input[type="checkbox"]:checked + .scripture-toggle-track {
    background: #16a34a;
}
#scripture-viewer .scripture-toggle input[type="checkbox"]:checked + .scripture-toggle-track::after {
    transform: translateX(1rem);
}
#scripture-viewer .scripture-delete-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    border-radius: 0.375rem;
    border: 1px solid #fca5a5;
    background: #ffffff;
    color: #b91c1c;
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 700;
}
#scripture-viewer .scripture-delete-btn input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}
#scripture-viewer .scripture-delete-btn:hover {
    background: #fef2f2;
}
#scripture-viewer .scripture-delete-btn:has(input[type="checkbox"]:checked) {
    background: #b91c1c;
    color: #ffffff;
    border-color: #b91c1c;
}
#scripture-viewer .scripture-side-thread-rail {
    display: none;
}
#scripture-viewer .scripture-side-panel-toggle {
    display: none;
}
#scripture-viewer .scripture-side-thread-controls {
    display: none;
    gap: 0;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #e7e5e4;
    background: transparent;
    padding: 0 0.08rem;
    box-shadow: none;
}
#scripture-viewer .scripture-side-thread-filter {
    display: inline-flex;
    position: relative;
    min-width: 0;
    min-height: 2.9rem;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #78716c;
    padding: 0.4rem 0.2rem 0.5rem;
    font-size: var(--scripture-text-10);
    font-weight: 900;
    line-height: 1;
    box-shadow: none;
    transform: translateY(1px);
    transition: background-color 150ms ease, color 150ms ease;
}
#scripture-viewer .scripture-side-thread-filter:hover {
    background: #fafaf9;
    color: #292524;
}
#scripture-viewer .scripture-side-thread-filter[aria-pressed="true"] {
    background: transparent;
    color: #92400e;
    box-shadow: none;
}
#scripture-viewer .scripture-side-thread-filter::after {
    content: "";
    position: absolute;
    left: 0.3rem;
    right: 0.3rem;
    bottom: 0;
    height: 2px;
    border-radius: 999px;
    background: transparent;
    transition: background-color 150ms ease;
}
#scripture-viewer .scripture-side-thread-filter[aria-pressed="true"]::after {
    background: #d97706;
}
#scripture-viewer .scripture-side-thread-filter-icon {
    width: 0.98rem;
    height: 0.98rem;
    flex: 0 0 auto;
}
#scripture-viewer .scripture-side-thread-filter span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* 탭 표시 순서: 설교노트 → 성경노트 → 각주 → 주석서 → 시각자료 (flex order, HTML 무변경). 2026-07-06 사용자 요청. */
#scripture-viewer .scripture-side-thread-filter[data-side-thread-filter="sermon"] { order: 1; }
#scripture-viewer .scripture-side-thread-filter[data-side-thread-filter="discussion"] { order: 2; }
#scripture-viewer .scripture-side-thread-filter[data-side-thread-filter="footnote"] { order: 3; }
#scripture-viewer .scripture-side-thread-filter[data-side-thread-filter="commentary"] { order: 4; }
#scripture-viewer .scripture-side-thread-filter[data-side-thread-filter="visual"] { order: 5; }
#scripture-viewer .scripture-side-thread-card {
    display: flex;
    width: 30px;
    height: 30px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    border: 1px solid #e7e5e4;
    border-radius: 0.3rem;
    background: #ffffff;
    overflow: hidden;
    padding: 1px 3px;
    text-align: center;
    box-shadow: 0 1px 2px rgb(28 25 23 / 0.04);
}
#scripture-viewer .scripture-side-thread-card[hidden] {
    display: none !important;
}
#scripture-viewer .scripture-side-thread-card:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}
#scripture-viewer .scripture-side-thread-card[data-side-thread-kind="discussion"] {
    border-color: #f1d6a5;
    background: #fffaf0;
}
#scripture-viewer .scripture-side-thread-card[data-side-thread-kind="discussion"]:hover {
    border-color: #e7bd6c;
    background: #fff5dd;
}
#scripture-viewer .scripture-side-thread-card[data-side-thread-kind="commentary"] {
    border-color: #c7dfff;
    background: #f5f9ff;
}
#scripture-viewer .scripture-side-thread-card[data-side-thread-kind="commentary"]:hover {
    border-color: #a8cfff;
    background: #eaf3ff;
}
#scripture-viewer .scripture-side-thread-card[data-side-thread-kind="sermon"] {
    border-color: #c7d2fe;
    background: #eef2ff;
}
#scripture-viewer .scripture-side-thread-card[data-side-thread-kind="sermon"]:hover {
    border-color: #a5b4fc;
    background: #e0e7ff;
}
/* 설교 카드 임시(draft) 표시 — 우상단 amber 점 (팝업 '임시' amber 배지와 일관). formal 260706.
   카드 안쪽(top/right 3px)에 두어 카드/stack 의 overflow:hidden 에도 안 잘림. */
#scripture-viewer .scripture-side-thread-card[data-sermon-draft]::after {
    content: "";
    position: absolute;
    top: 3px;
    right: 3px;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #f59e0b;
    border: 1.5px solid #eef2ff;
    box-sizing: border-box;
    pointer-events: none;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-side-thread-card[data-sermon-draft]::after {
    border-color: #1e1b4b;
}
#scripture-viewer .scripture-side-thread-card[data-side-thread-kind="visual"] {
    display: block;
    overflow: hidden;
    border-color: #d8b4fe;
    background: #faf5ff;
    padding: 0;
}
#scripture-viewer .scripture-side-thread-card[data-side-thread-kind="visual"]:hover {
    border-color: #c084fc;
    background: #f3e8ff;
}
#scripture-viewer .scripture-side-thread-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 9px;
    font-weight: 900;
    line-height: 10px;
    color: #44403c;
}
#scripture-viewer .scripture-side-thread-card[data-side-thread-kind="discussion"] .scripture-side-thread-label {
    color: #8a4b08;
}
#scripture-viewer .scripture-side-thread-card[data-side-thread-kind="commentary"] .scripture-side-thread-label {
    color: #1d4ed8;
}
#scripture-viewer .scripture-side-thread-card[data-side-thread-kind="sermon"] .scripture-side-thread-label {
    color: #4338ca;
}
#scripture-viewer .scripture-side-thread-card[data-side-thread-kind="footnote"] .scripture-side-thread-label {
    color: #b45309;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-side-thread-card[data-side-thread-kind="footnote"] .scripture-side-thread-label {
    color: #fcd34d;
}
#scripture-viewer .scripture-side-thread-card[data-side-thread-kind="visual"] .scripture-side-thread-label {
    display: none;
}
/* rail 카드 종류 아이콘 (텍스트 라벨 대체 — 어느 크기/언어에도 안 깨짐, hover title 로 전체명). */
#scripture-viewer .scripture-side-thread-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 0.9rem;
    height: 0.9rem;
    color: #44403c;
}
#scripture-viewer .scripture-side-thread-icon svg {
    width: 100%;
    height: 100%;
}
#scripture-viewer .scripture-side-thread-icon--char {
    width: auto;
    height: auto;
    font-size: 0.85rem;
    font-weight: 800;
    line-height: 1;
}
/* 아이콘+숫자 카드는 가로 직사각형([아이콘 숫자] 한 줄). 높이=절 line-height 유지(1:1 정렬).
   좌우 패딩을 상하 여백(세로 중앙정렬 gap ≈6px)과 비슷하게 줘서 너무 좁지 않게. */
#scripture-viewer .scripture-side-thread-card[data-side-thread-kind="commentary"],
#scripture-viewer .scripture-side-thread-card[data-side-thread-kind="footnote"] {
    flex-direction: row;
    gap: 3px;
    padding-left: 6px;
    padding-right: 6px;
}
/* row 카드의 숫자는 collapse 방지(flex min-width:0 로 0폭 되는 것 차단) → 자동폭 측정에 온전히 포함. */
#scripture-viewer .scripture-side-thread-card[data-side-thread-kind="commentary"] .scripture-side-thread-preview,
#scripture-viewer .scripture-side-thread-card[data-side-thread-kind="footnote"] .scripture-side-thread-preview {
    flex: 0 0 auto;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
}
#scripture-viewer .scripture-side-thread-card[data-side-thread-kind="commentary"] .scripture-side-thread-icon {
    color: #1d4ed8;
}
#scripture-viewer .scripture-side-thread-card[data-side-thread-kind="footnote"] .scripture-side-thread-icon {
    color: #b45309;
}
#scripture-viewer .scripture-side-thread-card[data-side-thread-kind="sermon"] .scripture-side-thread-icon {
    color: #4338ca;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-side-thread-card[data-side-thread-kind="commentary"] .scripture-side-thread-icon {
    color: #93c5fd;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-side-thread-card[data-side-thread-kind="footnote"] .scripture-side-thread-icon {
    color: #fcd34d;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-side-thread-card[data-side-thread-kind="sermon"] .scripture-side-thread-icon {
    color: #c7d2fe;
}
/* preview 숫자: UI 폰트 고정(reader serif 미상속 → 폰트 변경에도 안정). */
#scripture-viewer .scripture-side-thread-preview {
    font-family: ui-sans-serif, system-ui, "Noto Sans KR", sans-serif;
}
#scripture-viewer .scripture-side-thread-preview {
    max-width: 100%;
    overflow: hidden;
    display: block;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
    font-weight: 800;
    line-height: 10px;
    color: #78716c;
}
#scripture-viewer .scripture-side-thread-card[data-side-thread-kind="visual"] .scripture-side-thread-preview {
    display: none;
}
#scripture-viewer .scripture-side-thread-thumb {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #f5f3ff;
}
#scripture-viewer .scripture-side-thread-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* 잠금 시각자료 카드 (formal 260705-0047 R2) — 블러 썸네일 + 🔒 오버레이 */
#scripture-viewer .scripture-side-thread-card--locked {
    position: relative;
    cursor: pointer;
}
#scripture-viewer .scripture-side-thread-card--locked .scripture-side-thread-thumb img {
    filter: blur(4px);
    transform: scale(1.08);
}
#scripture-viewer .scripture-side-thread-lock {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(28, 25, 23, 0.44);
    color: #fff;
    border-radius: inherit;
}
#scripture-viewer .scripture-side-thread-lock svg {
    width: 45%;
    height: 45%;
    max-width: 15px;
    max-height: 15px;
}
#scripture-viewer .scripture-linked-content-frame {
    display: block;
    width: 100%;
    min-height: min(70vh, 48rem);
    border: 0;
    background: #ffffff;
}
@media (min-width: 720px) {
    #scripture-viewer[data-discussion-side-supported="1"] .scripture-side-panel-toggle {
        position: fixed;
        right: 8.25rem;
        bottom: 1rem;
        z-index: 51;
        display: inline-flex;
        min-height: 2.25rem;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
        border: 1px solid #d6d3d1;
        border-radius: 9999px;
        background: #ffffff;
        color: #44403c;
        padding: 0.45rem 0.85rem;
        font-size: 0.8rem;
        font-weight: 800;
        line-height: 1;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
        transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
    }
    #scripture-viewer[data-discussion-side-supported="1"] .scripture-side-panel-toggle svg {
        width: 1rem;
        height: 1rem;
        flex: 0 0 auto;
    }
    #scripture-viewer[data-discussion-side-supported="1"] .scripture-side-panel-toggle:hover {
        border-color: #f59e0b;
        color: #92400e;
        background: #fffbeb;
    }
    #scripture-viewer[data-discussion-layout="side"][data-discussion-side-supported="1"] .scripture-side-panel-toggle {
        border-color: #1c1917;
        background: #1c1917;
        color: #ffffff;
    }
    #scripture-viewer[data-discussion-layout="side"][data-discussion-side-supported="1"] .scripture-reading-layout {
        grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
    }
    #scripture-viewer[data-discussion-layout="side"][data-discussion-side-supported="1"] .scripture-side-thread-rail {
        display: block;
        grid-column: 2;
        grid-row: 1;
        /* 세로 크기 = 본문 카드 실측 높이(--scripture-text-panel-h). 콘텐츠로 늘어나게 두면
           auto 행이 부풀고, layoutSideThreadRail() 의 stack.minHeight = rail.clientHeight - 24 가
           매 재배치마다 레일을 더 키우는 양의 피드백이 된다(로딩 중 우측 패널이 계속 늘어남). */
        align-self: start;
        height: var(--scripture-text-panel-h, auto);
        min-height: 0;
        border: 1px solid #e2e8f0;
        border-radius: 0.5rem;
        background-color: #ffffff;
        /* 탭 top 여백 0.6rem — 우측 탭바 중심을 좌측 본문 툴바 버튼 중심에 수평 정렬 (0=너무 위 / 1.4rem=너무 아래 사이 보간, 2026-07-06). */
        padding: 0.6rem 0.875rem 0.875rem 0.875rem;
        position: relative;
        overflow: hidden;
    }
    #scripture-viewer[data-discussion-layout="side"][data-discussion-side-supported="1"] .scripture-side-thread-controls {
	                    display: flex;
	                    position: sticky;
	                    top: 0.5rem;
	                    z-index: 2;
	                    padding-bottom: 0.5rem;
	                }
    #scripture-viewer[data-discussion-layout="side"][data-discussion-side-supported="1"] .scripture-side-thread-stack {
        position: relative;
        --scripture-side-thread-card-size: 30px;
        --scripture-side-thread-card-gap: 3px;
        --scripture-side-thread-slot-min: 30px;
        min-height: 10rem;
    }
    #scripture-viewer[data-discussion-layout="side"][data-discussion-side-supported="1"] .scripture-side-thread-card {
        position: absolute;
        left: 0;
        width: var(--scripture-side-thread-card-size);
        height: var(--scripture-side-thread-card-size);
        aspect-ratio: 1 / 1;
    }
    #scripture-viewer[data-discussion-layout="side"][data-discussion-side-supported="1"] .scripture-side-thread-card[data-side-thread-kind="visual"] {
        aspect-ratio: auto;
    }
    /* 첫 배치 전 카드 숨김 (2026-07-15): 카드가 absolute 인데 top 은 JS(layoutSideThreadRail)가
       나중에 부여하므로, 그 전에는 스택 상단에 뭉쳐 보였다가 흩어지는 플래시가 있었다.
       배치 완료(is-laid-out) 후에만 표시하고 살짝 페이드인. */
    #scripture-viewer[data-discussion-layout="side"][data-discussion-side-supported="1"] .scripture-side-thread-stack:not(.is-laid-out) .scripture-side-thread-card {
        visibility: hidden;
    }
    #scripture-viewer[data-discussion-layout="side"][data-discussion-side-supported="1"] .scripture-side-thread-stack.is-laid-out .scripture-side-thread-card {
        animation: scripture-side-rail-appear 160ms ease;
    }
    #scripture-viewer[data-discussion-layout="side"][data-discussion-side-supported="1"] #scripture-discussions-list {
        display: none;
    }
    #scripture-viewer[data-scripture-theme="dark"][data-discussion-layout="side"][data-discussion-side-supported="1"] .scripture-side-thread-rail {
        border-color: #334155;
        background-color: #111827;
    }
}
#scripture-viewer .scripture-structure-summary-row > summary {
    display: flex;
    min-height: 2.5rem;
    cursor: pointer;
    list-style: none;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: 1px solid #f2c46d;
    border-radius: 0.375rem;
    background: #ffffff;
    color: #78350f;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 800;
}
#scripture-viewer .scripture-structure-summary-row > summary::-webkit-details-marker {
    display: none;
}
#scripture-viewer .scripture-structure-summary-row > summary:hover {
    border-color: #d97706;
    background: #fffdf7;
}
#scripture-viewer .scripture-structure-summary-row[open] > summary {
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
}
#scripture-viewer .scripture-structure-summary-content {
    border: 1px solid #f2c46d;
    border-top: 0;
    border-bottom-right-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
    background: #ffffff;
    color: #44403c;
    padding: 0.75rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.625;
    white-space: pre-line;
    word-break: break-word;
}
#scripture-viewer .scripture-verse-number {
    background: var(--scripture-verse-number-bg);
    color: var(--scripture-verse-number-fg);
    height: var(--scripture-body-line-height);
    line-height: var(--scripture-body-line-height) !important;
}
#scripture-viewer .scripture-verse-number:hover {
    background: var(--scripture-verse-number-hover-bg);
}
@media (max-width: 639px) {
    #scripture-viewer .scripture-verse-number {
        line-height: 1.65rem !important;
    }
}
#scripture-viewer .scripture-verse-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.16rem;
    border: 1px solid var(--scripture-action-border);
    border-radius: 9999px;
    background: var(--scripture-action-bg);
    color: var(--scripture-action-fg);
    white-space: nowrap;
}
#scripture-viewer .scripture-verse-action--discussion::before,
#scripture-viewer .scripture-verse-action--card::before {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 0.68rem;
    line-height: 1;
}
#scripture-viewer .scripture-verse-action--discussion::before { content: "▤"; }
#scripture-viewer .scripture-verse-action--card::before { content: "▧"; }
#scripture-viewer .scripture-verse-action:hover {
    border-color: var(--scripture-action-hover-border);
    background: var(--scripture-action-hover-bg);
}
#scripture-viewer .scripture-passage-action-button {
    transition: opacity 0.14s ease, transform 0.14s ease, background-color 0.14s ease, border-color 0.14s ease;
}
/* 구절 버튼은 사용자 버튼 순서/노출 설정 적용 전까지 숨긴다.
   페이지 로딩이 느릴 때 서버 렌더 기본 버튼들이 1절 주변에 먼저 보였다가
   JS 정렬 후 사라지는 FOUC 를 막기 위한 초기 hydration gate. */
#scripture-viewer:not([data-verse-buttons-hydrated="1"]) .scripture-passage-action-button {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
#scripture-viewer [data-verse-button-hidden="1"] {
    display: none !important;
}
#scripture-viewer[data-passage-action-visibility="contextual"] .scripture-passage-action-button {
    display: none;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-1px);
}
#scripture-viewer[data-passage-action-visibility="contextual"]:not([data-discussion-layout="side"]) .scripture-passage-action-button--discussion:not([data-discussion-count="0"]) {
    display: inline-flex;
    opacity: 1;
    pointer-events: auto;
    transform: none;
}
#scripture-viewer[data-passage-action-visibility="contextual"] .scripture-passage:focus-within .scripture-passage-action-button,
#scripture-viewer[data-passage-action-visibility="contextual"] .scripture-passage:focus-visible .scripture-passage-action-button,
#scripture-viewer[data-passage-action-visibility="contextual"] .scripture-passage.is-selected .scripture-passage-action-button {
    display: inline-flex;
    opacity: 1;
    pointer-events: auto;
    transform: none;
}
@media (hover: hover) and (pointer: fine) {
    #scripture-viewer[data-passage-action-visibility="contextual"] .scripture-passage:hover .scripture-passage-action-button {
        display: inline-flex;
        opacity: 1;
        pointer-events: auto;
        transform: none;
    }
}
#scripture-viewer .scripture-verse-action--cross {
    --scripture-action-bg: var(--scripture-action-cross-bg);
    --scripture-action-fg: var(--scripture-action-cross-fg);
    --scripture-action-border: var(--scripture-action-cross-border);
    --scripture-action-hover-bg: var(--scripture-action-cross-hover-bg);
    --scripture-action-hover-border: var(--scripture-action-cross-hover-border);
}
#scripture-viewer .scripture-verse-action--original {
    --scripture-action-bg: var(--scripture-action-original-bg);
    --scripture-action-fg: var(--scripture-action-original-fg);
    --scripture-action-border: var(--scripture-action-original-border);
    --scripture-action-hover-bg: var(--scripture-action-original-hover-bg);
    --scripture-action-hover-border: var(--scripture-action-original-hover-border);
}
#scripture-viewer .scripture-verse-action--commentary {
    --scripture-action-bg: var(--scripture-action-commentary-bg);
    --scripture-action-fg: var(--scripture-action-commentary-fg);
    --scripture-action-border: var(--scripture-action-commentary-border);
    --scripture-action-hover-bg: var(--scripture-action-commentary-hover-bg);
    --scripture-action-hover-border: var(--scripture-action-commentary-hover-border);
}
#scripture-viewer .scripture-verse-action--note {
    --scripture-action-bg: var(--scripture-action-note-bg);
    --scripture-action-fg: var(--scripture-action-note-fg);
    --scripture-action-border: var(--scripture-action-note-border);
    --scripture-action-hover-bg: var(--scripture-action-note-hover-bg);
    --scripture-action-hover-border: var(--scripture-action-note-hover-border);
}
#scripture-viewer .scripture-verse-action--general-note {
    --scripture-action-bg: #eef2ff;
    --scripture-action-fg: #4338ca;
    --scripture-action-border: #c7d2fe;
    --scripture-action-hover-bg: #e0e7ff;
    --scripture-action-hover-border: #818cf8;
}
#scripture-viewer .scripture-verse-action--discussion {
    --scripture-action-bg: var(--scripture-action-discussion-bg);
    --scripture-action-fg: var(--scripture-action-discussion-fg);
    --scripture-action-border: var(--scripture-action-discussion-border);
    --scripture-action-hover-bg: var(--scripture-action-discussion-hover-bg);
    --scripture-action-hover-border: var(--scripture-action-discussion-hover-border);
}
#scripture-viewer .scripture-verse-action--footnote {
    --scripture-action-bg: #fefce8;
    --scripture-action-fg: #854d0e;
    --scripture-action-border: #fde68a;
    --scripture-action-hover-bg: #fef3c7;
    --scripture-action-hover-border: #fbbf24;
}
#scripture-viewer .scripture-verse-action--count {
    border-color: transparent;
    background: var(--scripture-action-count-bg);
    color: var(--scripture-action-count-fg);
}
#scripture-viewer .scripture-verse-action--count:hover {
    background: var(--scripture-action-count-hover-bg);
}
#scripture-viewer .scripture-verse-action--resource {
    --scripture-action-bg: #292524;
    --scripture-action-fg: #ffffff;
    --scripture-action-border: #292524;
    --scripture-action-hover-bg: #44403c;
    --scripture-action-hover-border: #44403c;
}
#scripture-viewer .scripture-verse-action--multi {
    --scripture-action-bg: #ffffff;
    --scripture-action-fg: #44403c;
    --scripture-action-border: #d6d3d1;
    --scripture-action-hover-bg: #f5f5f4;
    --scripture-action-hover-border: #a8a29e;
}
#scripture-viewer .scripture-verse-action--card {
    --scripture-action-bg: #ecfeff;
    --scripture-action-fg: #0e7490;
    --scripture-action-border: #67e8f9;
    --scripture-action-hover-bg: #cffafe;
    --scripture-action-hover-border: #22d3ee;
}
#scripture-viewer .scripture-verse-action--custom {
    --scripture-action-bg: #f5f3ff;
    --scripture-action-fg: #5b21b6;
    --scripture-action-border: #ddd6fe;
    --scripture-action-hover-bg: #ede9fe;
    --scripture-action-hover-border: #c4b5fd;
}
#scripture-viewer .scripture-verse-action--resource:not(.scripture-verse-action--resource-part),
#scripture-viewer .scripture-verse-action--multi,
#scripture-viewer .scripture-verse-action--card,
#scripture-viewer .scripture-verse-action--custom {
    height: 1.05rem;
    min-height: 1.05rem;
    padding-inline: 0.35rem;
    font-size: 0.625rem;
    line-height: 1;
    vertical-align: 0.08em;
}
#scripture-viewer .scripture-verse-action--resource-part {
    display: none;
}
#scripture-viewer .scripture-verse-action--resource-part[data-verse-button-active="1"] {
    display: inline-flex;
}
#scripture-viewer[data-passage-action-visibility="contextual"] .scripture-verse-action--resource-part[data-verse-button-active="1"] {
    display: none;
}
#scripture-viewer[data-passage-action-visibility="contextual"] .scripture-passage:focus-within .scripture-verse-action--resource-part[data-verse-button-active="1"],
#scripture-viewer[data-passage-action-visibility="contextual"] .scripture-passage:focus-visible .scripture-verse-action--resource-part[data-verse-button-active="1"],
#scripture-viewer[data-passage-action-visibility="contextual"] .scripture-passage.is-selected .scripture-verse-action--resource-part[data-verse-button-active="1"] {
    display: inline-flex;
}
@media (hover: hover) and (pointer: fine) {
    #scripture-viewer[data-passage-action-visibility="contextual"] .scripture-passage:hover .scripture-verse-action--resource-part[data-verse-button-active="1"] {
        display: inline-flex;
    }
}
#scripture-viewer .scripture-verse-action-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: 0.08em;
}
#scripture-viewer .scripture-verse-custom-menu {
    position: absolute;
    z-index: 80;
    top: 1.45rem;
    right: 0;
    display: grid;
    gap: 0.2rem;
    min-width: 10.5rem;
    max-width: calc(100vw - 1rem);
    border: 1px solid #d6d3d1;
    border-radius: 0.55rem;
    background: #ffffff;
    padding: 0.3rem;
    box-shadow: 0 14px 32px rgba(41, 37, 36, 0.18);
}
#scripture-viewer .scripture-verse-custom-menu[hidden] {
    display: none !important;
}
#scripture-viewer .scripture-verse-custom-menu button,
#scripture-viewer .scripture-verse-custom-menu a {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.38rem;
    border: 0;
    border-radius: 0.4rem;
    background: transparent;
    color: #44403c;
    padding: 0.42rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
}
#scripture-viewer .scripture-verse-custom-menu button:hover,
#scripture-viewer .scripture-verse-custom-menu a:hover {
    background: #f5f5f4;
    color: #1c1917;
}
#scripture-viewer [data-inline-note-editor-box] {
    border-color: var(--scripture-inline-note-border);
    background: var(--scripture-inline-note-bg);
    color: inherit;
    padding: var(--scripture-inline-note-padding-y) var(--scripture-inline-note-padding-x) !important;
    font-size: var(--scripture-inline-note-font-size) !important;
    line-height: var(--scripture-inline-note-line-height) !important;
    box-shadow: none;
}
#scripture-viewer [data-inline-commentary-form][data-commentary-preset="warm"] [data-inline-note-editor-box] {
    border-color: var(--scripture-inline-note-border);
    background: var(--scripture-inline-note-bg);
    color: inherit;
}
#scripture-viewer [data-inline-commentary-form][data-commentary-preset="quiet"] [data-inline-note-editor-box] {
    border-color: var(--scripture-inline-note-border);
    background: var(--scripture-inline-note-bg);
    color: inherit;
}
#scripture-viewer [data-inline-commentary-form][data-commentary-preset="study"] [data-inline-note-editor-box] {
    border-color: var(--scripture-inline-note-border);
    background: var(--scripture-inline-note-bg);
    color: inherit;
}
#scripture-viewer [data-inline-commentary-form][data-commentary-preset="sermon"] [data-inline-note-editor-box] {
    border-color: var(--scripture-inline-note-border);
    background: var(--scripture-inline-note-bg);
    color: inherit;
}
#scripture-viewer [data-inline-note-editor-box] [data-rich-editor] {
    min-height: 2rem;
    border: 0 !important;
    background: transparent !important;
    color: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
    padding: 0 2.25rem 0 0 !important;
}
#scripture-viewer [data-inline-note-editor-box] [data-inline-note-insert-actions] {
    top: 0.75rem;
    right: 0.75rem;
}
#scripture-viewer [data-inline-note-tool-menu] > summary::-webkit-details-marker {
    display: none;
}
#scripture-viewer [data-inline-note-tool-popover] {
    top: 0;
    right: 1.75rem;
    width: max-content;
    max-width: calc(100vw - 2rem);
}
#scripture-viewer [data-inline-note-editor-box] [data-rich-editor]:focus {
    box-shadow: none;
}
#scripture-viewer [data-section-note-form] [data-inline-note-editor-box] {
    border-color: transparent !important;
    background: transparent !important;
    padding: 0 !important;
}
#scripture-viewer .scripture-structural-block {
    border-radius: 0.375rem;
    border: 1px solid #e7e5e4;
    border-left: 3px solid #d97706;
    background: #fffdf7;
    color: #292524;
}
#scripture-viewer [data-section-note-shell],
#scripture-viewer [data-section-note-form] {
    margin-left: calc(36px + 1rem);
    margin-right: 0.5rem;
}
@media (max-width: 639px) {
    #scripture-viewer [data-section-note-shell],
    #scripture-viewer [data-section-note-form] {
        margin-left: calc(1.65rem + 0.25rem);
        margin-right: 0.35rem;
    }
}
@media (min-width: 640px) and (max-width: 1023px) {
    #scripture-viewer [data-section-note-shell],
    #scripture-viewer [data-section-note-form] {
        margin-left: calc(1.85rem + 0.45rem);
        margin-right: 0.35rem;
    }
}
#scripture-viewer .scripture-audio-script[hidden] {
    display: none;
}
#scripture-viewer [data-verse-action-menu] > summary::-webkit-details-marker {
    display: none;
}
#scripture-viewer [data-verse-action-menu][open] > summary {
    background: #fef3c7;
}
#scripture-viewer .scripture-range-rails {
    display: grid;
    gap: 0.25rem;
    justify-items: end;
}
#scripture-viewer .scripture-range-rail {
    position: relative;
    min-height: 1.35rem;
    width: 2.35rem;
    border-right: 3px solid #d97706;
}
#scripture-viewer .scripture-range-rail::before,
#scripture-viewer .scripture-range-rail::after {
    content: "";
    position: absolute;
    right: -3px;
    width: 0.7rem;
    border-top: 3px solid #d97706;
}
#scripture-viewer .scripture-range-rail::before {
    top: 0;
}
#scripture-viewer .scripture-range-rail::after {
    bottom: 0;
}
#scripture-viewer .scripture-range-rail[data-range-position="middle"]::before,
#scripture-viewer .scripture-range-rail[data-range-position="middle"]::after {
    display: none;
}
#scripture-viewer .scripture-range-rail[data-range-position="start"]::after,
#scripture-viewer .scripture-range-rail[data-range-position="end"]::before {
    display: none;
}
#scripture-viewer .scripture-range-rail-label {
    position: absolute;
    right: 0.55rem;
    top: -0.15rem;
    max-width: 2.2rem;
    border-radius: 999px;
    background: #fff7ed;
    color: #92400e;
    font-size: 0.58rem;
    font-weight: 800;
    line-height: 1;
    padding: 0.2rem 0.3rem;
    white-space: nowrap;
}
#scripture-viewer .scripture-audio-player-card {
    border: 1px solid rgb(186 230 253);
    background: #ffffff;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.06);
}
#scripture-viewer .scripture-audio-player {
    display: block;
    min-height: 2.75rem;
    accent-color: #0369a1;
}
#scripture-viewer .scripture-comparison-split {
    display: grid;
    gap: 0.5rem;
}
#scripture-viewer .scripture-comparison-card {
    min-width: 0;
    border: 1px solid #e7e5e4;
    border-radius: 0.5rem;
    background: #fafaf9;
    padding: 0.75rem;
}
#scripture-viewer .scripture-comparison-card--current {
    border-color: #e7e5e4;
    background: #fafaf9;
}
/* 역본 함께보기 접기 — 화면에서만 숨긴다(URL 의 ?compare= 는 유지 → 링크 공유 시 구성 보존).
   현재 역본 카드와 원어 카드는 남긴다 — 접는 대상은 '비교 역본'뿐이다.
   ⚠️ 비교 레이아웃은 두 가지다: split(좌우 카드) / inline(절 아래 행). 둘 다 처리해야 한다. (2026-07-12) */
#scripture-viewer[data-compare-hidden="1"] .scripture-comparison-card:not(.scripture-comparison-card--current):not(.scripture-comparison-card--original),
#scripture-viewer[data-compare-hidden="1"] [data-compare-row] {
    display: none;
}
/* 비교 역본을 접으면 현재 역본 카드는 본문처럼 보이게 — 카드 테두리/배경을 지운다. */
#scripture-viewer[data-compare-hidden="1"] .scripture-comparison-card--current {
    border-color: transparent;
    background: none;
    padding-left: 0;
    padding-right: 0;
}
/* 하단 플로팅 토글 — '사전 강조' 왼쪽에 나란히. 함께보기를 쓸 때만 렌더된다. */
.scripture-compare-toggle {
    position: fixed;
    right: 1rem;
    bottom: 4rem;
    z-index: 50;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid #cbd5e1;
    border-radius: 9999px;
    background: #ffffff;
    padding: 0.4rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 800;
    color: #334155;
    box-shadow: 0 6px 18px -6px rgb(0 0 0 / 0.3);
    cursor: pointer;
}
#scripture-viewer[data-scripture-theme="dark"] ~ .scripture-compare-toggle,
body[data-scripture-theme="dark"] .scripture-compare-toggle {
    border-color: #334155;
    background: #101827;
    color: #e2e8f0;
}
#scripture-viewer .scripture-comparison-card--original {
    border-color: #bae6fd;
    background: #f0f9ff;
}
#scripture-viewer .scripture-original-version-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}
#scripture-viewer .scripture-original-version-token {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
    border: 1px solid #bae6fd;
    border-radius: 999px;
    background: #ffffff;
    color: #0c4a6e;
    padding: 0.18rem 0.5rem;
    font-weight: 800;
    line-height: 1.5;
}
#scripture-viewer .scripture-verse-discussions {
    border: 1px solid #e7e5e4;
    border-left: 3px solid #d97706;
    border-radius: 0.375rem;
    background: #fffdf7;
}
#scripture-viewer .scripture-verse-discussion-popover {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 80;
    width: min(26rem, calc(100vw - 2rem));
    max-height: min(32rem, 70vh);
    overflow: auto;
    border: 1px solid #e7e5e4;
    border-left: 3px solid #d97706;
    border-radius: 0.5rem;
    background: #ffffff;
    color: #1c1917;
    box-shadow: 0 18px 48px rgb(28 25 23 / 0.18);
}
#scripture-viewer .scripture-verse-discussion-popover[hidden] {
    display: none !important;
}
#scripture-viewer .scripture-verse-discussion-popover-card {
    display: block;
    border-radius: 0.375rem;
    background: #fffdf7;
    padding: 0.625rem 0.75rem;
}
#scripture-viewer .scripture-discussion-board-popover {
    width: min(42rem, calc(100vw - 2rem));
}
#scripture-viewer .scripture-verse-resources-sheet[open] {
    width: min(46rem, calc(100vw - 2rem));
    max-height: 86vh;
}
/* 검색 팝업도 자료 팝업과 동일 가로폭(빌드 CSS 비의존, JIT arbitrary 회피) */
#scripture-viewer .scripture-search-sheet[open],
.scripture-search-sheet[open] {
    width: min(46rem, calc(100vw - 2rem));
}
#scripture-viewer .scripture-verse-resource-tab[aria-selected="true"] {
    background: #1c1917;
    color: #ffffff;
}
#scripture-viewer .scripture-verse-resource-tab[aria-selected="false"] {
    background: #f5f5f4;
    color: #57534e;
}
#scripture-viewer .scripture-ow-view-mode[aria-selected="true"] {
    background: #1c1917;
    color: #ffffff;
}
#scripture-viewer .scripture-ow-view-mode[aria-selected="false"] {
    color: #57534e;
}
#scripture-viewer .scripture-verse-resource-panel[hidden] {
    display: none !important;
}
#scripture-viewer .scripture-verse-resource-body {
    max-height: calc(86vh - 9.5rem);
    overflow-y: auto;
}
/* 멀티성경 팝업은 본문/설정 카드를 JS로 생성하므로 라이트 유틸리티 색상을
   팝업 범위에서 다시 정리한다. 밝은 인디고 버튼 하나만 떠 보이지 않도록
   표면은 네이비, 선택 상태는 앰버, 참조 패널 액션은 딥 인디고로 구분한다. */
#scripture-viewer[data-scripture-theme="dark"] #scripture-multi-bible-sheet {
    border-color: #334155 !important;
    background: #101827 !important;
    color: #f8fafc !important;
}
#scripture-viewer[data-scripture-theme="dark"] #scripture-multi-bible-sheet .scripture-dialog-header,
#scripture-viewer[data-scripture-theme="dark"] #scripture-multi-bible-sheet > .border-b {
    border-color: #334155 !important;
}
#scripture-viewer[data-scripture-theme="dark"] #scripture-multi-bible-sheet [data-close-multi-bible] {
    border-color: #475569 !important;
    background: #172033 !important;
    color: #cbd5e1 !important;
}
#scripture-viewer[data-scripture-theme="dark"] #scripture-multi-bible-sheet [data-close-multi-bible]:hover {
    border-color: #d97706 !important;
    background: #2a2416 !important;
    color: #fde68a !important;
}
#scripture-viewer[data-scripture-theme="dark"] #scripture-multi-bible-sheet [data-multi-bible-tab][aria-selected="true"] {
    background: #2a2416 !important;
    color: #fde68a !important;
    box-shadow: inset 0 0 0 1px #92400e;
}
#scripture-viewer[data-scripture-theme="dark"] #scripture-multi-bible-sheet [data-multi-bible-tab][aria-selected="false"] {
    background: transparent !important;
    color: #cbd5e1 !important;
}
#scripture-viewer[data-scripture-theme="dark"] #scripture-multi-bible-sheet [data-multi-bible-tab][aria-selected="false"]:hover {
    background: #273449 !important;
    color: #f8fafc !important;
}
#scripture-viewer[data-scripture-theme="dark"] #scripture-multi-bible-sheet [data-multi-bible-body] article,
#scripture-viewer[data-scripture-theme="dark"] #scripture-multi-bible-sheet [data-multi-bible-settings] > section + section > div {
    border-color: #334155 !important;
    background: #172033 !important;
}
#scripture-viewer[data-scripture-theme="dark"] #scripture-multi-bible-sheet [data-multi-bible-body] article .bg-stone-900 {
    background: #2a2416 !important;
    color: #fde68a !important;
    box-shadow: inset 0 0 0 1px #92400e;
}
#scripture-viewer[data-scripture-theme="dark"] #scripture-multi-bible-sheet [data-multi-bible-body] .scripture-ref-open {
    border-color: #4f46e5 !important;
    background: #1e1b4b !important;
    color: #c7d2fe !important;
}
#scripture-viewer[data-scripture-theme="dark"] #scripture-multi-bible-sheet [data-multi-bible-body] .scripture-ref-open:hover {
    border-color: #818cf8 !important;
    background: #312e81 !important;
    color: #eef2ff !important;
}
#scripture-viewer[data-scripture-theme="dark"] #scripture-multi-bible-sheet [data-multi-bible-settings] > section:first-child {
    border-color: #92400e !important;
    background: #2a2416 !important;
    color: #fde68a !important;
}
#scripture-viewer[data-scripture-theme="dark"] #scripture-multi-bible-sheet [data-multi-bible-settings] > section:first-child .text-amber-900 {
    color: #fcd34d !important;
}
#scripture-viewer[data-scripture-theme="dark"] #scripture-multi-bible-sheet [data-multi-bible-version] {
    accent-color: #f59e0b;
}
#scripture-viewer[data-scripture-theme="dark"] #scripture-multi-bible-sheet [data-multi-bible-move] {
    border-color: #475569 !important;
    background: #101827 !important;
    color: #cbd5e1 !important;
}
#scripture-viewer[data-scripture-theme="dark"] #scripture-multi-bible-sheet [data-multi-bible-move]:not(:disabled):hover {
    border-color: #d97706 !important;
    background: #2a2416 !important;
    color: #fde68a !important;
}
@media (max-width: 767px) {
    #scripture-viewer .scripture-verse-discussion-popover {
        right: 0.75rem;
        bottom: 0.75rem;
        width: calc(100vw - 1.5rem);
        max-height: 48vh;
    }
    #scripture-viewer .scripture-verse-resources-sheet[open] {
        width: calc(100vw - 1.5rem);
        max-height: 78vh;
    }
    #scripture-viewer .scripture-verse-resource-body {
        max-height: calc(78vh - 9.5rem);
    }
    #scripture-viewer .scripture-scroll-hint {
        position: relative;
    }
    #scripture-viewer .scripture-scroll-hint-track {
        padding-right: 2.75rem;
        scrollbar-width: none;
    }
    #scripture-viewer .scripture-scroll-hint-track::-webkit-scrollbar {
        display: none;
    }
    #scripture-viewer .scripture-scroll-hint[data-scroll-more="1"]::after {
        content: "";
        position: absolute;
        inset: 0 0 0 auto;
        width: 3.25rem;
        border-radius: 0 0.5rem 0.5rem 0;
        background: linear-gradient(90deg, rgb(245 245 244 / 0), #f5f5f4 44%, #f5f5f4);
        pointer-events: none;
        z-index: 2;
    }
    #scripture-viewer .scripture-scroll-hint[data-scroll-more="1"]::before {
        content: "›";
        position: absolute;
        right: 0.55rem;
        top: 50%;
        z-index: 3;
        display: inline-flex;
        width: 1.45rem;
        height: 1.45rem;
        align-items: center;
        justify-content: center;
        transform: translateY(-50%);
        border-radius: 9999px;
        background: #ffffff;
        box-shadow: 0 1px 6px rgb(28 25 23 / 0.18);
        color: #44403c;
        font-size: 1.35rem;
        font-weight: 900;
        line-height: 1;
        pointer-events: none;
    }
}
#scripture-viewer .scripture-inline-commentary-view {
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    border-left-color: var(--scripture-inline-note-border) !important;
    box-shadow: none;
}
#scripture-viewer .scripture-original-version-token small {
    color: #0369a1;
    font-size: 0.62rem;
    font-weight: 700;
}
#scripture-viewer .scripture-original-version-token:hover {
    border-color: #38bdf8;
    background: #e0f2fe;
}
#scripture-viewer .scripture-original-source-token {
    min-width: 4.5rem;
}
#scripture-viewer .scripture-original-source-token--unaligned {
    border-style: dashed;
    border-color: #d6d3d1;
    background: #f5f5f4;
    box-shadow: none;
}
#scripture-viewer .scripture-original-source-token--unaligned:hover {
    border-color: #a8a29e;
    background: #e7e5e4;
}
#scripture-viewer .scripture-original-source-token--unaligned .ow-ko,
#scripture-viewer .scripture-original-source-token--unaligned .ow-surface,
#scripture-viewer .scripture-original-source-token--unaligned .ow-reading {
    color: #78716c;
}
#scripture-viewer .scripture-original-source-token--unaligned.is-active {
    border-color: #78716c;
    background: #44403c;
}
#scripture-viewer .scripture-original-source-token--unaligned.is-active .ow-ko,
#scripture-viewer .scripture-original-source-token--unaligned.is-active .ow-surface,
#scripture-viewer .scripture-original-source-token--unaligned.is-active .ow-reading {
    color: #f5f5f4;
}
#scripture-viewer .scripture-original-version-token--untranslated,
#scripture-viewer .scripture-original-token-button--untranslated {
    border-color: #d6d3d1 !important;
    background: #f5f5f4 !important;
    color: #57534e !important;
}
#scripture-viewer .scripture-original-version-token--untranslated small,
#scripture-viewer .scripture-original-token-button--untranslated small,
#scripture-viewer .scripture-original-token-button--untranslated span {
    color: #78716c !important;
}
#scripture-viewer .scripture-original-version-token--untranslated:hover,
#scripture-viewer .scripture-original-token-button--untranslated:hover {
    border-color: #a8a29e !important;
    background: #e7e5e4 !important;
}
@media (min-width: 768px) {
    #scripture-viewer .scripture-comparison-split {
        grid-template-columns: repeat(var(--comparison-columns, 2), minmax(0, 1fr));
    }
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-structural-block {
    border-color: #334155;
    background: #111827;
    color: #f8fafc;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-comparison-card {
    border-color: #334155;
    background: #0f172a;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-comparison-card--current {
    border-color: #f59e0b;
    background: #1c1917;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-comparison-card--original {
    border-color: #075985;
    background: #082f49;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-original-version-token {
    border-color: #075985;
    background: #0f172a;
    color: #e0f2fe;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-original-version-token small {
    color: #7dd3fc;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-original-version-token:hover {
    border-color: #38bdf8;
    background: #0c4a6e;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-original-source-token--unaligned {
    border-color: #57534e;
    background: #1c1917;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-original-source-token--unaligned:hover {
    border-color: #78716c;
    background: #292524;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-original-source-token--unaligned .ow-ko,
#scripture-viewer[data-scripture-theme="dark"] .scripture-original-source-token--unaligned .ow-surface,
#scripture-viewer[data-scripture-theme="dark"] .scripture-original-source-token--unaligned .ow-reading {
    color: #a8a29e;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-original-source-token--unaligned.is-active {
    border-color: #a8a29e;
    background: #44403c;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-original-source-token--unaligned.is-active .ow-ko,
#scripture-viewer[data-scripture-theme="dark"] .scripture-original-source-token--unaligned.is-active .ow-surface,
#scripture-viewer[data-scripture-theme="dark"] .scripture-original-source-token--unaligned.is-active .ow-reading {
    color: #ffffff;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-original-version-token--untranslated,
#scripture-viewer[data-scripture-theme="dark"] .scripture-original-token-button--untranslated {
    border-color: #57534e !important;
    background: #1c1917 !important;
    color: #d6d3d1 !important;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-original-version-token--untranslated small,
#scripture-viewer[data-scripture-theme="dark"] .scripture-original-token-button--untranslated small,
#scripture-viewer[data-scripture-theme="dark"] .scripture-original-token-button--untranslated span {
    color: #a8a29e !important;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-original-version-token--untranslated:hover,
#scripture-viewer[data-scripture-theme="dark"] .scripture-original-token-button--untranslated:hover {
    border-color: #78716c !important;
    background: #292524 !important;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-range-rail,
#scripture-viewer[data-scripture-theme="dark"] .scripture-range-rail::before,
#scripture-viewer[data-scripture-theme="dark"] .scripture-range-rail::after {
    border-color: #f59e0b;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-range-rail-label {
    background: #451a03;
    color: #fbbf24;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-audio-player-card {
    border-color: #075985;
    background: #0f172a;
    box-shadow: none;
}
#scripture-viewer[data-scripture-theme="dark"] .scripture-audio-player {
    accent-color: #38bdf8;
}

/* 구형 이북 브라우저(Boox Poke2 / Chrome 108)에서 선택 상태와 설정 시트의 검은 버튼을
   되살리는 규칙. 색 유틸리티 전반은 eink-utility-colors.css 가 리터럴 hex 로 다시 선언한다
   (토큰을 hex 로 재정의하는 방식은 같은 단말에서 듣지 않았다 — 2026-08-23 실측). */
#scripture-viewer[data-read-profile="eink"] .sc-pick-on {
    background: #1c1917 !important;
    color: #ffffff !important;
    border-color: #1c1917 !important;
}
#scripture-viewer[data-read-profile="eink"] #scripture-settings-sheet button.bg-stone-900 {
    background: #1c1917 !important;
    color: #ffffff !important;
    border-color: #1c1917 !important;
}

/* e-ink 선택 UI — 입력 상자처럼 보이는 외곽선·배경을 걷고,
   TTS 진행 표시와 같은 왼쪽 수직 막대만 남긴다.
   일부 구형 전자책 브라우저는 Tailwind의 #0000 투명색을 무시하므로
   선택 여부와 무관하게 절의 border box 자체를 제거한다. */
#scripture-viewer[data-read-profile="eink"] .scripture-passage {
    border: 0 !important;
    border-radius: 0 !important;
    transition: none;
}
#scripture-viewer[data-read-profile="eink"] .scripture-passage.is-selected {
    border-color: transparent !important;
    border-radius: 0 !important;
    background: none !important;
    box-shadow: none !important;
}
#scripture-viewer[data-read-profile="eink"] .scripture-passage.is-selected::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0.3rem;
    bottom: 0.3rem;
    width: 3px;
    background: currentColor;
    pointer-events: none;
}
/* e-ink의 절 버튼은 선택 상태 자체다. contextual/always 사용자 설정이나
   클릭 뒤 남는 focus 상태와 무관하게, 선택을 해제하면 반드시 함께 숨긴다. */
#scripture-viewer[data-read-profile="eink"] .scripture-passage:not(.is-selected) .scripture-passage-action-button {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transform: none !important;
}
#scripture-viewer[data-read-profile="eink"] .scripture-verse-action-bar {
    position: static;
    display: flex;
    width: 100%;
    grid-column: 1 / -1;
    justify-content: flex-end;
    gap: 0.45rem;
    margin-top: 0.6rem;
}
#scripture-viewer[data-read-profile="eink"] .scripture-verse-copy-button,
#scripture-viewer[data-read-profile="eink"] .scripture-verse-clear-button {
    min-height: 44px;
    border: 2px solid #111111;
    border-radius: 0.3rem;
    background: #ffffff;
    color: #111111;
    padding: 0 0.8rem;
    box-shadow: none;
    transition: none;
}
#scripture-viewer[data-read-profile="eink"] .scripture-verse-copy-button:hover,
#scripture-viewer[data-read-profile="eink"] .scripture-verse-copy-button:focus-visible,
#scripture-viewer[data-read-profile="eink"] .scripture-verse-clear-button:hover,
#scripture-viewer[data-read-profile="eink"] .scripture-verse-clear-button:focus-visible {
    border-color: #111111;
    background: #111111;
    color: #ffffff;
}
#scripture-viewer[data-read-profile="eink"] .scripture-verse-custom-menu {
    box-shadow: none;
    filter: grayscale(1);
    transition: none;
}
#scripture-viewer[data-read-profile="eink"] .scripture-verse-custom-menu button,
#scripture-viewer[data-read-profile="eink"] .scripture-verse-custom-menu a {
    min-height: 44px;
}
