@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

/* 페이지 로딩 표시 (본문 영역만, 레이아웃은 보임) */
.page-content-wrap {
    position: relative;
    min-height: 40vh;
}

/* UNIFIED-FIX: .viewer-wrapper가 HTML에서 제거됨 → body 직접 적용 */
body.viewer-body>.page-content-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

body.viewer-body>.page-content-wrap>.viewer-content {
    flex: 1;
}

.page-loader {
    position: absolute;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.page-loader.is-loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.page-loader-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

/* 프리미엄 원형 스피너 */
.page-loader-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(59, 130, 246, 0.1);
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: page-loader-spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

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

.page-loader-text {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1e293b;
    letter-spacing: -0.01em;
}

/* 패드/모바일 조정 */
@media (max-width: 768px) {
    .page-loader-spinner {
        width: 38px;
        height: 38px;
    }
    .page-loader-text {
        font-size: 0.875rem;
    }
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    margin: 0;
    background: #f7f7f7;
    color: #222;
}

a {
    color: #1565c0;
    text-decoration: none;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
}

/* 롤링배너 (API 연동 시 get_rolling_banners()에서 데이터 반환) */
.rolling-banner-wrap {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin-bottom: 24px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e1e1e1;
    background: #e9e9e9;
}

.rolling-banner {
    position: relative;
    width: 100%;
    aspect-ratio: 800 / 280;
    min-height: 200px;
}

.rolling-banner-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.rolling-banner-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

.rolling-banner-slide img,
.rolling-banner-slide .rolling-banner-link {
    display: block;
    width: 100%;
    height: 100%;
}

.rolling-banner-slide img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.rolling-banner-slide .rolling-banner-link {
    text-decoration: none;
}

.rolling-banner-title {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 6px;
}

.rolling-banner-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: #fff;
    border-top: 1px solid #e1e1e1;
}

.rolling-banner-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: #ccc;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.2s;
}

.rolling-banner-dot:hover {
    background: #999;
}

.rolling-banner-dot.active {
    background: #1565c0;
    transform: scale(1.2);
}

/* 목록 페이지 레이아웃 (첨부 이미지 스타일) */
.list-index-body {
    margin: 0;
    min-height: 100vh;
    background: #fff;
}

.list-index-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.list-index-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #eee;
}

.list-index-header-left,
.list-index-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 80px;
}

.list-index-header-right {
    justify-content: flex-end;
}

.list-index-brand {
    text-align: center;
}

.list-index-brand-sub {
    display: block;
    font-size: 0.75rem;
    color: #888;
    letter-spacing: 0.05em;
}

.list-index-brand-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #222;
}

.list-index-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #333;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.list-index-icon-btn:hover {
    background: #555;
    transform: scale(1.05);
}

.list-index-search-bar {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.list-index-search-bar.is-open {
    max-height: 80px;
}

.list-index-search-form {
    display: flex;
    gap: 10px;
    padding: 12px 0 16px;
    align-items: center;
}

.list-index-search-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9375rem;
}

.list-index-search-input:focus {
    outline: none;
    border-color: #3182F6;
    box-shadow: 0 0 0 2px rgba(49, 130, 246, 0.2);
}

.list-index-search-btn {
    padding: 10px 18px;
    background: #3182F6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    cursor: pointer;
}

.list-index-search-btn:hover {
    background: #1b64da;
}

.list-index-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 12px 0 0;
    margin: 0 auto;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.list-index-pill {
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: #fff;
    font-size: 0.875rem;
    color: #555;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.list-index-pill:hover {
    border-color: #3182F6;
    color: #3182F6;
}

.list-index-pill.is-active {
    background: #3182F6;
    border-color: #3182F6;
    color: #fff;
}

.list-index-pill i {
    margin-right: 6px;
}

.list-index-main {
    padding: 24px 0 40px;
    background: #fff;
}

.list-index-content {
    position: relative;
    min-height: 200px;
}

.list-index-content.is-loading .list-index-grid {
    opacity: 0.6;
    pointer-events: none;
}

.list-index-results-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.list-index-results-count {
    font-size: 0.9375rem;
    color: #555;
}

.list-index-sort-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.list-index-sort-label {
    font-size: 0.8125rem;
    color: #666;
}

.list-index-sort {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.8125rem;
    background: #fff;
    color: #333;
}

.list-index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    transition: opacity 0.2s;
}

.list-index-grid.is-search-result .list-index-empty {
    display: none !important;
}

.list-index-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 0.9375rem;
}

.list-index-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, transform 0.15s;
}

.list-index-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.list-index-card-img-wrap {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: #f0f0f0;
    overflow: hidden;
}

.list-index-card-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.list-index-card-placeholder {
    width: 100%;
    height: 100%;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8e8e8 0%, #f0f0f0 100%);
    font-size: 2rem;
    font-weight: 700;
    color: #999;
}

.list-index-card-placeholder-sm {
    min-height: 120px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #999;
}

.list-index-card-title {
    margin: 0;
    padding: 12px 14px 4px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #222;
    line-height: 1.35;
}

.list-index-card-desc {
    margin: 0;
    padding: 0 14px 8px;
    font-size: 0.8125rem;
    color: #666;
    line-height: 1.4;
    flex: 1;
}

.list-index-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px 12px;
    font-size: 0.75rem;
    color: #888;
    border-top: 1px solid #f0f0f0;
}

.list-index-card-meta-type {
    font-weight: 500;
    color: #555;
}

.list-index-result-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 0.9375rem;
}

@media (max-width: 900px) {
    .list-index-main {
        padding: 20px 0 32px;
    }

    .list-index-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.card {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e1e1e1;
    overflow: hidden;
}

.card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
    background: #e9e9e9;
}

.card-body {
    padding: 12px;
}

.viewer {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e1e1e1;
    padding: 16px;
}

.viewer img {
    width: 100%;
    height: auto;
    display: block;
}

.toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.toolbar input[type="number"] {
    width: 80px;
}

.alert {
    padding: 10px 12px;
    background: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 6px;
    margin-bottom: 12px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
}

