:root {
    /* Dark Navy Palette */
    --bg-light: #E4E7F0;
    --gray-mid: #5A607A;
    --gray-dark: #0E1629;
    --primary-dark: #071440;
    --primary-bright: #1A3A8F;
    --white: #FFFFFF;

    /* Semantic Mappings */
    --bg-color: var(--bg-light);
    --surface-color: var(--white);
    --text-main: var(--gray-dark);
    --text-muted: var(--gray-mid);
    --primary-color: var(--primary-bright);
    --border-color: rgba(0, 0, 0, 0.08);
}

body {
    box-sizing: border-box;
    font-family: 'Outfit', 'Noto Sans KR', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

/* Header & Logo */
.header-logo {
    max-height: 70px;
}

/* Premium Card Design */
.premium-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.premium-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(7, 20, 64, 0.14);
    border-color: rgba(26, 58, 143, 0.25);
}

/* Stagger animation */
.stagger-in {
    opacity: 0;
    transform: translateY(20px);
    animation: staggerReveal 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

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

/* Upload zone */
.upload-zone {
    transition: all 0.3s ease;
    border: 2px dashed rgba(26, 58, 143, 0.28);
    background: var(--white);
    outline: none;
}

.upload-zone:hover,
.upload-zone:focus,
.upload-zone.dragover {
    border-color: #1A3A8F !important;
    background: rgba(26, 58, 143, 0.04);
    transform: scale(1.005);
    outline: none;
}

/* Progress bar - Meritz Red Shimmer */
.progress-bar {
    background: linear-gradient(90deg, var(--primary-dark), var(--primary-bright), var(--primary-dark));
    background-size: 200% 100%;
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

/* Summary Grid Cards */
.summary-item-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-bottom: 2px solid transparent;
}

.summary-item-card:hover {
    border-bottom-color: var(--primary-color);
}

/* Toast */
.toast {
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-mid);
    border-radius: 3px;
}

/* Detail panel */
.detail-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.detail-panel.open {
    max-height: 1000px;
}

/* Background Gradients (Subtle) */
.bg-subtle-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 10% 20%, rgba(26, 58, 143, 0.07) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(7, 20, 64, 0.06) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
}

@view-transition {
    navigation: auto;
}

