
/* Mobile 3-Tab Segment Selector (Desktop Hidden) */
.mobile-tabs-bar {
    display: none;
}
/* static/style.css — Deep Space AI Theme v3.0.0 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800;900&display=swap');
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

/* ═══════════════════════════════════════════════════
   DESIGN TOKENS — Deep Space Palette
═══════════════════════════════════════════════════ */
:root,
[data-theme="light"] {
    /* Brand Colors (Linear Minimal Zinc Style) */
    --blue-core:     #2563eb;
    --blue-bright:   #1d4ed8;
    --blue-glow:     rgba(37, 99, 235, 0.08);
    --blue-deep:     #1e40af;
    --purple-core:   #7c3aed;
    --purple-glow:   rgba(124, 58, 237, 0.08);
    --cyan-core:     #0284c7;
    --orange-core:   #ea580c;
    --orange-glow:   rgba(234, 88, 12, 0.08);
    --green-core:    #059669;
    --green-glow:    rgba(5, 150, 105, 0.08);
    --red-core:      #e11d48;

    /* Gradient Presets - Refined & Crisp */
    --grad-blue:     linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
    --grad-orange:   linear-gradient(135deg, #ea580c 0%, #f97316 100%);
    --grad-green:    linear-gradient(135deg, #059669 0%, #10b981 100%);
    --grad-purple:   linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
    --grad-hero:     linear-gradient(135deg, #0f172a 30%, #2563eb 100%);
    --grad-neon:     linear-gradient(90deg, #2563eb, #7c3aed, #2563eb);

    /* Dynamic Accent System */
    --accent-core:     var(--blue-core);
    --accent-bright:   var(--blue-bright);
    --accent-glow:     var(--blue-glow);
    --accent-gradient: var(--grad-blue);

    /* Background System - Clean Matte Zinc & Off-White */
    --bg-root:       #f8fafc;
    --bg-main:       #ffffff;
    --bg-sidebar:    rgba(255, 255, 255, 0.88);
    --bg-header:     rgba(255, 255, 255, 0.85);
    --bg-modal:      #ffffff;
    --bg-dropdown:   #ffffff;
    --bg-user-bubble:rgba(241, 245, 249, 0.95);
    --bg-card:       #ffffff;
    --bg-card-hover: rgba(248, 250, 252, 0.9);
    --bg-glass:      rgba(255, 255, 255, 0.6);
    --bg-input:      #ffffff;
    --bg-input-solid:#ffffff;
    --bg-scrollbar-thumb: rgba(15, 23, 42, 0.15);

    /* Border System - Precision 1px Slate Borders */
    --border:        rgba(226, 232, 240, 0.9);
    --border-subtle: rgba(226, 232, 240, 0.5);
    --border-blue:   rgba(37, 99, 235, 0.25);
    --border-orange: rgba(234, 88, 12, 0.25);
    --border-green:  rgba(5, 150, 105, 0.25);
    --border-bright: rgba(203, 213, 225, 0.8);

    /* Text System - Deep Graphite & Charcoal */
    --text-primary:  #0f172a;
    --text-secondary:#475569;
    --text-muted:    #94a3b8;
    --text-bright:   #020617;

    /* Layout */
    --sidebar-width: 340px;
    --header-h:      60px;
    --radius-xl:     24px;
    --radius-lg:     14px;
    --radius-md:     10px;
    --radius-sm:     8px;
    --radius-xs:     6px;

    /* Shadows - Layered Precision Soft Shadows */
    --shadow-sm:     0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-md:     0 4px 14px -2px rgba(15, 23, 42, 0.06);
    --shadow-lg:     0 16px 36px -4px rgba(15, 23, 42, 0.08);
    --shadow-blue:   0 4px 16px rgba(37, 99, 235, 0.12);
    --shadow-orange: 0 4px 16px rgba(234, 88, 12, 0.12);
    --shadow-green:  0 4px 16px rgba(5, 150, 105, 0.12);

    /* Transitions */
    --ease:          all 0.22s cubic-bezier(0.25, 0.8, 0.25, 1);
    --ease-bounce:   all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1.1);

    /* Ambient Glow System */
    --glow-left:     rgba(37, 99, 235, 0.02);
    --glow-right:    rgba(124, 58, 237, 0.015);
    --glow-center:   rgba(2, 132, 199, 0.01);
    --glow-main-left: rgba(37, 99, 235, 0.015);
    --glow-main-right: rgba(124, 58, 237, 0.01);

    /* Typography Scale */
    --font-xxl:      2.4rem;    /* Hero / Welcome title */
    --font-xl:       1.2rem;    /* Main subtitles, large headers */
    --font-lg:       1.05rem;   /* Active mode, header titles, modal titles */
    --font-base:     0.975rem;  /* Body text, message bubbles, inputs */
    --font-md:       0.9rem;    /* Category chips, auto-routing, chips */
    --font-sm:       0.85rem;   /* Tab switcher buttons, secondary labels, description text */
    --font-xs:       0.75rem;   /* Meta details, helper texts, badge labels, timestamps */
}

[data-theme="dark"] {
    /* Brand Colors for Dark Mode - Deep Navy & Sky Blue Neon Accents */
    --blue-core:     #1e60ff;
    --blue-bright:   #38bdf8;
    --blue-glow:     rgba(56, 189, 248, 0.25);
    --blue-deep:     #0c4a6e;
    --purple-core:   #8b5cf6;
    --purple-glow:   rgba(139, 92, 246, 0.15);
    --cyan-core:     #00d2ff;
    --orange-core:   #fb923c;
    --orange-glow:   rgba(251, 146, 60, 0.15);
    --green-core:    #10b981;
    --green-glow:    rgba(16, 185, 129, 0.15);
    --red-core:      #f43f5e;

    /* Gradient Presets - Rich & Vibrant */
    --grad-blue:     linear-gradient(135deg, #0284c7 0%, #1e60ff 50%, #2563eb 100%);
    --grad-orange:   linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    --grad-green:    linear-gradient(135deg, #10b981 0%, #059669 100%);
    --grad-purple:   linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    --grad-hero:     linear-gradient(135deg, #ffffff 30%, #38bdf8 100%);
    --grad-neon:     linear-gradient(90deg, #38bdf8, #1e60ff, #38bdf8);

    /* Dynamic Accent System */
    --accent-core:     var(--blue-core);
    --accent-bright:   var(--blue-bright);
    --accent-glow:     var(--blue-glow);
    --accent-gradient: var(--grad-blue);

    /* Background System - Deep Space Navy Glassmorphism */
    --bg-root:       #0a0e17;
    --bg-main:       #0d1322;
    --bg-sidebar:    rgba(13, 19, 34, 0.88);
    --bg-header:     rgba(15, 23, 42, 0.82);
    --bg-modal:      rgba(20, 28, 48, 0.95);
    --bg-dropdown:   rgba(18, 26, 44, 0.95);
    --bg-user-bubble:rgba(30, 96, 255, 0.12);
    --bg-card:       rgba(23, 32, 53, 0.8);
    --bg-card-hover: rgba(30, 44, 76, 0.9);
    --bg-glass:      rgba(255, 255, 255, 0.03);
    --bg-input:      rgba(18, 26, 44, 0.85);
    --bg-input-solid:#111827;
    --bg-scrollbar-thumb: rgba(255, 255, 255, 0.15);

    /* Border System - Sleek & Refined */
    --border:        rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.04);
    --border-blue:   rgba(56, 189, 248, 0.3);
    --border-orange: rgba(249, 115, 22, 0.25);
    --border-green:  rgba(16, 185, 129, 0.25);
    --border-bright: rgba(255, 255, 255, 0.12);

    /* Text System - Eye Comfort Soft Platinum Zinc (눈부심 방지 AAA 가독성) */
    --text-primary:  #e2e8f0;
    --text-secondary:#94a3b8;
    --text-muted:    #64748b;
    --text-bright:   #f8fafc;

    /* Shadows - High Depth Glass Glows */
    --shadow-sm:     0 2px 6px rgba(0, 0, 0, 0.35);
    --shadow-md:     0 8px 24px -4px rgba(0, 0, 0, 0.5);
    --shadow-lg:     0 20px 50px -10px rgba(0, 0, 0, 0.7);
    --shadow-blue:   0 0 20px rgba(30, 96, 255, 0.3);
    --shadow-orange: 0 0 20px rgba(249, 115, 22, 0.25);
    --shadow-green:  0 0 20px rgba(16, 185, 129, 0.25);

    /* Ambient Glow System */
    --glow-left:     rgba(30, 96, 255, 0.08);
    --glow-right:    rgba(56, 189, 248, 0.06);
    --glow-center:   rgba(0, 210, 255, 0.03);
    --glow-main-left: rgba(30, 96, 255, 0.05);
    --glow-main-right: rgba(56, 189, 248, 0.04);
}

/* ═══════════════════════════════════════════════════
   DYNAMIC CATEGORY ACCENTS
   ═══════════════════════════════════════════════════ */
/* 1) 그린 테마 (인사, 복무, 공무원, 공무직, 늘봄학교 등) */
[data-category-accent="인사"],
[data-category-accent="복무"],
[data-category-accent="공무원"],
[data-category-accent="공무직"],
[data-category-accent="늘봄학교"] {
    --accent-core:     var(--green-core);
    --accent-bright:   var(--green-core);
    --accent-glow:     var(--green-glow);
    --accent-gradient: var(--grad-green);
}

/* 2) 오렌지 테마 (예산, 지출, 세입, 시설적립금, 발전기금, 재산, 물품 등) */
[data-category-accent="예산"],
[data-category-accent="지출"],
[data-category-accent="세입"],
[data-category-accent="시설적립금"],
[data-category-accent="발전기금"],
[data-category-accent="재산"],
[data-category-accent="물품"] {
    --accent-core:     var(--orange-core);
    --accent-bright:   var(--orange-core);
    --accent-glow:     var(--orange-glow);
    --accent-gradient: var(--grad-orange);
}

/* 3) 퍼플 테마 (계약 등) */
[data-category-accent="계약"] {
    --accent-core:     var(--purple-core);
    --accent-bright:   var(--purple-core);
    --accent-glow:     var(--purple-glow);
    --accent-gradient: var(--grad-purple);
}

/* ═══════════════════════════════════════════════════
   GLOBAL RESET
   ═══════════════════════════════════════════════════ */
*, *::before, *::after {
    font-family: 'Pretendard', 'Inter', sans-serif;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    font-size: 105%;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    background-color: var(--bg-root);
    background-image:
        radial-gradient(ellipse at 20% 10%, var(--glow-left) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 90%, var(--glow-right) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, var(--glow-center) 0%, transparent 60%);
    color: var(--text-primary);
    display: flex;
    height: 100vh;
    transition: background-color 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), color 0.3s ease, border-color 0.3s ease;
}

/* ═══════════════════════════════════════════════════
   1. SIDEBAR — Deep Space Glass Panel
═══════════════════════════════════════════════════ */
aside {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 20;
    border-right: 1px solid var(--border);
    position: relative;
    transition: background-color 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.3s ease;
}

/* Ambient glow line on sidebar right edge */
aside::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    bottom: 20%;
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--accent-glow), transparent);
    transition: background 0.4s ease;
}

/* Logo Header */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: var(--header-h);
    padding: 0 18px;
    border-bottom: 1px solid var(--border-subtle);
    box-sizing: border-box;
}

.logo-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--accent-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.05rem;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 0 15px var(--accent-glow), var(--shadow-sm);
    flex-shrink: 0;
}

.logo-text h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-bright);
    line-height: 1.1;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
}

.sidebar-version-badge {
    font-size: 0.68rem !important;
    font-weight: 800 !important;
    font-family: 'Outfit', sans-serif !important;
    color: var(--blue-bright, #2563eb) !important;
    background: rgba(37, 99, 235, 0.08) !important;
    border: 1px solid rgba(37, 99, 235, 0.25) !important;
    padding: 1px 5px !important;
    border-radius: 10px !important;
    margin-left: 5px !important;
    vertical-align: middle !important;
    display: inline-block !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

[data-theme="dark"] .sidebar-version-badge {
    color: #60a5fa !important;
    background: rgba(59, 130, 246, 0.18) !important;
    border-color: rgba(96, 165, 250, 0.35) !important;
}

.logo-text span {
    font-family: 'Outfit', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--accent-bright);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 2px;
    display: block;
}

/* Tab Switcher */
.sidebar-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-subtle);
}

.tab-btn {
    padding: 6px 4px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    border: 1px solid var(--border);
    background: var(--bg-glass);
    color: var(--text-secondary);
    transition: var(--ease);
    letter-spacing: -0.02em;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.tab-btn:hover:not(.active) {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-bright);
}

.tab-btn.active {
    background: var(--accent-glow);
    color: var(--accent-bright);
    border-color: var(--accent-bright);
    box-shadow: none;
}

/* Sidebar Scroll Area */
.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 6px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-scroll::-webkit-scrollbar { width: 3px; }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.sidebar-scroll::-webkit-scrollbar-thumb {
    background: var(--bg-scrollbar-thumb);
    border-radius: 3px;
}

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

/* Auto Routing Button */
.btn-auto-routing {
    width: 100%;
    padding: 7px 10px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    text-align: center;
    border: 1px solid var(--border);
    background: var(--bg-glass);
    color: var(--text-secondary);
    transition: var(--ease);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-auto-routing.active {
    background: rgba(251, 146, 60, 0.08) !important;
    color: var(--orange-core) !important;
    border: 1.5px solid rgba(251, 146, 60, 0.25) !important;
    box-shadow: none !important;
}

.btn-auto-routing:hover:not(.active) {
    background: var(--bg-card-hover);
    border-color: var(--orange-core);
    color: var(--text-primary);
    box-shadow: 0 0 8px var(--orange-glow);
}

/* Category Chip Grid */
.category-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 6px;
}

.cat-btn {
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.86rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-glass);
    color: var(--text-secondary);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    transition: var(--ease);
    letter-spacing: -0.01em;
    line-height: 1.25;
    display: flex;
    align-items: center;
    min-height: 28px;
}

.cat-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--blue-core);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.cat-btn.active {
    background: var(--accent-glow);
    color: var(--accent-bright);
    border-color: var(--accent-bright);
    box-shadow: none;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 8px 12px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.opinion-board-card-btn {
    width: 100%;
    padding: 7px 10px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    transition: var(--ease);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.opinion-board-card-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-core);
}

.card-btn-header {
    display: flex;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    gap: 4px;
}

.card-btn-sub {
    font-size: 0.70rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: -0.02em;
    padding-left: 2px;
}

.manual-btn-footer {
    width: 100%;
    height: 38px;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    background: var(--bg-glass);
    border: 1px solid var(--accent-core);
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-bright);
    cursor: pointer;
    text-align: center;
    transition: var(--ease);
    letter-spacing: -0.01em;
    box-sizing: border-box;
}

.manual-btn-footer:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-core);
    color: var(--text-bright);
    box-shadow: var(--accent-glow);
}

.manual-btn-footer.active {
    background: var(--accent-glow);
    color: var(--accent-bright);
    border-color: var(--accent-bright);
    box-shadow: none;
}

.admin-link-btn {
    width: 100%;
    height: 38px;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: center;
    transition: var(--ease);
    letter-spacing: -0.01em;
    position: relative;
    box-sizing: border-box;
}

.admin-link-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-bright);
    color: var(--text-primary);
}

.admin-link-btn.logged-in::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 7px;
    height: 7px;
    background: var(--green-core);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--green-core);
    animation: pulse-green 2s ease-in-out infinite;
}

.disclaimer {
    font-size: 0.66rem;
    line-height: 1.3;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Lucide Icons Styling */
.lucide-icon, svg.lucide {
    width: 13px;
    height: 13px;
    stroke-width: 2px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 4px;
    margin-top: -1px;
}

/* ═══════════════════════════════════════════════════
   2. MAIN CONTENT AREA
═══════════════════════════════════════════════════ */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: var(--bg-main);
    background-image:
        radial-gradient(ellipse at 70% 20%, var(--glow-main-left) 0%, transparent 50%),
        radial-gradient(ellipse at 30% 80%, var(--glow-main-right) 0%, transparent 40%);
    transition: background-color 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 2-A. Header */
.main-header {
    height: var(--header-h);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: var(--bg-header);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 5;
    flex-shrink: 0;
    position: relative;
    box-sizing: border-box;
}

.header-left {
    display: flex;
    align-items: center;
    min-width: 40px;
}

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

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

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 6px var(--green-core); }
    50% { box-shadow: 0 0 14px var(--green-core), 0 0 24px rgba(16, 185, 129, 0.3); }
}