.btn {
    display: inline-block;
    padding: 8px 12px;
    background: #1565c0;
    color: #fff;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}

.btn.secondary {
    background: #6c757d;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.table th,
.table td {
    padding: 10px;
    border: 1px solid #e1e1e1;
    text-align: left;
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* 뷰어 레이아웃: 목차 + 본문 */
.viewer-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.toc-sidebar {
    flex: 0 0 220px;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 12px;
}

.toc-sidebar h3 {
    margin: 0 0 10px 0;
    font-size: 1rem;
}

.toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc-list li {
    margin-bottom: 4px;
}

.toc-list li a {
    display: block;
    padding: 6px 8px;
    border-radius: 4px;
}

.toc-list li.active a {
    background: #E8F3FF;
    color: #3182F6;
}

/* 2depth TOC */
.toc-item { position: relative; }
.toc-item-row { display: flex; align-items: center; }
.toc-item-row > a { flex: 1; min-width: 0; }
.toc-sub-toggle {
    flex-shrink: 0;
    background: none; border: none; cursor: pointer;
    padding: 4px 6px; color: #94a3b8;
    transition: transform 0.2s, color 0.15s;
    line-height: 1;
}
.toc-sub-toggle:hover { color: #3182F6; }
.toc-sub-toggle.open { transform: rotate(180deg); }
.toc-sub-list {
    list-style: none;
    margin: 2px 0 4px 12px;
    padding: 0;
    border-left: 2px solid #e2e8f0;
    display: none;
}
.toc-sub-list.open { display: block; }
.toc-sub-item > a {
    display: block;
    padding: 5px 8px 5px 10px;
    font-size: 0.8rem;
    color: #64748b;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.toc-sub-item > a:hover { background: #f1f5f9; color: #1e293b; }
.toc-sub-item.active > a { background: #E8F3FF; color: #3182F6; }
.toc-pg { font-size: 0.72em; color: #94a3b8; margin-left: 4px; }
.toc-sub-item .toc-pg { color: #b0bec5; }
/* 검색 결과 하위 목차 표시 */
.toc-search-sub-item > a { padding-left: 18px; font-size: 0.82rem; color: #64748b; }
.toc-search-sub-mark { color: #b0bec5; margin-right: 4px; font-size: 0.8em; }

.toc-empty {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.viewer-main {
    flex: 1;
    min-width: 0;
}

.page-info {
    margin-left: 8px;
}

.page-jump {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

/* 썸네일 스트립 */
.thumb-strip {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e1e1e1;
}

.thumb-strip h4 {
    margin: 0 0 10px 0;
    font-size: 0.95rem;
}

.thumb-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.thumb-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
    padding: 4px;
    border: 2px solid transparent;
    border-radius: 6px;
    text-decoration: none;
    color: #222;
}

.thumb-item:hover {
    border-color: #ccc;
}

.thumb-item.active {
    border-color: #1565c0;
    background: #e3f2fd;
}

.thumb-item img {
    width: 72px;
    height: 96px;
    object-fit: cover;
    display: block;
    border-radius: 4px;
}

.thumb-item span {
    font-size: 0.75rem;
    margin-top: 4px;
}

/* 검색 */
.search-form {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    max-width: 400px;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.search-section {
    margin-bottom: 24px;
}

.search-section h2 {
    font-size: 1rem;
    margin-bottom: 8px;
}

.search-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.search-list li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.search-desc {
    display: block;
    color: #666;
    font-size: 0.9rem;
    margin-top: 4px;
}

/* 수정 폼 목차 행 */
.toc-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
}

.toc-thumb-wrap {
    flex-shrink: 0;
    width: 60px;
    height: 85px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #ddd;
}

.toc-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

.toc-thumb-wrap {
    cursor: pointer;
}

.toc-thumb-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.toc-thumb-popup.visible {
    display: flex;
}

.toc-thumb-popup-inner {
    width: 600px;
    height: 850px;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.toc-thumb-popup-inner img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.toc-row input[type="number"] {
    width: 80px;
}

.toc-row input[type="text"] {
    flex: 1;
}

.form-hint {
    margin: 0 0 8px 0;
    color: #666;
    font-size: 0.9rem;
}

.logo-upload-zone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    background: #fafafa;
    transition: border-color 0.2s, background 0.2s;
}

.logo-upload-zone:hover,
.logo-upload-zone.dragover {
    border-color: #3182F6;
    background: #f0f7ff;
}

.logo-upload-placeholder {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-upload-text {
    color: #666;
    font-size: 0.95rem;
}

.logo-upload-placeholder .logo-preview {
    max-width: 200px;
    max-height: 120px;
    object-fit: contain;
}

.form-section {
    margin-bottom: 24px;
}

.form-section h2 {
    font-size: 1rem;
    margin-bottom: 12px;
}

.form-section select {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

/* ===== 이북 뷰어 ===== */
html.viewer-html {
    height: 100%;
    margin: 0;
    padding: 0;
}

html.viewer-html body.viewer-body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body.viewer-body {
    overflow: hidden;
    height: 100%;
    height: 100dvh;
    /* 최신 모바일 기기의 상하 주소창/메뉴바를 인식하여 동적인 화면 높이 할당 */
}

/* UNIFIED-FIX: .viewer-wrapper 제거됨 → body가 직접 flex 컨테이너 역할 */
body.viewer-body {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    height: 100dvh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.viewer-body {
    background: #e8e8e8;
    overflow: hidden;
}

/* UNIFIED-FIX: .viewer-wrapper 제거됨 — 이 규칙은 body.viewer-body로 병합됨 */

/* ── 뉴모픽 헤더 버튼 ── */
.viewer-header .btn,
.viewer-header .header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0.875rem;
    border-radius: 10px;
    border: none;
    background: #e8ecf2;
    color: #1e3a8a;
    width: 36px;
    height: 36px;
    min-height: 36px;
    flex-shrink: 0;
    box-sizing: border-box;
    text-decoration: none;
    white-space: nowrap;
    box-shadow:
        4px 4px 8px rgba(163, 177, 198, 0.6),
        -3px -3px 7px rgba(255, 255, 255, 0.92);
    transition: box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
    cursor: pointer;
}

.viewer-header .btn:hover,
.viewer-header .header-btn:hover {
    background: #edf1f7;
    color: #1e3a8a;
    box-shadow:
        5px 5px 10px rgba(163, 177, 198, 0.7),
        -4px -4px 9px rgba(255, 255, 255, 0.95);
}

.viewer-header .btn:active,
.viewer-header .header-btn:active {
    background: #e4e8ee;
    box-shadow:
        inset 3px 3px 6px rgba(163, 177, 198, 0.65),
        inset -2px -2px 5px rgba(255, 255, 255, 0.88);
    color: #1e3a8a;
}

.viewer-header .btn[href*="download"] {
    background: #1e3a8a;
    color: #fff;
    box-shadow:
        4px 4px 8px rgba(30, 58, 138, 0.4),
        -2px -2px 6px rgba(255, 255, 255, 0.8);
}

.viewer-header .btn[href*="download"]:hover {
    background: #2d4fa8;
    color: #fff;
    box-shadow:
        5px 5px 10px rgba(30, 58, 138, 0.45),
        -3px -3px 7px rgba(255, 255, 255, 0.85);
}

#fullscreenBtn {
    background: #e8ecf2;
}

#fullscreenBtn:hover {
    background: #edf1f7;
}

.viewer-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 0 24px;
    height: 64px;
    box-sizing: border-box;
    background: #e8ecf2;
    border-bottom: 1px solid #d4dae4;
    position: relative;
    box-shadow: 0 2px 8px rgba(163, 177, 198, 0.35);
    z-index: 1000;
}

.viewer-header-left {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 0 0 auto;
}

.viewer-header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 4px;
}

.viewer-header-title-wrap {
    flex: 0 1 auto;
    position: static;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    pointer-events: none;
    max-width: calc(50% - 280px); /* 태블릿·모바일용 기본값. PC 모드는 파일 끝 2026-11-11 규칙이 덮어씀 */
    padding: 0 8px 0 32px;
}

.viewer-header-title-wrap .viewer-header-title {
    pointer-events: auto;
    text-align: center;
}

.viewer-header-logo {
    width: 250px;
    max-width: 250px;
    height: 100%;
    max-height: 64px;
    object-fit: contain;
    object-position: left center;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
}

.viewer-header-title {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    color: #191F28;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    background: #f3f4f6;
    border: 1px solid #e0e3e8;
    border-radius: 20px;
    padding: 7px 16px;
    position: relative;
    line-height: 1.4;
}

.viewer-header-title-wrap .viewer-header-title {
    max-width: none;
}
.viewer-header-title-wrap {
    position: relative;
}
.viewer-header-title::before {
    content: none;
}

/* === 모바일/패드 헤더 레이아웃 조정 === */

/* 패드 모드 (1360px 이하): 로고 여백 무시하고 무조건 화면의 정중앙에 제목 배치 */
body.viewer-mobile-mode-v23 .viewer-header-title-wrap {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: absolute !important;
    /* 화면 정중앙 고정 */
    left: 50% !important;
    transform: translateX(-50%) !important;
    flex: none !important;
    width: auto !important;
    max-width: 50% !important;
    /* 가운데에서 차지할 최대 폭 */
    justify-content: center !important;
    z-index: 100 !important;
    padding: 0 !important;
}

body.viewer-mobile-mode-v23 .viewer-header-title-wrap .viewer-header-title {
    display: block !important;
    visibility: visible !important;
    text-align: center !important;
    pointer-events: auto !important;
    color: #191F28 !important;
    max-width: 100% !important;
}

/* 모바일 모드 (768px 이하): 로고 숨기고 제목은 원래 로고가 있던 왼쪽에서 시작 */
@media (max-width: 768px) {
    .viewer-header-brand {
        display: none !important;
    }

    body.viewer-mobile-mode-v23 .viewer-header-title-wrap {
        position: absolute !important;
        left: 24px !important;
        /* 헤더의 좌측 기본 여백과 동일하게 시작 */
        transform: none !important;
        /* 중앙 정렬 해제 */
        justify-content: flex-start !important;
        /* 왼쪽 정렬 */
        width: calc(100% - 100px) !important;
        /* 우측 햄버거 메뉴 공간 확보 */
        max-width: none !important;
    }

    body.viewer-mobile-mode-v23 .viewer-header-title-wrap .viewer-header-title {
        text-align: left !important;
    }
}

.viewer-header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    flex: none;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 2;
}

body.viewer-mobile-mode-v23 .viewer-header-center {
    display: none !important;
}

.viewer-header-right {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    margin-left: auto;
}
.viewer-header-btns {
    display: flex;
    gap: 10px;
    align-items: center;
}

.viewer-hamburger {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.viewer-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #333;
    border-radius: 1px;
}

.viewer-hamburger:hover span {
    background: #1565c0;
}

.viewer-header .header-btn i {
    margin-right: 0;
    font-size: 18px;
}

.viewer-header .page-jump-btn i,
.viewer-header .zoom-btn i {
    font-size: 18px;
}

.viewer-hamburger i {
    font-size: 18px;
    color: #333;
}

.viewer-hamburger:hover i {
    color: #1565c0;
}

.page-jump-btn {
    padding: 6px 10px;
    font-size: 1rem;
    min-width: 36px;
}

.page-display {
    font-size: 0.95rem;
    color: #333;
    min-width: 60px;
}

.zoom-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.zoom-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #ccc;
    background: #fff;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-btn:hover {
    background: #f0f0f0;
}

.zoom-btn-1x {
    width: auto;
    min-width: 36px;
    font-size: 0.8rem;
    font-weight: 600;
}

.zoom-slider {
    width: 80px;
    height: 6px;
    accent-color: #3182F6;
}

.zoom-value {
    font-size: 0.85rem;
    color: #666;
    min-width: 36px;
}

.header-slider-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 140px;
}

.header-slider {
    width: 100%;
    height: 4px;
    accent-color: #3182F6;
    cursor: pointer;
}

.zoom-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 10px 16px;
    background: rgba(255, 255, 255, 0.98);
    border-left: 1px solid #e0e0e0;
    box-shadow: -2px 0 16px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.zoom-panel-close {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: #e8ecf2;
    color: #1e3a8a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    z-index: 10;
    box-shadow:
        4px 4px 8px rgba(163, 177, 198, 0.6),
        -3px -3px 7px rgba(255, 255, 255, 0.92);
}

.zoom-panel-close i {
    pointer-events: none;
}

.zoom-panel-close:hover {
    background: #edf1f7;
    color: #1e3a8a;
    box-shadow:
        5px 5px 10px rgba(163, 177, 198, 0.7),
        -4px -4px 9px rgba(255, 255, 255, 0.95);
}

.zoom-control-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.zoom-vertical-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.zoom-slider-vertical-wrap {
    width: 24px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.zoom-slider-vertical {
    width: 120px;
    height: 24px;
    margin: 0;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    accent-color: #3182F6;
    transform: rotate(-90deg);
    transform-origin: 60px 12px;
    cursor: pointer;
}

.zoom-slider-vertical::-webkit-slider-runnable-track {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
}

.zoom-slider-vertical::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3182F6;
    margin-top: -6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.zoom-slider-vertical::-moz-range-track {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
}

.zoom-slider-vertical::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3182F6;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.zoom-control-vertical .zoom-btn {
    flex-shrink: 0;
}

.zoom-control-vertical .zoom-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: #3182F6;
}

body.zoom-panel-open .book-area .page-nav-circle,
body.zoom-panel-open .page-nav-circle {
    display: none !important;
}

/* ===== 반원형 줌 팔렛트 ===== */
/* 컨테이너: 화면 우측 중앙에 고정, 크기 0 (자식이 음수 방향으로 펼쳐짐) */
.zoom-radial {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    z-index: 500;
    pointer-events: none;
}

/* 반원형 배경 팔렛트
   - width=190px = 반원 반지름
   - height=380px = 직경 (좌우 대칭 반원)
   - border-radius: 왼쪽만 둥글게 → 우측 끝에 붙은 반원
   - 열릴 때 translateX(0), 닫힐 때 translateX(100%) */
.zoom-radial-arc {
    position: absolute;
    right: 0;
    top: -190px;          /* height/2 위로 올려 수직 중앙 정렬 */
    width: 190px;
    height: 380px;
    border-radius: 190px 0 0 190px;
    background: #e8ecf2;
    box-shadow:
        -6px 0 28px rgba(163, 177, 198, 0.55),
        -1px 0 0 rgba(255, 255, 255, 0.7) inset;
    transform: translateX(105%);
    transition: transform 0.42s cubic-bezier(0.34, 1.15, 0.64, 1);
    pointer-events: none;
    overflow: visible;
}

.zoom-radial.is-open .zoom-radial-arc {
    transform: translateX(0);
    pointer-events: auto;
}

/* ── 아이템 공통 (arc 기준 absolute) ── */
.zoom-radial-item,
.zoom-radial-close {
    position: absolute;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: none;
    background: #e8ecf2;
    color: #1e3a8a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow:
        4px 4px 8px rgba(163, 177, 198, 0.6),
        -3px -3px 7px rgba(255, 255, 255, 0.92);
    /* 기본: 닫힌 상태 — 중앙에서 수축 */
    transform: scale(0);
    opacity: 0;
    transition:
        box-shadow 0.15s ease,
        background 0.15s ease,
        transform 0.38s cubic-bezier(0.34, 1.45, 0.64, 1),
        opacity 0.28s ease;
}
.zoom-radial-item:hover,
.zoom-radial-close:hover {
    background: #edf1f7;
    color: #1e3a8a;
    box-shadow:
        5px 5px 10px rgba(163, 177, 198, 0.7),
        -4px -4px 9px rgba(255, 255, 255, 0.95);
}
.zoom-radial-item:active,
.zoom-radial-close:active {
    background: #e4e8ee;
    box-shadow:
        inset 3px 3px 6px rgba(163, 177, 198, 0.65),
        inset -2px -2px 5px rgba(255, 255, 255, 0.88);
}

/* 열릴 때 bloom 애니메이션 — 순차 지연 */
.zoom-radial.is-open .zoom-radial-close { transform: scale(1); opacity: 1; transition-delay: 0.10s; }
.zoom-radial.is-open .zoom-radial-zi    { transform: scale(1); opacity: 1; transition-delay: 0.18s; }
.zoom-radial.is-open .zoom-radial-arm   { transform: scale(1); opacity: 1; transition-delay: 0.24s; }
.zoom-radial.is-open .zoom-radial-zo    { transform: scale(1); opacity: 1; transition-delay: 0.30s; }
.zoom-radial.is-open .zoom-radial-zr    { transform: scale(1); opacity: 1; transition-delay: 0.36s; }

/* 닫기(×) — 반원 오른쪽 끝 중앙 */
.zoom-radial-close {
    right: 6px;
    top: calc(50% - 19px);
    border-radius: 12px 0 0 12px;
    width: 42px;
    height: 42px;
}
.zoom-radial-close i,
.zoom-panel-close i,
.fullscreen-exit-btn i {
    font-size: 1rem;
    opacity: 0.9;
}

/* 배율 뱃지 — 닫기 버튼 위 */
.zoom-radial-badge {
    position: absolute;
    right: 4px;
    top: calc(50% - 46px);
    font-size: 0.6rem;
    font-weight: 700;
    color: #3182F6;
    text-align: center;
    width: 36px;
    pointer-events: none;
    line-height: 1;
}

/* 슬라이더 암 — 수평 중앙 (우측 X버튼과 20px 간격 유지: 142-20=122, 122-16=106) */
.zoom-radial-arm {
    position: absolute;
    left: 16px;
    top: 176px;
    width: 106px;
    height: 28px;
    background: #d8dde8;
    border-radius: 14px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    box-sizing: border-box;
    box-shadow:
        inset 3px 3px 6px rgba(163, 177, 198, 0.5),
        inset -2px -2px 5px rgba(255, 255, 255, 0.85);
    /* bloom 애니메이션용 */
    transform: scale(0);
    opacity: 0;
    transition:
        transform 0.38s cubic-bezier(0.34, 1.45, 0.64, 1),
        opacity 0.28s ease;
}
.zoom-radial-arm .zoom-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    accent-color: #3182F6;
    cursor: pointer;
    margin: 0; padding: 0;
}
.zoom-radial-arm .zoom-slider::-webkit-slider-runnable-track {
    height: 4px;
    background: #c5ccd8;
    border-radius: 2px;
}
.zoom-radial-arm .zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #3182F6;
    margin-top: -6px;
    box-shadow: 0 1px 4px rgba(49,130,246,0.45);
}
.zoom-radial-arm .zoom-slider::-moz-range-track {
    height: 4px; background: #c5ccd8; border-radius: 2px;
}
.zoom-radial-arm .zoom-slider::-moz-range-thumb {
    width: 16px; height: 16px;
    border-radius: 50%; background: #3182F6;
    border: none; box-shadow: 0 1px 4px rgba(49,130,246,0.45);
}

/* 확대(+) — 슬라이더 위 중앙 */
/* 슬라이더 center-x = 16 + 64 = 80, 버튼 반폭 19 → left=61 */
.zoom-radial-zi { left: 61px; top: 124px; }

/* 축소(-) — 슬라이더 아래 중앙 */
.zoom-radial-zo { left: 61px; top: 218px; }

/* 리셋(1x) — 축소 버튼 오른쪽 나란히 (20px 간격) */
.zoom-radial-zr { left: 123px; top: 218px; }

.viewer-content {
    flex: 1;
    display: flex;
    position: relative;
    min-height: 0;
    overflow: hidden;
    flex: 1 1 0%;
    min-height: 200px;
}

body.fullscreen-mode .viewer-header {
    display: none;
}

body.fullscreen-mode .header-toggle-btn {
    display: none !important;
}

.fullscreen-exit-btn {
    display: none;
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1000;
    width: 44px;
    height: 44px;
    padding: 0;
    background: #e8ecf2;
    color: #1e3a8a;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    cursor: pointer;
    box-shadow:
        4px 4px 8px rgba(163, 177, 198, 0.6),
        -3px -3px 7px rgba(255, 255, 255, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-exit-btn:hover {
    background: #edf1f7;
    color: #1e3a8a;
    box-shadow:
        5px 5px 10px rgba(163, 177, 198, 0.7),
        -4px -4px 9px rgba(255, 255, 255, 0.95);
}

body.fullscreen-mode .fullscreen-exit-btn {
    display: block !important;
}

/* UNIFIED-FIX: fullscreen 시 body 직접 타겟 */
body.fullscreen-mode {
    height: 100vh;
}

body.fullscreen-mode .viewer-content {
    flex: 1;
    overflow: visible;
}

body.fullscreen-mode .book-area {
    overflow: visible;
}

body.fullscreen-mode .flipbook-wrap {
    flex: none;
    transition: none !important;
}

.page-nav-circle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: #e8ecf2;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        4px 4px 8px rgba(163, 177, 198, 0.6),
        -3px -3px 7px rgba(255, 255, 255, 0.92);
    transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
    padding: 0;
}

.page-nav-circle:hover {
    background: #edf1f7;
    box-shadow:
        5px 5px 10px rgba(163, 177, 198, 0.7),
        -4px -4px 9px rgba(255, 255, 255, 0.95);
}

.page-nav-prev {
    left: 16px;
}

.page-nav-next {
    right: 16px;
}

.nav-arrow {
    line-height: 1;
    color: #333;
}

.page-nav-circle .nav-arrow-img {
    display: inline-flex;
    width: auto;
    height: auto;
    font-size: 1.4rem;
    line-height: 1;
    pointer-events: none;
    opacity: 0.9;
    color: #1e3a8a;
    transition: opacity 0.2s, color 0.15s ease;
}

.page-nav-circle:hover .nav-arrow-img {
    opacity: 1;
}

.book-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-width: 0;
    position: relative;
    overflow: hidden;
    min-height: 300px;
    cursor: pointer;
}

.book-area.pan-mode {
    user-select: none;
    -webkit-user-select: none;
}

.flipbook-wrap {
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 50% 100%;
    padding: 0;
    border-radius: 4px;
    transform-origin: center center;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* 모바일 전용 배경 설정 (싱글 페이지) */
@media (max-width: 1360px) {
    .flipbook-wrap {
        background-position: center center;
        background-size: contain;
    }
}

#pageFlipBook {
    transition: opacity 0.5s ease;
    opacity: 0;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    background: transparent !important;
    position: relative;
}

.flipbook-wrap.ready #pageFlipBook {
    opacity: 1;
}

/* 양쪽 페이지 만나는 중앙(책등) 음영 — 2026-11-07 개편
   예전엔 책 전체(#pageFlipBook::after)에 고정 띠로 그리고 넘김 중엔 z-order 문제로 숨겼다
   → 넘길 때마다 0.13s 사라짐 → 0.4s 없음 → 착지 후 0.1s 다시 나타남(실측)이 깜빡임으로 보였다.
   이제 각 페이지 안쪽(책등 쪽) 가장자리에 붙여 그린다. 음영이 종이와 함께 움직이고 넘김 중에도 꺼지지 않는다.
   진하기: 책등 0.18, 안쪽 0.07 (양쪽 합친 모양은 예전 띠와 같음). 표지·뒷표지(하드커버)는 제외. */
.flipbook-wrap.ready #pageFlipBook .pf-page:not([data-density="hard"])::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: clamp(7px, 3.5%, 20px);
    pointer-events: none;
    z-index: 3;
}
.flipbook-wrap.ready #pageFlipBook .pf-page.--left:not([data-density="hard"])::after {
    right: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.07) 64%, rgba(0, 0, 0, 0.18) 100%);
}
.flipbook-wrap.ready #pageFlipBook .pf-page.--right:not([data-density="hard"])::after {
    left: 0;
    background: linear-gradient(to left, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.07) 64%, rgba(0, 0, 0, 0.18) 100%);
}

