/* ===== 디자인 시스템 (Tokens) ===== */
:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #8b5cf6;
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-overlay: rgba(15, 15, 26, 0.8);
    /* Kept from original, not in provided new root */
    --bg-hover: rgba(99, 102, 241, 0.15);
    /* Kept from original, not in provided new root */
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    /* Kept from original, not in provided new root */
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    /* Kept from original, not in provided new root */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    /* Kept from original, renamed to --border-color in provided new root, will use --border */
    --border-color: rgba(255, 255, 255, 0.1);
    /* Added from provided new root */
    --glass-bg: rgba(15, 23, 42, 0.6);
    /* Added from provided new root */
    --header-height: 60px;
    /* Added from provided new root */
    --toolbar-height: 50px;
    /* Added from provided new root */
    --sidebar-width: 280px;
    /* Added from provided new root */
    /* [CRITICAL 11차] 시스템 폰트 최우선 순위 배치 (네트워크 이슈 무시) */
    --font-main: 'Verdana', 'Arial', 'Inter', 'Noto Sans KR', sans-serif;
    /* Added from provided new root */
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    /* Added from provided new root */
    --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    /* Kept from original, not in provided new root */
    --shadow-float: 0 20px 50px rgba(0, 0, 0, 0.7);
    /* Kept from original, not in provided new root */
    --radius-lg: 16px;
    /* Kept from original, not in provided new root */
    --radius-md: 10px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    /* [CRITICAL 21차] Headless/서버 환경 숫자 왜곡(Oldstyle) 방지 */
    font-variant-numeric: lining-nums tabular-nums;
    font-feature-settings: "lnum" 1, "onum" 0, "tnum" 1;
}

.hidden {
    display: none !important;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
    overflow-x: hidden;
    /* 가로 스크롤만 차단 */
    overflow-y: auto;
    /* 가로 잘림 시 세로 스크롤 허용 */
    user-select: none;
    -webkit-font-smoothing: antialiased;
    background-image:
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.1) 0px, transparent 50%);

    /* 폰트 렌더링 회복력 강화 */
    font-variant-numeric: lining-nums !important;
}

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

.header {
    flex-shrink: 0;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: rgba(15, 15, 26, 0.7);
    backdrop-filter: blur(25px) saturate(180%);
    border-bottom: 1px solid var(--border);
    z-index: 20000;
    position: sticky;
    top: 0;
    min-height: var(--header-height);
    box-sizing: border-box;
    flex-wrap: wrap;
    /* 모바일에서 요소가 넘치면 줄바꿈 */
}

.logo {
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(99, 102, 241, 0.3));
    cursor: default;
    letter-spacing: -1px;
    /* 글자 간격 더 좁게 */
}

/* 기본: 모바일 타이틀 숨김 */
.mobile-title {
    display: none;
}

@media (max-width: 600px) {
    .header {
        padding: 8px 10px !important;
        flex-wrap: nowrap !important;
        /* 물리적 줄바꿈 절대 차단 */
        justify-content: space-between !important;
        width: 100vw !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
        gap: 4px !important;
        /* 공간 절약 */
    }

    .desktop-title {
        display: none !important;
    }

    .mobile-title {
        display: inline !important;
        font-size: 0.95rem !important;
        /* 가시성 확보 */
    }

    .logo-container {
        flex: 1 1 auto !important;
        /* 남은 공간 모두 점유 */
        min-width: 0 !important;
        max-width: none !important;
        width: auto !important;
    }

    .logo {
        width: 100% !important;
        max-width: none !important;
        font-size: 0.95rem !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .language-switcher-btn {
        padding: 4px 8px !important;
        border-radius: 8px !important;
        width: auto !important;
        min-width: 40px !important;
        height: 32px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: rgba(255, 255, 255, 0.1) !important;
    }

    #currentLangEmoji {
        display: none !important;
    }

    #currentLangLabel {
        display: inline !important;
        font-size: 0.78rem !important;
        /* 가독성을 위해 살짝 상향 */
        font-weight: 700 !important;
        white-space: nowrap !important;
        letter-spacing: -0.2px !important;
    }

    .language-switcher-btn svg {
        display: none !important;
        /* 화살표 숨김 */
    }

    .header-actions {
        gap: 8px !important;
        margin-left: 4px;
        /* 최소 마진 */
        flex-shrink: 0;
        /* 버튼이 찌그러지지 않게 보호 */
    }
}

.subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.promo-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

/* ===== Branding: hill.pe.kr 각인 효과 ===== */
.logo-container {
    display: flex;
    align-items: baseline;
    gap: 6px;
    cursor: pointer;
}

.domain-hint {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
    opacity: 0;
    transform: translateX(-10px);
    transition: var(--transition);
    pointer-events: none;
}

.logo-container:hover .domain-hint {
    opacity: 1;
    transform: translateX(0);
}

.domain-pulse {
    animation: domainPulse 2s infinite;
    color: var(--primary);
    font-weight: 700;
}

@keyframes domainPulse {

    0%,
    100% {
        opacity: 0.8;
        text-shadow: 0 0 0px var(--primary);
    }

    50% {
        opacity: 1;
        text-shadow: 0 0 8px var(--primary);
    }
}

/* ===== 언어 드롭다운 ===== */
.lang-dropdown {
    position: relative;
    margin-left: auto;
}