/* ── Typographic Enhancements ── */
.title-accent {
    color: var(--primary-bright);
    letter-spacing: -0.04em;
    text-shadow: 0 2px 12px rgba(7, 20, 64, 0.15);
    background: linear-gradient(to right, #040D2C, #1A3A8F);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-right: 2px;
    /* Prevent subtle clipping on some browsers */
}

.title-main {
    letter-spacing: -0.03em;
    color: var(--gray-dark);
    font-weight: 800;
}

/* ══════════════════════════════════════════════
   ── Global Navy Override (Default / Meritz) ──
   Tailwind red → navy (기본 테마 전역 적용)
   ══════════════════════════════════════════════ */
body:not(.samsung-theme):not(.db-theme):not(.heungkuk-theme):not(.meritz-theme) .text-red-600,
body:not(.samsung-theme):not(.db-theme):not(.heungkuk-theme):not(.meritz-theme) .text-red-500 { color: #1A3A8F !important; }
body:not(.samsung-theme):not(.db-theme):not(.heungkuk-theme):not(.meritz-theme) .bg-red-600   { background-color: #1A3A8F !important; }
body:not(.samsung-theme):not(.db-theme):not(.heungkuk-theme):not(.meritz-theme) .bg-red-50    { background-color: #EEF2FF !important; }
body:not(.samsung-theme):not(.db-theme):not(.heungkuk-theme):not(.meritz-theme) .bg-red-100   { background-color: #E0E7FF !important; }
body:not(.samsung-theme):not(.db-theme):not(.heungkuk-theme):not(.meritz-theme) .border-red-600 { border-color: #1A3A8F !important; }
body:not(.samsung-theme):not(.db-theme):not(.heungkuk-theme):not(.meritz-theme) .border-red-100 { border-color: #C7D2FE !important; }
body:not(.samsung-theme):not(.db-theme):not(.heungkuk-theme):not(.meritz-theme) .border-red-200 { border-color: #A5B4FC !important; }
body:not(.samsung-theme):not(.db-theme):not(.heungkuk-theme):not(.meritz-theme) .border-red-300 { border-color: #818CF8 !important; }
body:not(.samsung-theme):not(.db-theme):not(.heungkuk-theme):not(.meritz-theme) .ring-red-200  { --tw-ring-color: #C7D2FE !important; }
body:not(.samsung-theme):not(.db-theme):not(.heungkuk-theme):not(.meritz-theme) .focus\:border-red-300:focus { border-color: #818CF8 !important; }
body:not(.samsung-theme):not(.db-theme):not(.heungkuk-theme):not(.meritz-theme) .focus\:ring-red-200:focus   { --tw-ring-color: #C7D2FE !important; }
body:not(.samsung-theme):not(.db-theme):not(.heungkuk-theme):not(.meritz-theme) .hover\:bg-red-100:hover { background-color: #E0E7FF !important; }
body:not(.samsung-theme):not(.db-theme):not(.heungkuk-theme):not(.meritz-theme) .hover\:bg-red-700:hover { background-color: #071440 !important; }
body:not(.samsung-theme):not(.db-theme):not(.heungkuk-theme):not(.meritz-theme) .file\:bg-red-50    { background-color: #EEF2FF !important; }
body:not(.samsung-theme):not(.db-theme):not(.heungkuk-theme):not(.meritz-theme) .file\:text-red-600 { color: #1A3A8F !important; }
body:not(.samsung-theme):not(.db-theme):not(.heungkuk-theme):not(.meritz-theme) .bg-red-400  { background-color: #818CF8 !important; }
body:not(.samsung-theme):not(.db-theme):not(.heungkuk-theme):not(.meritz-theme) .decoration-red-200 { text-decoration-color: #A5B4FC !important; }
body:not(.samsung-theme):not(.db-theme):not(.heungkuk-theme):not(.meritz-theme) .border-red-500\/30 { border-color: rgba(26,58,143,0.3) !important; }
body:not(.samsung-theme):not(.db-theme):not(.heungkuk-theme):not(.meritz-theme) .bg-red-500\/5  { background-color: rgba(26,58,143,0.05) !important; }
body:not(.samsung-theme):not(.db-theme):not(.heungkuk-theme):not(.meritz-theme) .bg-red-500\/10 { background-color: rgba(26,58,143,0.10) !important; }
body:not(.samsung-theme):not(.db-theme):not(.heungkuk-theme):not(.meritz-theme) .shadow-red-100 { --tw-shadow-color: rgba(26,58,143,0.12) !important; }
body:not(.samsung-theme):not(.db-theme):not(.heungkuk-theme):not(.meritz-theme) .ring-red-100   { --tw-ring-color: rgba(26,58,143,0.15) !important; }
body:not(.samsung-theme):not(.db-theme):not(.heungkuk-theme):not(.meritz-theme) .underline      { text-decoration-color: rgba(26,58,143,0.35) !important; }

/* welcome-code & badge dot */
body:not(.samsung-theme):not(.db-theme):not(.heungkuk-theme):not(.meritz-theme) .welcome-code {
    color: #2547B8 !important;
    background: rgba(26, 58, 143, 0.07) !important;
}
body:not(.samsung-theme):not(.db-theme):not(.heungkuk-theme):not(.meritz-theme) .welcome-name::after {
    background: #2547B8 !important;
}

/* ══════════════════════════════════════════════
   ── Meritz Theme Override ──
   body.meritz-theme → 기존 레드 테마 복원
   ══════════════════════════════════════════════ */
body.meritz-theme {
    --primary-dark:   #A60000;
    --primary-bright: #E60000;
    --primary-color:  #E60000;
    --bg-light: #EBEBEB;
    --gray-dark: #404040;
    --gray-mid: #8C8C8C;
}

body.meritz-theme .bg-subtle-glow {
    background: radial-gradient(circle at 10% 20%, rgba(230, 0, 0, 0.03) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(166, 0, 0, 0.03) 0%, transparent 40%);
}

body.meritz-theme .upload-zone {
    border-color: rgba(166, 0, 0, 0.2);
}
body.meritz-theme .upload-zone:hover,
body.meritz-theme .upload-zone.dragover {
    background: rgba(230, 0, 0, 0.02);
}

body.meritz-theme .premium-card:hover {
    box-shadow: 0 12px 30px rgba(166, 0, 0, 0.08);
    border-color: rgba(166, 0, 0, 0.15);
}

body.meritz-theme .title-accent {
    text-shadow: 0 4px 15px rgba(230, 0, 0, 0.12);
    background: linear-gradient(to right, #A60000, #E60000);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.meritz-theme .welcome-code {
    color: #E60000 !important;
    background: rgba(230, 0, 0, 0.05) !important;
}
body.meritz-theme .welcome-name::after { background: #E60000 !important; }

/* ══════════════════════════════════════════════
   ── Samsung Fire Insurance Theme Override ──
   body.samsung-theme → 레드 → 네이비 블루
   ══════════════════════════════════════════════ */
body.samsung-theme {
    /* Samsung Fire navy palette */
    --primary-dark:   #002E7A;
    --primary-bright: #1251CC;
    --primary-color:  #1251CC;

    /* Subtle background tint (Meritz: warm red → Samsung: cool blue) */
    --bg-light: #EAECF4;
}

/* Background glow: red radial → blue radial */
body.samsung-theme .bg-subtle-glow {
    background: radial-gradient(circle at 10% 20%, rgba(18, 81, 204, 0.04) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(0, 46, 122, 0.04) 0%, transparent 40%);
}

/* Upload zone dashed border */
body.samsung-theme .upload-zone {
    border-color: rgba(0, 46, 122, 0.2);
}
body.samsung-theme .upload-zone:hover,
body.samsung-theme .upload-zone.dragover {
    background: rgba(18, 81, 204, 0.02);
}

/* Card hover accent */
body.samsung-theme .premium-card:hover {
    box-shadow: 0 12px 30px rgba(18, 81, 204, 0.08);
    border-color: rgba(18, 81, 204, 0.15);
}

/* Title accent gradient */
body.samsung-theme .title-accent {
    color: var(--primary-bright);
    text-shadow: 0 4px 15px rgba(18, 81, 204, 0.12);
    background: linear-gradient(to right, #002E7A, #1251CC);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Tailwind red → navy overrides */
body.samsung-theme .text-red-600,
body.samsung-theme .text-red-500 { color: #1251CC !important; }
body.samsung-theme .bg-red-600   { background-color: #1251CC !important; }
body.samsung-theme .bg-red-50    { background-color: #EFF4FF !important; }
body.samsung-theme .bg-red-100   { background-color: #DBEAFE !important; }
body.samsung-theme .border-red-600 { border-color: #1251CC !important; }
body.samsung-theme .border-red-100 { border-color: #BFDBFE !important; }
body.samsung-theme .border-red-200 { border-color: #93C5FD !important; }
body.samsung-theme .border-red-300 { border-color: #60A5FA !important; }
body.samsung-theme .ring-red-200  { --tw-ring-color: #BFDBFE !important; }
body.samsung-theme .focus\:border-red-300:focus { border-color: #60A5FA !important; }
body.samsung-theme .focus\:ring-red-200:focus   { --tw-ring-color: #BFDBFE !important; }
body.samsung-theme .hover\:bg-red-100:hover { background-color: #DBEAFE !important; }
body.samsung-theme .hover\:bg-red-700:hover { background-color: #002E7A !important; }
body.samsung-theme .file\:bg-red-50    { background-color: #EFF4FF !important; }
body.samsung-theme .file\:text-red-600 { color: #1251CC !important; }

/* Badge border (hardcoded rgba red in index.html inline style) */
body.samsung-theme #manager-badge-container > div {
    border-color: rgba(0, 46, 122, 0.6) !important;
}
body.samsung-theme .welcome-code {
    color: #1251CC !important;
    background: rgba(18, 81, 204, 0.06) !important;
}
body.samsung-theme .welcome-name::after {
    background: #1251CC !important;
}

/* animate-ping dot in badge */
body.samsung-theme .bg-red-400 { background-color: #60A5FA !important; }
body.samsung-theme .bg-red-600 { background-color: #1251CC !important; }

/* Error island keep red (it's UI feedback, not brand) */
body.samsung-theme #error-report-island { /* intentionally unchanged */ }

/* Hardcoded rgba(230,0,0,...) inline styles → samsung blue */
body.samsung-theme [style*="rgba(230,0,0"] {
    background: rgba(18, 81, 204, 0.06) !important;
    border-color: rgba(18, 81, 204, 0.15) !important;
}
body.samsung-theme [style*="rgba(166,0,0"] {
    background: rgba(0, 46, 122, 0.06) !important;
    border-color: rgba(0, 46, 122, 0.15) !important;
}

/* ══════════════════════════════════════════════
   ── DB Insurance Theme Override ──
   body.db-theme → 레드 → DB그린
   ══════════════════════════════════════════════ */
body.db-theme {
    --primary-dark:   #00703C;
    --primary-bright: #00A04B;
    --primary-color:  #00A04B;
    --bg-light: #E8F5EE;
}

body.db-theme .bg-subtle-glow {
    background: radial-gradient(circle at 10% 20%, rgba(0, 160, 75, 0.04) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(0, 112, 60, 0.04) 0%, transparent 40%);
}

body.db-theme .upload-zone {
    border-color: rgba(0, 112, 60, 0.2);
}
body.db-theme .upload-zone:hover,
body.db-theme .upload-zone.dragover {
    background: rgba(0, 160, 75, 0.02);
}

body.db-theme .premium-card:hover {
    box-shadow: 0 12px 30px rgba(0, 160, 75, 0.08);
    border-color: rgba(0, 160, 75, 0.15);
}

body.db-theme .title-accent {
    color: var(--primary-bright);
    text-shadow: 0 4px 15px rgba(0, 160, 75, 0.12);
    background: linear-gradient(to right, #00703C, #00A04B);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.db-theme .text-red-600,
body.db-theme .text-red-500 { color: #00A04B !important; }
body.db-theme .bg-red-600   { background-color: #00A04B !important; }
body.db-theme .bg-red-50    { background-color: #ECFDF5 !important; }
body.db-theme .bg-red-100   { background-color: #D1FAE5 !important; }
body.db-theme .border-red-600 { border-color: #00A04B !important; }
body.db-theme .border-red-100 { border-color: #A7F3D0 !important; }
body.db-theme .border-red-200 { border-color: #6EE7B7 !important; }
body.db-theme .border-red-300 { border-color: #34D399 !important; }
body.db-theme .ring-red-200  { --tw-ring-color: #A7F3D0 !important; }
body.db-theme .focus\:border-red-300:focus { border-color: #34D399 !important; }
body.db-theme .focus\:ring-red-200:focus   { --tw-ring-color: #A7F3D0 !important; }
body.db-theme .hover\:bg-red-100:hover { background-color: #D1FAE5 !important; }
body.db-theme .hover\:bg-red-700:hover { background-color: #00703C !important; }
body.db-theme .file\:bg-red-50    { background-color: #ECFDF5 !important; }
body.db-theme .file\:text-red-600 { color: #00A04B !important; }

body.db-theme #manager-badge-container > div {
    border-color: rgba(0, 112, 60, 0.6) !important;
}
body.db-theme .welcome-code {
    color: #00A04B !important;
    background: rgba(0, 160, 75, 0.06) !important;
}
body.db-theme .welcome-name::after {
    background: #00A04B !important;
}

body.db-theme .bg-red-400 { background-color: #34D399 !important; }

body.db-theme [style*="rgba(230,0,0"] {
    background: rgba(0, 160, 75, 0.06) !important;
    border-color: rgba(0, 160, 75, 0.15) !important;
}
body.db-theme [style*="rgba(166,0,0"] {
    background: rgba(0, 112, 60, 0.06) !important;
    border-color: rgba(0, 112, 60, 0.15) !important;
}

/*
   body.heungkuk-theme → 레드 → 핑크 딥로즈
*/
body.heungkuk-theme {
    --primary-dark:   #9D174D;
    --primary-bright: #DB2777;
    --primary-color:  #DB2777;
    --bg-light: #FDF2F8;
}

body.heungkuk-theme .bg-subtle-glow {
    background: radial-gradient(ellipse at 60% 40%, rgba(219,39,119,0.08) 0%, transparent 70%);
}

body.heungkuk-theme .upload-zone {
    border-color: rgba(219,39,119,0.35);
}
body.heungkuk-theme .upload-zone:hover,
body.heungkuk-theme .upload-zone.dragover {
    border-color: #DB2777;
    background: rgba(219,39,119,0.04);
}
body.heungkuk-theme .premium-card:hover {
    box-shadow: 0 20px 60px -10px rgba(219,39,119,0.18);
}

body.heungkuk-theme .title-accent {
    color: var(--primary-bright);
    text-shadow: 0 4px 15px rgba(219, 39, 119, 0.18);
    background: linear-gradient(to right, #9D174D, #DB2777, #F472B6);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.heungkuk-theme .welcome-greet {
    color: #fff !important;
    opacity: 0.85;
}
body.heungkuk-theme .welcome-name {
    color: #fff !important;
}

body.heungkuk-theme .text-red-600,
body.heungkuk-theme .text-red-500 { color: #DB2777 !important; }
body.heungkuk-theme .bg-red-600   { background-color: #DB2777 !important; }
body.heungkuk-theme .bg-red-50    { background-color: #FDF2F8 !important; }
body.heungkuk-theme .bg-red-100   { background-color: #FCE7F3 !important; }
body.heungkuk-theme .border-red-600 { border-color: #DB2777 !important; }
body.heungkuk-theme .border-red-100 { border-color: #FBCFE8 !important; }
body.heungkuk-theme .border-red-200 { border-color: #F9A8D4 !important; }
body.heungkuk-theme .border-red-300 { border-color: #F472B6 !important; }
body.heungkuk-theme .ring-red-200  { --tw-ring-color: #FBCFE8 !important; }
body.heungkuk-theme .focus\:border-red-300:focus { border-color: #F472B6 !important; }
body.heungkuk-theme .focus\:ring-red-200:focus   { --tw-ring-color: #FBCFE8 !important; }
body.heungkuk-theme .hover\:bg-red-100:hover { background-color: #FCE7F3 !important; }
body.heungkuk-theme .hover\:bg-red-700:hover { background-color: #9D174D !important; }
body.heungkuk-theme .file\:bg-red-50    { background-color: #FDF2F8 !important; }
body.heungkuk-theme .file\:text-red-600 { color: #DB2777 !important; }

body.heungkuk-theme #manager-badge-container > div {
    background: linear-gradient(135deg, #9D174D, #DB2777);
}
body.heungkuk-theme .welcome-code {
    color: #DB2777;
}
body.heungkuk-theme .welcome-name::after {
    background: linear-gradient(90deg, #9D174D, #DB2777, #9D174D);
}

body.heungkuk-theme .bg-red-400 { background-color: #F472B6 !important; }
body.heungkuk-theme .bg-red-600 { background-color: #DB2777 !important; }

body.heungkuk-theme [style*="rgba(230,0,0"] {
    background: rgba(219, 39, 119, 0.06) !important;
    border-color: rgba(219, 39, 119, 0.15) !important;
}
body.heungkuk-theme [style*="rgba(166,0,0"] {
    background: rgba(157, 23, 77, 0.06) !important;
    border-color: rgba(157, 23, 77, 0.15) !important;
}

/* ── Capture specific overrides ── */
/* 한글 폰트를 앞에 배치하여 자간 계산 오류 방지 */
.html2canvas-container {
    font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif !important;
    letter-spacing: -0.02em !important;
    /* 약간의 자간 조절 */
    line-height: 1.4 !important;
}

/* 겹침이 심한 숫자/단위 부분 강제 설정 */
.coverage-amount,
.price,
b,
strong {
    display: inline-block !important;
    /* 글자 뭉침 방지 */
    letter-spacing: 0px !important;
}