/* 모바일/좁은 화면: 플립북 미사용 */
@media (max-width: 1360px) {
    .flipbook-wrap.ready #pageFlipBook .pf-page::after {
        display: none;
    }
}

#pageFlipBook.stf__parent {
    background: transparent !important;
}

#pageFlipBook .stf__block {
    background: transparent !important;
}

#pageFlipBook .stf__outer {
    background: transparent !important;
}

/* page-flip library overrides */
#pageFlipBook canvas {
    background: transparent !important;
}

/* 북마크 리본 스타일 */
.page-bookmark-btn {
    position: absolute;
    top: -1px !important;
    /* 틈새 제거 */
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    z-index: 100;
    line-height: 0;
    display: block;
    transition: transform 0.2s ease;
}

.bookmark-ribbon {
    width: 16px;
    height: 24px;
    fill: #E0E0E0;
    /* 기본 상태: 연회색 */
    transition: fill 0.3s ease;
}

.page-bookmark-btn.bookmarked .bookmark-ribbon {
    fill: #3182F6;
    /* 활성 상태: 메인 블루 */
}

.page-bookmark-btn:hover {
    transform: translateY(2px);
}

.pf-page {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #fff;
}

.pf-page .pf-page-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pf-page .pf-page-img img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    /* 여백 없이 꽉 채우기 위해 fill 적용 - 1px 소수점 오차 해결 */
    display: block;
}