.language-switcher-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.language-switcher-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.lang-dropdown-content {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 160px;
    max-height: 350px;
    overflow-y: auto;
    background: rgba(20, 20, 35, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-float);
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 2px;
    z-index: 9999;
    animation: slideUp 0.2s ease;
}

/* 슬림 스크롤바 */
.lang-dropdown-content::-webkit-scrollbar {
    width: 4px;
}

.lang-dropdown-content::-webkit-scrollbar-track {
    background: transparent;
}

.lang-dropdown-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.lang-dropdown-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.lang-dropdown-content.show {
    display: flex;
}

.lang-option {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.lang-option:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.lang-option.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    font-weight: 600;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toolbar {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: rgba(20, 20, 35, 0.4);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    /* 툴바 아이콘 줄바꿈 허용 */
    gap: 12px;
}

.toolbar-center {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    justify-content: center;
}

.save-status-wrap {
    margin: 0 15px;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.save-status-info {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.save-status-wrap.dirty {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
}

.save-status-wrap.dirty .save-status-info {
    color: #fbbf24;
}

.toolbar-group {
    display: flex;
    align-items: center;
    /* 기본은 중앙 정렬 */
    gap: 8px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    text-decoration: none;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.btn-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3) !important;
    color: white !important;
}

.btn-success:hover {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%) !important;
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.4) !important;
    transform: translateY(-1px);
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
    background: #05050a;
}

.canvas-container {
    flex: 1;
    overflow: auto;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* 상단 고정 후 중앙 정렬 */
    position: relative;
    min-height: 0;
}

.placeholder {
    margin: auto 0;
    /* 세로 중앙 정렬 핵심 */
    flex-shrink: 0;
    text-align: center;
    padding: 60px 40px;
    border: 3px dashed rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.02);
    width: 90%;
    max-width: 700px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    position: relative;
    box-sizing: border-box;
    max-width: 95%;
    /* 모바일에서 좌우 여백 확보 */
}

.placeholder:hover {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-8px);
    /* 위아래 위치 고정 없이 효과 */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.sortable-ghost {
    opacity: 0.3;
    transform: scale(0.95);
    background: var(--primary-color) !important;
}

/* 썸네일 카드 호버 시에도 드래그 가능함을 암시 */
.page-thumb-card {
    cursor: grab;
}

.page-thumb-card:active {
    cursor: grabbing;
}

.placeholder.drag-over {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.15);
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.4);
}

