/* ============================================================
   DENBOWIKI · 치과건강보험 통합자료집 위키 모듈
   dev(NETCITY) 테마 디자인 토큰에 맞춘 스타일
   ============================================================ */

:root {
    --dw-text: #111827;
    --dw-muted: #64748b;
    --dw-soft: #f6f8fb;
    --dw-line: rgba(17, 24, 39, 0.10);
    --dw-line-strong: rgba(17, 24, 39, 0.16);
    --dw-card: #ffffff;
    --dw-accent: #0ea5e9;
    --dw-accent-soft: #e0f2fe;
    --dw-orange: #ff6b35;
    --dw-radius: 22px;
    --dw-radius-sm: 12px;
    --dw-shadow: 0 22px 60px rgba(15, 23, 42, 0.07);
    --dw-shadow-sm: 0 6px 18px rgba(15, 23, 42, 0.06);
    --dw-warn: #fff8e6;
}

/* 위키 페이지에서는 우측 사이드(로그인·배너)를 숨기고 본문(목차+문서)을 넓게 사용 */
.dev-container-grid:not(.dev-container-grid-board) { grid-template-columns: minmax(0, 1fr) !important; }
.dev-container-grid:not(.dev-container-grid-board) > .dev-aside { display: none !important; }
body.denbowiki-page #container.dev-container { width: 100%; }

/* ── 모듈 컨테이너 ── */
.denbo-wiki-module {
    display: grid;
    gap: 16px;
    color: var(--dw-text);
    font-size: 15px;
    line-height: 1.78;
}
.denbo-wiki-module *,
.editor-backdrop * { box-sizing: border-box; }

/* ── 헤더(타이틀 + 검색) ── */
.dw-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
    gap: 18px;
    align-items: center;
    padding: 22px 26px;
    border: 1px solid var(--dw-line);
    border-radius: var(--dw-radius);
    background: var(--dw-card);
    box-shadow: var(--dw-shadow);
}
.dw-kicker {
    font: 700 11px/1 "Space Grotesk", "IBM Plex Sans KR", sans-serif;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--dw-accent);
}
.dw-head-titles h2 {
    margin: 8px 0 4px;
    font-family: "Space Grotesk", "IBM Plex Sans KR", sans-serif;
    font-size: clamp(22px, 2.4vw, 30px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.01em;
}
.dw-meta {
    margin: 0;
    color: var(--dw-muted);
    font-size: 13px;
}
.dw-search {
    display: grid;
    grid-template-columns: 1fr auto;
    border: 1.5px solid var(--dw-line-strong);
    border-radius: 999px;
    background: var(--dw-soft);
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
}
.dw-search:focus-within {
    border-color: var(--dw-accent);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.14);
    background: #fff;
}
.dw-search input {
    width: 100%;
    border: 0;
    padding: 11px 18px;
    font: inherit;
    font-size: 14px;
    background: transparent;
    outline: 0;
}
.dw-search button {
    border: 0;
    padding: 0 22px;
    background: var(--dw-accent);
    color: #fff;
    font: inherit;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: background .15s;
}
.dw-search button:hover { background: #0284c7; }

/* ── 대주제 메뉴 ── */
.dw-main-menu {
    border: 1px solid var(--dw-line);
    border-radius: var(--dw-radius);
    background: var(--dw-card);
    box-shadow: var(--dw-shadow-sm);
    overflow: hidden;
}
.main-menu-list {
    display: flex;
    gap: 4px;
    margin: 0;
    padding: 10px 14px 0;
    list-style: none;
    overflow-x: auto;
    scrollbar-width: none;
}
.main-menu-list::-webkit-scrollbar { display: none; }
.main-menu-item { flex: 0 0 auto; }
.main-menu-button {
    border: 0;
    border-radius: var(--dw-radius-sm) var(--dw-radius-sm) 0 0;
    background: transparent;
    padding: 10px 16px 12px;
    color: var(--dw-muted);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: color .15s, background .15s;
    border-bottom: 3px solid transparent;
}
.main-menu-button:hover { color: var(--dw-text); background: var(--dw-soft); }
.main-menu-button.is-active {
    color: var(--dw-accent);
    border-bottom-color: var(--dw-accent);
}
.sub-menu-row {
    display: flex;
    gap: 6px;
    align-items: center;
    min-height: 46px;
    padding: 8px 16px;
    border-top: 1px solid var(--dw-line);
    background: var(--dw-soft);
    overflow-x: auto;
    scrollbar-width: none;
}
.sub-menu-row::-webkit-scrollbar { display: none; }
.sub-menu-row a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 13px;
    border: 1.5px solid transparent;
    border-radius: 999px;
    color: var(--dw-muted);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    transition: all .15s;
}
.sub-menu-row a:hover {
    border-color: var(--dw-line-strong);
    background: #fff;
    color: var(--dw-text);
}
.sub-menu-row .sub-menu-primary,
.sub-menu-row a.is-active {
    border-color: var(--dw-accent);
    background: var(--dw-accent-soft);
    color: #0369a1;
}
.sub-menu-placeholder { color: var(--dw-muted); font-size: 13px; }