/* 레거시 (page-flip 미사용시) */
.book-scene {
    position: relative;
    width: 1108px;
    margin: 0 auto;
    cursor: pointer;
    perspective: 1200px;
    overflow: hidden;
}

.book-spread {
    display: flex;
    width: 1108px;
    height: 786px;
    margin: 0 auto;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    overflow: hidden;
}

.book-spread.cover-mode .page-left {
    flex: 0 0 554px;
    width: 554px;
    min-width: 554px;
}

.book-spread .page-left,
.book-spread .page-right {
    flex: 0 0 554px;
    width: 554px;
    height: 786px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.book-spread .page-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-spread .page-blank {
    background: #e8e8e8 !important;
}



.book-spread .page-content img {
    width: 100%;
    height: 100%;
    min-height: 786px;
    object-fit: fill;
    display: block;
}

/* 3D 페이지 넘기기 */
.flip-container {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
    perspective: 1200px;
    transform-style: preserve-3d;
    overflow: hidden;
}

.flip-container.flip-next {
    display: flex;
    justify-content: flex-end;
}

.flip-container.flip-prev {
    display: flex;
    justify-content: flex-start;
}

.flip-page {
    width: 50%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    will-change: transform;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.12);
    border-radius: 0 2px 2px 0;
}

.flip-page.flip-prev {
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.12);
    border-radius: 2px 0 0 2px;
}