.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.placeholder-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.placeholder-action {
    margin-top: 20px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.btn-lg:hover {
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
}

/* ===== 로봇 서명 & 도장 애니메이션 (Scenario A) ===== */
.robot-scene-svg {
    width: 240px;
    height: auto;
    filter: drop-shadow(0 0 25px rgba(99, 102, 241, 0.25));
}

.brush-signature-path {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: brushSignDraw 6s linear infinite;
}

.stamped-seal {
    animation: sealAppear 6s linear infinite;
}

.robot-arm-system {
    transform-origin: 190px 87px;
    animation: armSequence 6s ease-in-out infinite;
}

.tool-head {
    transform-origin: 140px 87px;
}

.tool-brush {
    animation: brushToggle 6s linear infinite;
}

.tool-stamp {
    animation: stampToggle 6s linear infinite;
}

/* 1. 서명 궤적 그리기 (0%~40%) */
@keyframes brushSignDraw {

    0%,
    5% {
        stroke-dashoffset: 100;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    40% {
        stroke-dashoffset: 0;
        opacity: 1;
    }

    85% {
        opacity: 1;
    }

    95%,
    100% {
        opacity: 0;
    }
}

/* 2. 도장 찍힌 결과 나타나기 (65%~) */
@keyframes sealAppear {

    0%,
    65% {
        opacity: 0;
        transform: scale(3);
    }

    70% {
        opacity: 1;
        transform: scale(1);
    }

    90% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* 3. 로봇 팔 전체 시퀀스 */
@keyframes armSequence {

    /* 초기 위치: 서명 시작점 부근 */
    0%,
    5% {
        transform: translate(0, 0) rotate(0deg);
    }

    /* 서명 중 (붓질) */
    10% {
        transform: translate(-80px, 30px) rotate(-10deg);
    }

    25% {
        transform: translate(-40px, 20px) rotate(5deg);
    }

    40% {
        transform: translate(-10px, 25px) rotate(-5deg);
    }

    /* 도구 교체하러 이동 */
    50% {
        transform: translate(10px, -10px) rotate(15deg);
    }

    /* 도장 위치로 이동 */
    60% {
        transform: translate(-25px, 30px) rotate(0deg);
    }

    /* 도장 찍기 (내려찍기) */
    65% {
        transform: translate(-25px, 45px) rotate(0deg);
    }

    70% {
        transform: translate(-25px, 30px) rotate(0deg);
    }

    /* 복귀 */
    90%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

/* 4. 붓/도장 도구 교체 타이밍 */
@keyframes brushToggle {

    0%,
    50% {
        opacity: 1;
    }

    55%,
    100% {
        opacity: 0;
    }
}

@keyframes stampToggle {

    0%,
    50% {
        opacity: 0;
    }

    55%,
    90% {
        opacity: 1;
    }

    95%,
    100% {
        opacity: 0;
    }
}

/* ===== Hilly Mascot (Hill Concept) ===== */
.hilly-mascot {
    width: 120px;
    height: auto;
    margin-bottom: -10px;
    z-index: 10;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
}

.hilly-body {
    fill: var(--primary);
    animation: hillyBounce 3s ease-in-out infinite;
}

.hilly-eyes {
    animation: hillyBlink 4s infinite;
}

.hilly-flag {
    transform-origin: bottom center;
    animation: flagWave 2s ease-in-out infinite;
}

@keyframes hillyBounce {

    0%,
    100% {
        transform: translateY(0) scaleY(1);
    }

    50% {
        transform: translateY(-10px) scaleY(0.95);
    }
}

@keyframes hillyBlink {

    0%,
    90%,
    100% {
        transform: scaleY(1);
    }

    95% {
        transform: scaleY(0.1);
    }
}

@keyframes flagWave {

    0%,
    100% {
        transform: rotate(-5deg);
    }

    50% {
        transform: rotate(10deg);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* 기존 shadow 애니메이션 제거 */

.placeholder-badge {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
    white-space: nowrap !important;
    /* 뱃지 텍스트 한 줄 유지 */
}

.visual-guide {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.guide-pdf {
    width: 60px;
    height: 80px;
    background: #1e1e32;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    position: relative;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 2;
}

.guide-pdf::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 18px;
    height: 18px;
    background: #0f0f1a;
    border-left: 1.5px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.2);
    border-bottom-left-radius: 8px;
}

.guide-line {
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

/* guide-seal 제거 (로봇으로 대체됨) */

.placeholder-subtext {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}

.placeholder-subtext strong {
    color: var(--primary);
    font-weight: 700;
}

.canvas-wrapper {
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: none;
}

.canvas-wrapper.active {
    display: block;
}

#pdfCanvas {
    display: block;
    background: white;
}

#overlayCanvas {
    position: absolute;
    top: 0;
    left: 0;
    cursor: crosshair;
}

.sidebar {
    width: 280px;
    background: rgba(20, 20, 35, 0.8);
    backdrop-filter: blur(10px);
    border-left: 1px solid var(--border);
    padding: 20px;
    overflow-y: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.left-sidebar {
    display: flex;
    flex-direction: column;
}

.page-thumbnail-list {
    flex: 1;
    overflow-y: auto;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(15, 15, 26, 0.5);
    backdrop-filter: blur(10px);
}

.sidebar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.sidebar-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* ===== 이미지 목록 슬림화 ===== */
.image-list {
    list-style: none;
    margin-bottom: 20px;
}

.image-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
}

.image-list-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.image-list-item.selected {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.image-list-item img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
    background: #222;
}

.image-list-item-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    color: var(--primary);
    font-weight: bold;
}

.image-list-item-info {
    flex: 1;
    min-width: 0;
}

.image-list-item-name {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-list-item-page {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.image-list-item-delete {
    color: #ef4444;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    opacity: 0.5;
}

.image-list-item:hover .image-list-item-delete {
    opacity: 1;
}

/* ===== 텍스트 속성 바 (Original Style) ===== */
.property-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    /* 상시 노출로 변경 */
    align-items: center;
    gap: 16px;
    padding: 12px 24px;
    background: rgba(15, 15, 26, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 100px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

/* .property-bar.active 불필요하므로 제거하거나 유지 */
.property-bar.active {
    display: flex;
}

.property-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.property-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.property-group input[type="text"],
.property-group select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    outline: none;
    font-size: 0.85rem;
}

.property-group input[type="text"] {
    width: 150px;
}

.property-group select {
    width: 70px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: white;
    padding: 6px 8px;
    border-radius: 8px;
    outline: none;
    font-size: 0.85rem;
}

.property-group select option {
    background: #151523;
    color: white;
}

.property-group input[type="color"] {
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    cursor: pointer;
}

/* ===== 후원/기부 카드 개편 ===== */
.donation-card {
    margin-top: auto;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 24px;
}

.donation-title {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
    font-weight: 500;
}

.donation-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toss-qr-mini {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.toss-qr-mini:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}

.qr-img-wrapper {
    width: 32px;
    height: 32px;
    background: white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 2px;
}

.toss-qr-mini img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.btn-kakao,
.btn-donation {
    display: block;
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: var(--transition);
}

.btn-kakao {
    background: #ffeb00;
    color: #3c1e1e;
}

.btn-kakao:hover {
    background: #fada00;
}

.btn-donation {
    background: linear-gradient(135deg, #fde047 0%, #facc15 100%) !important;
    color: #000 !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(250, 204, 21, 0.3) !important;
    font-weight: 800 !important;
}

.btn-donation:hover {
    background: linear-gradient(135deg, #fef08a 0%, #fde047 100%) !important;
    box-shadow: 0 6px 16px rgba(250, 204, 21, 0.4) !important;
    transform: translateY(-1px);
}

.btn-donation.btn-sm {
    background: #ffffff !important;
    color: #000000 !important;
}

.btn-donation.btn-sm:hover {
    background: #f1f5f9 !important;
}

.btn-donation.btn-sm:hover {
    background: #f1f5f9;
}

/* ===== 단축키 안내 ===== */
.shortcut-info {
    margin-top: 24px;
    padding: 0 4px;
    opacity: 0.8;
}

.shortcut-info h4 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.shortcut-info ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shortcut-info li {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    line-height: 1.4;
}

kbd {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: inherit;
    font-size: 0.75rem;
    color: var(--text-primary);
    margin: 0 2px;
}

/* ===== 모달 스타일 통합 ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: #151523;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    /* 모바일에서 화면을 넘지 않도록 제한 */
    overflow-y: auto;
    /* 내용이 길면 내부 스크롤 허용 */
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 32px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
    text-align: center;
    position: relative;
    /* 닫기 버튼 기준점 */
}

.modal-header {
    position: relative;
    margin-bottom: 20px;
}

.modal-close-btn {
    position: absolute;
    top: 12px;
    /* 구석에 파묻히지 않도록 내부로 이동 */
    right: 12px;
    width: 44px;
    /* 터치 편의성을 위해 크기 확대 */
    height: 44px;
    background: #f8fafc;
    /* 확실히 눈에 띄는 밝은 배경색 적용 */
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    color: #1e293b;
    /* 대비가 큰 어두운 아이콘 색상 */
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10000 !important;
    /* 최상단 레이어 보장 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    /* 입체감 부여 */
}

.modal-close-btn:hover,
.modal-close-btn:active {
    background: #ffffff;
    transform: scale(1.05);
}

.qr-image {
    width: 140px;
    height: 140px;
    background: white;
    padding: 8px;
    border-radius: 12px;
}

/* ===== 후원 모달 수직 리스트 개편 ===== */
.donation-methods-vertical {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.donation-methods-vertical .toss-qr-mini {
    justify-content: flex-start !important;
    padding: 14px 20px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 16px !important;
    text-decoration: none;
    color: inherit;
}

.donation-methods-vertical .toss-qr-mini:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.donation-methods-vertical .qr-img-wrapper {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 2px;
    margin-right: 12px;
}

.donation-methods-vertical .qr-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.method-icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 20px;
    flex-shrink: 0;
}

.method-info {
    flex-grow: 1;
    text-align: left;
}

.method-label {
    font-weight: 600;
    color: #f8fafc;
    margin: 0;
    font-size: 0.9rem;
}

.method-desc {
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 2px 0 0 0;
}

.link-item svg {
    color: #94a3b8;
    transition: var(--transition);
}

.link-item:hover svg {
    transform: translateX(4px);
    color: #fff;
}

/* Language Switcher */
.language-switcher {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    margin-left: 8px;
    transition: all 0.2s;
}

.language-switcher:hover {
    background: var(--background);
    border-color: var(--primary);
}

.donation-methods-vertical .link-item {
    text-decoration: none;
    color: inherit;
}

.donation-methods-vertical .link-item:hover {
    border-color: #6366f1 !important;
    background: rgba(99, 102, 241, 0.15) !important;
}

/* [CRITICAL 11차] 시스템 폰트 최우선 적용 및 Oldstyle 차단 */
.page-info,
.page-info span,
#currentPage,
#totalPages {
    font-family: 'Verdana', 'Arial', sans-serif !important;
    font-weight: bold !important;
    font-variant-numeric: lining-nums tabular-nums !important;
    font-feature-settings: "lnum" 1, "onum" 0, "tnum" 1 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
}

.method-info {
    flex: 1;
    text-align: left;
    margin-left: 14px;
}

.method-label {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    color: #ffffff;
}

.method-desc {
    font-size: 0.75rem !important;
    color: var(--text-secondary) !important;
    margin: 2px 0 0 0 !important;
}

.method-icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
}

/* 중첩 모달 레이어 우선순위 */
#qrZoomModal {
    z-index: 9999 !important;
}

#donationModal,
#saveSuccessModal {
    z-index: 8000 !important;
}

/* 애니메이션/레이아웃 보조 */
.status-bar {
    padding: 8px 24px;
    background: rgba(15, 15, 26, 0.9);
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-link:hover {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
}

.status-bar .divider-v {
    width: 1px;
    height: 12px;
    background: var(--border);
    margin: 0;
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 50px);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* ===== 문의 폼 스타일 ===== */
.contact-content {
    max-width: 450px !important;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: white;
    padding: 10px 14px;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

.security-guarantee-mini {
    font-size: 0.7rem;
    color: #94a3b8;
    line-height: 1.4;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-top: 8px;
}

/* ===== 스피너 및 로딩 상태 ===== */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ===== 토스트 알림 ===== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    padding: 12px 20px;
    border-radius: 12px;
    background: #1e1e32;
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: toastSlideIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    transition: all 0.3s ease;
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 650px) {
    .property-bar {
        width: 95%;
        flex-wrap: wrap;
        border-radius: 16px;
    }
}

/* ===== 도장/싸인 모달 스타일 ===== */
.seal-modal-content {
    width: 95%;
    max-width: 850px;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 85vh;
    max-height: 700px;
}

.modal-header {
    padding: 24px 32px 0;
    flex-shrink: 0;
}

.tab-container {
    display: flex;
    gap: 8px;
    margin-top: 24px;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.tab-btn:hover {
    color: white;
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
}

.modal-body {
    flex: 1;
    overflow: hidden;
    padding: 0;
    position: relative;
    background: #1e1e2d;
}

.tab-content {
    display: none;
    height: 100%;
    padding: 32px;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- 도장 만들기 스타일 --- */
.seal-maker-container {
    display: flex;
    gap: 40px;
    height: 100%;
}

.preview-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    /* Paper white */
    border-radius: 16px;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.05);
    background-image: radial-gradient(#e5e5e5 1px, transparent 1px);
    background-size: 20px 20px;
}

.preview-hint {
    margin-top: 16px;
    color: #94a3b8;
    font-size: 0.8rem;
}

#sealCanvas {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.controls-section {
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
    padding-right: 4px;
}

.shape-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.shape-option {
    aspect-ratio: 1;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.05);
}

.shape-option:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.shape-option.selected {
    border-color: #ef4444;
    /* Seal Red */
    background: rgba(239, 68, 68, 0.1);
}

.shape-icon {
    width: 24px;
    height: 24px;
    border-color: #cbd5e1;
}

/* Shape Icons CSS */
.icon-circle {
    border: 2px solid currentColor;
    border-radius: 50%;
}

.icon-oval {
    border: 2px solid currentColor;
    border-radius: 50%;
    width: 18px;
    transform: scaleY(1.2);
}

.icon-square {
    border: 2px solid currentColor;
}

.icon-rounded {
    border: 2px solid currentColor;
    border-radius: 6px;
}

.shape-option.selected .shape-icon {
    color: #ef4444;
}

.toggles-row {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: rgba(255, 255, 255, 0.03);
    padding: 16px;
    border-radius: 12px;
}

.toggle-group {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.toggle-switch {
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    position: relative;
    transition: 0.3s;
}

.toggle-knob {
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

input[type="checkbox"]:checked+.toggle-switch {
    background: var(--primary);
}

input[type="checkbox"]:checked+.toggle-switch .toggle-knob {
    transform: translateX(20px);
}

.info-text {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 6px;
}

/* --- 싸인 만들기 스타일 --- */
.signature-maker-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 20px;
}

.signature-pad-wrapper {
    flex: 1;
    background: white;
    border-radius: 16px;
    position: relative;
    cursor: crosshair;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#signatureCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.signature-placeholder {
    position: absolute;
    color: #cbd5e1;
    font-size: 1.5rem;
    pointer-events: none;
    font-weight: 500;
}

.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
}

.color-options {
    display: flex;
    gap: 12px;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: white;
    box-shadow: 0 0 0 2px var(--primary);
}

/* ===== 반응형 유틸리티 ===== */
.mobile-only {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile-only {
        display: flex !important;
    }

    .desktop-only {
        display: none !important;
    }
}

/* ===== 반응형 미디어 쿼리 (Mobile Responsiveness) ===== */

/* 태블릿 및 모바일 유틸리티 */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
}

/* 모바일 바텀 시트의 기본 상태.
   이 요소의 규칙이 전부 아래 @media (max-width: 768px) 안에만 있어서, 데스크톱에서는
   스타일이 하나도 붙지 않은 채 일반 블록으로 그려졌다. app-container가 height:100vh라
   화면 바로 아래에 '도구 선택' 제목만 남아 스크롤하면 보였다.

   반드시 미디어쿼리보다 '앞'에 있어야 한다 — 미디어쿼리는 특이도를 올리지 않으므로
   같은 선택자끼리는 소스 순서가 이긴다. 파일 끝에 두면 모바일에서도 숨겨져 시트가
   아예 열리지 않는다. */
.mobile-bottom-sheet {
    display: none;
}

/* 모바일 (768px 이하) */
@media (max-width: 768px) {
    body {
        height: 100vh;
        overflow: hidden;
    }

    .app-container {
        height: 100vh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .header {
        padding: 8px 16px;
        background: #0f0f1a;
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 60px;
        position: sticky;
        top: 0;
        z-index: 20000;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .logo {
        font-size: 0.95rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 50%;
    }

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

    .main-content {
        flex: 1;
        flex-direction: row;
        overflow: hidden;
        position: relative;
    }

    /* 사이드바 강제 은닉 (모바일 전용 드로어 시스템 사용) */
    .left-sidebar,
    .right-info-sidebar,
    .sidebar {
        display: none !important;
    }

    /* 드로어 활성화 시에만 노출 */
    .left-sidebar.show,
    .right-info-sidebar.show {
        display: flex !important;
        position: fixed;
        top: 0;
        bottom: 0;
        width: 85%;
        max-width: 320px;
        z-index: 6000;
        background: #0f0f1a;
    }

    .left-sidebar.show {
        left: 0;
    }

    .right-info-sidebar.show {
        right: 0;
    }

    .mobile-tab-bar {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 70px;
        background: rgba(20, 20, 35, 0.98);
        backdrop-filter: blur(20px);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 5000;
        justify-content: space-around;
        align-items: center;
        padding-bottom: env(safe-area-inset-bottom);
    }

    /* 모바일 속성바 정밀 제어 */
    .property-bar-v2 {
        display: none !important;
        position: fixed !important;
        bottom: 70px !important;
        /* 탭 바 바로 위 */
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
        background: rgba(15, 15, 26, 0.98) !important;
        border-radius: 0 !important;
        border: none !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
        z-index: 4500 !important;
        padding: 10px 16px !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .property-bar-v2.show {
        display: flex !important;
    }

    .right-info-sidebar.show {
        right: 0;
    }

    .mobile-tab-bar {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 70px;
        background: rgba(20, 20, 35, 0.98);
        backdrop-filter: blur(20px);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 5000;
        justify-content: space-around;
        align-items: center;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .tab-item {
        background: none;
        border: none;
        color: #94a3b8;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        font-size: 0.65rem;
        font-weight: 600;
        cursor: pointer;
        flex: 1;
        transition: 0.2s;
    }

    .tab-item.active {
        color: var(--primary);
    }

    .tab-item svg {
        width: 20px;
        height: 20px;
    }

    /* 바텀 시트 */
    .mobile-bottom-sheet {
        display: block;
        position: fixed;
        bottom: -100%;
        left: 0;
        right: 0;
        background: #151523;
        border-radius: 24px 24px 0 0;
        z-index: 5000;
        transition: transform 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
        padding: 20px;
        box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.5);
    }

    .mobile-bottom-sheet.show {
        transform: translateY(-70px);
        /* 탭 바 위로 */
    }

    .sheet-handle {
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 2px;
        margin: 0 auto 15px;
    }

    .sheet-header h3 {
        font-size: 1.1rem;
        margin-bottom: 20px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1rem;
    }

    .toolbar-group label span,
    .toolbar-group button span {
        display: none !important;
        /* 초소형 화면에서는 아이콘만 표시 */
    }

    .btn {
        padding: 8px !important;
        min-width: 40px;
    }

    .btn svg {
        margin: 0;
    }

    .header {
        padding: 8px 16px !important;
    }
}

/* ===== [NEW] 3컬럼 레이아웃 전용 사이드바 & 컴포넌트 ===== */

/* Left Sidebar (Page Thumbnails) */
.left-sidebar {
    width: 220px;
    background: rgba(20, 20, 35, 0.6);
    border-right: 1px solid var(--border);
    display: none;
    /* 초기 상태 숨김 */
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.left-sidebar.active {
    display: flex;
}

.page-list-header {
    padding: 18px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 800;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.page-thumbnail-list {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Thumbnail Card Style */
.page-thumb-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.page-thumb-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

.page-thumb-card.active {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.05);
}

.thumb-canvas-wrap {
    width: 100%;
    aspect-ratio: 1 / 1.414;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumb-canvas-wrap canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.thumb-label {
    margin-top: 10px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.page-thumb-card.active .thumb-label {
    color: var(--primary);
}

.thumb-delete-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 24px;
    height: 24px;
    background: #ef4444;
    border: 2px solid var(--bg-dark);
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
    z-index: 10;
}

.page-thumb-card:hover .thumb-delete-btn {
    opacity: 1;
}

/* Features Guide Section */
.features-guide {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 800px;
}

.features-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
    text-align: center;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    text-align: left;
}

.feature-item {
    padding: 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
    border-color: rgba(var(--primary-rgb), 0.3);
}

.feature-icon {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.feature-item h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.feature-item p {
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* New Badge */
.badge-new {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 6px;
    text-transform: uppercase;
    vertical-align: middle;
    animation: pulse-new 2s infinite;
}

@keyframes pulse-new {
    0% {
        opacity: 0.8;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    100% {
        opacity: 0.8;
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
        /* 2단에서 1단으로 변경하여 가로폭 확보 */
        gap: 16px;
    }
}

/* Right Sidebar (Shortcuts & Info) */
.right-info-sidebar {
    width: 330px;
    background: var(--bg-overlay);
    border-left: 1px solid var(--border);
    padding: 30px 24px;
    display: none;
    /* 초기 상태 숨김 */
    flex-direction: column;
    gap: 30px;
    overflow-y: auto;
    flex-shrink: 0;
}

.right-info-sidebar.active {
    display: flex;
}

/* [NEW] 고도화된 하단 속성 바 (Property Bar) */
.property-bar-v2 {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(15, 15, 26, 0.95);
    backdrop-filter: blur(25px);
    padding: 12px 32px;
    border-radius: 100px;
    border: 1px solid rgba(99, 102, 241, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    white-space: nowrap !important;
    /* 텍스트 수직 깨짐 방지 */
    min-width: fit-content !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28), opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.property-bar-v2.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.prop-input-modern {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 100px;
    padding: 8px 18px;
    font-size: 0.9rem;
    outline: none;
    width: 180px;
    transition: var(--transition);
}

.prop-input-modern:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--primary);
}

.prop-icon-btn {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
}

.prop-icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    border-color: #fff;
}

.prop-icon-btn.delete:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
}

.prop-divider {
    width: 1px;
    height: 32px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 5px;
}

/* ===== RTL Support (Right-to-Left) ===== */
[dir="rtl"] .header {
    flex-direction: row-reverse;
}

[dir="rtl"] .lang-dropdown {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .lang-dropdown-content {
    /* 모바일 잘림 방지를 위해 RTL에서도 우측 정렬 유지 (안쪽으로 펼쳐짐) */
    right: 0;
    left: auto;
}

[dir="rtl"] .toolbar {
    flex-direction: row-reverse;
}

[dir="rtl"] .sidebar {
    border-left: none;
    border-right: 1px solid var(--border);
}

[dir="rtl"] .image-list-item {
    flex-direction: row-reverse;
}

[dir="rtl"] .property-bar {
    flex-direction: row-reverse;
}

[dir="rtl"] .sidebar-btn {
    flex-direction: row-reverse;
    gap: 8px;
}

[dir="rtl"] .btn {
    flex-direction: row-reverse;
}

[dir="rtl"] .placeholder-subtext strong {
    display: inline-block;
}

[dir="rtl"] .shortcut.title {
    text-align: right;
}

[dir="rtl"] .mobile-only {
    margin-left: 0;
    margin-right: auto;
}

/* ===== Tutorial Video Modal ===== */
/* The following properties were likely intended for a specific selector,
   but were placed outside any rule. They are commented out to fix syntax.
   Please re-integrate them into the correct selector if needed.
justify-content: center !important;
gap: 10px;
margin-bottom: 16px;
padding: 0;
}
*/

@media (max-width: 480px) {
    .badge-row {
        flex-direction: column !important;
        /* 모바일에서 배지/영상버튼 상하 배치 */
        gap: 12px !important;
    }
}

/* 모바일 사이드바 전용 닫기 버튼 */
.mobile-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border: none;
    color: white;
    z-index: 10001;
    cursor: pointer;
    transition: background 0.2s;
}

.mobile-close-btn:active {
    background: rgba(255, 255, 255, 0.2);
}

.left-sidebar .mobile-close-btn {
    right: 15px;
}

/* 뱃지 및 버튼 마진 완전 제거 (정렬 오류 해결 핵심) */
.badge-row .placeholder-badge,
.badge-row .tutorial-btn-small {
    margin: 0 !important;
    vertical-align: middle;
}

.tutorial-btn-small {
    border: 1px solid rgba(99, 102, 241, 0.5) !important;
    background: rgba(99, 102, 241, 0.3) !important;
    /* 배경색 농도 추가 (20% -> 30%) */
    color: #fff !important;
    height: 34px;
    /* 뱃지 높이와 더 가깝게 조정 */
    padding: 0 16px !important;
    font-size: 0.85rem !important;
    font-weight: 800 !important;
    /* 폰트 두께 강화 */
    border-radius: 17px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3) !important;
    cursor: pointer;
}

.tutorial-btn-small:hover {
    background: rgba(99, 102, 241, 0.45) !important;
    border-color: #818cf8 !important;
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.5) !important;
    transform: translateY(-3px) scale(1.02);
    /* 호버 효과 극대화 */
}

.tutorial-modal-content {
    max-width: 900px !important;
    width: 95% !important;
    padding: 0 !important;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.9) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.tutorial-video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.tutorial-btn {
    border: 1px solid rgba(99, 102, 241, 0.3) !important;
    background: rgba(99, 102, 241, 0.05) !important;
    color: var(--primary) !important;
    font-weight: 700 !important;
}

.tutorial-btn:hover {
    background: rgba(99, 102, 241, 0.15) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3) !important;
}

#placeholderTutorialBtn {
    margin-top: 10px;
}

@media (max-width: 768px) {
    .tutorial-modal-content {
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }
}

/* ===== License Modal Styles ===== */
.license-modal-content {
    max-width: 600px !important;
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.license-body {
    overflow-y: auto;
    padding: 20px;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-primary);
}

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

.license-section h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 4px;
}

.license-item {
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.license-item strong {
    font-size: 1rem;
    color: #fff;
}

.license-item a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.8rem;
    display: inline-block;
    margin-top: 4px;
}

.license-item a:hover {
    text-decoration: underline;
}

.license-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    font-style: italic;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Slim Scrollbar for License Body */
.license-body::-webkit-scrollbar {
    width: 6px;
}

.license-body::-webkit-scrollbar-track {
    background: transparent;
}

.license-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.license-body::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

@media (max-width: 768px) {
    .license-modal-content {
        width: 90% !important;
        max-height: 70vh;
    }
}

/* ===== [12차 최종] 모바일 우측 정보창(사이드바) 전용 하단 닫기 바 ===== */
.mobile-sidebar-close-bar {
    display: none;
    /* 데스크톱 숨김 */
    width: 100%;
    min-height: 58px;
    margin: 24px 0;
    /* 상하 여백 확보 */
    background: #f8fafc !important;
    /* 밝은 회색 고시인성 */
    color: #0f172a !important;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    font-size: 1.15rem;
    font-weight: 800 !important;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9999;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.mobile-sidebar-close-bar:active {
    transform: scale(0.96);
    background: #ffffff !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .mobile-sidebar-close-bar.mobile-only {
        display: flex !important;
        /* 모바일에서만 노출 */
    }
}

/* ===== [14차] 테두리 빛 흐름 애니메이션 버튼 (Luminous CTA) ===== */
@keyframes borderRotate {
    100% {
        transform: rotate(360deg);
    }
}

.luminous-btn {
    position: relative;
    overflow: hidden;
    padding: 10px 24px !important;
    background: #1e293b !important;
    /* 어두운 배경으로 네온 테두리 강조 */
    color: #ffffff !important;
    border: none !important;
    border-radius: 12px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800 !important;
    cursor: pointer;
    box-shadow: 0 10px 30px -10px rgba(175, 255, 0, 0.5);
    /* 네온 그린 쉐도우 */
    transition: all 0.3s;
}

/* 회전하는 빛줄기 배경 레이어 (네온 그린 튜닝) */
.luminous-btn::before {
    content: '';
    position: absolute;
    top: -150%;
    left: -50%;
    width: 200%;
    height: 400%;
    background: conic-gradient(transparent,
            rgba(175, 255, 0, 0.8),
            rgba(175, 255, 0, 1),
            rgba(175, 255, 0, 0.8),
            transparent 30%);
    animation: borderRotate 4s linear infinite;
    /* 3s -> 4s로 부드럽게 조절 */
    z-index: -2;
}

/* 내부 배경을 덮어 테두리만 남기는 레이어 */
.luminous-btn::after {
    content: '';
    position: absolute;
    inset: 2px;
    /* 테두리 두께 */
    background: #0f172a;
    /* 주변 배경색과 일치시켜 세련되게 처리 */
    border-radius: 11px;
    z-index: -1;
    transition: background 0.3s;
}

.luminous-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 15px 40px -10px rgba(175, 255, 0, 0.8);
    /* 호버 시 네온 강화 */
}