.active-mode-badge {
    padding: 3px 9px;
    border-radius: 30px;
    font-size: var(--font-xs);
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.active-mode-badge.badge-blue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--blue-bright);
    border: 1px solid var(--border-blue);
}

.active-mode-badge.badge-green {
    background: rgba(16, 185, 129, 0.12);
    color: var(--green-core);
    border: 1px solid var(--border-green);
}

.active-category-title {
    font-size: var(--font-lg);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.engine-badge {
    font-family: 'Outfit', sans-serif;
    font-size: var(--font-xs);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 30px;
}

.engine-badge.badge-blue {
    border: 1px solid var(--border-blue);
    color: var(--blue-bright);
    background: rgba(59, 130, 246, 0.08);
}

.engine-badge.badge-green {
    border: 1px solid var(--border-green);
    color: var(--green-core);
    background: rgba(16, 185, 129, 0.06);
}

/* Main Site Link Button & Header Opinion Board Button */
.main-site-btn,
.header-opinion-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-blue);
    border-radius: var(--radius-xl);
    font-size: var(--font-sm);
    font-weight: 700;
    color: var(--blue-bright);
    text-decoration: none;
    transition: var(--ease);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    white-space: nowrap;
    box-sizing: border-box;
}

.main-site-btn:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: var(--blue-core);
    color: var(--blue-bright);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px var(--blue-glow);
}

.header-opinion-btn {
    border-color: rgba(124, 58, 237, 0.3);
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.05);
}

.header-opinion-btn:hover {
    background: rgba(124, 58, 237, 0.12);
    border-color: #7c3aed;
    color: #7c3aed;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.15);
}

[data-theme="dark"] .header-opinion-btn {
    border-color: rgba(168, 85, 247, 0.45);
    color: #c7d2fe;
    background: rgba(168, 85, 247, 0.1);
}

[data-theme="dark"] .header-opinion-btn:hover {
    background: rgba(168, 85, 247, 0.22);
    border-color: #a78bfa;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.3);
}

/* Header Left: 질의응답수 뱃지 (글라스모피즘 & 톤온톤) */
.header-stat-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    font-size: var(--font-sm);
    color: var(--text-secondary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: var(--ease);
    cursor: default;
    user-select: none;
    white-space: nowrap;
    box-sizing: border-box;
}

.header-stat-badge:hover {
    border-color: var(--border-blue);
    background: rgba(59, 130, 246, 0.06);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.12);
}

.header-stat-badge .stat-badge-icon {
    width: 15px;
    height: 15px;
    color: var(--blue-core);
    margin-right: 6px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.header-stat-badge:hover .stat-badge-icon {
    transform: scale(1.1);
}

.header-stat-badge .stat-badge-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 6px;
    letter-spacing: -0.02em;
}

.header-stat-badge .stat-badge-value {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--blue-bright);
    font-family: 'Pretendard', 'Inter', sans-serif;
    letter-spacing: -0.01em;
}

[data-theme="dark"] .header-stat-badge {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(59, 130, 246, 0.25);
}

[data-theme="dark"] .header-stat-badge:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: var(--blue-core);
}

[data-theme="dark"] .header-stat-badge .stat-badge-value {
    color: #60a5fa;
}

.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    font-size: var(--font-sm);
    font-weight: 700;
    box-sizing: border-box;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--ease);
    white-space: nowrap;
}

.theme-toggle-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-bright);
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════
   2-B. MANUAL VIEWER — Full-Screen Fixed Overlay
═══════════════════════════════════════════════════ */
.manual-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none; /* JS로 flex 전환 */
    flex-direction: column;
    background: var(--bg-root);
    padding-left: var(--sidebar-width);
}

.manual-overlay.active {
    display: flex;
}

.manual-overlay-header {
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-header);
    backdrop-filter: blur(20px);
    flex-shrink: 0;
}

.manual-overlay-title {
    font-size: var(--font-lg);
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.manual-overlay-close {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: var(--font-sm);
    font-weight: 700;
    cursor: pointer;
    padding: 6px 14px;
    transition: var(--ease);
    display: flex;
    align-items: center;
    gap: 6px;
}

.manual-overlay-close:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-bright);
    color: var(--text-primary);
}

.manual-iframe-wrapper {
    flex: 1;
    overflow: hidden;
    background: #ffffff;
    margin: 20px 28px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg), var(--shadow-blue);
}

.manual-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ═══════════════════════════════════════════════════
   2-C. CHAT AREA
═══════════════════════════════════════════════════ */
.chat-viewport {
    flex: 1;
    overflow: hidden;
    width: 100%;
    position: relative;
}

.chat-container {
    height: 100%;
    overflow-y: auto;
    padding: 32px 28px 220px;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
}

.chat-container::-webkit-scrollbar { width: 4px; }
.chat-container::-webkit-scrollbar-track { background: transparent; }
.chat-container::-webkit-scrollbar-thumb {
    background: var(--bg-scrollbar-thumb);
    border-radius: 4px;
}

/* Chat Messages */
.chat-message {
    width: 100%;
    margin-bottom: 28px;
    display: flex;
    gap: 16px;
    animation: slideIn 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.chat-message.user {
    flex-direction: row-reverse;
}

/* Avatars */
.avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: var(--accent-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: var(--font-xs);
    font-family: 'Outfit', sans-serif;
    flex-shrink: 0;
    box-shadow: var(--accent-glow);
}

.chat-message.user .avatar {
    background: rgba(71, 85, 105, 0.8);
    box-shadow: var(--shadow-sm);
}

/* Message Bubbles */
.message-content {
    flex: 1;
    font-size: 1.03rem;
    line-height: 1.8;
    color: var(--text-primary);
    overflow-wrap: break-word;
    word-break: keep-all;
}

.chat-message.user .message-content {
    background: var(--bg-user-bubble);
    border: 1px solid var(--border);
    padding: 14px 22px;
    border-radius: var(--radius-md);
    max-width: 75%;
    width: auto;
    min-width: 140px;
    flex: 0 0 auto;
    color: var(--text-primary);
    word-break: normal;
    overflow-wrap: break-word;
    white-space: normal;
}

.chat-message.user .message-content p {
    margin: 0;
    line-height: 1.65;
    word-break: normal;
    overflow-wrap: break-word;
    white-space: normal;
}

[data-theme="dark"] .chat-message.user .message-content {
    background: rgba(30, 96, 255, 0.14);
    border-color: rgba(56, 189, 248, 0.28);
    color: #f8fafc;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
/* (max-width: 600px) user bubble override removed - handled by standard responsive rules */

/* AI message has a subtle left accent */
.chat-message.ai .message-content {
    border-left: 2.5px solid var(--accent-core);
    padding-left: 16px;
}

/* 📄 근거 지침 아랫줄 독립 뱃지 디자인 */
.citation-line {
    display: block;
    margin-top: 3px;
    margin-bottom: 4px;
}

.citation-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.22);
    border-radius: 6px;
    font-size: 0.81rem;
    color: #2563eb;
    font-weight: 500;
    line-height: 1.4;
    transition: all 0.2s ease;
    word-break: break-all;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .citation-badge {
    background: rgba(59, 130, 246, 0.14);
    border-color: rgba(96, 165, 250, 0.3);
    color: #93c5fd;
}

.citation-badge:hover {
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

.citation-badge.clickable-citation {
    cursor: pointer;
    user-select: none;
}

.citation-badge.clickable-citation:hover {
    background: rgba(37, 99, 235, 0.22) !important;
    border-color: rgba(37, 99, 235, 0.6) !important;
    color: #1d4ed8 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

[data-theme="dark"] .citation-badge.clickable-citation:hover {
    background: rgba(59, 130, 246, 0.32) !important;
    border-color: rgba(96, 165, 250, 0.7) !important;
    color: #bfdbfe !important;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

/* ═══════════════════════════════════════════════════
   2-D. WELCOME SCREEN
═══════════════════════════════════════════════════ */
.chat-container.welcome-mode,
.chat-container:has(.welcome-screen) {
    padding-top: 24px !important;
    padding-bottom: 140px !important;
    justify-content: flex-start !important;
    align-items: center;
}

.welcome-screen {
    text-align: center;
    margin: 0 auto;
    padding: 0 0 20px;
    animation: slideIn 0.5s ease-out forwards;
    flex-shrink: 0;
    width: 100%;
}

.welcome-logo {
    font-family: 'Outfit', sans-serif;
    font-size: var(--font-xxl);
    font-weight: 900;
    background: var(--grad-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    letter-spacing: -0.03em;
    animation: shimmer 4s ease-in-out infinite;
    background-size: 200% auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.welcome-version {
    font-size: 0.9rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: #2563eb !important;
    background: rgba(37, 99, 235, 0.08) !important;
    border: 1.5px solid rgba(37, 99, 235, 0.28) !important;
    padding: 2px 10px;
    border-radius: 20px;
    margin-left: 10px;
    vertical-align: middle;
    display: inline-block;
    letter-spacing: 0.03em;
    -webkit-text-fill-color: #2563eb !important;
    -webkit-background-clip: border-box !important;
    background-clip: border-box !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

[data-theme="dark"] .welcome-version {
    color: #60a5fa !important;
    -webkit-text-fill-color: #60a5fa !important;
    background: rgba(59, 130, 246, 0.18) !important;
    border-color: rgba(96, 165, 250, 0.35) !important;
}

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

.welcome-screen h3 {
    font-size: var(--font-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.welcome-screen p {
    font-size: var(--font-base);
    color: var(--text-secondary);
    margin-bottom: 36px;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
    word-break: keep-all;
}

/* 모바일 전용: 입력창 안내 힌트 */
.welcome-mobile-hint {
    font-size: var(--font-base) !important;
    color: var(--accent-bright) !important;
    margin-bottom: 0 !important;
    padding: 14px 24px;
    background: var(--accent-glow);
    border: 1px solid var(--accent-core);
    border-radius: var(--radius-lg);
    display: inline-block;
    animation: pulse-glow 2.5s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 transparent; }
    50%       { box-shadow: 0 0 16px var(--accent-glow); }
}

@media (max-width: 768px) {
    /* === Mobile 3-Tab Segment Selector === */
    .mobile-tabs-bar {
        display: flex !important;
        align-items: center;
        gap: 6px;
        padding: 8px 12px;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border);
        flex-shrink: 0;
        z-index: 10;
        box-shadow: 0 1px 4px rgba(0,0,0,0.03);
    }
    .mobile-tab-btn {
        flex: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        padding: 7px 4px;
        font-size: 0.82rem;
        font-weight: 700;
        border-radius: 8px;
        border: 1px solid var(--border);
        background: var(--bg-main);
        color: var(--text-muted);
        cursor: pointer;
        transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
        white-space: nowrap;
    }
    .mobile-tab-btn .lucide-icon {
        width: 14px;
        height: 14px;
    }
    .mobile-tab-btn.active {
        background: var(--blue-core) !important;
        color: #ffffff !important;
        border-color: var(--blue-core) !important;
        box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
    }
    #mobile-tab-laws.active {
        background: var(--green-core) !important;
        border-color: var(--green-core) !important;
        box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
    }
    #mobile-tab-edufine.active {
        background: #ea580c !important;
        border-color: #ea580c !important;
        box-shadow: 0 2px 6px rgba(234, 88, 12, 0.25);
    }

    
    /* Header and Hamburger: Clean non-overlapping sticky bars */
    .main-header {
        position: sticky !important;
        top: 0 !important;
        z-index: 150 !important;
        height: 48px !important;
        padding: 0 10px 0 50px !important;
        background: var(--bg-header) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
    }
    .sidebar-toggle {
        top: 5px !important;
        left: 8px !important;
        width: 38px !important;
        height: 38px !important;
        font-size: 1.1rem !important;
        z-index: 160 !important;
    }
    .mobile-tabs-bar {
        position: sticky !important;
        top: 48px !important;
        z-index: 140 !important;
    }

    /* === Main Header: Clean Single-Bar on Mobile === */
    .main-header {
        padding: 0 10px 0 52px !important;
        height: 48px !important;
    }
    .header-center {
        position: static !important;
        transform: none !important;
        display: flex !important;
        align-items: center !important;
        margin-left: 6px !important;
        margin-right: auto !important;
    }
    .main-site-btn {
        height: 32px !important;
        min-width: 32px !important;
        padding: 5px 8px !important;
        justify-content: center !important;
        border-radius: var(--radius-md) !important;
    }
    .main-site-btn .lucide-icon {
        margin-right: 0 !important;
        width: 16px !important;
        height: 16px !important;
    }
    .header-right {
        gap: 4px !important;
    }
    .header-right .theme-toggle-btn {
        padding: 5px 7px !important;
        min-width: 32px !important;
        height: 32px !important;
        justify-content: center !important;
    }
    .header-btn-label {
        display: none !important;
    }
    .header-right .theme-toggle-btn .lucide-icon {
        margin-right: 0 !important;
        width: 16px !important;
        height: 16px !important;
    }
    .mobile-new-chat-btn {
        display: inline-flex !important;
        background: var(--accent-gradient) !important;
        color: white !important;
        border-color: transparent !important;
    }

    .welcome-screen {
        padding: 12px 0 8px;
        margin: 0;
    }
    .welcome-logo { font-size: 2.0rem; margin-bottom: 4px; }
    .welcome-screen h3 { font-size: 0.98rem; margin-bottom: 14px; }
}


.welcome-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
}

@media (max-width: 680px) {
    .welcome-grid { grid-template-columns: 1fr; }
}

.welcome-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    text-align: left;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

[data-theme="dark"] .welcome-card {
    background: rgba(18, 26, 44, 0.75);
    border-color: rgba(255, 255, 255, 0.07);
}

.welcome-card:hover {
    border-color: var(--blue-bright);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -4px rgba(0, 0, 0, 0.4), 0 0 16px var(--blue-glow);
}

[data-theme="dark"] .welcome-card:hover {
    background: rgba(30, 44, 76, 0.9);
    border-color: rgba(56, 189, 248, 0.4);
}

.file-download-card {
    border: 1.5px solid rgba(139, 92, 246, 0.28) !important;
}

.file-download-card:hover {
    border-color: #7c3aed !important;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.2) !important;
}

.ref-card-premium {
    border: 1.5px solid rgba(59, 130, 246, 0.25) !important;
    transition: all 0.25s ease !important;
}

.ref-card-premium:hover {
    border-color: #2563eb !important;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.16) !important;
    transform: translateY(-2px);
}

.welcome-card h4 {
    font-size: var(--font-md);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.welcome-card h4 i {
    color: var(--blue-core);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.08);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.welcome-card:hover h4 i {
    background: var(--blue-core);
    color: #ffffff;
    transform: scale(1.08);
}

[data-theme="dark"] .welcome-card h4 i {
    color: var(--blue-bright);
    background: rgba(56, 189, 248, 0.12);
}

[data-theme="dark"] .welcome-card:hover h4 i {
    background: var(--blue-bright);
    color: #0a0e17;
}

.welcome-card p {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.55;
    position: relative;
    word-break: keep-all;
}

/* Welcome screen list items */
.welcome-screen ul {
    list-style: none;
    padding: 0;
    max-width: 500px;
    margin: 0 auto 32px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.welcome-screen li {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    background: var(--bg-card);
    padding: 8px 18px;
    border-radius: 30px;
    border: 1px solid var(--border);
    display: inline-block;
}

/* ═══════════════════════════════════════════════════
   2-E. BOTTOM INPUT BAR
═══════════════════════════════════════════════════ */
.bottom-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, var(--bg-main) 70%, transparent 100%);
    padding: 16px 24px 28px;
    z-index: 4;
}

.bottom-bar-wrapper {
    max-width: 1800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

/* Quick Category Chips */
.quick-chip-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    justify-content: center;
}

.quick-chip-btn {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 5px 13px;
    border-radius: 30px;
    font-size: var(--font-sm);
    font-weight: 700;
    cursor: pointer;
    transition: var(--ease);
    letter-spacing: -0.01em;
}

.quick-chip-btn:hover {
    border-color: var(--accent-core);
    color: var(--accent-bright);
    background: var(--accent-glow);
}

/* Input Form — Dark Glass Capsule */
.chat-form {
    position: relative;
    border-radius: 28px;
    border: 1.5px solid var(--border);
    background: var(--bg-input);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    transition: var(--ease);
    display: flex;
    align-items: center;
    padding: 12px 18px;
    gap: 10px;
}

[data-theme="dark"] .chat-form {
    background: rgba(18, 26, 44, 0.88);
    border-color: rgba(56, 189, 248, 0.3);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 16px rgba(30, 96, 255, 0.15);
}

.chat-form:focus-within {
    border-color: var(--blue-bright) !important;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.55), 0 0 24px rgba(56, 189, 248, 0.35) !important;
}

[data-theme="dark"] .chat-form:focus-within {
    background: rgba(22, 32, 54, 0.95);
}

.chat-form textarea {
    flex: 1;
    border: none;
    outline: none;
    font-size: var(--font-base);
    color: var(--text-primary);
    background: transparent;
    resize: none;
    height: 26px;
    line-height: 26px;
    caret-color: var(--blue-bright);
    ime-mode: active;
    -webkit-ime-mode: active;
}

.chat-form textarea::placeholder {
    color: var(--text-muted);
}

.send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--grad-blue);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--ease);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(30, 96, 255, 0.35);
}