.flip-page .flip-front::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: linear-gradient(to right, transparent 60%, rgba(0, 0, 0, 0.04) 80%, rgba(0, 0, 0, 0.1) 100%);
    opacity: 0;
}

.flip-page.animating .flip-front::after {
    opacity: 1;
}

.flip-page.flip-prev .flip-front::after {
    background: linear-gradient(to left, transparent 60%, rgba(0, 0, 0, 0.04) 80%, rgba(0, 0, 0, 0.1) 100%);
}

.flip-img-wrap {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.flip-img-wrap img {
    width: 100%;
    height: 100%;
    min-height: 786px;
    object-fit: contain;
    display: block;
}

.flip-page .flip-shadow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.1) 0%, transparent 40%);
    transform: translateZ(-1px);
    opacity: 0;
}

.flip-page.animating .flip-shadow {
    opacity: 1;
}

.flip-page.flip-prev .flip-shadow {
    left: auto;
    right: 0;
    background: linear-gradient(270deg, rgba(0, 0, 0, 0.1) 0%, transparent 40%);
}

.flip-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    overflow: hidden;
}

.flip-front {
    transform: rotateY(0deg);
    background: #fff;
}

.flip-back {
    transform: rotateY(180deg);
    background: #fff;
}

.flip-back .flip-inner {
    transform: rotateY(180deg);
    transform-style: preserve-3d;
}