.luminous-btn:hover::after {
    background: #1e293b;
    /* 호버 시 아주 살짝 밝아짐 */
}

/* 클릭 효과 */
.luminous-btn:active {
    transform: translateY(1px) scale(0.98);
}

/* 아이콘 흔들림 애니메이션 */
@keyframes shakeIcon {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-10deg);
    }

    75% {
        transform: rotate(10deg);
    }
}

.luminous-btn span:first-child {
    font-size: 1.2rem;
    display: inline-block;
    animation: shakeIcon 2s ease-in-out infinite;
}

/* ===== [NEW] 추천 배너 및 Friction 모달 애니메이션 스타일 ===== */
@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.recommendation-banner {
    transition: all 0.3s ease;
}

.recommendation-banner button:hover {
    transform: translateY(-1px);
}

/* ===== USDT 기부 컴포넌트 추가 스타일 ===== */
.usdt-donation-item .chevron-icon {
    transition: transform 0.3s ease;
}
.usdt-donation-item.active .chevron-icon {
    transform: rotate(180deg);
}
.usdt-form-container {
    transition: all 0.3s ease-in-out;
}
.usdt-form-container input:focus {
    border-color: #26a17b !important;
    background: rgba(38, 161, 123, 0.08) !important;
}
.usdt-form-container .btn-primary {
    background: #26a17b !important;
    border-color: #26a17b !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(38, 161, 123, 0.3) !important;
}
.usdt-form-container .btn-primary:hover {
    background: #208566 !important;
    border-color: #208566 !important;
}