.send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 18px rgba(30, 96, 255, 0.55);
    filter: brightness(1.1);
}

/* AI Streaming Typing Cursor */
.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 17px;
    background-color: var(--accent-core);
    margin-left: 4px;
    vertical-align: middle;
    animation: typing-blink 0.8s step-end infinite;
}

@keyframes typing-blink {
    from, to { background-color: transparent }
    50% { background-color: var(--accent-core) }
}

/* ═══════════════════════════════════════════════════
   3. REFERENCE CARDS (출처 카드)
═══════════════════════════════════════════════════ */
.ref-section-premium {
    margin-top: 14px;
    border-top: 1px solid var(--border-subtle);
    padding-top: 10px;
    width: 100%;
}

/* ─── Reference Section & Download Section (콜아웃 카드형 디자인 통일) ─── */
.ref-section-premium,
.dl-section-premium {
    margin-top: 8px;
    margin-bottom: 0px;
    border-radius: 12px;
    padding: 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

/* 참고 지침 원문 확인 (인디고/퍼플 톤) */
.ref-section-premium {
    background: linear-gradient(135deg, rgba(238, 242, 255, 0.65) 0%, rgba(224, 231, 255, 0.4) 100%);
    border: 1.5px solid rgba(99, 102, 241, 0.35);
    border-left: 5px solid #6366f1;
}

[data-theme="dark"] .ref-section-premium {
    background: linear-gradient(135deg, rgba(49, 46, 129, 0.28) 0%, rgba(67, 56, 202, 0.2) 100%);
    border-color: rgba(129, 140, 248, 0.4);
    border-left-color: #818cf8;
}

/* 공식 지침서 다운로드 (에메랄드/그린 톤) */
.dl-section-premium {
    background: linear-gradient(135deg, rgba(236, 253, 245, 0.65) 0%, rgba(209, 250, 229, 0.4) 100%);
    border: 1.5px solid rgba(16, 185, 129, 0.35);
    border-left: 5px solid #10b981;
}

[data-theme="dark"] .dl-section-premium {
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.28) 0%, rgba(4, 120, 87, 0.2) 100%);
    border-color: rgba(52, 211, 153, 0.4);
    border-left-color: #34d399;
}

.ref-section-title-premium,
.dl-section-title-premium {
    font-size: 1.0rem;
    font-weight: 800;
    margin-bottom: 0px;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s ease;
}

.ref-section-title-premium {
    color: #4338ca;
}

[data-theme="dark"] .ref-section-title-premium {
    color: #a5b4fc;
}

.dl-section-title-premium {
    color: #047857;
}

[data-theme="dark"] .dl-section-title-premium {
    color: #6ee7b7;
}

.ref-section-title-premium:hover,
.dl-section-title-premium:hover {
    opacity: 0.82;
}

.ref-section-title-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ref-count-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    background: rgba(99, 102, 241, 0.15);
    color: #4f46e5;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 10px;
    margin-left: 2px;
}

.dl-section-premium .ref-count-badge {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

[data-theme="dark"] .ref-count-badge {
    background: rgba(129, 140, 248, 0.2);
    color: #c7d2fe;
}

[data-theme="dark"] .dl-section-premium .ref-count-badge {
    background: rgba(52, 211, 153, 0.2);
    color: #a7f3d0;
}

.ref-grid-premium,
.dl-grid-premium {
    display: none;
    padding: 0 16px 16px 16px;
    animation: fadeIn 0.25s ease;
}

.ref-section-premium.is-open .ref-grid-premium {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
}

.dl-section-premium.is-open .dl-grid-premium {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

@media (max-width: 900px) { .ref-grid-premium { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .ref-grid-premium { grid-template-columns: 1fr; } }

.ref-card-premium {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.22s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.22s ease, box-shadow 0.22s ease;
    cursor: pointer;
    min-width: 0;
    box-shadow: var(--shadow-sm);
}

.ref-card-premium:hover {
    border-color: var(--accent-core);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.ref-icon-premium {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: rgba(59, 130, 246, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: var(--font-xs);
}

.ref-info-premium { flex: 1; min-width: 0; }

.ref-title-premium {
    font-size: var(--font-md);
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.ref-score-premium {
    font-size: var(--font-xs);
    color: var(--text-muted);
    margin-top: 1px;
}

/* ═══════════════════════════════════════════════════
   3-B. DOWNLOAD LINKS SECTION (답변 관련 지침서 다운로드)
═══════════════════════════════════════════════════ */
.dl-section {
    margin-top: 14px;
    border-top: 1px solid var(--border-subtle);
    padding-top: 12px;
    width: 100%;
}

.dl-section-title {
    font-size: var(--font-xs);
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.dl-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.dl-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 13px 5px 10px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 30px;
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--ease);
    white-space: nowrap;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.dl-chip:hover {
    border-color: var(--accent-core);
    color: var(--accent-bright);
    background: var(--accent-glow);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.dl-chip-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* 📥 Premium File Download Card Grid */
.dl-section-premium {
    margin-top: 14px;
    margin-bottom: 12px;
    border-top: 1px dashed var(--border);
    padding-top: 10px;
    width: 100%;
}

.dl-section-title-premium {
    font-size: var(--font-xs);
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    letter-spacing: 0.02em;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    background: rgba(15, 23, 42, 0.02);
}

.dl-section-title-premium:hover {
    background: rgba(15, 23, 42, 0.05);
    color: var(--text-primary);
}

[data-theme="dark"] .dl-section-title-premium {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .dl-section-title-premium:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #f8fafc;
}

.dl-grid-premium {
    display: none;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
    animation: fadeIn 0.25s ease;
}

.dl-section-premium.is-open .dl-grid-premium {
    display: grid;
}

@media (max-width: 768px) {
    .dl-grid-premium {
        grid-template-columns: 1fr;
    }
}

.dl-card-premium {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(37, 99, 235, 0.1) 100%);
    border: 1.5px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none !important;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.06);
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .dl-card-premium {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.22) 0%, rgba(37, 99, 235, 0.16) 100%);
    border-color: rgba(96, 165, 250, 0.35);
}

.dl-card-premium:hover {
    border-color: #2563eb !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.22) !important;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(37, 99, 235, 0.18) 100%);
}

.dl-card-icon-premium {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--accent-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.dl-card-info-premium {
    flex: 1;
    min-width: 0;
}

.dl-card-title-premium {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.dl-card-sub-premium {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.dl-card-action-premium {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(37, 99, 235, 0.3);
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #2563eb;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

[data-theme="dark"] .dl-card-action-premium {
    background: rgba(59, 130, 246, 0.22);
    border-color: rgba(96, 165, 250, 0.4);
    color: #93c5fd;
}

.dl-card-premium:hover .dl-card-action-premium {
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

/* ═══════════════════════════════════════════════════
   3-C. ADMINISTRATIVE FORMS SECTION (관련 행정 서식 안내 카드)
═══════════════════════════════════════════════════ */
.forms-section-premium {
    margin-top: 14px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.04) 0%, rgba(14, 165, 233, 0.08) 100%);
    border: 1.5px solid rgba(2, 132, 199, 0.28);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.06);
    width: 100%;
}

[data-theme="dark"] .forms-section-premium {
    background: linear-gradient(135deg, rgba(12, 74, 110, 0.25) 0%, rgba(3, 105, 161, 0.18) 100%);
    border-color: rgba(56, 189, 248, 0.35);
}

.forms-header-premium {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(2, 132, 199, 0.15);
}

.forms-title-left {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-xs);
    font-weight: 700;
    color: var(--primary, #0284c7);
    letter-spacing: 0.02em;
}

.forms-count-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    background: rgba(2, 132, 199, 0.15);
    color: var(--primary, #0284c7);
}

.forms-grid-premium {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 10px;
}

.form-card-item {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(2, 132, 199, 0.2);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .form-card-item {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(56, 189, 248, 0.25);
}

.form-card-item:hover {
    border-color: var(--primary, #0284c7);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15);
}

.form-card-top {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.form-badge-no {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 1px 6px;
    background: rgba(2, 132, 199, 0.12);
    color: #0284c7;
    border-radius: 4px;
    border: 1px solid rgba(2, 132, 199, 0.25);
}

[data-theme="dark"] .form-badge-no {
    background: rgba(56, 189, 248, 0.18);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.35);
}

.form-card-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.form-card-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 3px;
}

.form-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.form-btn-view, .form-btn-download {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 700;
    text-decoration: none !important;
    transition: all 0.18s ease;
    cursor: pointer;
    text-align: center;
}

.form-btn-view {
    background: rgba(2, 132, 199, 0.1);
    border: 1px solid rgba(2, 132, 199, 0.3);
    color: #0284c7;
}

.form-btn-view:hover {
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}

.form-btn-download {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #059669;
}

.form-btn-download:hover {
    background: #10b981;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

[data-theme="dark"] .form-btn-view {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.35);
    color: #38bdf8;
}

[data-theme="dark"] .form-btn-download {
    background: rgba(52, 211, 153, 0.15);
    border-color: rgba(52, 211, 153, 0.35);
    color: #34d399;
}

/* ═══════════════════════════════════════════════════
   4. FEEDBACK & RECOMMENDATIONS
═══════════════════════════════════════════════════ */
.feedback-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.feedback-btn {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    font-size: var(--font-xs);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.feedback-btn:hover {
    border-color: var(--border-blue);
    color: var(--blue-bright);
    background: rgba(59, 130, 246, 0.08);
}

.feedback-registered-text {
    font-size: var(--font-xs);
    color: var(--green-core);
    font-weight: 700;
    margin-top: 12px;
}

.feedback-comment-form {
    margin-top: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 14px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 460px;
}

.feedback-comment-form input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--font-sm);
    outline: none;
    background: var(--bg-glass);
    color: var(--text-primary);
}

.feedback-comment-form input:focus {
    border-color: var(--border-blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.feedback-comment-form button {
    align-self: flex-end;
    padding: 7px 14px;
    background: var(--grad-blue);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: var(--font-xs);
    font-weight: 700;
    cursor: pointer;
}

/* Recommendations (필요 시 display: block으로 원복 가능) */
.recommendations-section { 
    display: none !important; 
    margin-top: 16px; 
}

.recommendations-title {
    font-size: var(--font-xs);
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.recommendations-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rec-btn {
    background: var(--bg-glass);
    color: var(--blue-bright);
    border: 1px solid var(--border-blue);
    border-radius: 30px;
    padding: 7px 14px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--ease);
}

.rec-btn:hover {
    background: var(--grad-blue);
    color: white;
    border-color: transparent;
    transform: translateY(-1.5px);
    box-shadow: var(--shadow-blue);
}

/* ═══════════════════════════════════════════════════
   4-1. SMART CLARIFICATION CHIPS (3-Track 스마트 칩)
═══════════════════════════════════════════════════ */
.smart-chips-container {
    margin-top: 14px;
    margin-bottom: 4px;
    padding: 12px 14px;
    background: rgba(37, 99, 235, 0.05);
    border: 1px dashed rgba(56, 189, 248, 0.35);
    border-radius: 12px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeInSlideUp 0.25s ease-out;
}

[data-theme="dark"] .smart-chips-container {
    background: rgba(30, 58, 138, 0.18);
    border-color: rgba(56, 189, 248, 0.3);
}

.smart-chips-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: -0.01em;
}

.smart-chips-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.smart-chip-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    color: var(--blue-core, #2563eb);
    border: 1px solid rgba(37, 99, 235, 0.28);
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 0.83rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    word-break: keep-all;
    line-height: 1.4;
}

[data-theme="dark"] .smart-chip-btn {
    background: rgba(15, 23, 42, 0.7);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.32);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.smart-chip-btn:hover {
    background: var(--blue-core, #2563eb);
    color: #ffffff;
    border-color: transparent;
    transform: translateY(-1.5px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

[data-theme="dark"] .smart-chip-btn:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #38bdf8;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.45);
}

.smart-chip-btn:active {
    transform: translateY(0);
}

@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════════════
   5. AUTOCOMPLETE DROPDOWN
═══════════════════════════════════════════════════ */
.autocomplete-dropdown {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 10px;
    width: 320px;
    max-height: 260px;
    overflow-y: auto;
    background: var(--bg-dropdown);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg), var(--shadow-blue);
    z-index: 999;
    display: none;
    padding: 8px 0;
}

.autocomplete-item {
    padding: 9px 16px;
    cursor: pointer;
    font-size: var(--font-sm);
    color: var(--text-primary);
    font-weight: 500;
    transition: var(--ease);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue-bright);
}

.autocomplete-item .shortcut {
    font-size: var(--font-xs);
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════
   6. MODAL (출처 원문 팝업)
═══════════════════════════════════════════════════ */
.premium-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.premium-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.premium-modal-window {
    background: var(--bg-modal);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 660px;
    max-height: 80vh;
    box-shadow: var(--shadow-lg), var(--shadow-blue);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.premium-modal-overlay.active .premium-modal-window {
    transform: scale(1);
}

.premium-modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.premium-modal-title {
    font-size: var(--font-lg);
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.premium-modal-close {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 1.4rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--ease);
    padding: 0 6px;
    line-height: 1.2;
}

.premium-modal-close:hover {
    color: var(--text-primary);
    transform: rotate(90deg);
    border-color: var(--border-bright);
}

.premium-modal-body {
    padding: 24px;
    overflow-y: auto;
    font-size: var(--font-base);
    line-height: 1.75;
    color: var(--text-secondary);
}

.premium-modal-body::-webkit-scrollbar { width: 4px; }
.premium-modal-body::-webkit-scrollbar-thumb {
    background: var(--bg-scrollbar-thumb);
    border-radius: 4px;
}

.premium-modal-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
}

.premium-modal-footer-btn {
    background: var(--grad-blue);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-size: var(--font-sm);
    font-weight: 700;
    cursor: pointer;
    transition: var(--ease);
    box-shadow: var(--shadow-blue);
}

.premium-modal-footer-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════
   7. LOADING & BADGE EXTRAS
═══════════════════════════════════════════════════ */
.loading-bubble {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    padding-left: 4px;
}

.loading-dot {
    width: 6px;
    height: 6px;
    background: var(--blue-core);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
    box-shadow: 0 0 6px var(--blue-core);
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0.4); opacity: 0.4; }
    40% { transform: scale(1.0); opacity: 1; }
}

/* Badge extras */
.badge-info, .badge-route, .badge-slash {
    font-size: var(--font-xs);
    font-weight: 700;
}

.badge-fallback {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(245, 158, 11, 0.08); /* Soft amber glow */
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 12px;
    font-size: var(--font-xs);
    font-weight: 600;
    color: #d97706; /* Amber-600 */
    margin-top: 4px;
    margin-bottom: 12px;
    width: fit-content;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

/* Dark theme overrides for fallback badge */
[data-theme="dark"] .badge-fallback {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
    color: #fbbf24; /* Amber-400 */
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.1);
}

/* 1초 핵심 결론 신호등 컬러 뱃지 (Traffic-light status badges) */
.badge-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1.4;
    vertical-align: middle;
    margin: 0 2px;
}
.badge-status-green {
    background-color: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.badge-status-red {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.badge-status-amber {
    background-color: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}
.badge-status-blue {
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

[data-theme="dark"] .badge-status-green {
    background-color: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.4);
}
[data-theme="dark"] .badge-status-red {
    background-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.4);
}
[data-theme="dark"] .badge-status-amber {
    background-color: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.4);
}
[data-theme="dark"] .badge-status-blue {
    background-color: rgba(14, 165, 233, 0.2);
    color: #38bdf8;
    border-color: rgba(14, 165, 233, 0.4);
}

/* ═══════════════════════════════════════════════════
   MOBILE RESPONSIVE (< 768px)
═══════════════════════════════════════════════════ */

/* Hamburger toggle button (hidden on desktop) */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 200;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 1.2rem;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: var(--ease);
}
.sidebar-toggle:hover {
    border-color: var(--border-blue);
    color: var(--blue-bright);
}

/* Sidebar overlay backdrop (mobile) */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}
.sidebar-backdrop.active { display: block; }

@media (max-width: 768px) {
    :root {
        --font-xxl: 2.0rem;
        --font-xl:  1.1rem;
        --font-lg:  1.0rem;
        --font-base: 0.95rem;
        --font-md:  0.875rem;
        --font-sm:  0.82rem;
        --font-xs:  0.74rem;
    }

    /* Body: single column, sidebar off-canvas */
    body {
        flex-direction: column;
        overflow: hidden;
    }

    /* Hamburger visible */
    .sidebar-toggle { display: flex; }

    /* Sidebar: off-canvas slide */
    aside {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 30;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    }
    aside.sidebar-open {
        transform: translateX(0);
        box-shadow: 4px 0 32px rgba(0,0,0,0.6);
    }

    /* Main: full width */
    main {
        flex: 1;
        width: 100%;
        height: 100vh;
        padding-top: 0;
    }

    /* Header: leave room for hamburger */
    .main-header {
        padding: 14px 16px 14px 62px;
    }

    /* Chat container: No horizontal scroll, tight padding, bottom reserved 105px */
    .chat-container {
        padding: 8px 10px 105px !important;
        overflow-x: hidden !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Chat message: compact spacing */
    .chat-message {
        gap: 10px !important;
        margin-bottom: 20px !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Avatars on mobile: slim 26px to recover 30px+ horizontal space */
    .chat-message .avatar {
        width: 26px !important;
        height: 26px !important;
        font-size: 0.7rem !important;
        border-radius: 6px !important;
        flex-shrink: 0 !important;
    }

    /* Message content: strict width enclosure & optimal typography */
    .message-content {
        min-width: 0 !important;
        max-width: 100% !important;
        font-size: 0.91rem !important; /* ~14.5px gold standard */
        line-height: 1.65 !important;
        word-break: keep-all !important;
        overflow-wrap: break-word !important;
        box-sizing: border-box !important;
    }

    /* User Question Message: Wide, spacious horizontal bubble like KakaoTalk/Telegram */
    .chat-message.user {
        display: flex !important;
        flex-direction: row !important;
        justify-content: flex-end !important;
        align-items: flex-start !important;
        gap: 8px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin-bottom: 14px !important;
        overflow: visible !important;
    }
    .chat-message.user .avatar {
        order: 2 !important;
        width: 24px !important;
        height: 24px !important;
        font-size: 0.68rem !important;
        border-radius: 6px !important;
        flex-shrink: 0 !important;
        margin-top: 2px !important;
    }
    .chat-message.user .message-content {
        order: 1 !important;
        display: inline-block !important;
        width: auto !important;
        min-width: 140px !important;
        max-width: calc(100% - 36px) !important;
        padding: 10px 16px !important;
        border-radius: 18px 4px 18px 18px !important;
        line-height: 1.5 !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
        white-space: normal !important;
        box-sizing: border-box !important;
        text-align: left !important;
        flex: 0 0 auto !important;
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
    }
    .chat-message.user .message-content p {
        margin: 0 !important;
        display: inline !important;
        line-height: 1.5 !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
        white-space: normal !important;
    }

    /* Assistant message bubble */
    .chat-message.assistant .message-content,
    .chat-message.ai .message-content {
        min-width: 0 !important;
        max-width: 100% !important;
        padding-left: 10px !important;
        border-left-width: 2px !important;
    }

    /* Markdown Table: isolated inside table-wrapper without expanding chat width */
    .table-wrapper-premium {
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        margin: 8px 0 !important;
        box-sizing: border-box !important;
        display: block !important;
    }

    .markdown-table-premium {
        font-size: 0.78rem !important;
    }

    .markdown-table-premium th,
    .markdown-table-premium td {
        padding: 7px 9px !important;
    }

    /* Citation badge: prevent horizontal overflow */
    .citation-badge {
        max-width: 100% !important;
        white-space: normal !important;
        word-break: break-all !important;
        font-size: 0.74rem !important;
        padding: 2px 6px !important;
        line-height: 1.35 !important;
    }

    /* Instant tip and step status */
    .step-status-instant,
    .instant-tip-box {
        max-width: 100% !important;
        box-sizing: border-box !important;
        word-break: break-word !important;
    }
    .instant-tip-box {
        padding: 5px 8px !important;
        font-size: 0.76rem !important;
    }

    /* Bottom bar: solid docked to bottom with safe-area */
    .bottom-bar {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        padding: 8px 12px max(8px, env(safe-area-inset-bottom)) !important;
        background: var(--bg-main) !important;
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-top: 1px solid var(--border);
        z-index: 20;
    }
    .bottom-bar-wrapper {
        max-width: 100%;
    }

    /* Chat form: slightly smaller */
    .chat-form {
        padding: 11px 14px;
        border-radius: 22px;
    }
    .chat-form textarea {
        font-size: var(--font-base);
        height: 24px;
        line-height: 24px;
    }

    /* Quick chips: Hide on mobile to secure vertical space */
    .quick-chip-container {
        display: none !important;
    }
    .quick-chip-container::-webkit-scrollbar { display: none; }
    .quick-chip-btn { flex-shrink: 0; }

    /* Welcome screen: ultra-compact 2-column grid */
    .welcome-screen {
        padding: 8px 0 4px !important;
        margin: 0 !important;
    }
    .welcome-header {
        margin-bottom: 4px !important;
    }
    .welcome-logo { font-size: 1.75rem !important; margin-bottom: 2px !important; }
    .welcome-subtitle { font-size: 1.05rem !important; margin-bottom: 2px !important; }
    .welcome-desc { font-size: 0.78rem !important; margin-bottom: 10px !important; line-height: 1.35 !important; }
    .welcome-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        max-width: 100% !important;
    }
    .welcome-card {
        padding: 9px 10px !important;
        border-radius: 10px !important;
    }
    .welcome-card h4 {
        font-size: 0.8rem !important;
        margin-bottom: 2px !important;
        display: flex;
        align-items: center;
        gap: 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .welcome-card h4 .lucide-icon {
        width: 13px !important;
        height: 13px !important;
        flex-shrink: 0;
    }
    .welcome-card p {
        font-size: 0.68rem !important;
        line-height: 1.25 !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin: 0 !important;
    }

    /* User message: wider on mobile - handled specifically in .chat-message.user */

    /* Manual overlay: no sidebar offset */
    .manual-overlay { padding-left: 0; }

    /* Send button: bigger tap target */
    .send-btn { padding: 6px 10px; }

    /* Ref cards: 1 column */
    .ref-grid-premium { grid-template-columns: 1fr; }

    /* Modal: full screen on mobile */
    .premium-modal-box {
        max-width: 100% !important;
        max-height: 90vh !important;
        margin: auto 8px 0;
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
    }
    .premium-modal-overlay {
        align-items: flex-end !important;
    }

    /* Admin link smaller */
    .admin-link-btn { font-size: var(--font-xs); padding: 8px 10px; }
}

@media (max-width: 480px) {
    :root {
        --font-xxl: 1.8rem;
        --font-xl:  1.0rem;
        --font-lg:  0.9rem;
        --font-base: 0.92rem;
        --font-md:  0.85rem;
        --font-sm:  0.78rem;
        --font-xs:  0.7rem;
    }
    .active-category-title { font-size: var(--font-lg); }
    .engine-badge { display: none; }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── FAQ 등록 모달 전용 폼 스타일 ── */
.premium-modal-window .form-group {
    margin-bottom: 16px;
    text-align: left;
}

.premium-modal-window .form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.premium-modal-window .form-group input,
.premium-modal-window .form-group select,
.premium-modal-window .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    outline: none;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: var(--ease);
    font-family: inherit;
}

.premium-modal-window .form-group input::placeholder,
.premium-modal-window .form-group textarea::placeholder {
    color: var(--text-muted);
}

.premium-modal-window .form-group select option {
    background: var(--bg-main);
    color: var(--text-primary);
}

.premium-modal-window .form-group input:focus,
.premium-modal-window .form-group select:focus,
.premium-modal-window .form-group textarea:focus {
    border-color: var(--border-blue);
    background: rgba(59, 130, 246, 0.05);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* Dark mode specific visibility overrides inside premium modals */
[data-theme="dark"] .premium-modal-window .form-group input,
[data-theme="dark"] .premium-modal-window .form-group select,
[data-theme="dark"] .premium-modal-window .form-group textarea {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .premium-modal-window .form-group input::placeholder,
[data-theme="dark"] .premium-modal-window .form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.45) !important;
}

[data-theme="dark"] .premium-modal-window .form-group label {
    color: rgba(255, 255, 255, 0.85) !important;
}

[data-theme="dark"] .premium-modal-window .form-group input:focus,
[data-theme="dark"] .premium-modal-window .form-group select:focus,
[data-theme="dark"] .premium-modal-window .form-group textarea:focus {
    border-color: #60a5fa !important;
    background: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.3) !important;
}

.premium-modal-window .btn-submit {
    background: var(--grad-blue);
    color: white;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: var(--ease);
    box-shadow: var(--shadow-blue);
}

.premium-modal-window .btn-submit:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

/* ── 테마 토글 버튼 ── */
.theme-toggle-btn {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 7px 14px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: -0.01em;
    user-select: none;
}

.theme-toggle-btn:hover {
    border-color: var(--border-blue);
    background: rgba(59, 130, 246, 0.08);
    color: var(--blue-bright);
    box-shadow: var(--shadow-blue);
    transform: translateY(-1px);
}

.theme-toggle-btn:active {
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════════
   8. RIGHT SIDEBAR — Conversation History Storage
   ═══════════════════════════════════════════════════ */
.right-sidebar {
    width: 300px;
    background: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 20;
    border-left: 1px solid var(--border);
    border-right: none;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), width 0.3s ease, border-color 0.3s ease;
    overflow: hidden;
}

.right-sidebar.collapsed {
    width: 0;
    border-left-color: transparent;
}

.right-sidebar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--blue-glow), transparent);
}

/* Header */
.right-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 20px 16px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.right-sidebar-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-bright);
    letter-spacing: -0.01em;
}