.flip-back .flip-inner,
.flip-back .flip-img-wrap {
    width: 100%;
    height: 100%;
}

.flip-back .flip-inner img,
.flip-back .flip-img-wrap img {
    width: 100%;
    height: 100%;
    min-height: 786px;
    object-fit: fill;
    display: block;
}

.flip-inner {
    width: 100%;
    height: 100%;
}

.flip-inner img {
    width: 100%;
    height: 100%;
    min-height: 786px;
    object-fit: contain;
    display: block;
}

.side-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 998;
}

.side-backdrop.visible {
    display: block;
}

/* 공유 패널 (오른쪽 슬라이드) */
.share-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 998;
}

.share-backdrop.visible {
    display: block;
}

.share-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    max-width: 90vw;
    /* MOBILE-FIX: 100vh -> 100dvh 교체 */
    height: calc(var(--real-vh, 1vh) * 100);
    height: 100dvh;
    background: #fff;
    border-left: 1px solid #e1e1e1;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.share-panel.open {
    transform: translateX(0);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
}

.share-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #e1e1e1;
    flex-shrink: 0;
}

.share-panel-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.share-panel-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 0 4px;
}

.share-panel-close:hover {
    color: #222;
}

.share-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.share-panel-desc {
    margin: 0 0 16px;
    font-size: 0.875rem;
    color: #666;
}

.share-sns-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.share-sns-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: background 0.2s, transform 0.15s;
    border: 1px solid #eee;
    background: #fff;
}

.share-sns-btn:hover {
    background: #f5f5f5;
    transform: translateX(-2px);
}

.share-sns-btn:active {
    transform: translateX(0);
}

.share-sns-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex-shrink: 0;
}

.share-sns-icon svg {
    width: 24px;
    height: 24px;
}

.share-sns-kakao .share-sns-icon {
    background: #FEE500;
    color: #3C1E1E;
}

.share-sns-facebook .share-sns-icon {
    background: #1877F2;
    color: #fff;
}

.share-sns-twitter .share-sns-icon {
    background: #000;
    color: #fff;
}

.share-sns-line .share-sns-icon {
    background: #00B900;
    color: #fff;
}

.share-sns-band .share-sns-icon {
    background: #00C73C;
    color: #fff;
}

.share-toast {
    margin: 12px 0 0;
    padding: 10px 12px;
    font-size: 0.8125rem;
    color: #0c5460;
    background: #d1ecf1;
    border-radius: 8px;
    border: 1px solid #bee5eb;
}

/* 링크 복사 */
.share-link-copy {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.share-link-label {
    margin: 0 0 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #555;
}

.share-link-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.share-link-input {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    font-size: 0.72rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f7f7f7;
    color: #666;
    outline: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: default;
}

.share-link-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    font-size: 0.8125rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    background: hsl(243,75%,59%);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    white-space: nowrap;
}

.share-link-btn:hover {
    background: hsl(243,75%,45%);
    transform: translateY(-1px);
}

.share-link-btn:active {
    transform: translateY(0);
}

.share-link-btn.copied {
    background: #28a745;
}

/* 모바일 슬라이드 뷰 (1페이지씩) - 1360px 이하에서 CSS로 표시 */
.mobile-slide-view {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
    width: 100%;
    height: 100%;
}

.mobile-slide-track {
    display: flex;
    height: 100%;
    width: 100%;
    min-height: 0;
    transition: none;
    will-change: transform;
    flex-shrink: 0;
}

.mobile-slide-view .mobile-page {
    height: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    flex-shrink: 0;
    background: #fff;
}
/* 모바일 skeleton shimmer — 이미지 로드 전 */
.mobile-slide-view .mobile-page:has(img[data-src]) {
    background: linear-gradient(90deg, #f0f2f5 25%, #e8eaed 50%, #f0f2f5 75%);
    background-size: 200% 100%;
    animation: _vSkelShimmer 1.4s ease-in-out infinite;
}

/* VERTICAL-SLIDE: safe-area는 상위 헤더/푸터에서 처리하므로 mobile-page에서 제거 */

.mobile-slide-view .mobile-page img {
    width: auto;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center center;
    display: block;
    margin: 0 auto;
    transform: translateZ(0);
    backface-visibility: hidden;
}

body.viewer-mobile-mode-v23 .flipbook-wrap {
    display: none !important;
    visibility: hidden;
    position: absolute;
    pointer-events: none;
}

body.viewer-mobile-mode-v23 .mobile-slide-view {
    display: block !important;
    visibility: visible !important;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

body.viewer-mobile-mode-v23 .page-nav-circle {
    display: none;
}

/* 하단 페이지 진행 슬라이더 (모바일/패드) */
.viewer-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid #E8EBEF;
    font-size: 0.875rem;
    color: #333;
    min-height: 56px;
    box-sizing: border-box;
}

@supports (padding: max(1px, env(safe-area-inset-bottom))) {
    .viewer-footer {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
}

.viewer-footer-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
    max-width: 100%;
}

.viewer-footer-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: #F2F4F6;
    color: #4E5968;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    touch-action: manipulation;
}

.viewer-footer-btn:hover {
    background: #E8EBEF;
    color: #191F28;
}

.viewer-footer-btn:active {
    background: #D1D5DB;
}

.viewer-footer-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.viewer-footer-btn svg {
    display: block;
}

.viewer-footer-slider-wrap {
    flex: 1;
    min-width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin: 0 8px;
}

.viewer-footer-page-num {
    font-size: 0.6875rem;
    color: #6B7280;
    line-height: 1;
    font-weight: 500;
}

.viewer-footer-slider-wrap .viewer-footer-slider {
    width: 100%;
    margin: 0;
}

.viewer-footer-slider {
    flex: 1;
    min-width: 60px;
    height: 6px;
    margin: 0 8px;
    accent-color: #3182F6;
}

.viewer-footer-page {
    flex-shrink: 0;
    min-width: 2ch;
    font-weight: 600;
    color: #191F28;
}