/* ── 안내 배너 ── */
.dw-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 18px;
    border: 1px solid rgba(245, 158, 11, 0.30);
    border-radius: var(--dw-radius-sm);
    background: var(--dw-warn);
    color: #92660b;
    font-size: 13.5px;
}
.dw-notice button {
    border: 1px solid rgba(146, 102, 11, 0.4);
    border-radius: 999px;
    background: #fff;
    padding: 5px 12px;
    color: #92660b;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}
.dw-notice button:hover { background: #fffbeb; }

/* ── 검색 결과 ── */
.search-result {
    display: none;
    padding: 14px 18px;
    border: 1px solid var(--dw-line);
    border-radius: var(--dw-radius-sm);
    background: var(--dw-card);
    box-shadow: var(--dw-shadow-sm);
    color: var(--dw-muted);
    font-size: 14px;
}

/* ── 2단 레이아웃: 목차 + 본문 ── */
.dw-layout {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

/* 목차 */
.dw-toc {
    position: sticky;
    top: 18px;
    align-self: start;
    max-height: calc(100vh - 36px);
    overflow: auto;
    border: 1px solid var(--dw-line);
    border-radius: var(--dw-radius);
    background: var(--dw-card);
    box-shadow: var(--dw-shadow-sm);
    scrollbar-width: thin;
}
.dw-toc-title {
    margin: 0;
    padding: 14px 18px;
    border-bottom: 1px solid var(--dw-line);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dw-muted);
}
.toc, .toc ol { list-style: none; margin: 0; padding: 0; }
.toc { padding: 8px 0; }
.toc li { line-height: 1.4; }
.toc a { display: block; color: var(--dw-text); font-size: 13px; text-decoration: none; }
.toc-group.single > a {
    padding: 8px 18px;
    font-weight: 600;
    border-bottom: 1px solid var(--dw-soft);
}
.toc details { border-bottom: 1px solid var(--dw-soft); }
.toc summary {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr);
    gap: 6px;
    align-items: start;
    padding: 9px 18px;
    color: var(--dw-text);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    transition: background .12s;
}
.toc summary::-webkit-details-marker { display: none; }
.toc summary::before {
    content: "›";
    color: var(--dw-muted);
    font-size: 18px;
    line-height: 14px;
    transition: transform .16s ease;
}
.toc details[open] summary::before { transform: rotate(90deg); }
.toc summary:hover,
.toc-group.single > a:hover { background: var(--dw-accent-soft); }
.toc-top-link {
    margin: 0 18px 5px 38px;
    padding: 3px 0;
    color: var(--dw-accent) !important;
    font-size: 12px !important;
}
.toc details ol { padding: 0 0 8px; }
.toc details li a {
    padding: 4px 14px 4px 38px;
    color: var(--dw-muted);
    overflow-wrap: anywhere;
}
.toc details li a:hover { background: var(--dw-accent-soft); color: #0369a1; }
.toc-page > a.is-active {
    background: var(--dw-accent-soft);
    color: #0369a1;
    font-weight: 800;
    box-shadow: inset 3px 0 0 var(--dw-accent);
}
.toc-placeholder {
    display: block;
    padding: 4px 14px 4px 38px;
    color: var(--dw-muted);
    font-size: 13px;
}
.toc-placeholder small { margin-left: 4px; font-size: 11px; }
.toc-current-page { margin: 3px 0 8px !important; padding: 0 !important; border-left: 1px solid var(--dw-line); }
.toc-current-page a { font-size: 12px !important; color: var(--dw-muted) !important; }
.toc-current-page a:hover { color: var(--dw-accent) !important; }
.toc-l3 a { padding-left: 50px !important; }
.toc-l4 a, .toc-l5 a { padding-left: 62px !important; }

/* 본문 */
.dw-document {
    min-width: 0;
    border: 1px solid var(--dw-line);
    border-radius: var(--dw-radius);
    background: var(--dw-card);
    box-shadow: var(--dw-shadow);
    padding: 30px 36px 48px;
}
.wiki-section { padding-top: 8px; }
.section-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    margin: -2px 0 10px;
}
.edit-section, .rename-section, .add-subsection, .add-major, .delete-section { display: none; }
.denbo-wiki-module.is-admin .edit-section,
.denbo-wiki-module.is-admin .rename-section,
.denbo-wiki-module.is-admin .add-subsection,
.denbo-wiki-module.is-admin .add-major,
.denbo-wiki-module.is-admin .delete-section,
body.is-admin .edit-section,
body.is-admin .rename-section,
body.is-admin .add-subsection,
body.is-admin .add-major,
body.is-admin .delete-section { display: inline-flex; }

.edit-section, .rename-section, .add-subsection, .add-major, .delete-section {
    align-items: center;
    border: 1.5px solid var(--dw-line);
    border-radius: 999px;
    background: var(--dw-soft);
    color: var(--dw-muted);
    padding: 4px 12px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all .12s;
}
.edit-section:hover, .rename-section:hover { border-color: var(--dw-line-strong); color: var(--dw-text); }
.delete-section { color: #dc2626; border-color: #f3b4b4; background: #fff1f1; }
.delete-section:hover { background: #fee2e2; border-color: #dc2626; }
.add-subsection, .add-major { color: var(--dw-accent); border-color: var(--dw-accent); background: var(--dw-accent-soft); }
.add-subsection:hover, .add-major:hover { background: #d3ecfb; }
.add-major-wrap { margin: 28px 0 0; padding: 18px 0 0; border-top: 1px solid var(--dw-line); }
.add-major { padding: 8px 16px; font-size: 13px; }
.saved-indicator { color: #16a34a; font-size: 12px; font-weight: 700; }
/* 편집 저장 시 좌측 파란 띠(수정됨 표시) 제거 */
.section-content[data-edited="true"] { border-left: 0; padding-left: 0; }

/* 제목 계층 */
.wiki-section h2, .wiki-section h3, .wiki-section h4, .wiki-section h5, .wiki-section h6 {
    margin: 26px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--dw-line);
    line-height: 1.35;
    font-weight: 700;
}
.wiki-section h2 {
    font-size: 25px;
    font-family: "Space Grotesk", "IBM Plex Sans KR", sans-serif;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #0f172a;
}
.wiki-section h3 { font-size: 20px; color: #1e293b; }
.wiki-section h4 { font-size: 17px; }
.wiki-section h5, .wiki-section h6 { font-size: 15px; }
.section-title-link { color: inherit; text-decoration: none; }
.section-title-link:hover { color: var(--dw-accent); }
.section-content .detail-heading {
    border-bottom: 0;
    margin: 20px 0 6px;
    padding-bottom: 0;
    font-size: 16px;
    font-weight: 800;
    color: var(--dw-text);
}
.wiki-section p { margin: 9px 0; word-break: keep-all; overflow-wrap: anywhere; }
.wiki-section .lead { color: var(--dw-muted); }

/* 표 */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    margin: 16px 0 22px;
    border: 1px solid var(--dw-line);
    border-radius: var(--dw-radius-sm);
}
.wiki-section table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 14px;
}
.wiki-section th, .wiki-section td {
    border: 1px solid var(--dw-line);
    padding: 9px 12px;
    vertical-align: top;
    min-width: 90px;
}
.wiki-section th {
    background: var(--dw-soft);
    text-align: left;
    font-weight: 700;
    font-size: 13px;
    color: #334155;
}
.wiki-section th p, .wiki-section td p { margin: 0 0 5px; }
.wiki-section th p:last-child, .wiki-section td p:last-child { margin-bottom: 0; }
.wiki-section tbody tr:hover td { background: #fafcfe; }
.wiki-section mark { background: #fde68a; padding: 0 2px; border-radius: 2px; }

/* 게시판 fallback(가드된 영역) */
.board-loading, .board-fallback { padding: 16px; color: var(--dw-muted); font-size: 14px; }

/* ── 에디터 모달 ── */
.editor-backdrop {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
}
.editor-backdrop[hidden] { display: none; }
.editor-dialog {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    width: min(1100px, 96vw);
    height: min(820px, 92vh);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
    overflow: hidden;
    font-size: 15px;
}
.editor-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid var(--dw-line);
    background: var(--dw-soft);
}
.editor-title { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-close {
    border: 1.5px solid var(--dw-line);
    border-radius: 50%;
    background: #fff;
    width: 34px;
    height: 34px;
    font-size: 18px;
    cursor: pointer;
    transition: all .12s;
}
.editor-close:hover { background: #fee2e2; border-color: #f87171; }
.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--dw-line);
    background: #fff;
}
.editor-toolbar button {
    border: 1.5px solid var(--dw-line);
    border-radius: 8px;
    background: var(--dw-soft);
    min-width: 34px;
    height: 32px;
    padding: 0 10px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all .12s;
}
.editor-toolbar button:hover { background: var(--dw-accent-soft); border-color: var(--dw-accent); color: #0369a1; }
.editor-toolbar .separator { width: 1px; margin: 4px 3px; background: var(--dw-line); }
.editor-body { min-height: 0; overflow: auto; padding: 18px; background: var(--dw-soft); }
.editor-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 18px;
    border-top: 1px solid var(--dw-line);
    background: var(--dw-soft);
    color: var(--dw-muted);
    font-size: 13px;
}
.editor-footer-actions { display: flex; gap: 8px; }
.editor-footer-actions button {
    border: 1.5px solid var(--dw-line-strong);
    border-radius: 10px;
    background: #fff;
    padding: 8px 16px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background .12s;
}
.editor-footer-actions button:hover { background: var(--dw-soft); }
.editor-footer-actions .primary { background: var(--dw-accent); color: #fff; border-color: var(--dw-accent); }
.editor-footer-actions .primary:hover { background: #0284c7; }
#editor-root, .fallback-editor {
    min-height: 560px;
    border: 1.5px solid var(--dw-line-strong);
    border-radius: 10px;
    background: #fff;
}
.ProseMirror, .fallback-editor {
    min-height: 560px;
    padding: 18px;
    outline: 0;
    font: inherit;
    line-height: 1.78;
}
.ProseMirror table, .fallback-editor table { width: 100%; border-collapse: collapse; }
.ProseMirror th, .ProseMirror td, .fallback-editor th, .fallback-editor td {
    border: 1px solid var(--dw-line-strong);
    padding: 7px 10px;
    vertical-align: top;
}
.ProseMirror th, .fallback-editor th { background: var(--dw-soft); }

/* ── 반응형 ── */
@media (max-width: 1024px) {
    .dw-layout { grid-template-columns: 1fr; }
    .dw-toc { position: static; max-height: 320px; }
}
@media (max-width: 680px) {
    .dw-head { grid-template-columns: 1fr; }
    .dw-document { padding: 22px 18px 36px; }
    .wiki-section h2 { font-size: 21px; }
    .editor-dialog { width: 100%; height: 96vh; border-radius: 12px; }
}

/* ── 비회원 접근 차단 게이트 ── */
.denbo-wiki-gate {
    display: grid;
    place-items: center;
    min-height: 52vh;
    padding: 40px 16px;
}
.dw-gate-card {
    box-sizing: border-box;
    width: min(520px, 100%);
    text-align: center;
    padding: 40px 32px;
    border: 1px solid var(--dw-line);
    border-radius: var(--dw-radius);
    background: var(--dw-card);
    box-shadow: var(--dw-shadow);
}
.dw-gate-card .dw-kicker {
    color: var(--dw-accent);
}
.dw-gate-card h2 {
    margin: 12px 0 14px;
    font-family: "Space Grotesk", "IBM Plex Sans KR", sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
}
.dw-gate-card p {
    margin: 0 0 24px;
    color: var(--dw-muted);
    font-size: 15px;
    line-height: 1.7;
}
.dw-gate-card p strong { color: var(--dw-accent); font-weight: 800; }
.dw-gate-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.dw-gate-actions .dev-action-button,
.dw-gate-actions .dev-outline-button {
    min-width: 140px;
    justify-content: center;
}

/* ── 태그 (페이지 하단 키워드) ── */
.wiki-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px dashed var(--wiki-line, #d8dee6);
}
.wiki-tags__label {
    font-size: 12px;
    font-weight: 700;
    color: var(--wiki-muted, #6b7280);
    letter-spacing: .3px;
    margin-right: 2px;
}
.wiki-tag {
    display: inline-flex;
    align-items: center;
    border: 1px solid #cfe0ff;
    background: #eef4ff;
    color: #1a56db;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, transform .05s;
}
.wiki-tag:hover {
    background: #1a56db;
    border-color: #1a56db;
    color: #fff;
}
.wiki-tag:active { transform: translateY(1px); }

/* ── 자료집 본문 복사/드래그 방지 + 경고 토스트 ── */
#document {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
/* 편집 모달(Tiptap) 내부는 선택 허용 */
#editor-modal, #editor-modal * {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}
.copy-guard-toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%) translateY(20px);
    z-index: 9999;
    max-width: calc(100vw - 32px);
    padding: 13px 20px;
    border-radius: 10px;
    background: rgba(20, 24, 31, .94);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    box-shadow: 0 8px 28px rgba(0,0,0,.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}
.copy-guard-toast.is-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── [관련고시] 인용 콜아웃 / 💡덴보Tip 형광 콜아웃 (모든 페이지 공통) ── */
.wiki-callout {
    margin: 14px 0;
    border-radius: 8px;
}
.wiki-callout > :first-child {
    margin-top: 0;
}

/* 관련고시: 인용형태 + 진한 회색 글자 */
.wiki-callout--gosi {
    border-left: 4px solid #9aa3ad;
    background: #f3f4f6;
    padding: 12px 18px;
    color: #374151;
}
.wiki-callout--gosi .detail-heading,
.wiki-callout--gosi h1, .wiki-callout--gosi h2, .wiki-callout--gosi h3,
.wiki-callout--gosi h4, .wiki-callout--gosi h5, .wiki-callout--gosi h6,
.wiki-callout--gosi p,
.wiki-callout--gosi li,
.wiki-callout--gosi td,
.wiki-callout--gosi th {
    color: #374151 !important;
}
.wiki-callout--gosi .detail-heading,
.wiki-callout--gosi h1, .wiki-callout--gosi h2, .wiki-callout--gosi h3,
.wiki-callout--gosi h4, .wiki-callout--gosi h5, .wiki-callout--gosi h6 {
    font-weight: 700;
    letter-spacing: -.2px;
}

/* 덴보Tip: 노랑 형광펜 느낌 */
.wiki-callout--tip {
    background: #fff7ad;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(214, 188, 0, .35);
}
.wiki-callout--tip .detail-heading,
.wiki-callout--tip h1, .wiki-callout--tip h2, .wiki-callout--tip h3,
.wiki-callout--tip h4, .wiki-callout--tip h5, .wiki-callout--tip h6 {
    color: #6b5800;
    font-weight: 800;
    margin-bottom: 6px;
}
.wiki-callout--tip p,
.wiki-callout--tip li {
    color: #4a3f00;
}

/* 본문 링크 */
.section-content a[href] {
    color: #1a56db;
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-all;
}
.section-content a[href]:hover { color: #1246c0; }

/* ⚠ 경고 문장: 붉은색 강조 (콜아웃 내부에서도 우선) */
.section-content .wiki-warn,
.wiki-callout .wiki-warn {
    color: #d92d20 !important;
    font-weight: 600;
}

/* ── 목차 개선: 대주제 크게 / 중간주제 볼드 / 선택된 중간주제 펼치기·닫기 ── */
/* 대주제(그룹) 폰트 한 단계 크게 */
.toc-group > details > summary { font-size: 15px; }

/* 중간주제(페이지) 볼드 */
.toc-page > a { font-weight: 700; color: var(--dw-text); }

/* 선택된 중간주제: 펼치기/닫기 가능한 summary */
.toc-sub { border-bottom: 0 !important; }
.toc-sub > summary {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr);
    gap: 6px;
    align-items: start;
    padding: 6px 14px 6px 18px;
    font-size: 13px;
    font-weight: 800;
    color: #0369a1;
    background: var(--dw-accent-soft);
    box-shadow: inset 3px 0 0 var(--dw-accent);
    cursor: pointer;
    list-style: none;
    overflow-wrap: anywhere;
}
.toc-sub > summary::-webkit-details-marker { display: none; }
.toc-sub > summary::before {
    content: "›";
    color: var(--dw-accent);
    font-size: 16px;
    line-height: 14px;
    transition: transform .16s ease;
}
.toc-sub[open] > summary::before { transform: rotate(90deg); }
.toc-sub > summary:hover { background: #d6ecfa; }

/* ── 검색 하이라이트 + 플로팅 검색바 ── */
mark.wiki-hl {
    background: #fff2a8;
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}
mark.wiki-hl--current {
    background: #ffb01f;
    color: #1a1a1a;
    box-shadow: 0 0 0 2px rgba(255, 176, 31, .45);
}
.wiki-find[hidden] { display: none !important; }
.wiki-find {
    position: fixed;
    top: 88px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    z-index: 9500;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 10px 8px 16px;
    background: #f0f9ff;
    border: 2px solid var(--dw-accent);
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(14, 165, 233, .30);
}
.wiki-find__input {
    border: 0;
    outline: 0;
    width: 180px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #0c4a6e;
    background: transparent;
}
.wiki-find__input::placeholder { color: #7dd3fc; font-weight: 500; }
.wiki-find__count {
    font-size: 13px;
    font-weight: 700;
    color: #0369a1;
    white-space: nowrap;
    min-width: 52px;
    text-align: center;
}
.wiki-find button {
    border: 0;
    background: #e0f2fe;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    line-height: 1;
    font-size: 15px;
    cursor: pointer;
    color: #0369a1;
    transition: background .12s, color .12s;
}
.wiki-find button:hover { background: var(--dw-accent); color: #fff; }
.wiki-find__close { font-size: 17px; }
@media (max-width: 640px) {
    .wiki-find { top: 70px; width: calc(100vw - 24px); }
    .wiki-find__input { width: 100%; }
}