.new-chat-btn {
    background: var(--bg-glass);
    border: 1px solid var(--border-blue);
    border-radius: var(--radius-sm);
    color: var(--blue-bright);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    padding: 5px 10px;
    transition: var(--ease);
    letter-spacing: -0.01em;
}

.new-chat-btn:hover {
    background: var(--grad-blue);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-blue);
}

/* Scroll Area */
.right-sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.right-sidebar-scroll::-webkit-scrollbar { width: 4px; }
.right-sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.right-sidebar-scroll::-webkit-scrollbar-thumb {
    background: var(--bg-scrollbar-thumb);
    border-radius: 4px;
}

/* History Cards */
.history-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    position: relative;
    cursor: pointer;
    transition: var(--ease-bounce);
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
}

.history-card:hover {
    border-color: var(--border-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-blue), var(--shadow-sm);
}

.history-card.active {
    background: rgba(59, 130, 246, 0.04);
    border-color: var(--blue-core);
    box-shadow: var(--shadow-blue);
}

.history-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-right: 18px; /* Room for delete button */
}

.history-card-title {
    font-size: var(--font-md);
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.3;
}

.history-card-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--ease);
}

.history-card-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red-core);
}

.history-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.history-card-badge {
    font-size: var(--font-xs);
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.history-card-badge.badge-tab-guide {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue-bright);
}

.history-card-badge.badge-tab-law {
    background: rgba(16, 185, 129, 0.1);
    color: var(--green-core);
}

.history-card-badge.badge-tab-edufine {
    background: rgba(249, 115, 22, 0.12);
    color: var(--orange-core, #f97316);
}

.history-card-category {
    font-size: var(--font-xs);
    color: var(--text-muted);
    font-weight: 600;
}

.history-card-time {
    font-size: var(--font-xs);
    color: var(--text-muted);
    margin-top: 1px;
}

/* Mobile Backdrops */
.right-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 290;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.right-sidebar-backdrop.active {
    display: block;
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE OVERRIDES
   ═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .right-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        left: auto !important; /* 좌측 aside 상속 해제 */
        bottom: 0;
        z-index: 300;
        width: 280px !important;
        transform: translateX(100%);
        border-left: 1px solid var(--border);
        border-right: none;
    }
    
    .right-sidebar.open {
        transform: translateX(0);
        box-shadow: -4px 0 32px rgba(0,0,0,0.6);
    }
}

/* ═══════════════════════════════════════════════════
   MAIN SCREEN FILE CARD LIBRARY
   ═══════════════════════════════════════════════════ */
.file-download-card {
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    min-height: 125px;
    text-decoration: none !important;
    box-sizing: border-box;
}

.file-meta-desc {
    font-size: var(--font-xs);
    color: var(--text-muted);
    margin-top: 4px !important;
    margin-bottom: 12px !important;
    line-height: 1.4;
}

.btn-download-chip {
    align-self: flex-start;
    padding: 3px 8px;
    font-size: var(--font-xs);
    font-weight: 800;
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    transition: var(--ease);
}

.file-download-card:hover .btn-download-chip {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
    box-shadow: var(--accent-glow);
}

/* ═══════════════════════════════════════════════════
   9. FILE DOWNLOAD CARD - COMPACT RESPONSIVE GRID
   ═══════════════════════════════════════════════════ */
.file-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)) !important;
    max-width: 1000px !important;
    gap: 8px !important;
    margin: 0 auto 30px !important;
}

/* 카드가 많을 경우 크기 축소 */
.file-card-grid .file-download-card {
    min-height: 82px !important;
    padding: 12px 14px !important;
    border-radius: var(--radius-md) !important;
}

.file-card-grid .file-download-card h4 {
    font-size: var(--font-md) !important;
    line-height: 1.35 !important;
    margin-bottom: 8px !important;
    font-weight: 700 !important;
}

.file-card-grid .file-meta-desc {
    display: none !important;
}

.file-card-grid .btn-download-chip {
    padding: 2.5px 7px !important;
    font-size: var(--font-xs) !important;
    font-weight: 700 !important;
}

@media (max-width: 768px) {
    .file-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)) !important;
        gap: 6px !important;
    }
    .file-card-grid .file-download-card {
        min-height: 88px !important;
        padding: 10px 12px !important;
    }
}

/* 복사 버튼 추가 스타일 */
.copy-msg-btn {
    border-color: rgba(255, 255, 255, 0.15) !important;
}

.copy-msg-btn:hover {
    border-color: var(--blue-core) !important;
    background: rgba(30, 96, 255, 0.08) !important;
    color: var(--text-bright) !important;
    box-shadow: 0 0 6px rgba(30, 96, 255, 0.2);
}

/* 개인정보 보호 고지 스타일 */
.privacy-warning {
    text-align: center;
    font-size: var(--font-xs);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 10px;
    margin-bottom: 2px;
    letter-spacing: -0.01em;
    user-select: none;
    animation: fadeIn 0.8s ease-in-out;
}

/* 다크 테마가 아닐 때(라이트 모드)를 위한 대응 */
[data-theme="light"] .privacy-warning {
    color: rgba(0, 0, 0, 0.45);
}

/* 답변 출력 생성 중 중단 버튼 스타일 */
.send-btn.generating {
    background: #ea580c !important; /* 오렌지/레드 계열의 경고색 */
    color: white !important;
    box-shadow: 0 0 8px rgba(234, 88, 12, 0.4) !important;
    animation: pulseGlow 1.5s infinite ease-in-out;
}

.send-btn.generating:hover {
    background: #dc2626 !important; /* 조금 더 짙은 빨간색 */
    box-shadow: 0 0 12px rgba(220, 38, 38, 0.6) !important;
}