.viewer-footer-mobile {
    display: none;
}

/* == UNIFIED-FIX: 통합 모바일 배경 균일화 (viewer-wrapper 제거 반영) == */
html.viewer-html.viewer-mobile-mode-v23,
body.viewer-mobile-mode-v23,
body.viewer-mobile-mode-v23 .page-content-wrap,
body.viewer-mobile-mode-v23 .viewer-content,
body.viewer-mobile-mode-v23 .book-area {
    /* VERTICAL-SLIDE: 모든 레이어 흰 배경 통일 — 회색 플래시 근절 */
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* 모바일 푸터를 강제 고정이 아닌, 플렉스 하단 배치 요소로 둠 */
body.viewer-mobile-mode-v23 .viewer-footer-mobile {
    display: flex !important;
    position: relative !important;
    flex: 0 0 auto !important;
    z-index: 9999 !important;
    background: #fff;
    padding-bottom: max(12px, env(safe-area-inset-bottom)) !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

/* 도화지 영역은 부모 플렉스 컨테이너 안에서 남은 공간 전체를 정확히 차지함 */
body.viewer-mobile-mode-v23 .mobile-slide-view {
    position: relative !important;
    display: block !important;
    flex: 1 1 0% !important;
    width: 100% !important;
    height: auto !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

body.viewer-mobile-mode-v23 .mobile-slide-view .mobile-page {
    padding: 0 !important;
    margin: 0 !important;
    height: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

body.viewer-mobile-mode-v23 .mobile-slide-view .mobile-page img {
    width: auto !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    margin: 0 auto !important;
}

/* 사이드 패널 메뉴 (모바일) */
.side-panel-menu {
    display: none;
    flex-direction: column;
    padding: 12px;
    border-bottom: 1px solid #e1e1e1;
}

.side-panel-menu-item {
    display: block;
    padding: 12px 14px;
    text-align: left;
    font-size: 1rem;
    color: #222;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    width: 100%;
    box-sizing: border-box;
}

.side-panel-menu-item:hover {
    background: #f2f4f6;
}

.side-panel-menu-item i {
    margin-right: 8px;
}

/* SOUND-TOGGLE: 효과음 토글 버튼 스타일 */
.side-panel-sound-toggle {
    display: flex !important;
    align-items: center;
    gap: 8px;
    border-top: 1px solid #f0f0f0;
    margin-top: 4px;
    padding-top: 12px !important;
    color: #3182F6;
    transition: color 0.2s;
}

/* 사이드 패널 (목차/썸네일 토글) */
.side-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    max-width: 85vw;
    /* MOBILE-FIX: 100vh -> 100dvh 교체 */
    height: calc(var(--real-vh, 1vh) * 100);
    height: 100dvh;
    background: #fff;
    border-right: 1px solid #e1e1e1;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.side-panel.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
}

.side-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #e1e1e1;
    flex-shrink: 0;
}

.side-panel-header h3 {
    margin: 0;
    font-size: 1rem;
}

.side-panel-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 0 4px;
}

.side-panel-close:hover {
    color: #222;
}

.side-panel-body {
    flex: 1;
    overflow-y: auto;
}

.side-panel-toc {
    padding: 12px;
}

.side-panel-search {
    padding: 12px;
}

.toc-search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
    box-sizing: border-box;
    margin-bottom: 12px;
}

.toc-search-empty {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.side-panel-thumb {
    padding: 12px;
}

.side-panel-thumb .thumb-panel-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.side-panel-toc .toc-list li a {
    padding: 8px 10px;
}

.side-panel-bookmark {
    padding: 12px;
}

.btn-add-bookmark {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 12px;
    border: 1px solid #3182F6;
    background: #fff;
    color: #3182F6;
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
}

.btn-add-bookmark:hover {
    background: #F2F4F6;
}

.bookmark-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bookmark-list li a {
    flex: 1;
    padding: 8px 10px;
}

.bookmark-remove {
    background: none;
    border: none;
    color: #8B95A1;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px 8px;
}

.bookmark-remove:hover {
    color: #3182F6;
}

.bookmark-empty {
    margin: 0;
    color: #8B95A1;
    font-size: 0.9rem;
}

.thumb-panel-list {
    display: grid;
    align-content: start;
}

.thumb-panel-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px;
    border: 2px solid transparent;
    border-radius: 6px;
    text-decoration: none;
    color: #222;
    transition: border-color 0.2s, background 0.2s;
}

.thumb-panel-item:hover {
    border-color: #ccc;
    background: #f9f9f9;
}

.thumb-panel-item.active {
    border-color: #3182F6;
    background: #E8F3FF;
}