/* Glassmorphism 다크 테일러드 QR 코드 카드 */
.usdt-qr-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 16px;
    backdrop-filter: blur(8px);
}
/* 하단 상태바 우측 묶음. 제작사 표기와 도메인을 나란히 둔다. */
.status-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.maker-credit {
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.maker-credit:hover {
    color: var(--primary);
}

/* 좁은 화면에서는 제작사 표기를 접는다 — 상태 문구와 도메인이 우선이다. */
@media (max-width: 640px) {
    .status-right .maker-credit,
    .status-right .divider-v {
        display: none;
    }
}

/* ---------------------------------------------------------------------------
   저장 완료 모달의 제작사 문의 줄 (.vrof-cta)

   **다섯 언어에서만 보인다 — ko · en · ja · zh · fr.** i18n.js 의 setLanguage() 가
   언어를 바꿀 때 document.documentElement.lang 을 같이 바꾸므로, 자바스크립트를
   건드리지 않고 CSS 로만 가를 수 있다. index.html 은 <html lang="ko"> 로 시작한다.

   선은 「한국어냐 아니냐」가 아니라 **「우리가 응대할 수 있느냐」**에 그었다.
   vrof.co.kr 이 그 다섯 언어로 서비스하고 상담 창구도 그 다섯을 받는다. 나머지
   여섯(es de vi fa hi sv)은 문의가 와도 받을 곳이 없다 — 응대 못 할 초대는
   초대가 아니라 잡음이다.

   그 여섯에서는 t() 가 없는 키를 만나 'save.vrofCta' 를 그대로 뿌리지만, 아래
   한정이 감추므로 화면에는 나오지 않는다. 키를 열한 벌 채우는 것보다 이 편이
   낫다 — 못 받을 언어의 문구를 만들지 않는다. 창구가 늘면 그 언어를 한정에
   더하고 i18n.js 에 한 줄 넣으면 된다.

   후원 링크보다 조용해야 한다. 완료 화면에 부탁이 둘인데 둘 다 소리를 내면
   둘 다 안 읽힌다. --------------------------------------------------------- */
.vrof-cta {
    display: none;
}

html[lang='ko'] .vrof-cta,
html[lang='en'] .vrof-cta,
html[lang='ja'] .vrof-cta,
html[lang='zh'] .vrof-cta,
html[lang='fr'] .vrof-cta {
    display: inline-block;
    margin-top: 2px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-decoration: none;
    opacity: 0.85;
    transition: color 0.15s ease, opacity 0.15s ease;
}

html[lang='ko'] .vrof-cta:hover,
html[lang='en'] .vrof-cta:hover,
html[lang='ja'] .vrof-cta:hover,
html[lang='zh'] .vrof-cta:hover,
html[lang='fr'] .vrof-cta:hover {
    color: var(--primary);
    opacity: 1;
    text-decoration: underline;
}