@keyframes pulseGlow {
    0% { transform: scale(1); box-shadow: 0 0 8px rgba(234, 88, 12, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 14px rgba(234, 88, 12, 0.7); }
    100% { transform: scale(1); box-shadow: 0 0 8px rgba(234, 88, 12, 0.4); }
}

/* ═══════════════════════════════════════════════════
   웰컴 사용법 모달 팝업 스타일
   ═══════════════════════════════════════════════════ */
.welcome-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(8, 9, 15, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s cubic-bezier(0.25, 0.8, 0.25, 1), visibility 0.28s;
}

.welcome-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.welcome-modal-card {
    background: var(--bg-modal);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 540px;
    max-height: 85vh;
    box-shadow: var(--shadow-lg), 0 20px 50px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(24px) scale(0.96);
    transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.welcome-modal-overlay.active .welcome-modal-card {
    transform: translateY(0) scale(1);
}

/* 모달 헤더 */
.welcome-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px 16px;
}

.welcome-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.welcome-modal-title .lucide-icon {
    width: 22px;
    height: 22px;
    color: var(--accent-core);
}

.welcome-modal-title h2 {
    font-family: 'Outfit', 'Pretendard', sans-serif;
    font-size: var(--font-lg);
    font-weight: 700;
    color: var(--text-bright);
    margin: 0;
    letter-spacing: -0.02em;
}

.welcome-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--ease);
}

.welcome-modal-close:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    transform: rotate(90deg);
}

/* 모달 바디 */
.welcome-modal-body {
    padding: 0 28px 20px;
    overflow-y: auto;
    flex: 1;
}

.welcome-intro {
    font-size: var(--font-base);
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 20px;
    letter-spacing: -0.01em;
}

/* 웰컴 탭 메뉴 */
.welcome-tabs {
    display: flex;
    gap: 6px;
    background: rgba(15, 23, 42, 0.03);
    padding: 4px;
    border-radius: var(--radius-md);
    margin-bottom: 18px;
    border: 1px solid var(--border-subtle);
}

[data-theme="dark"] .welcome-tabs {
    background: rgba(255, 255, 255, 0.03);
}

.welcome-tab-btn {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1.5px solid var(--border-bright); /* 비활성 탭에도 뚜렷한 외곽선 추가 */
    background: none;
    border-radius: var(--radius-sm);
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-secondary); /* 비활성 탭 글자 가독성 개선 */
    cursor: pointer;
    transition: var(--ease);
}

.welcome-tab-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--accent-core); /* 호버 시 테두리 액센트화 */
}

.welcome-tab-btn .lucide-icon {
    width: 16px;
    height: 16px;
}

.welcome-tab-btn.active {
    background: var(--bg-main);
    color: var(--accent-bright);
    border-color: var(--accent-core); /* 활성 탭은 선명한 액센트 테두리 적용 */
    box-shadow: var(--shadow-sm);
}

/* 탭 콘텐츠 */
.welcome-tab-content {
    display: none;
}

.welcome-tab-content.active {
    display: block;
    animation: fadeInTab 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes fadeInTab {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 설명 인포 박스 */
.info-box {
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.info-title {
    font-weight: 700;
    font-size: var(--font-md);
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-title .lucide-icon {
    width: 16px;
    height: 16px;
}

.info-box p {
    font-size: var(--font-sm);
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
}

/* 박스 컬러 베리에이션 - 보더 선명성 개선 (굵기 1.5px 및 투명도 0.25로 강화) */
.info-box.blue {
    background: rgba(59, 130, 246, 0.04);
    border: 1.5px solid rgba(59, 130, 246, 0.25);
}
.info-box.blue .info-title { color: var(--blue-core); }

.info-box.orange {
    background: rgba(249, 115, 22, 0.04);
    border: 1.5px solid rgba(249, 115, 22, 0.25);
}
.info-box.orange .info-title { color: var(--orange-core); }

.info-box.purple {
    background: rgba(139, 92, 246, 0.04);
    border: 1.5px solid rgba(139, 92, 246, 0.25);
}
.info-box.purple .info-title { color: var(--purple-core); }

.info-box.teal {
    background: rgba(6, 182, 212, 0.04);
    border: 1.5px solid rgba(6, 182, 212, 0.25);
}
.info-box.teal .info-title { color: var(--cyan-core); }

.info-box.indigo {
    background: rgba(99, 102, 241, 0.04);
    border: 1.5px solid rgba(99, 102, 241, 0.25);
}
.info-box.indigo .info-title { color: #6366f1; }

.info-box.emerald {
    background: rgba(16, 185, 129, 0.04);
    border: 1.5px solid rgba(16, 185, 129, 0.25);
}
.info-box.emerald .info-title { color: #10b981; }

/* 피드백 안내 영역 */
.welcome-feedback-notice {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card-hover);
    border-radius: var(--radius-md);
    border: 1.5px dashed var(--border-bright); /* 외곽선 굵기 강화 */
    margin-top: 20px;
}

.feedback-icon-container {
    display: flex;
    gap: 6px;
    color: var(--accent-core);
}

.feedback-icon-container .lucide-icon {
    width: 18px;
    height: 18px;
}

.feedback-text {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    line-height: 1.5;
    letter-spacing: -0.01em;
}

/* 모달 푸터 */
.welcome-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 28px 24px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-modal);
}

.welcome-cookie-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-sm);
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.welcome-cookie-label input {
    width: 16px;
    height: 16px;
    border-radius: var(--radius-xs);
    accent-color: var(--accent-core);
    cursor: pointer;
}

.welcome-btn-confirm {
    padding: 10px 24px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-sm);
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--ease);
}

.welcome-btn-confirm:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), 0 4px 12px var(--accent-glow);
}

.welcome-btn-confirm:active {
    transform: translateY(0);
}

/* 반응형 모달 최적화 */
@media (max-width: 576px) {
    .welcome-modal-card {
        width: 95%;
        max-height: 90vh;
    }
    .welcome-modal-header {
        padding: 20px 20px 12px;
    }
    .welcome-modal-body {
        padding: 0 20px 16px;
    }
    .welcome-modal-footer {
        padding: 14px 20px 20px;
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    .welcome-btn-confirm {
        width: 100%;
        text-align: center;
    }
    .welcome-cookie-label {
        justify-content: center;
    }
}

/* ═══════════════════════════════════════════════════
   사용자 의견 모달 입력창 스타일
═══════════════════════════════════════════════════ */
.opinion-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    color: var(--text-primary);
    font-size: var(--font-base);
    resize: none;
    box-sizing: border-box;
    transition: var(--ease);
}
.opinion-textarea:focus {
    outline: none;
    border-color: var(--accent-core);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ═══════════════════════════════════════════════════
   0.01초 즉시 대기 패널, 1초 실무 팁 & 검색어 형광펜 하이라이트
═══════════════════════════════════════════════════ */
.step-status-instant {
    background: rgba(30, 96, 255, 0.05);
    border: 1px solid rgba(30, 96, 255, 0.16);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin-bottom: 8px;
    font-size: var(--font-sm);
    color: var(--text-primary);
    backdrop-filter: blur(8px);
    transition: var(--ease);
}
.instant-status-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    color: var(--blue-core);
    font-weight: 600;
}
.instant-tip-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: var(--shadow-sm);
}
body.dark-mode .instant-tip-box {
    background: rgba(30, 40, 60, 0.8);
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.1);
}
.tip-badge {
    background: linear-gradient(135deg, #1e60ff 0%, #3b82f6 100%);
    color: white;
    font-weight: 700;
    font-size: 0.72rem;
    padding: 2px 7px;
    border-radius: 6px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(30, 96, 255, 0.2);
}
.spin-icon {
    animation: spin-around 1.6s linear infinite;
}
@keyframes spin-around {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 검색어 키워드 강조 스타일 (하이라이트 박스 배경/테두리 제거, 깔끔한 굵은 글씨) */
mark, mark.query-highlight, strong.query-highlight {
    background: transparent !important;
    color: inherit !important;
    border: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    font-weight: 700 !important;
}
[data-theme="dark"] mark, body.dark-mode mark.query-highlight, [data-theme="dark"] strong.query-highlight, body.dark-mode strong.query-highlight {
    background: transparent !important;
    color: inherit !important;
    border: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    font-weight: 700 !important;
}

/* 아이콘 및 뱃지 보조 요소 드래그 복사 시 깨짐 방지 */
.lucide-icon, svg, .chk-box-icon, .citation-badge i, .callout-header i {
    user-select: none;
    -webkit-user-select: none;
}

/* ═══════════════════════════════════════════════════
   5. READABLE CALLOUT BOXES & SECTION STYLING
═══════════════════════════════════════════════════ */
.callout-box {
    margin: 8px 0;
    padding: 14px 18px;
    border-radius: 12px;
    line-height: 1.75;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

.callout-header {
    font-size: 1.05rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}

.callout-header-title {
    display: flex;
    align-items: center;
}

/* 아코디언 토글 인터랙션 */
.callout-box.callout-collapsible .callout-header {
    cursor: pointer;
    user-select: none;
    padding: 0;
    transition: opacity 0.2s ease;
}

.callout-box.callout-collapsible .callout-header:hover {
    opacity: 0.82;
}

.callout-toggle-badge {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.06);
    color: currentColor;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

[data-theme="dark"] .callout-toggle-badge {
    background: rgba(255, 255, 255, 0.12);
}

.callout-toggle-badge .toggle-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: rotate(0deg);
}

.callout-box.callout-collapsed .callout-toggle-badge .toggle-icon {
    transform: rotate(-90deg);
}

.callout-body {
    font-size: 1.0rem;
    line-height: 1.82;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.callout-box.callout-collapsed {
    padding: 11px 16px !important;
    margin: 8px 0 !important;
}

.callout-box.callout-collapsed .callout-header {
    margin-bottom: 0 !important;
}

.callout-box.callout-collapsed .callout-body {
    display: none !important;
}

/* 1. Summary Box (💡 핵심 요약) */
.callout-summary {
    background: linear-gradient(135deg, rgba(254, 243, 199, 0.55) 0%, rgba(253, 230, 138, 0.35) 100%);
    border: 1.5px solid rgba(245, 158, 11, 0.35);
    border-left: 4px solid #f59e0b;
    color: var(--text-primary);
}

.callout-summary .callout-header {
    color: #b45309;
}

[data-theme="dark"] .callout-summary {
    background: rgba(28, 38, 60, 0.75);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-left: 4px solid #f59e0b;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .callout-summary .callout-header {
    color: #fbbf24;
}

/* 2. Warning Box (⚠️ 행정 감사 유의사항) */
.callout-warning {
    background: linear-gradient(135deg, rgba(254, 226, 226, 0.55) 0%, rgba(254, 202, 202, 0.35) 100%);
    border: 1.5px solid rgba(239, 68, 68, 0.35);
    border-left: 4px solid #ef4444;
    color: var(--text-primary);
}

.callout-warning .callout-header {
    color: #b91c1c;
}

[data-theme="dark"] .callout-warning {
    background: rgba(38, 28, 42, 0.75);
    border: 1px solid rgba(244, 63, 94, 0.35);
    border-left: 4px solid #f43f5e;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .callout-warning .callout-header {
    color: #fda4af;
}

/* 3. Checklist Box (📋 실무 체크리스트) */
.callout-checklist {
    background: linear-gradient(135deg, rgba(224, 242, 254, 0.55) 0%, rgba(186, 230, 253, 0.35) 100%);
    border: 1.5px solid rgba(14, 165, 233, 0.35);
    border-left: 4px solid #0284c7;
    color: var(--text-primary);
}

.callout-checklist .callout-header {
    color: #0369a1;
}

[data-theme="dark"] .callout-checklist {
    background: rgba(22, 36, 56, 0.75);
    border: 1px solid rgba(0, 210, 255, 0.3);
    border-left: 4px solid #00d2ff;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .callout-checklist .callout-header {
    color: #38bdf8;
}

/* 4. Detail Box (🔍 상세 해설 및 분석) */
.callout-detail {
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.65) 0%, rgba(219, 234, 254, 0.4) 100%);
    border: 1.5px solid rgba(59, 130, 246, 0.35);
    border-left: 4px solid #2563eb;
    color: var(--text-primary);
}

.callout-detail .callout-header {
    color: #1e40af;
}

[data-theme="dark"] .callout-detail {
    background: rgba(20, 30, 50, 0.7);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-left: 4px solid #38bdf8;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .callout-detail .callout-header {
    color: #38bdf8;
}

/* 5. Edufine Process Box (💻 화면 메뉴 경로 및 처리 절차) */
.callout-edufine {
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.65) 0%, rgba(219, 234, 254, 0.4) 100%);
    border: 1.5px solid rgba(59, 130, 246, 0.35);
    border-left: 4px solid #2563eb;
    color: var(--text-primary);
}

.callout-edufine .callout-header {
    color: #1e40af;
}

[data-theme="dark"] .callout-edufine {
    background: rgba(20, 30, 50, 0.7);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-left: 4px solid #38bdf8;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .callout-edufine .callout-header {
    color: #38bdf8;
}

/* 마크다운 표(Table) 프리미엄 스타일 */
.table-wrapper-premium {
    overflow-x: auto;
    margin: 10px 0;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .table-wrapper-premium {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
}

.markdown-table-premium {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.92rem;
}

.markdown-table-premium th {
    background: rgba(241, 245, 249, 0.85);
    font-weight: 700;
    padding: 10px 14px;
    border-bottom: 1.5px solid rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
    white-space: nowrap;
}

[data-theme="dark"] .markdown-table-premium th {
    background: rgba(30, 41, 59, 0.85);
    border-bottom-color: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

.markdown-table-premium td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
    line-height: 1.6;
}

[data-theme="dark"] .markdown-table-premium td {
    border-bottom-color: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
}

.markdown-table-premium tr:last-child td {
    border-bottom: none;
}

.markdown-table-premium tr:hover td {
    background: rgba(248, 250, 252, 0.7);
}

[data-theme="dark"] .markdown-table-premium tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

/* Section Headers with Left Accent Bar */
.section-header-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 22px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    letter-spacing: -0.02em;
}

.section-header-title.main-section-title {
    padding-left: 10px;
    border-left: 4px solid var(--accent-core, #2563eb);
}

.section-subheader-title {
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 18px;
    margin-bottom: 8px;
    padding-left: 10px;
    border-left: 3px solid rgba(59, 130, 246, 0.6);
    letter-spacing: -0.01em;
}

[data-theme="dark"] .section-subheader-title {
    border-left-color: rgba(96, 165, 250, 0.7);
}

/* Section Divider (hr) */
hr.section-divider {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border), transparent);
    margin: 22px 0;
}

/* 📊 Premium Markdown Table */
.table-wrapper-premium {
    width: 100%;
    overflow-x: auto;
    margin: 14px 0;
    border-radius: 10px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.markdown-table-premium {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.markdown-table-premium th {
    background: rgba(59, 130, 246, 0.09);
    color: var(--text-primary);
    font-weight: 800;
    padding: 10px 14px;
    border-bottom: 1.5px solid var(--border);
    white-space: nowrap;
}

[data-theme="dark"] .markdown-table-premium th {
    background: rgba(59, 130, 246, 0.22);
}

.markdown-table-premium td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    line-height: 1.6;
}

.markdown-table-premium tr:last-child td {
    border-bottom: none;
}

/* Mobile responsiveness for header links & badges */
@media (max-width: 768px) {
    .main-site-btn, .chatbot-url-badge {
        padding: 5px 10px;
        font-size: var(--font-xs);
    }
    .main-site-btn .main-site-btn-text, .chatbot-url-badge .chatbot-url-badge-text {
        display: none;
    }
    .main-site-btn .lucide-icon, .chatbot-url-badge .lucide-icon {
        margin-right: 0 !important;
    }
    .header-stat-badge {
        height: 28px;
        padding: 0 8px;
    }
    .header-stat-badge .stat-badge-label {
        display: none;
    }
    .header-stat-badge .stat-badge-value {
        font-size: 0.84rem;
    }
}

@media (max-width: 520px) {
    .header-stat-badge {
        display: none;
    }
}

/* ═══════════════════════════════════════════════════
   📢 CHATBOT OPINION BOARD MODAL & 2X CARD BUTTON STYLES
═══════════════════════════════════════════════════ */
.opinion-board-card-btn {
    width: 100%;
    height: 72px;
    margin: 8px 0 10px 0;
    padding: 12px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(168, 85, 247, 0.15) 100%);
    border: 1px solid rgba(168, 85, 247, 0.35);
    color: #4f46e5;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.12);
    text-align: center;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .opinion-board-card-btn {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.22) 0%, rgba(168, 85, 247, 0.25) 100%);
    border-color: rgba(168, 85, 247, 0.45);
    color: #c7d2fe;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.opinion-board-card-btn:hover {
    transform: translateY(-2px) scale(1.01);
    border-color: #818cf8;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.25);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(168, 85, 247, 0.25) 100%);
}