.thumb-panel-item img {
    width: 100%;
    max-width: 90px;
    height: auto;
    aspect-ratio: 3/4;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    /* 로드 전 기본 배경 */
    background: linear-gradient(90deg, #f0f2f5 25%, #e8eaed 50%, #f0f2f5 75%);
    background-size: 200% 100%;
}

/* 아직 로드 안 된 썸네일 — shimmer 애니메이션 */
.thumb-panel-item img.lazy-thumb:not(.thumb-loaded) {
    animation: _thumbShimmer 1.4s ease-in-out infinite;
}
@keyframes _thumbShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 로드 완료 — fade-in + shimmer 해제 */
.thumb-panel-item img.thumb-loaded {
    animation: _thumbFadeIn 0.22s ease-out forwards;
    background: none;
}
@keyframes _thumbFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.thumb-panel-item canvas.lazy-pdf-thumb {
    width: 100%;
    max-width: 90px;
    height: auto;
    aspect-ratio: 3/4;
    object-fit: contain;
    background: #f0f0f0;
    border-radius: 4px;
    display: block;
}

.thumb-panel-item span {
    font-size: 0.75rem;
    margin-top: 4px;
}

/* 패드/모바일 반응형 (1360px 이하 = 모바일·패드 동일 레이아웃, Chrome 패드 대응) */
@media (max-width: 1360px) {

    /* UNIFIED-FIX: min-height: 100vh 제거 — dvh 기반 높이가 이미 적용됨 */
    body.viewer-body {
        min-height: 0;
    }

    .viewer-header {
        padding: 10px 12px;
        gap: 8px;
        min-height: auto;
    }

    @supports (padding: max(1px, env(safe-area-inset-left))) {
        .viewer-header {
            padding-left: max(12px, env(safe-area-inset-left));
            padding-right: max(12px, env(safe-area-inset-right));
            padding-top: max(10px, env(safe-area-inset-top));
        }
    }

    .viewer-header-left {
        flex: 0 0 auto;
    }

    .viewer-header-brand {
        flex: none;
    }

    .viewer-header-title-wrap {
        position: static;
        left: auto;
        width: auto;
        flex: 1;
        min-width: 0;
        justify-content: center;
        align-items: center;
        padding: 0 8px;
    }

    .viewer-header-title-wrap .viewer-header-title {
        text-align: center;
        font-size: 0.9rem;
        padding: 0;
    }

    .viewer-header-logo {
        flex-shrink: 0;
        width: 250px;
        max-width: 250px;
        max-height: 44px;
    }

    .viewer-header-title {
        max-width: none;
    }

    .viewer-header-center {
        display: flex !important;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        gap: 8px;
        z-index: 10;
    }

    .viewer-header-center .page-jump-btn {
        padding: 4px 6px;
        min-width: 32px;
    }

    .header-slider-wrap {
        min-width: 100px;
        display: flex;
    }

    .header-slider {
        display: block !important;
        height: 4px;
    }

    .viewer-header-title-wrap {
        display: flex;
        flex: 1;
        justify-content: center;
        align-items: center;
        padding: 0 10px;
        min-width: 0;
        z-index: 100;
    }

    .viewer-header-right {
        flex: 0 0 auto;
        justify-content: flex-end;
    }

    .viewer-header-btns {
        display: none !important;
    }

    .viewer-hamburger {
        display: flex;
    }

    .book-area {
        padding: 12px;
        min-height: 0;
        flex: 1;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 120px;
    }

    @supports (padding: max(1px, env(safe-area-inset-left))) {
        .book-area {
            padding-left: max(12px, env(safe-area-inset-left));
            padding-right: max(12px, env(safe-area-inset-right));
            padding-top: max(12px, env(safe-area-inset-top));
            padding-bottom: max(12px, env(safe-area-inset-bottom));
        }
    }

    .flipbook-wrap {
        display: none !important;
        padding: 12px;
        /* MOBILE-FIX: 100vh -> 100dvh 교체 */
        max-height: calc(calc(var(--real-vh, 1vh) * 100) - 180px);
        max-height: calc(100dvh - 180px);
        min-height: 0;
    }

    .book-area {
        height: 100%;
    }

    .mobile-slide-view {
        display: block !important;
        visibility: visible !important;
        position: absolute !important;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100% !important;
        height: 100% !important;
        z-index: 2;
        /* VERTICAL-SLIDE: #e8e8e8 → #fff 회색 플래시 원인 제거 */
        background: #fff;
    }

    .mobile-slide-track {
        height: 100%;
        width: 100%;
        min-height: 100%;
    }

    .page-nav-circle {
        display: none !important;
    }

    .side-panel {
        left: auto;
        right: 0;
        width: 280px;
        max-width: 92vw;
        border-right: none;
        border-left: 1px solid #e1e1e1;
        box-shadow: none;
        transform: translateX(100%);
    }

    .side-panel.open {
        transform: translateX(0);
    }

    .side-panel-menu {
        display: flex;
    }

    .viewer-footer,
    .viewer-footer-mobile {
        display: flex !important;
        flex-shrink: 0;
        visibility: visible !important;
        min-height: 56px;
    }

    /* UNIFIED-FIX: .viewer-wrapper 제거됨 → body 직접 타겟 */
    body.viewer-body {
        display: flex;
        flex-direction: column;
        height: calc(var(--real-vh, 1vh) * 100);
        height: 100dvh;
        max-height: 100dvh;
        min-height: 100dvh;
        overflow: hidden;
        touch-action: pan-y pinch-zoom;
    }

    /* UNIFIED-FIX: 푸터가 body의 직접 자식이므로 > 선택자 수정 */
    body.viewer-body>.viewer-footer {
        flex-shrink: 0;
    }

    body.viewer-body .viewer-content {
        flex: 1;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    body.viewer-body .viewer-content .book-area {
        flex: 1;
        min-height: 200px;
    }
}

@media (max-width: 768px) {
    .viewer-header {
        padding: 8px 12px;
    }

    .viewer-header-title {
        max-width: none;
        font-size: 0.875rem;
    }

    .viewer-header-logo {
        max-height: 38px;
        max-width: 160px;
    }

    .book-area {
        padding: 8px;
    }

    .flipbook-wrap {
        padding: 8px;
        /* MOBILE-FIX: 100vh -> 100dvh 교체 */
        max-height: calc(calc(var(--real-vh, 1vh) * 100) - 160px);
        max-height: calc(100dvh - 160px);
    }

    .viewer-footer {
        padding: 10px 12px;
    }

    .viewer-footer-btn {
        width: 36px;
        height: 36px;
    }

    .viewer-footer-btn svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .viewer-header-title {
        max-width: none;
    }

    .flipbook-wrap {
        /* MOBILE-FIX: 100vh -> 100dvh 교체 */
        max-height: calc(calc(var(--real-vh, 1vh) * 100) - 150px);
        max-height: calc(100dvh - 150px);
    }
}
/* 2026-11-11 PC 레이아웃 좁은 구간(1361~1520px, 브라우저 확대·1366/1440 노트북):
   오른쪽 버튼 12개(542px)와 가운데 페이지 이동 묶음(348px)이 부딪혀 '내 서재' 버튼이 가려졌다.
   버튼 36→32px, 간격 축소 → 오른쪽 450px, 가운데 288px. 1236px까지 겹침 없음.
   가운데 묶음 폭이 바뀌므로 제목 최대폭 계산용 --vh-center-half 도 함께 바꾼다. */
@media (min-width: 1361px) and (max-width: 1520px) {
    .viewer-header {
        --vh-center-half: 144px;
    }
    .viewer-header .btn,
    .viewer-header .header-btn {
        width: 32px;
        height: 32px;
        min-height: 32px;
    }
    .viewer-header .page-jump-btn {
        min-width: 32px;
    }
    .viewer-header .header-btn i,
    .viewer-header .page-jump-btn i {
        font-size: 16px;
    }
    .viewer-header-btns {
        gap: 6px;
    }
    .viewer-header-center {
        gap: 10px;
    }
    .header-slider-wrap {
        min-width: 120px;
    }
}

/* 2026-11-11 PC 모드 제목 겹침 수정: 제목 오른쪽 끝이 가운데 페이지 이동 묶음 시작점(중앙 - 묶음폭/2) 12px 앞에서 멈춤.
   content-box 기준 시작 위치 = 로고 254 + gap 12 + padding-left 32 = 298, +12 = 310.
   예전 calc(50% - 280px)는 묶음 폭(348px)을 빼지 않아 최대 192px 겹쳤다.
   태블릿·모바일 모드는 로고·가운데 묶음이 숨겨지므로 제외. */
@media (min-width: 1361px) {
    body:not(.viewer-tablet-mode):not(.viewer-mobile-mode-v23) .viewer-header-title-wrap {
        max-width: calc(50% - var(--vh-center-half, 174px) - 310px);
    }
}