.opinion-board-card-btn .card-btn-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.opinion-board-card-btn .card-btn-sub {
    font-size: 0.73rem;
    opacity: 0.85;
    font-weight: 500;
}

/* 게시판 팝업 모달 오버레이 */
.welcome-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000 !important;
}

.welcome-modal-overlay.active {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.opinion-board-modal-card {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 20px;
    width: 90%;
    max-width: 680px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] .opinion-board-modal-card {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.92) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.opinion-board-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border, #e2e8f0);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(99, 102, 241, 0.04);
}

[data-theme="dark"] .opinion-board-header {
    border-color: #334155;
    background: rgba(99, 102, 241, 0.08);
}

.opinion-board-title {
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary, #0f172a);
}

[data-theme="dark"] .opinion-board-title {
    color: #f8fafc;
}

.opinion-modal-close-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary, #64748b);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.opinion-modal-close-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-primary, #0f172a);
}

/* 탭 네비게이션 */
.board-nav-tabs {
    display: flex;
    border-bottom: 1px solid var(--border, #e2e8f0);
    padding: 0 24px;
    background: var(--bg-card, #ffffff);
}

[data-theme="dark"] .board-nav-tabs {
    border-color: #334155;
    background: #1e293b;
}

.board-tab-btn {
    padding: 14px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.board-tab-btn.active {
    color: #4f46e5;
    border-bottom-color: #4f46e5;
}

[data-theme="dark"] .board-tab-btn.active {
    color: #818cf8;
    border-bottom-color: #818cf8;
}

.board-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* 필터 칩 */
.board-filter-container {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.chip-filter {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    background: var(--bg-secondary, #f1f5f9);
    color: var(--text-secondary, #64748b);
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.chip-filter.active {
    background: #4f46e5;
    color: #ffffff;
}

[data-theme="dark"] .chip-filter {
    background: #334155;
    color: #94a3b8;
}

[data-theme="dark"] .chip-filter.active {
    background: #6366f1;
    color: #ffffff;
}

/* 목록 카드 */
.board-cards-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.board-post-card {
    padding: 16px;
    border-radius: 12px;
    background: var(--bg-card, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    transition: all 0.2s;
}

[data-theme="dark"] .board-post-card {
    background: #0f172a;
    border-color: #334155;
}

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

.board-post-tag {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
}

[data-theme="dark"] .board-post-tag {
    background: rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
}

.board-post-author {
    font-size: 0.8rem;
    color: var(--text-secondary, #64748b);
}

.board-post-content {
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--text-primary, #1e293b);
    white-space: pre-wrap;
    word-break: break-word;
}

[data-theme="dark"] .board-post-content {
    color: #e2e8f0;
}

.board-admin-reply {
    margin-top: 10px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(16, 185, 129, 0.08);
    border-left: 4px solid #10b981;
    font-size: 0.88rem;
}

[data-theme="dark"] .board-admin-reply {
    background: rgba(16, 185, 129, 0.15);
}

/* 입력 폼 */
.board-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.board-form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary, #334155);
}

[data-theme="dark"] .board-form-group label {
    color: #cbd5e1;
}

.board-input, .opinion-textarea {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border, #cbd5e1);
    background: var(--bg-card, #ffffff);
    color: var(--text-primary, #0f172a);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

[data-theme="dark"] .board-input, [data-theme="dark"] .opinion-textarea {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

.board-input:focus, .opinion-textarea:focus {
    border-color: #6366f1;
}

.opinion-textarea {
    min-height: 110px;
    resize: vertical;
}

.board-submit-btn {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.board-submit-btn:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

/* ─────────────────────────────────────────────────────────────
   PDF 원문 바로보기 인라인 & 푸터 버튼 스타일
   ───────────────────────────────────────────────────────────── */
.pdf-modal-inline-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff !important;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none !important;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
    white-space: nowrap;
}

.pdf-modal-inline-btn:hover {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.4);
}

.pdf-modal-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--primary, #0284c7) !important;
    text-decoration: none !important;
    font-weight: 600;
    padding: 6px 8px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.pdf-modal-footer-link:hover {
    background: rgba(2, 132, 199, 0.08);
    color: #0369a1 !important;
}

[data-theme="dark"] .pdf-modal-footer-link:hover {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8 !important;
}

/* ═══════════════════════════════════════════════════
   23. FUEL & TRAVEL CALCULATOR MODAL (출장 유류비 계산기)
═══════════════════════════════════════════════════ */
.calc-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10005;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 16px 60px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    transition: opacity 0.22s ease;
}

.calc-modal-backdrop.active {
    opacity: 1;
}

.calc-modal-card {
    background: var(--bg-surface, #1e293b);
    border: 1px solid var(--border-accent, rgba(56, 189, 248, 0.35));
    border-radius: 12px;
    width: 860px;
    max-width: 100%;
    height: auto;
    max-height: none;
    overflow: hidden;
    resize: none !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 25px rgba(56, 189, 248, 0.15);
    display: flex;
    flex-direction: column;
    transform: scale(0.96);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.calc-modal-backdrop.active .calc-modal-card {
    transform: scale(1);
}

.calc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px 4px;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    flex-shrink: 0;
}

.calc-title-box {
    display: flex;
    align-items: center;
    gap: 7px;
}

.calc-emoji {
    font-size: 1.1rem;
}

.calc-title {
    font-size: 1.0rem;
    font-weight: 800;
    color: #ffffff !important;
    margin: 0;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.calc-close-btn {
    background: transparent;
    border: none;
    font-size: 1.3rem;
    color: #cbd5e1;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}

.calc-close-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

.calc-legal-badge {
    margin: 0;
    padding: 3px 10px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #38bdf8;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
    flex-shrink: 0;
}

.calc-badge-icon {
    font-size: 0.85rem;
}

.calc-modal-body {
    padding: 10px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(56, 189, 248, 0.4) rgba(15, 23, 42, 0.6);
}

.calc-modal-body::-webkit-scrollbar {
    width: 6px;
}

.calc-modal-body::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 3px;
}

.calc-modal-body::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.4);
    border-radius: 3px;
}

.calc-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, 0.7);
}

.calc-grid-origin-dest {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto;
    gap: 5px;
    align-items: end;
}

.calc-btn-swap {
    height: 30px;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 6px;
    color: #38bdf8;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0;
    flex-shrink: 0;
}

.calc-btn-swap:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #38bdf8;
    transform: scale(1.08) rotate(180deg);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.calc-btn-swap.rotated {
    transform: rotate(180deg);
}

/* 빠른 출장지 퀵 칩 바 */
.calc-quick-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 1px 0;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.calc-quick-chips::-webkit-scrollbar {
    display: none;
}

.calc-chips-label {
    font-size: 0.76rem;
    font-weight: 700;
    color: #94a3b8;
    flex-shrink: 0;
}

.calc-chips-scroll {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    scrollbar-width: none;
}

.calc-chip {
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 5px;
    color: #cbd5e1;
    font-size: 0.73rem;
    font-weight: 600;
    padding: 2px 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.calc-chip:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    color: #ffffff;
    transform: translateY(-1px);
}

.calc-btn-group-search {
    display: flex;
    align-items: flex-end;
}

.calc-btn-group-search .calc-btn-primary {
    height: 30px;
    padding: 0 12px;
    font-weight: 700;
}

.calc-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    align-items: start;
}

.calc-grid-3 {
    display: grid;
    grid-template-columns: 1.05fr 0.75fr 1.2fr;
    gap: 5px;
    align-items: start;
}

.calc-grid-datetime {
    display: grid;
    grid-template-columns: 1.05fr 0.75fr 1.2fr;
    gap: 5px;
    align-items: end;
    margin-top: 1px;
}

.calc-btn-today {
    height: 30px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 6px;
    color: #38bdf8;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
}

.calc-btn-today:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #38bdf8;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(56, 189, 248, 0.3);
}

.calc-field-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.calc-label-highlight {
    font-size: 0.80rem !important;
    font-weight: 800 !important;
    color: #e2e8f0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.calc-field-group input,
.calc-field-group select {
    height: 33px;
    box-sizing: border-box;
    background: #0f172a !important;
    border: 1.5px solid rgba(56, 189, 248, 0.35) !important;
    border-radius: 6px;
    padding: 0 10px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #ffffff !important;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    width: 100%;
    ime-mode: active;
}

.calc-field-group input:focus,
.calc-field-group select:focus {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.3) !important;
}

/* 출장일자 커스텀 달력 버튼 및 내장 아이콘 가숨김 처리 */
input[type="date"] {
    color-scheme: dark !important;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    display: none !important;
    -webkit-appearance: none !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 커스텀 선명한 달력 버튼 */
.calc-date-picker-btn {
    height: 30px;
    width: 30px;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.90rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.calc-date-picker-btn:hover {
    background: #0284c7;
    border-color: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
    transform: translateY(-1px);
}

.calc-date-picker-btn:active {
    transform: scale(0.94);
}

/* 출장일자 일별 상하 조정 스테퍼 버튼 */
.calc-date-input-wrapper {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 30px;
    width: 100%;
}

.calc-date-input-wrapper input[type="date"] {
    flex: 1;
    min-width: 0;
    height: 30px;
    padding-right: 4px !important;
}

.calc-date-stepper-btns {
    display: flex;
    flex-direction: column;
    height: 30px;
    justify-content: center;
    gap: 1px;
    flex-shrink: 0;
}

.calc-stepper-btn {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    font-size: 0.58rem;
    line-height: 1;
    width: 18px;
    height: 13px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.calc-stepper-btn:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #38bdf8;
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.4);
}

.calc-stepper-btn:active {
    transform: scale(0.92);
}

.calc-input-with-btn {
    display: flex;
    gap: 5px;
    height: 30px;
}

.calc-input-with-btn input {
    flex: 1;
    min-width: 0;
    height: 30px;
}

.calc-btn-primary {
    height: 30px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 6px;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 0 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.calc-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
}

.calc-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.calc-btn-add-via,
.calc-btn-add-more-via {
    background: rgba(56, 189, 248, 0.15) !important;
    border: 1px solid rgba(56, 189, 248, 0.4) !important;
    border-radius: 5px !important;
    color: #38bdf8 !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    padding: 2px 8px !important;
    cursor: pointer;
    line-height: 1.3;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.calc-btn-add-via:hover,
.calc-btn-add-via.active,
.calc-btn-add-more-via:hover {
    background: #0284c7 !important;
    color: #ffffff !important;
    border-color: #38bdf8 !important;
    transform: translateY(-1px);
}

.calc-via-row {
    display: flex;
    width: 100%;
    margin-top: 3px;
    animation: fadeInVia 0.2s ease-out;
}

@keyframes fadeInVia {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.calc-via-field {
    width: 100% !important;
}

.calc-btn-remove-via {
    background: rgba(239, 68, 68, 0.15) !important;
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
    border-radius: 5px !important;
    color: #f87171 !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    padding: 2px 8px !important;
    cursor: pointer;
    line-height: 1.3;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.calc-btn-remove-via:hover {
    background: #dc2626 !important;
    color: #ffffff !important;
    border-color: #ef4444 !important;
    transform: translateY(-1px);
}

.calc-input-unit {
    position: relative;
    display: flex;
    align-items: center;
    height: 30px;
}

.calc-input-unit input {
    width: 100%;
    height: 30px;
    padding-right: 50px;
}

.calc-unit-text {
    position: absolute;
    right: 10px;
    font-size: 0.80rem;
    font-weight: 700;
    color: #94a3b8;
    pointer-events: none;
}

/* 지도 영역 */
.calc-map-section {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.calc-map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
    gap: 8px;
    white-space: nowrap;
    flex-wrap: nowrap;
}

.calc-map-header-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.calc-map-title {
    font-weight: 700;
    color: #e2e8f0;
    white-space: nowrap;
}

.calc-map-stats {
    font-weight: 700;
    color: #38bdf8;
    white-space: nowrap;
    font-size: 0.78rem;
    letter-spacing: -0.2px;
}

.calc-zoom-controls {
    display: flex;
    gap: 4px;
}

.calc-source-desktop { display: inline; }
.calc-source-mobile { display: none; }

.calc-zoom-btn {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 4px;
    color: #38bdf8;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 2px 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.calc-zoom-btn:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #38bdf8;
}

.calc-map-container {
    position: relative;
    width: 100%;
    height: 365px;
    background: #1e2433;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#calc-map-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.calc-map-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #38bdf8;
    font-size: 0.85rem;
    font-weight: 600;
}

.calc-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(56, 189, 248, 0.2);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* 📍 지도 클릭 핀 피커 & 힌트 스타일 */
.calc-map-click-hint {
    font-size: 0.68rem;
    font-weight: 600;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 4px;
    padding: 1px 5px;
    margin-left: 2px;
    display: inline-block;
    vertical-align: middle;
    white-space: nowrap;
    cursor: help;
}

.calc-saved-origin-badge {
    font-size: 0.78rem;
    font-weight: 700;
    color: #10b981;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 5px;
    padding: 2px 6px;
    margin-left: 5px;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.calc-pin-popup {
    position: relative;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 12px rgba(56, 189, 248, 0.2);
    min-width: 210px;
    max-width: 260px;
    color: #f8fafc;
    font-family: inherit;
    box-sizing: border-box;
    cursor: default;
    user-select: none;
    z-index: 10000;
}

.calc-pin-popup::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px 7px 0;
    border-style: solid;
    border-color: rgba(15, 23, 42, 0.96) transparent transparent;
    display: block;
    width: 0;
}

/* 상단 클릭 시 아래쪽으로 열리는 팝업 */
.calc-pin-popup.calc-pin-popup-bottom::after {
    bottom: auto;
    top: -8px;
    border-width: 0 7px 8px;
    border-color: transparent transparent rgba(15, 23, 42, 0.96) transparent;
}

/* 좌/우측 가장자리 쏠림 보정 꼬리표 */
.calc-pin-popup.calc-pin-popup-left::after {
    left: 18%;
    transform: none;
}

.calc-pin-popup.calc-pin-popup-right::after {
    left: auto;
    right: 18%;
    transform: none;
}

.calc-pin-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 6px;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.calc-pin-header-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #38bdf8;
    display: flex;
    align-items: center;
    gap: 4px;
}

.calc-pin-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.82rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s ease;
}

.calc-pin-close-btn:hover {
    color: #f87171;
}

.calc-pin-addr-box {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 6px 8px;
    margin-bottom: 8px;
    font-size: 0.74rem;
    color: #f1f5f9;
    line-height: 1.35;
    word-break: break-all;
    display: flex;
    align-items: center;
    gap: 6px;
}

.calc-pin-spinner {
    font-size: 0.75rem;
    animation: spin 1.2s infinite linear;
}

.calc-pin-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calc-pin-btn {
    width: 100%;
    padding: 6px 8px;
    border-radius: 6px;
    border: none;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.calc-pin-btn-origin {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #ffffff;
}

.calc-pin-btn-origin:hover {
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
    transform: translateY(-1px);
}

.calc-pin-btn-via {
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
    color: #ffffff;
}

.calc-pin-btn-via:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #7c3aed 100%);
    transform: translateY(-1px);
}

.calc-pin-btn-dest {
    background: linear-gradient(135deg, #e11d48 0%, #f43f5e 100%);
    color: #ffffff;
}

.calc-pin-btn-dest:hover {
    background: linear-gradient(135deg, #be123c 0%, #e11d48 100%);
    transform: translateY(-1px);
}


/* 결과 요약 카드 */
.calc-result-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.calc-table-breakdown {
    width: 100%;
    border-collapse: collapse;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.calc-table-breakdown th, .calc-table-breakdown td {
    padding: 9px 6px;
    font-size: 0.88rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.calc-table-breakdown th {
    background: rgba(30, 58, 138, 0.70);
    color: #bae6fd;
    font-weight: 800;
    text-align: center;
    white-space: nowrap;
    letter-spacing: -0.2px;
}

.calc-table-breakdown td {
    color: #ffffff !important;
    font-weight: 700;
    font-size: 0.90rem;
}

.calc-table-breakdown td.center { text-align: center; }
.calc-table-breakdown td.right { text-align: right; }
.calc-table-breakdown td.bold { font-weight: 800; color: #ffffff !important; font-size: 0.92rem; }
.calc-table-breakdown td.calc-cost-highlight { 
    color: #38bdf8 !important; 
    font-weight: 900; 
    font-size: 0.96rem;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

.calc-toll-input-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 100%;
}

.calc-toll-input {
    width: 62px;
    height: 27px;
    background: rgba(15, 23, 42, 0.85);
    border: 1.5px solid rgba(56, 189, 248, 0.45);
    border-radius: 4px;
    color: #38bdf8 !important;
    font-size: 0.88rem;
    font-weight: 800;
    text-align: right;
    padding: 0 4px;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.calc-toll-input:hover,
.calc-toll-input:focus {
    background: rgba(15, 23, 42, 0.98);
    border-color: #38bdf8;
    outline: none;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.calc-toll-input::-webkit-outer-spin-button,
.calc-toll-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.calc-toll-input[type=number] {
    -moz-appearance: textfield;
}

.calc-toll-unit {
    font-size: 0.80rem;
    font-weight: 700;
    color: #f8fafc;
}

/* 최종 여비 지급 총액 골드/에메랄드 글로잉 하이라이트 배너 */
.calc-total-banner {
    margin: 6px 0 6px;
    padding: 10px 18px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.20) 0%, rgba(6, 78, 59, 0.55) 100%);
    border: 1.5px solid rgba(52, 211, 153, 0.85);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.25);
    flex-wrap: wrap;
    transition: all 0.2s ease;
}

.calc-total-banner:hover {
    border-color: rgba(52, 211, 153, 1.0);
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.45);
}

.calc-banner-star {
    color: #fbbf24;
    font-size: 1.15rem;
    line-height: 1;
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.7));
}

.calc-banner-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.calc-banner-amount {
    font-size: 1.38rem;
    font-weight: 900;
    color: #fde047;
    letter-spacing: -0.02em;
    text-shadow: 0 0 14px rgba(253, 224, 71, 0.5);
    margin: 0 4px;
}

.calc-banner-sub {
    font-size: 0.84rem;
    font-weight: 700;
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.5);
    padding: 3px 8px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.calc-formula-detail {
    font-size: 0.82rem;
    color: #cbd5e1;
    font-weight: 600;
    text-align: center;
    border-top: 1px dashed rgba(255, 255, 255, 0.15);
    padding: 6px 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

/* 모달 하단 액션 버튼 (주/부 계층화) */
.calc-modal-footer {
    display: flex;
    gap: 8px;
    padding: 6px 12px 8px;
    border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.calc-action-btn {
    flex: 1;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 6px;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.82rem;
    padding: 5px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
    gap: 4px;
    box-shadow: 0 3px 10px rgba(2, 132, 199, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.calc-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.5);
}

.calc-action-btn.print-btn {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border-color: rgba(52, 211, 153, 0.5);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.calc-action-btn.print-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(5, 150, 105, 0.5);
}

.calc-action-btn.secondary {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: #f1f5f9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.calc-action-btn.secondary:hover {
    background: rgba(51, 65, 85, 0.95);
    border-color: rgba(148, 163, 184, 0.45);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

/* 카카오 지도 커스텀 오버레이 핀 */
.kakao-custom-pin {
    background: rgba(15, 23, 42, 0.92);
    border: 1.5px solid #38bdf8;
    border-radius: 6px;
    padding: 3px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

.kakao-custom-pin.start {
    border-color: #10b981;
}

.kakao-custom-pin.end {
    border-color: #ef4444;
}

.kakao-custom-pin .pin-dot {
    font-size: 0.95rem;
}

.kakao-custom-pin .pin-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #f8fafc;
}

/* 챗봇 인라인 칩 버튼 */
.inline-calc-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8 !important;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-top: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.inline-calc-trigger:hover {
    background: rgba(56, 189, 248, 0.22);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(56, 189, 248, 0.3);
}

/* ─────────────────────────────────────────────────────────────
   유류비 계산기 지도 세로 확장 및 사각형 비율 최적화 (v2.0)
   ───────────────────────────────────────────────────────────── */
.calc-map-section {
    margin-top: 4px;
}

.calc-map-container {
    width: 100% !important;
    height: 385px !important;
    min-height: 385px !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    position: relative !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

#calc-kakao-map, #calc-real-map-img, #calc-map-canvas {
    width: 100% !important;
    height: 100% !important;
    min-height: 385px !important;
    border-radius: 10px !important;
}

.calc-zoom-controls {
    display: flex;
    gap: 6px;
}

.calc-zoom-btn {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calc-zoom-btn:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #38bdf8;
    transform: scale(1.05);
}

/* ─────────────────────────────────────────────────────────────
   계산기 창 크기 자유 조절(Resizable) 및 최대화 스타일
   ───────────────────────────────────────────────────────────── */
.calc-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ─────────────────────────────────────────────────────────────
   출장 유류비 계산기 산출 근거 및 사용안내 모달 스타일
   ───────────────────────────────────────────────────────────── */
.calc-help-btn {
    height: 32px;
    padding: 0 12px;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-sizing: border-box;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.calc-help-btn:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.calc-board-btn {
    height: 32px;
    padding: 0 12px;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-sizing: border-box;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.calc-board-btn:hover {
    background: #059669;
    color: #ffffff;
    border-color: #34d399;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.calc-help-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    z-index: 11000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.calc-help-modal-backdrop.active {
    opacity: 1;
}

.calc-help-modal-card {
    width: 100%;
    max-width: 630px;
    max-height: 90vh;
    max-height: 90dvh;
    background: #0f172a;
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 12px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6), 0 0 25px rgba(56, 189, 248, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #f8fafc;
}

.calc-help-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(15, 23, 42, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.calc-help-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.calc-help-emoji {
    font-size: 1.15rem;
}

.calc-help-title h4 {
    margin: 0;
    font-size: 0.94rem;
    font-weight: 800;
    color: #ffffff;
}

.calc-help-close-btn {
    background: transparent;
    border: none;
    font-size: 1.3rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 6px;
    line-height: 1;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.calc-help-close-btn:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.15);
}

.calc-help-body {
    padding: 14px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
}

.calc-help-body::-webkit-scrollbar {
    width: 6px;
}
.calc-help-body::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.3);
    border-radius: 3px;
}

.calc-help-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.calc-help-sec-title {
    margin: 0 0 2px 0;
    font-size: 0.84rem;
    font-weight: 700;
    color: #38bdf8;
    display: flex;
    align-items: center;
    gap: 5px;
}

.calc-help-box {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 8px 12px;
}

.calc-help-list {
    margin: 0;
    padding-left: 16px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.78rem;
    color: #cbd5e1;
    line-height: 1.45;
    word-break: keep-all;
}

.calc-help-list code {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    padding: 2px 6px;
    margin: 0 1px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 600;
    word-break: keep-all;
    white-space: normal;
    display: inline;
}

.calc-help-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
}

.calc-help-table th, .calc-help-table td {
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.calc-help-table th {
    background: rgba(15, 23, 42, 0.9);
    color: #94a3b8;
    font-weight: 700;
    padding: 5px 8px;
}

.calc-help-table td .highlight-val {
    color: #38bdf8;
    font-weight: 700;
}

.calc-help-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

@media (max-width: 540px) {
    .calc-help-grid {
        grid-template-columns: 1fr;
    }
}

.calc-help-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 8px;
    padding: 6px 10px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.calc-help-card-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.calc-help-card-content strong {
    display: block;
    font-size: 0.76rem;
    color: #38bdf8;
    margin-bottom: 2px;
}

.calc-help-card-content p {
    margin: 0;
    font-size: 0.71rem;
    color: #cbd5e1;
    line-height: 1.35;
    word-break: keep-all;
}

.calc-help-footer {
    padding: 8px 16px;
    background: rgba(15, 23, 42, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

.calc-help-confirm-btn {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #ffffff;
    font-size: 0.80rem;
    font-weight: 700;
    padding: 5px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.calc-help-confirm-btn:hover {
    background: #0284c7;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}


.calc-max-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #94a3b8;
    font-size: 14px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calc-max-btn:hover {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.4);
    transform: scale(1.08);
}

/* 드래그 크기 조절 (Resizable) */
.calc-modal-card.resizable-modal {
    resize: both;
    overflow: hidden;
    width: 760px;
    height: 820px;
    min-width: 500px;
    min-height: 500px;
    max-width: 95vw;
    max-height: 95vh;
}

/* 최대화 모드 (전체화면 꽉 찬 뷰) */
.calc-modal-card.maximized {
    width: 95vw !important;
    height: 92vh !important;
    max-width: 95vw !important;
    max-height: 92vh !important;
    resize: none !important;
    border-radius: 12px !important;
}

.calc-modal-card.maximized .calc-map-container {
    height: 480px !important;
    min-height: 480px !important;
}

.calc-modal-card.maximized #calc-kakao-map,
.calc-modal-card.maximized #calc-real-map-img {
    height: 480px !important;
    min-height: 480px !important;
}

/* 하단 액션 버튼 (클립보드 복사 등) 시인성 대폭 개선 */
.calc-action-btn {
    font-weight: 700 !important;
    font-size: 13px !important;
    padding: 10px 16px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
}

.calc-action-btn.secondary {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%) !important;
    border: 1px solid rgba(56, 189, 248, 0.45) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
}

.calc-action-btn.secondary:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    color: #ffffff !important;
    border-color: #38bdf8 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.35) !important;
}

/* ─────────────────────────────────────────────────────────────
   📱 공무원 출장 유류비 계산기 모바일 프리미엄 슬림 반응형 UI (v2.2)
   ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    * {
        box-sizing: border-box !important;
    }

    /* 1. 모바일 전체 세로 스크롤 & 가로 넘침 원천 방어 */
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        width: 100% !important;
    }

    .calc-modal-backdrop {
        padding: 0 !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        background: #0f172a !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100% !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        z-index: 99999 !important;
        display: block !important;
        box-sizing: border-box !important;
    }

    .calc-modal-card {
        width: 100% !important;
        max-width: 100vw !important;
        min-width: 0 !important;
        min-height: 100% !important;
        height: auto !important;
        max-height: none !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        transform: none !important;
        background: #0f172a !important;
        resize: none !important;
        display: block !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
        box-sizing: border-box !important;
        padding-bottom: 45px !important;
    }

    /* 2. 상단 헤더 */
    .calc-modal-header {
        position: sticky !important;
        top: 0 !important;
        z-index: 100 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 8px 12px 6px !important;
        background: rgba(15, 23, 42, 0.97) !important;
        backdrop-filter: blur(12px) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
        gap: 6px !important;
        width: 100% !important;
        max-width: 100vw !important;
    }

    .calc-title-box {
        display: flex !important;
        align-items: center !important;
        gap: 5px !important;
        flex: 1 !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .calc-emoji {
        font-size: 1.05rem !important;
        flex-shrink: 0 !important;
    }

    .calc-title {
        font-size: 0.88rem !important;
        font-weight: 800 !important;
        color: #ffffff !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        letter-spacing: -0.02em !important;
    }

    .calc-header-actions {
        display: flex !important;
        align-items: center !important;
        gap: 5px !important;
        flex-shrink: 0 !important;
    }

    .calc-help-btn,
    .calc-board-btn,
    .calc-standalone-btn,
    .top-nav-back {
        font-size: 0.70rem !important;
        font-weight: 700 !important;
        padding: 3px 7px !important;
        border-radius: 6px !important;
        white-space: nowrap !important;
    }

    .calc-close-btn {
        font-size: 1.4rem !important;
        padding: 0 4px !important;
        line-height: 1 !important;
        color: #94a3b8 !important;
    }

    /* 3. 본문 컨테이너 */
    .calc-modal-body {
        padding: 8px 10px 14px !important;
        gap: 8px !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

    /* 4. 출발지 / 스왑 / 도착지 / 조회버튼 (가로 1행 4단 올인원) */
    .calc-grid-origin-dest {
        display: grid !important;
        grid-template-columns: 1fr 28px 1fr 38px !important;
        gap: 3px !important;
        align-items: end !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .calc-field-group {
        width: 100% !important;
        min-width: 0 !important;
    }

    .calc-label-highlight {
        font-size: 0.84rem !important;
        font-weight: 700 !important;
        color: #f1f5f9 !important;
        margin-bottom: 2px !important;
        display: flex !important;
        align-items: center !important;
        gap: 3px !important;
        white-space: nowrap !important;
        text-overflow: ellipsis !important;
        overflow: hidden !important;
    }

    .calc-source-desktop { display: none !important; }
    .calc-source-mobile { display: inline !important; }

    .calc-field-group input,
    .calc-field-group select {
        height: 34px !important;
        font-size: 0.82rem !important;
        font-weight: 600 !important;
        padding: 0 5px !important;
        border-radius: 6px !important;
        background: #0f172a !important;
        border: 1px solid rgba(56, 189, 248, 0.35) !important;
        color: #ffffff !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        ime-mode: active !important;
    }

    .calc-btn-swap {
        align-self: end !important;
        width: 28px !important;
        height: 34px !important;
        margin: 0 !important;
        border-radius: 6px !important;
        background: rgba(56, 189, 248, 0.15) !important;
        border: 1px solid rgba(56, 189, 248, 0.4) !important;
        color: #38bdf8 !important;
        font-size: 0.95rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        padding: 0 !important;
    }

    .calc-btn-group-search {
        width: 38px !important;
        margin: 0 !important;
    }

    .calc-btn-group-search .calc-btn-primary {
        width: 38px !important;
        height: 34px !important;
        font-size: 0.85rem !important;
        font-weight: 800 !important;
        border-radius: 6px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
    }

    /* 5. 빠른 출장지 퀵 칩 바 */
    .calc-quick-chips {
        display: flex !important;
        align-items: center !important;
        gap: 3px !important;
        padding: 1px 0 !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .calc-chips-label {
        font-size: 0.66rem !important;
        font-weight: 700 !important;
        color: #38bdf8 !important;
        flex-shrink: 0 !important;
    }

    .calc-chips-scroll {
        display: flex !important;
        gap: 3px !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
    }

    .calc-chip {
        font-size: 0.66rem !important;
        font-weight: 600 !important;
        padding: 2px 5px !important;
        border-radius: 4px !important;
        background: rgba(56, 189, 248, 0.1) !important;
        border: 1px solid rgba(56, 189, 248, 0.3) !important;
        color: #cbd5e1 !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }

    /* 6. 유종(1.15fr) / 지역(0.75fr) / 단가(1.1fr) 가로 1행 3열 올인원 */
    .calc-grid-3 {
        display: grid !important;
        grid-template-columns: 1.15fr 0.75fr 1.1fr !important;
        gap: 3px !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .calc-grid-datetime {
        display: grid !important;
        grid-template-columns: 1.35fr 0.9fr 0.75fr !important;
        gap: 3px !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .calc-btn-add-via {
        font-size: 0.60rem !important;
        padding: 1px 4px !important;
        margin-left: auto !important;
    }

    .calc-grid-3 > div:nth-child(1) {
        grid-column: auto !important;
    }

    .calc-input-unit {
        position: relative !important;
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .calc-input-unit input {
        padding-right: 32px !important;
        text-align: right !important;
        font-weight: 700 !important;
        height: 34px !important;
        font-size: 0.76rem !important;
    }

    .calc-unit-text {
        position: absolute !important;
        right: 4px !important;
        font-size: 0.62rem !important;
        font-weight: 700 !important;
        color: #94a3b8 !important;
        pointer-events: none !important;
    }

    /* 7. 지도 영역 & 인포 헤더 */
    .calc-map-section {
        margin-top: 2px !important;
        width: 100% !important;
        border-radius: 8px !important;
        overflow: hidden !important;
        border: 1px solid rgba(56, 189, 248, 0.25) !important;
    }

    .calc-map-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 4px 6px !important;
        background: rgba(15, 23, 42, 0.9) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
        gap: 4px !important;
        white-space: nowrap !important;
        flex-wrap: nowrap !important;
    }

    .calc-map-header-left {
        display: flex !important;
        align-items: center !important;
        gap: 3px !important;
        flex-shrink: 0 !important;
    }

    .calc-map-title {
        font-size: 0.68rem !important;
        font-weight: 700 !important;
        color: #cbd5e1 !important;
        white-space: nowrap !important;
    }

    .calc-map-stats {
        font-size: 0.68rem !important;
        font-weight: 800 !important;
        color: #38bdf8 !important;
        white-space: nowrap !important;
        letter-spacing: -0.3px !important;
        text-align: right !important;
        flex: 1 !important;
        min-width: 0 !important;
    }

    .calc-zoom-controls {
        display: flex !important;
        gap: 2px !important;
        flex-shrink: 0 !important;
    }

    .calc-zoom-btn {
        padding: 2px 4px !important;
        font-size: 0.62rem !important;
        font-weight: 700 !important;
        border-radius: 4px !important;
    }

    .calc-map-container {
        height: 230px !important;
        min-height: 230px !important;
        max-height: 230px !important;
        border-radius: 0 0 8px 8px !important;
        touch-action: pan-y !important;
        width: 100% !important;
    }

    #calc-kakao-map, #calc-real-map-img, #calc-map-canvas {
        height: 230px !important;
        min-height: 230px !important;
        border-radius: 0 0 8px 8px !important;
        touch-action: pan-y !important;
        width: 100% !important;
    }

    /* 8. ⭐ 최종 유류비 지급 총액 골드/에메랄드 배너 (중앙 정렬 콤팩트 바) */
    .calc-total-banner {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 5px 10px !important;
        margin: 3px 0 !important;
        border-radius: 6px !important;
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(6, 78, 59, 0.5) 100%) !important;
        border: 1.5px solid rgba(52, 211, 153, 0.75) !important;
        box-shadow: 0 0 10px rgba(16, 185, 129, 0.2) !important;
        gap: 6px !important;
        width: 100% !important;
    }

    .calc-banner-title {
        font-size: 0.74rem !important;
        font-weight: 700 !important;
        color: #e2e8f0 !important;
        display: flex !important;
        align-items: center !important;
        gap: 3px !important;
    }

    .calc-banner-star {
        font-size: 0.85rem !important;
        color: #fbbf24 !important;
    }

    .calc-banner-amount {
        font-size: 1.08rem !important;
        font-weight: 900 !important;
        color: #fde047 !important;
        letter-spacing: -0.02em !important;
        text-shadow: 0 0 6px rgba(253, 224, 71, 0.4) !important;
        margin: 0 2px !important;
    }

    .calc-banner-sub {
        display: none !important;
    }

    /* 9. 상세 산출내역 표 */
    .calc-result-card {
        width: 100% !important;
        padding: 4px 6px !important;
        border-radius: 8px !important;
        background: rgba(15, 23, 42, 0.85) !important;
        border: 1px solid rgba(56, 189, 248, 0.3) !important;
    }

    .calc-table-breakdown {
        width: 100% !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
        border: 1px solid rgba(56, 189, 248, 0.3) !important;
        border-radius: 5px !important;
        overflow: hidden !important;
    }

    .calc-table-breakdown th {
        font-size: 0.68rem !important;
        font-weight: 700 !important;
        padding: 5px 2px !important;
        background: rgba(30, 58, 138, 0.65) !important;
        color: #93c5fd !important;
        text-align: center !important;
        vertical-align: middle !important;
        white-space: nowrap !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    .calc-table-breakdown td {
        font-size: 0.70rem !important;
        font-weight: 600 !important;
        padding: 6px 2px !important;
        color: #f8fafc !important;
        text-align: center !important;
        vertical-align: middle !important;
        line-height: 1.3 !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        word-break: keep-all !important;
    }

    .calc-toll-input {
        width: 48px !important;
        height: 23px !important;
        font-size: 0.74rem !important;
        padding: 0 2px !important;
    }

    .calc-formula-detail {
        font-size: 0.62rem !important;
        line-height: 1.3 !important;
        color: #94a3b8 !important;
        text-align: center !important;
        padding-top: 3px !important;
        border-top: 1px dashed rgba(255, 255, 255, 0.1) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        letter-spacing: -0.03em !important;
    }

    .calc-legal-badge {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 4px 6px !important;
        font-size: 0.65rem !important;
        line-height: 1.3 !important;
        border-radius: 6px !important;
        gap: 4px !important;
        background: rgba(56, 189, 248, 0.08) !important;
        border: 1px solid rgba(56, 189, 248, 0.25) !important;
        margin-top: 3px !important;
    }

    /* 7. 지도 영역 & 인포 헤더 (모바일 2행 분리 겹침 100% 차단) */
    .calc-map-section {
        margin-top: 3px !important;
        width: 100% !important;
        border-radius: 8px !important;
        overflow: hidden !important;
        border: 1px solid rgba(56, 189, 248, 0.25) !important;
    }

    .calc-map-header {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 5px 8px !important;
        background: rgba(15, 23, 42, 0.95) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
        gap: 3px 6px !important;
    }

    .calc-map-header-left {
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
        flex: 0 0 auto !important;
    }

    .calc-map-title {
        font-size: 0.72rem !important;
        font-weight: 700 !important;
        color: #cbd5e1 !important;
        white-space: nowrap !important;
    }

    .calc-map-click-hint {
        font-size: 0.60rem !important;
        padding: 1px 4px !important;
    }

    .calc-map-stats {
        font-size: 0.74rem !important;
        font-weight: 800 !important;
        color: #38bdf8 !important;
        white-space: nowrap !important;
        margin-left: auto !important;
        flex: 0 0 auto !important;
    }

    .calc-zoom-controls {
        display: flex !important;
        gap: 3px !important;
        width: 100% !important;
        justify-content: flex-end !important;
        padding-top: 2px !important;
        border-top: 1px dashed rgba(255, 255, 255, 0.08) !important;
    }

    .calc-zoom-btn {
        padding: 2px 6px !important;
        font-size: 0.65rem !important;
        font-weight: 700 !important;
        border-radius: 4px !important;
    }

    .calc-date-input-wrapper input[type="date"] {
        font-size: 0.75rem !important;
        padding-left: 3px !important;
        padding-right: 1px !important;
        letter-spacing: -0.4px !important;
    }

    .calc-date-stepper-btns {
        gap: 1px !important;
    }

    .calc-stepper-btn {
        width: 16px !important;
        height: 12px !important;
        font-size: 0.52rem !important;
    }

    .calc-map-container {
        height: 230px !important;
        min-height: 230px !important;
        max-height: 230px !important;
        border-radius: 0 0 8px 8px !important;
        touch-action: pan-y !important;
        width: 100% !important;
    }

    #calc-kakao-map, #calc-real-map-img, #calc-map-canvas {
        height: 260px !important;
        min-height: 260px !important;
        border-radius: 0 0 8px 8px !important;
        touch-action: pan-y !important;
        width: 100% !important;
    }

    /* 8. 상세 산출내역 표 (가독성 & 센터 정렬 최적화) */
    .calc-result-card {
        width: 100% !important;
        padding: 5px 6px !important;
        border-radius: 8px !important;
        background: rgba(15, 23, 42, 0.85) !important;
        border: 1px solid rgba(56, 189, 248, 0.3) !important;
    }

    .calc-table-breakdown {
        width: 100% !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
        border: 1px solid rgba(56, 189, 248, 0.3) !important;
        border-radius: 6px !important;
        overflow: hidden !important;
    }

    .calc-table-breakdown th {
        font-size: 0.68rem !important;
        font-weight: 700 !important;
        padding: 5px 2px !important;
        background: rgba(30, 58, 138, 0.65) !important;
        color: #93c5fd !important;
        text-align: center !important;
        vertical-align: middle !important;
        white-space: nowrap !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    .calc-table-breakdown td {
        font-size: 0.70rem !important;
        font-weight: 600 !important;
        padding: 6px 2px !important;
        color: #f8fafc !important;
        text-align: center !important;
        vertical-align: middle !important;
        line-height: 1.3 !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        word-break: keep-all !important;
    }

    /* 9. 최종 유류비 지급 총액 골드/에메랄드 배너 (중앙 정렬 콤팩트 바) */
    .calc-total-banner {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 5px 12px !important;
        margin: 4px 0 !important;
        border-radius: 6px !important;
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(6, 78, 59, 0.5) 100%) !important;
        border: 1.5px solid rgba(52, 211, 153, 0.75) !important;
        box-shadow: 0 0 12px rgba(16, 185, 129, 0.25) !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .calc-banner-title {
        font-size: 0.78rem !important;
        font-weight: 700 !important;
        color: #e2e8f0 !important;
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
    }

    .calc-banner-star {
        font-size: 0.90rem !important;
        color: #fbbf24 !important;
    }

    .calc-banner-amount {
        font-size: 1.15rem !important;
        font-weight: 900 !important;
        color: #fde047 !important;
        letter-spacing: -0.02em !important;
        text-shadow: 0 0 8px rgba(253, 224, 71, 0.5) !important;
        margin: 0 4px !important;
    }

    .calc-banner-sub {
        display: none !important;
    }

    .calc-formula-detail {
        font-size: 0.64rem !important;
        line-height: 1.35 !important;
        color: #94a3b8 !important;
        text-align: center !important;
        padding-top: 3px !important;
        border-top: 1px dashed rgba(255, 255, 255, 0.1) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        letter-spacing: -0.03em !important;
    }

    /* 10. 하단 액션 버튼 바 (풀사이즈 40px 터치 최적화) */
    .calc-modal-footer {
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
        padding: 6px 10px 24px !important;
        background: transparent !important;
        border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
        width: 100% !important;
    }

    .calc-action-btn.print-btn {
        display: none !important;
    }

    .calc-action-btn {
        width: 100% !important;
        height: 40px !important;
        font-size: 0.84rem !important;
        font-weight: 800 !important;
        border-radius: 8px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 5px !important;
        box-shadow: 0 3px 10px rgba(2, 132, 199, 0.3) !important;
    }

    /* 단독 페이지(`/calculator`) 마운트 최적화 */
    .standalone-wrapper .calc-modal-card {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        display: block !important;
        width: 100% !important;
    }

    .standalone-wrapper .calc-modal-body {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        flex: none !important;
        width: 100% !important;
    }
}

/* ==========================================================================
   🏛️ AI-SEN 행정·민원 서식 포털 모달 전용 스타일 (Forms Portal Modal)
   ========================================================================== */
.forms-portal-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.forms-portal-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.forms-portal-modal-card {
    background: #ffffff;
    width: 92vw;
    max-width: 1240px;
    height: 86vh;
    min-height: 620px;
    border-radius: 20px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(226, 232, 240, 0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: formsModalScaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes formsModalScaleUp {
    from {
        transform: scale(0.95) translateY(10px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* 1. 모달 헤더 */
.forms-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
}

.forms-modal-title-area {
    display: flex;
    align-items: center;
    gap: 14px;
}

.forms-modal-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.forms-modal-icon i {
    width: 24px;
    height: 24px;
}

.forms-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.4px;
}

.forms-modal-subtitle {
    font-size: 0.85rem;
    color: #64748b;
    margin: 3px 0 0 0;
}

.forms-modal-close {
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.1rem;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.forms-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: rotate(90deg);
}

/* 2. 검색 및 통계 바 */
.forms-modal-search-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 28px;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
}

.forms-search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.forms-search-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: #94a3b8;
    pointer-events: none;
}

#forms-search-input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    font-size: 0.95rem;
    background: #f8fafc;
    color: #0f172a;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

#forms-search-input:focus {
    outline: none;
    border-color: #0284c7;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.12);
}

.forms-total-badge {
    padding: 6px 14px;
    border-radius: 20px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid #bae6fd;
}

/* 3. 카테고리 탭 바 (가로 스크롤) */
.forms-category-tabs-wrapper {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 28px;
}

.forms-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 0;
}

.forms-category-tabs::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.forms-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.forms-tab-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.forms-tab-btn.active {
    background: #e0f2fe;
    color: #0284c7;
    border-color: #bae6fd;
    font-weight: 700;
}

.forms-tab-badge {
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.06);
    color: inherit;
}

.forms-tab-btn.active .forms-tab-badge {
    background: #0284c7;
    color: #ffffff;
}

/* 4. 모달 본문 및 카드 그리드 (컴팩트 고밀도 5열 레이아웃) */
.forms-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    background: #f8fafc;
    min-height: 450px;
}

.forms-grid-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

@media (max-width: 1280px) {
    .forms-grid-container {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (max-width: 1024px) {
    .forms-grid-container {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 768px) {
    .forms-grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .forms-modal-header, .forms-modal-search-bar, .forms-category-tabs-wrapper, .forms-modal-body {
        padding-left: 14px;
        padding-right: 14px;
    }
    .forms-modal-subtitle {
        display: none;
    }
}
@media (max-width: 480px) {
    .forms-grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

/* 서식 카드 디자인 (컴팩트 모던 화이트 카드) */
.form-card-modern {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 10px 10px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
    position: relative;
    cursor: pointer;
}

.form-card-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(2, 132, 199, 0.15), 0 0 0 1.5px #0284c7;
    border-color: #0284c7;
}

.form-card-icon-wrapper {
    margin-bottom: 8px;
}

.form-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(2, 132, 199, 0.2);
    transition: transform 0.2s ease;
}

.form-card-modern:hover .form-card-icon {
    transform: scale(1.06);
}

.form-card-icon i {
    width: 18px;
    height: 18px;
}

.form-card-title-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    min-height: 40px;
    width: 100%;
}

.form-card-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    color: #0284c7;
    background: #e0f2fe;
    padding: 1px 6px;
    border-radius: 4px;
    margin-bottom: 4px;
}

.form-card-title-link {
    font-size: 0.84rem;
    font-weight: 700;
    color: #1e293b;
    text-decoration: none;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: keep-all;
    overflow-wrap: break-word;
    text-align: center;
    max-height: 2.7em;
    width: 100%;
    transition: color 0.2s ease;
}

.form-card-title-link:hover {
    color: #0284c7;
    text-decoration: underline;
}

.form-card-actions {
    width: 100%;
}

.form-card-btn-download {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 6px 8px;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-size: 0.76rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-card-btn-download:hover {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

.forms-empty-state {
    grid-column: 1 / -1;
    padding: 60px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 다크 모드 지원 (Dark Theme Overrides) */
[data-theme="dark"] .forms-portal-modal-card {
    background: #0f172a;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(51, 65, 85, 0.8);
}
[data-theme="dark"] .forms-modal-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-bottom-color: #334155;
}
[data-theme="dark"] .forms-modal-title {
    color: #f8fafc;
}
[data-theme="dark"] .forms-modal-subtitle {
    color: #94a3b8;
}
[data-theme="dark"] .forms-modal-close {
    background: #1e293b;
    color: #94a3b8;
}
[data-theme="dark"] .forms-modal-close:hover {
    background: #334155;
    color: #f8fafc;
}
[data-theme="dark"] .forms-modal-search-bar {
    background: #0f172a;
    border-bottom-color: #1e293b;
}
[data-theme="dark"] #forms-search-input {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}
[data-theme="dark"] #forms-search-input:focus {
    border-color: #38bdf8;
    background: #0f172a;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
}
[data-theme="dark"] .forms-total-badge {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.3);
}
[data-theme="dark"] .forms-category-tabs-wrapper {
    background: #0f172a;
    border-bottom-color: #334155;
}
[data-theme="dark"] .forms-tab-btn {
    color: #94a3b8;
}
[data-theme="dark"] .forms-tab-btn:hover {
    background: #1e293b;
    color: #f8fafc;
}
[data-theme="dark"] .forms-tab-btn.active {
    background: rgba(2, 132, 199, 0.2);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.4);
}
[data-theme="dark"] .forms-modal-body {
    background: #0b1120;
}
[data-theme="dark"] .form-card-modern {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
[data-theme="dark"] .form-card-modern:hover {
    border-color: #38bdf8;
    box-shadow: 0 10px 20px -5px rgba(56, 189, 248, 0.2), 0 0 0 1.5px #38bdf8;
}
[data-theme="dark"] .form-card-title-link {
    color: #f1f5f9;
}
[data-theme="dark"] .form-card-title-link:hover {
    color: #38bdf8;
}
[data-theme="dark"] .form-card-badge {
    background: rgba(2, 132, 199, 0.25);
    color: #38bdf8;
}
[data-theme="dark"] .form-card-btn-download {
    background: #0f172a;
    border-color: #475569;
    color: #cbd5e1;
}
[data-theme="dark"] .form-card-btn-download:hover {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
}



