/* ========================
   기본 설정
======================== */
:root {
    --primary: #1a56db;
    --primary-light: #e8f0fe;
    --primary-dark: #1344b0;
    --secondary: #7c3aed;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --bg: #f0f4ff;
    --card-bg: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
    --radius: 16px;
    --radius-sm: 8px;
    --radius-lg: 24px;
    --header-height: 60px;
    --sidebar-width: 80px;         /* 좌측 사이드바 너비 */
    --bottom-nav-height: 65px;     /* 레거시 변수 유지 (다른 곳 참조용) */
    --font: 'Noto Sans KR', sans-serif;
}

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

html, body {
    height: 100%;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ========================
   스플래시 화면
======================== */
#splash-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(145deg, #1a56db 0%, #7c3aed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.splash-content {
    text-align: center;
    color: white;
    padding: 20px;
}

.splash-logo {
    margin-bottom: 48px;
}

.logo-icon {
    font-size: 72px;
    margin-bottom: 16px;
    animation: bounceIn 0.8s ease;
}

.splash-title {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    animation: slideUp 0.6s ease 0.2s both;
}

.splash-subtitle {
    font-size: 14px;
    opacity: 0.8;
    animation: slideUp 0.6s ease 0.4s both;
}

.loader-bar {
    width: 200px;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    margin: 0 auto 12px;
    overflow: hidden;
}

.loader-fill {
    height: 100%;
    background: white;
    border-radius: 2px;
    animation: loadProgress 2s ease forwards;
}

.loader-text {
    font-size: 13px;
    opacity: 0.7;
}

.splash-credit {
    margin-top: 32px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.08em;
    font-style: normal;
    animation: fadeInCredit 1.8s ease 0.8s both;
}

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

@keyframes loadProgress {
    from { width: 0%; }
    to { width: 100%; }
}

@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

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

/* ========================
   헤더 (사이드바 너비만큼 오른쪽으로)
======================== */
.app-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--border);
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 16px;
    max-width: 900px;
    margin: 0 auto;
}

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

.header-emoji {
    font-size: 22px;
}

.header-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.3px;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.icon-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* ========================
   사이드 메뉴
======================== */
.side-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: white;
    z-index: 200;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.side-menu.open {
    transform: translateX(0);
    display: flex;
}

.side-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.side-menu-title {
    font-size: 16px;
    font-weight: 700;
    color: white;
}

.side-menu-header .icon-btn {
    color: white;
}

.side-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.side-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
    border-radius: 0;
}

.side-nav-item:hover, .side-nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.side-nav-item i {
    width: 20px;
    text-align: center;
    color: var(--text-muted);
}

.side-nav-item.active i, .side-nav-item:hover i {
    color: var(--primary);
}

.side-nav-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 16px;
}

.side-menu-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
}

.version {
    margin-top: 4px;
    color: var(--primary);
    font-weight: 600;
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 150;
    backdrop-filter: blur(2px);
}

/* ========================
   메인 콘텐츠 (사이드바 오른쪽)
======================== */
.main-content {
    margin-top: var(--header-height);
    margin-bottom: 0;
    margin-left: var(--sidebar-width);
    margin-right: 0;
    min-height: calc(100vh - var(--header-height));
    max-width: 860px;
    padding: 0;
}

.page {
    padding: 16px;
    animation: fadeIn 0.3s ease;
}

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

/* ========================
   홈 화면
======================== */
.home-hero {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    color: white;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* 공지 티커가 있을 때 hero 높이 줄임 */
.home-hero--compact {
    padding: 14px 20px 12px;
    margin-bottom: 14px;
}
.home-hero--compact .hero-badge { margin-bottom: 6px; font-size: 11px; }
.home-hero--compact .hero-title { font-size: 18px; margin-bottom: 0; }
.home-hero--compact .hero-desc  { display: none; }

.home-hero::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.home-hero::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: -20px;
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}

.hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    margin-bottom: 10px;
}

.hero-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
    position: relative;
}

.hero-desc {
    font-size: 14px;
    opacity: 0.85;
    line-height: 1.6;
    position: relative;
}

/* 빠른 카드들 */
.quick-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.quick-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: white;
    border-radius: var(--radius);
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow);
    border: 1.5px solid transparent;
}

.quick-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.quick-card:active {
    transform: scale(0.98);
}

.qc-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.bg-blue { background: #dbeafe; }
.bg-green { background: #d1fae5; }
.bg-purple { background: #ede9fe; }
.bg-orange { background: #fed7aa; }
.bg-pink { background: #fce7f3; }
.bg-cyan { background: #cffafe; }
.bg-teal { background: #ccfbf1; }
.bg-red { background: #fee2e2; }

.qc-content {
    flex: 1;
}

.qc-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.qc-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.qc-arrow {
    color: var(--text-muted);
    font-size: 13px;
}

/* 최근 질문 */
.section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.empty-state {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 36px;
    margin-bottom: 8px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 14px;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recent-item {
    background: white;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow);
    transition: all 0.2s;
}

.recent-item:hover {
    background: var(--primary-light);
}

.recent-dept-tag {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--primary);
    white-space: nowrap;
    font-weight: 600;
}

.recent-q-text {
    flex: 1;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========================
   페이지 헤더
======================== */
.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-top: 4px;
    position: relative;
}

/* ── 대화 이력 드롭다운 ── */
.hist-dropdown-wrap {
    margin-left: auto;
    position: relative;
    z-index: 200;
}
.hist-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 7px 13px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(99,102,241,0.25);
    transition: background 0.2s;
}
.hist-dropdown-btn:hover { background: var(--secondary); }
.hist-arrow { font-size: 10px; transition: transform 0.25s; }
.hist-arrow.open { transform: rotate(180deg); }

.hist-dropdown-list {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: min(340px, 82vw);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    overflow: hidden;
    max-height: 360px;
    overflow-y: auto;
}
.hist-dropdown-list.hidden { display: none; }

.hist-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}
.hist-dropdown-item:last-child { border-bottom: none; }
.hist-dropdown-item:hover { background: var(--primary-light); }
.hist-dept-tag {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 8px;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.hist-q-text {
    font-size: 12px;
    color: var(--text-primary);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex: 1;
}
.hist-q-date {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}
/* 툴팁: 텍스트가 잘릴 때만 full 내용 표시 */
.hist-dropdown-item[data-overflow="true"]:hover::after {
    content: attr(data-fulltext);
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1e293b;
    color: #fff;
    font-size: 12px;
    line-height: 1.6;
    padding: 8px 12px;
    border-radius: 8px;
    z-index: 999;
    white-space: pre-wrap;
    word-break: break-word;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    max-width: 320px;
}
.hist-dropdown-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.back-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.page-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

/* ========================
   섹션 카드
======================== */
.section-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.section-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.step-badge {
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

/* 드롭다운 */
.select-wrapper {
    position: relative;
}

.dept-select {
    width: 100%;
    padding: 14px 44px 14px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    font-family: var(--font);
    font-weight: 500;
    color: var(--text-primary);
    background: white;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.dept-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}

.select-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* 부서 정보 */
.dept-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 12px;
    background: var(--primary-light);
    border-radius: 10px;
    border-left: 3px solid var(--primary);
    animation: slideDown 0.3s ease;
}

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

.dept-info-icon {
    font-size: 28px;
}

.dept-info-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
}

.dept-info-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ── 키워드 직접 입력 영역 ──────────────────────────────── */
.kw-input-wrap {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1.5px solid #bae6fd;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 14px;
}
.kw-input-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}
.kw-icon { color: #0284c7; font-size: 15px; }
.kw-label {
    font-size: 13px;
    font-weight: 700;
    color: #0369a1;
}
.kw-optional {
    font-weight: 400;
    color: #64748b;
    font-size: 12px;
}
.kw-hint {
    font-size: 11.5px;
    color: #475569;
    margin-bottom: 10px;
    line-height: 1.5;
    padding: 6px 10px;
    background: rgba(255,255,255,0.7);
    border-radius: 6px;
    border-left: 3px solid #38bdf8;
}
.kw-chips-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.kw-chip-wrap {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid #7dd3fc;
    border-radius: 20px;
    padding: 4px 10px 4px 12px;
    gap: 4px;
    flex: 1;
    min-width: 80px;
    max-width: 160px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.kw-chip-wrap:focus-within {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 2px rgba(14,165,233,0.2);
}
.kw-chip-input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    color: #0f172a;
    font-weight: 600;
    width: 100%;
    min-width: 0;
}
.kw-chip-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}
.kw-chip-clear {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    padding: 0;
    font-size: 11px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s;
}
.kw-chip-clear:hover { color: #ef4444; }
.kw-preview {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.kw-preview-tag {
    background: #0ea5e9;
    color: #fff;
    border-radius: 12px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
}

/* 질문 팁 */
.question-tip {
    display: flex;
    gap: 10px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 14px;
}

.question-tip > i {
    color: #d97706;
    font-size: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}

.tip-title {
    font-size: 13px;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 4px;
}

.tip-text {
    font-size: 12px;
    color: #78350f;
    margin-bottom: 8px;
}

.tip-example {
    font-size: 12px;
    line-height: 1.7;
    color: #78350f;
    background: rgba(255,255,255,0.5);
    border-radius: 6px;
    padding: 8px 10px;
}

.tip-bad { color: #dc2626; font-weight: 600; }
.tip-good { color: #059669; font-weight: 600; }

/* 질문 텍스트에리어 */
.question-textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    font-family: var(--font);
    resize: vertical;
    outline: none;
    transition: all 0.2s;
    line-height: 1.6;
    color: var(--text-primary);
    min-height: 120px;
}

.question-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}

.question-textarea::placeholder {
    color: var(--text-muted);
    line-height: 1.6;
}

/* ─── 검색 모드 토글 ─────────────────────────────── */
.search-mode-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 8px 12px;
    background: #f8faff;
    border: 1.5px solid #dce7ff;
    border-radius: 12px;
    flex-wrap: wrap;
}
.search-mode-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}
.search-mode-toggle {
    display: flex;
    background: #e8eeff;
    border-radius: 9px;
    padding: 3px;
    gap: 3px;
}
.smode-btn {
    border: none;
    border-radius: 7px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font);
}
.smode-btn.active {
    box-shadow: 0 1px 6px rgba(0,0,0,0.12);
    color: white;
}
.smode-fast.active {
    background: linear-gradient(135deg, #1a56db, #3b82f6);
}
.smode-precise.active {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
}
.smode-btn:hover:not(.active) {
    background: #d8e2ff;
    color: var(--primary);
}
.search-mode-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
    white-space: nowrap;
}
@media (max-width: 480px) {
    .search-mode-desc { display: none; }
    .search-mode-row { gap: 8px; }
}
/* ──────────────────────────────────────────────── */

/* ─── 업로드 모달 내 포인트 안내 ──────────────────────── */
.um-point-notice {
    display: inline-block;
    background: linear-gradient(135deg,#fef3c7,#fde68a);
    color: #92400e; font-size: 12px; font-weight: 700;
    padding: 3px 10px; border-radius: 20px; margin-left: 6px;
    border: 1px solid #fcd34d;
}
.um-point-result { margin: 12px 0; }
.um-point-result-card {
    display: flex; align-items: center; gap: 12px;
    background: linear-gradient(135deg,#fef9e7,#fef3c7);
    border: 1.5px solid #fcd34d; border-radius: 16px;
    padding: 14px 18px;
}
.um-point-result-icon { font-size: 28px; }
.um-point-result-text { font-size: 13px; line-height: 1.6; color: #374151; }
.um-point-result-text strong { color: #92400e; font-size: 14px; }
.um-point-result-text em { color: #f59e0b; font-weight: 700; font-style: normal; }

/* ─── 자료실 업로드 유도 버튼 (bf-btn-nudge) ──────────── */
.bf-btn-nudge {
    background: linear-gradient(135deg,#fef3c7,#fde68a) !important;
    color: #92400e !important;
    border: 1.5px solid #fcd34d !important;
    cursor: pointer;
}
.bf-btn-nudge:hover { background: linear-gradient(135deg,#fde68a,#fbbf24) !important; }
.ifl-nudge {
    background: linear-gradient(135deg,#fef3c7,#fde68a);
    color: #92400e; border: 1.5px solid #fcd34d;
    border-radius: 8px; padding: 3px 9px; font-size: 11px; font-weight: 700;
    cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
    transition: all 0.15s; font-family: var(--font);
}
.ifl-nudge:hover { background: linear-gradient(135deg,#fde68a,#fbbf24); }

/* 관리자 패널 메타데이터 매칭 카드 강조 */
.admin-member-card.meta-highlight {
    border: 2px solid #f59e0b !important;
    background: linear-gradient(135deg,#fffbeb,#fef3c7) !important;
    box-shadow: 0 4px 20px rgba(245,158,11,0.25) !important;
}

/* ─── 업로드 유도 모달 (준비중/검색 버튼 클릭 시) ─────── */
.upload-nudge-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(3px);
    z-index: 3000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.upload-nudge-overlay.hidden { display: none; }
.upload-nudge-box {
    background: white;
    border-radius: 24px;
    padding: 36px 32px 32px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: nudgeIn 0.35s cubic-bezier(.34,1.56,.64,1);
}
@keyframes nudgeIn {
    from { transform: scale(0.7) translateY(40px); opacity:0; }
    to   { transform: scale(1) translateY(0);      opacity:1; }
}
.un-close {
    position: absolute; top: 14px; right: 14px;
    background: #f3f4f6; border: none; border-radius: 50%;
    width: 32px; height: 32px; cursor: pointer; font-size: 14px; color: #6b7280;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.un-close:hover { background: #e5e7eb; }
.un-icon-wrap { margin-bottom: 12px; }
.un-icon { font-size: 52px; line-height: 1; }
.un-title {
    font-size: 18px; font-weight: 800; color: #111827; margin: 0 0 12px;
}
.un-desc {
    font-size: 14px; color: #374151; line-height: 1.75; margin-bottom: 8px;
}
.un-highlight {
    color: #1a56db; font-size: 15px; display: block; margin-bottom: 4px;
}
.un-point {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: white; padding: 3px 10px; border-radius: 20px;
    font-weight: 700; font-size: 15px;
}
.un-sub {
    font-size: 14px; color: #6b7280; margin-bottom: 20px;
}
.un-btn-row {
    display: flex; gap: 12px; justify-content: center;
}
.un-btn-yes {
    background: linear-gradient(135deg, #1a56db, #3b82f6);
    color: white; border: none; border-radius: 14px;
    padding: 12px 24px; font-size: 14px; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; gap: 8px;
    font-family: var(--font); transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(26,86,219,0.35);
}
.un-btn-yes:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(26,86,219,0.45); }
.un-btn-no {
    background: #f3f4f6; color: #6b7280; border: none; border-radius: 14px;
    padding: 12px 24px; font-size: 14px; font-weight: 600;
    cursor: pointer; font-family: var(--font); transition: background 0.2s;
}
.un-btn-no:hover { background: #e5e7eb; }

/* 관리자 패널 '가치 있는 자료' 승인 버튼 반짝 효과 */
.btn-approve.meta-match-glow {
    animation: approveGlow 1.2s infinite alternate;
    box-shadow: 0 0 0 3px #fbbf2488, 0 0 12px 4px #f59e0b88;
    border: 2px solid #f59e0b !important;
}
@keyframes approveGlow {
    from { box-shadow: 0 0 4px 2px #fbbf2488, 0 0 10px 3px #f59e0b44; }
    to   { box-shadow: 0 0 14px 5px #fbbf24cc, 0 0 24px 8px #f59e0baa; }
}
.meta-match-badge {
    display: inline-block;
    background: linear-gradient(135deg,#f59e0b,#f97316);
    color: white; font-size: 10px; font-weight: 700;
    padding: 2px 7px; border-radius: 20px; margin-left: 6px;
    animation: badgePulse 1.5s infinite;
    vertical-align: middle;
}
@keyframes badgePulse {
    0%,100% { opacity:1; transform: scale(1); }
    50%      { opacity:.75; transform: scale(1.08); }
}
/* ─── 관리자 파일 교체 모달 ──────────────────────── */
.replace-file-box {
    background: #fff;
    border-radius: 22px;
    padding: 28px 28px 24px;
    max-width: 460px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.28);
    animation: nudgeIn 0.3s cubic-bezier(.34,1.56,.64,1);
}
.replace-file-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f3f4f6;
}
.replace-file-icon {
    width: 46px; height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg,#7c3aed,#4f46e5);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.replace-file-title {
    font-size: 16px; font-weight: 800; color: #111827; margin: 0 0 3px;
}
.replace-file-sub {
    font-size: 12px; color: #9ca3af; margin: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px;
}
.replace-current-info {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
}
.replace-info-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    padding: 4px 0;
}
.replace-info-label {
    color: #6b7280;
    font-weight: 600;
    min-width: 54px;
    flex-shrink: 0;
}
.replace-info-val {
    color: #111827;
    word-break: break-all;
}
.replace-info-current {
    color: #ef4444;
    font-style: italic;
}
.replace-drop-zone {
    border: 2px dashed #d1d5db;
    border-radius: 14px;
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
}
.replace-drop-zone:hover,
.replace-drop-zone.dragover {
    border-color: #7c3aed;
    background: #f5f3ff;
}
.replace-select-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #7c3aed;
    color: white;
    padding: 8px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.replace-select-label:hover { background: #6d28d9; }
.replace-selected-info {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 4px;
}
.replace-warn {
    margin-top: 6px;
    font-size: 12px;
    color: #ef4444;
}

/* 관리자 전용 교체 버튼 (자료실 목록 내) */
.bf-replace-btn {
    background: linear-gradient(135deg,#7c3aed,#4f46e5);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 5px 9px;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: var(--font);
}
.bf-replace-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124,58,237,0.4);
}
/* ──────────────────────────────────────────────── */

.question-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}

.char-count {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26,86,219,0.4);
}

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

/* ========================
   질문 확인 화면
======================== */
.analyzing-container {
    text-align: center;
    padding: 40px 20px;
}

.analyzing-icon {
    font-size: 56px;
    animation: pulse 1.5s infinite;
    margin-bottom: 16px;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.analyzing-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.analyzing-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 24px;
}

.analyzing-dots span {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: dotBounce 1.4s infinite both;
}

.analyzing-dots span:nth-child(2) { animation-delay: 0.2s; }
.analyzing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50% { transform: translateY(-8px); opacity: 1; }
}

.analyzing-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 240px;
    margin: 0 auto;
}

.a-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: 8px;
    text-align: left;
}

.a-step.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

.a-step.done {
    color: var(--success);
}

/* 요약 카드 */
.summary-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
    border: 1.5px solid var(--border);
}

.summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.summary-badge {
    font-size: 14px;
    font-weight: 700;
}

.summary-dept {
    font-size: 12px;
    background: rgba(255,255,255,0.2);
    padding: 3px 10px;
    border-radius: 10px;
}

.summary-body {
    padding: 16px;
}

.summary-item {
    margin-bottom: 14px;
}

.summary-item:last-child {
    margin-bottom: 0;
}

.summary-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.keyword-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.keyword-tag {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 10px;
    border: 1px solid rgba(26,86,219,0.2);
}

/* 사용자 직접 입력 키워드 - 강조 스타일 */
.keyword-tag-user {
    background: #0ea5e9;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 10px;
    border: 1.5px solid #0284c7;
    box-shadow: 0 1px 4px rgba(14,165,233,0.3);
}

.summary-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg);
    padding: 12px;
    border-radius: 8px;
}

.source-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.source-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 10px;
}

.source-1 { background: #dbeafe; color: #1e40af; }
.source-2 { background: #d1fae5; color: #065f46; }
.source-3 { background: #ede9fe; color: #5b21b6; }
.source-4 { background: #fed7aa; color: #9a3412; }

.confirm-question {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.confirm-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-confirm-correct {
    background: linear-gradient(135deg, var(--success), #10b981);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-confirm-correct:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5,150,105,0.4);
}

.btn-confirm-edit {
    background: white;
    color: var(--warning);
    border: 2px solid var(--warning);
    border-radius: 12px;
    padding: 14px;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-confirm-edit:hover {
    background: #fffbeb;
    transform: translateY(-2px);
}

/* ========================
   답변 화면
======================== */
.answer-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.loading-card {
    background: white;
    border-radius: var(--radius);
    padding: 32px 24px;
    box-shadow: var(--shadow-md);
    text-align: center;
    width: 100%;
    max-width: 360px;
}

.loading-icon {
    font-size: 48px;
    margin-bottom: 12px;
    animation: pulse 1.5s infinite;
}

.loading-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.loading-progress {
    margin-bottom: 24px;
}

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
    width: 0%;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 12px;
    color: var(--text-muted);
}

.source-checking {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.source-check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-muted);
    padding: 8px 10px;
    border-radius: 8px;
}

.source-check-item.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

.source-check-item.done {
    color: var(--success);
}

.source-check-item.done i {
    color: var(--success);
}

/* 답변 헤더 카드 */
.answer-header-card {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius);
    padding: 20px;
    color: white;
    margin-bottom: 16px;
}

.answer-dept-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

.answer-question-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 12px;
}

.answer-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.answer-source-badge {
    font-size: 11px;
    background: rgba(255,255,255,0.25);
    padding: 3px 10px;
    border-radius: 10px;
}

.answer-time {
    font-size: 11px;
    opacity: 0.7;
}

/* 답변 카드들 */
.answer-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.answer-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    animation: cardSlideIn 0.4s ease both;
}

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

.answer-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.card-type-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.ct-overview { background: #dbeafe; }
.ct-process { background: #d1fae5; }
.ct-form { background: #ede9fe; }
.ct-caution { background: #fee2e2; }
.ct-tip { background: #fef3c7; }

.card-title {
    flex: 1;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.card-toggle {
    color: var(--text-muted);
    font-size: 13px;
    transition: transform 0.3s;
}

.card-toggle.rotated {
    transform: rotate(180deg);
}

.answer-card-body {
    padding: 16px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-primary);
}

.answer-card-body.collapsed {
    display: none;
}

/* 서식 다운로드 */
.forms-section {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.forms-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.forms-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-download-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
    cursor: pointer;
}

.form-download-item:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateX(3px);
}

.form-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.form-info {
    flex: 1;
}

.form-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-size {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* .form-download-btn 기본 스타일은 아래 출처 배지 섹션에 통합 정의 */

/* 주의사항 */
.caution-section {
    background: #fff5f5;
    border: 1.5px solid #fecaca;
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.caution-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #dc2626;
    margin-bottom: 12px;
}

.caution-content {
    font-size: 13px;
    line-height: 1.8;
    color: #7f1d1d;
}

.caution-item {
    display: flex;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #fecaca;
}

.caution-item:last-child {
    border-bottom: none;
}

.caution-num {
    color: #dc2626;
    font-weight: 700;
    flex-shrink: 0;
}

/* 단계별 따라하기 */
.steps-section {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.steps-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.steps-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.step-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}

.step-content {
    flex: 1;
    padding-top: 4px;
}

.step-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.step-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.step-connector {
    width: 2px;
    height: 16px;
    background: var(--border);
    margin-left: 15px;
}

/* 액션 버튼들 */
/* ─── 빠른 검색 힌트 배너 ──────────────────────────── */
.fast-search-hint {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    background: linear-gradient(135deg, #fefce8, #fef9c3);
    border: 1.5px solid #fde047;
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 14px;
    font-size: 13px;
    color: #713f12;
    line-height: 1.5;
    animation: hintFadeIn 0.4s ease;
}
@keyframes hintFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fast-search-hint i.fa-lightbulb { color: #f59e0b; font-size: 15px; flex-shrink: 0; }
.fast-search-hint strong { color: #92400e; }
.fsh-btn {
    margin-left: auto;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font);
    transition: all 0.2s;
    white-space: nowrap;
}
.fsh-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(124,58,237,.4); }
/* ──────────────────────────────────────────────────── */

.answer-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.btn-action {
    flex: 1;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.btn-action:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-new-question {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-new-question:hover {
    background: var(--primary-dark);
    color: white;
}

/* 피드백 */
.feedback-section {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.feedback-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.feedback-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.feedback-btn {
    background: white;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.feedback-btn[data-val="good"]:hover {
    border-color: var(--success);
    color: var(--success);
    background: #f0fdf4;
}

.feedback-btn[data-val="bad"]:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: #fff5f5;
}

.feedback-btn.selected-good {
    border-color: var(--success);
    color: var(--success);
    background: #f0fdf4;
}

.feedback-btn.selected-bad {
    border-color: var(--danger);
    color: var(--danger);
    background: #fff5f5;
}

/* 아쉬움 의견 입력창 */
.feedback-bad-box {
    margin-top: 16px;
    background: #fff5f5;
    border: 1.5px solid #fecaca;
    border-radius: 14px;
    padding: 16px;
    text-align: left;
    animation: fbBadIn 0.3s ease;
}
@keyframes fbBadIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.feedback-bad-label {
    font-size: 13px;
    font-weight: 700;
    color: #991b1b;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.feedback-optional {
    font-size: 11px;
    font-weight: 400;
    color: #b91c1c;
    opacity: 0.75;
}
.feedback-comment-textarea {
    width: 100%;
    border: 1.5px solid #fca5a5;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    font-family: var(--font);
    color: var(--text-primary);
    background: #fff;
    resize: vertical;
    min-height: 80px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.feedback-comment-textarea:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239,68,68,0.15);
}
.feedback-bad-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    justify-content: flex-end;
}
.feedback-char-count {
    font-size: 11px;
    color: #9ca3af;
    margin-right: auto;
}
.feedback-submit-btn {
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}
.feedback-submit-btn:hover { background: #dc2626; }
.feedback-skip-btn {
    background: none;
    border: 1.5px solid #fca5a5;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    font-family: var(--font);
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s;
}
.feedback-skip-btn:hover { border-color: #d1d5db; color: #6b7280; }

/* 피드백 완료 메시지 */
.feedback-done-msg {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    animation: fbDoneIn 0.4s ease;
}
@keyframes fbDoneIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}
.feedback-done-msg.good-msg {
    background: #f0fdf4;
    color: #166534;
    border: 1.5px solid #bbf7d0;
}
.feedback-done-msg.bad-msg {
    background: #fef2f2;
    color: #991b1b;
    border: 1.5px solid #fecaca;
}

/* ========================
   추가 질문 / 피드백 영역
======================== */
.followup-action-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0 4px;
}

/* "추가로 궁금한 내용" 버튼 */
.btn-followup {
    width: 100%;
    padding: 14px 18px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 2px solid #93c5fd;
    border-radius: 14px;
    color: #1d4ed8;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    text-align: left;
}
.btn-followup:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59,130,246,0.2);
}
.btn-followup i { font-size: 18px; flex-shrink: 0; }

/* "괜찮아요. 초기 화면으로" 버튼 */
.btn-go-home {
    width: 100%;
    padding: 13px 18px;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}
.btn-go-home:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: var(--text-primary);
}
.btn-go-home i { font-size: 16px; }

/* 추가 질문 패널 */
.followup-panel {
    margin-top: 12px;
    background: white;
    border: 2px solid #93c5fd;
    border-radius: 16px;
    overflow: hidden;
    animation: slideDown 0.3s ease;
}

.followup-panel-header {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
}

/* 대화 히스토리 */
.followup-history {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 400px;
    overflow-y: auto;
}
.followup-history:empty { display: none; }

/* 사용자 말풍선 */
.fh-user {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    align-items: flex-start;
}
.fh-user-bubble {
    background: #2563eb;
    color: white;
    border-radius: 16px 16px 4px 16px;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.6;
    max-width: 85%;
    white-space: pre-wrap;
}

/* AI 말풍선 */
.fh-ai {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.fh-ai-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 2px;
}
.fh-ai-bubble {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px 16px 16px 16px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.7;
    max-width: 85%;
    color: var(--text-primary);
}
.fh-ai-bubble .md-h2 { font-size: 16px; margin: 8px 0 4px; font-weight: 700; }
.fh-ai-bubble .md-h3 { font-size: 15px; margin: 6px 0 3px; font-weight: 600; }
.fh-ai-bubble .md-ul,
.fh-ai-bubble .md-ol { padding-left: 18px; margin: 4px 0; font-size: 15px; }
.fh-ai-bubble .md-p  { margin: 4px 0; font-size: 15px; line-height: 1.85; }
.fh-ai-bubble .md-bullet-item { display: block; padding: 4px 0 4px 12px; font-size: 15px; line-height: 1.8; border-bottom: 1px dashed rgba(0,0,0,0.08); }
.fh-ai-bubble .md-bullet-key  { font-weight: 700; color: var(--primary); }
.fh-ai-bubble .md-bullet-dot  { color: var(--primary); font-weight: 700; margin-right: 3px; }

/* AI 로딩 말풍선 */
.fh-ai-loading {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 10px 14px;
}
.fh-dot {
    width: 8px; height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: fhBounce 1.2s infinite ease-in-out;
}
.fh-dot:nth-child(2) { animation-delay: 0.2s; }
.fh-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes fhBounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
}

/* 추가질문 입력창 */
.followup-input-wrap {
    border-top: 1px solid #e2e8f0;
    padding: 12px 14px;
    background: #f8fafc;
}
.followup-textarea {
    width: 100%;
    min-height: 90px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    font-family: var(--font);
    resize: none;
    outline: none;
    background: white;
    color: var(--text-primary);
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.followup-textarea:focus { border-color: var(--primary); }
.followup-input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    gap: 8px;
}
.followup-input-footer span {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}
/* 버튼 묶음 */
.followup-btn-group {
    display: flex;
    gap: 8px;
    align-items: center;
}
/* 홈으로 버튼 */
.btn-followup-home {
    background: white;
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-followup-home:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: var(--text-primary);
}
/* 질문하기 버튼 */
.btn-followup-send {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-followup-send:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
}
.btn-followup-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* ========================
   채팅 대화 인터페이스 (Gemini 스타일)
======================== */
.chat-conversation {
    margin-top: 16px;
    background: white;
    border: 2px solid #93c5fd;
    border-radius: 16px;
    overflow: hidden;
}
.chat-conv-header {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
}
.chat-conv-hint {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.8;
    margin-left: auto;
}
.chat-history {
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 500px;
    overflow-y: auto;
    scroll-behavior: smooth;
}
.chat-history:empty { display: none; }

/* 파일 첨부 미리보기 */
.chat-file-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #eff6ff;
    border-top: 1px solid #bfdbfe;
    padding: 8px 14px;
    font-size: 12px;
    color: #1d4ed8;
    font-weight: 500;
}
.chat-file-preview i { font-size: 14px; }
.chat-file-size { color: #6b7280; font-weight: 400; margin-left: 2px; }
.chat-file-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    font-size: 13px;
    padding: 2px 4px;
    margin-left: auto;
    border-radius: 4px;
    transition: background 0.15s;
}
.chat-file-remove:hover { background: #fee2e2; color: #dc2626; }

/* 채팅 입력바 */
.chat-input-bar {
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    padding: 10px 12px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
.chat-attach-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid #d1d5db;
    background: white;
    color: #6b7280;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}
.chat-attach-btn:hover { border-color: var(--primary); color: var(--primary); background: #eff6ff; }
.chat-attach-btn.has-file { border-color: #2563eb; color: #2563eb; background: #eff6ff; }
.chat-textarea {
    flex: 1;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 13px;
    font-family: var(--font);
    resize: none;
    outline: none;
    background: white;
    color: var(--text-primary);
    line-height: 1.5;
    max-height: 120px;
    overflow-y: auto;
    transition: border-color 0.2s;
}
.chat-textarea:focus { border-color: var(--primary); }
.chat-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}
.chat-send-btn:hover:not(:disabled) { background: var(--primary-dark); transform: scale(1.05); }
.chat-send-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }
.chat-input-footer {
    padding: 4px 14px 10px;
    background: #f8fafc;
    font-size: 11px;
    color: #9ca3af;
    text-align: right;
}

/* 채팅 말풍선 - 사용자 */
.chat-msg-user {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    align-items: flex-start;
}
.chat-bubble-user {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border-radius: 18px 18px 4px 18px;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.6;
    max-width: 82%;
    white-space: pre-wrap;
    box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}
.chat-bubble-file {
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    padding: 4px 8px;
    margin-top: 6px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 채팅 말풍선 - AI */
.chat-msg-ai {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.chat-ai-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
    margin-top: 2px;
    box-shadow: 0 2px 6px rgba(124,58,237,0.3);
}
.chat-bubble-ai {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px 18px 18px 18px;
    padding: 12px 15px;
    font-size: 13px;
    line-height: 1.75;
    max-width: 85%;
    color: var(--text-primary);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.chat-bubble-ai .md-h2 { font-size: 16px; margin: 8px 0 4px; font-weight: 700; }
.chat-bubble-ai .md-h3 { font-size: 15px; margin: 6px 0 3px; font-weight: 600; }
.chat-bubble-ai .md-ul,
.chat-bubble-ai .md-ol { padding-left: 18px; margin: 4px 0; font-size: 15px; }
.chat-bubble-ai .md-p  { margin: 4px 0; font-size: 15px; line-height: 1.85; }
.chat-bubble-ai .md-bullet-item { display: block; padding: 4px 0 4px 12px; font-size: 15px; line-height: 1.8; border-bottom: 1px dashed rgba(0,0,0,0.08); }
.chat-bubble-ai .md-bullet-key  { font-weight: 700; color: var(--primary); }
.chat-bubble-ai .md-bullet-dot  { color: var(--primary); font-weight: 700; margin-right: 3px; }

/* AI 로딩 말풍선 */
.chat-loading-bubble {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 10px 14px;
}
.chat-dot {
    width: 8px; height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: chatBounce 1.2s infinite ease-in-out;
}
.chat-dot:nth-child(2) { animation-delay: 0.2s; }
.chat-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes chatBounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
}

/* 질문 파일 첨부 버튼 */
.btn-attach-q {
    background: white;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font);
    transition: all 0.15s;
    white-space: nowrap;
}
.btn-attach-q:hover { border-color: var(--primary); color: var(--primary); }
.btn-attach-q.has-file { border-color: #2563eb; color: #2563eb; background: #eff6ff; }

/* 질문 파일 미리보기 */
.q-file-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 6px 12px;
    margin-top: 8px;
    font-size: 12px;
    color: #1d4ed8;
}

/* 히스토리 아이템 이어서 질문 버튼 */
.hi-continue-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    background: #eff6ff;
    border: 1.5px solid #bfdbfe;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 11px;
    color: #1d4ed8;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.15s;
}
.hi-continue-btn:hover { background: #dbeafe; border-color: #93c5fd; }

/* ========================
   서식 자료실 페이지
======================== */
.forms-dept-filter {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.forms-dept-filter::-webkit-scrollbar {
    height: 3px;
}

.filter-btn {
    white-space: nowrap;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.filter-btn.active, .filter-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.forms-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 80px; /* 서식추가 버튼 공간 확보 */
}

/* 검색창 */
.forms-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}
.forms-search-icon {
    position: absolute;
    left: 13px;
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}
.forms-search-input {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 11px 38px 11px 36px;
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.forms-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}
.forms-search-clear {
    position: absolute;
    right: 10px;
    background: var(--border);
    border: none;
    border-radius: 50%;
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.2s;
}
.forms-search-clear:hover { background: #d1d5db; }

/* 버튼 범례 */
.forms-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid var(--border);
}
.forms-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-secondary);
}
.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.legend-label {
    font-weight: 500;
}
.legend-label i {
    margin-right: 2px;
}

/* 서식 통계 */
.forms-stats {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 500;
}

/* 검색 하이라이트 */
mark.search-highlight {
    background: #fef08a;
    color: #713f12;
    border-radius: 2px;
    padding: 0 1px;
}

/* 부서 섹션 */
.forms-dept-section {
    margin-bottom: 20px;
}
.forms-dept-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #eff6ff, #f0f0ff);
    border-left: 4px solid var(--primary);
    border-radius: 0 8px 8px 0;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.forms-dept-heading-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
}
.forms-dept-count {
    font-size: 11px;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    padding: 2px 8px;
    font-weight: 600;
}
/* 부서 전체 ZIP 다운로드 버튼 */
.dept-zip-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #f0fdf4;
    color: #15803d;
    border: 1.5px solid #86efac;
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.2s;
    margin-left: auto;
    margin-right: 0;
    white-space: nowrap;
}
.dept-zip-btn:hover {
    background: #15803d;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(21,128,61,0.25);
}
.dept-zip-btn i { font-size: 11px; }
/* 단일 부서 필터 뷰 헤더 */
.dept-filter-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #eff6ff, #f0f0ff);
    border-left: 4px solid var(--primary);
    border-radius: 0 10px 10px 0;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.dept-filter-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
}

/* 부서 구분선 */
.forms-section-divider {
    font-size: 12px;
    font-weight: 700;
    color: #7c3aed;
    padding: 8px 2px 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    border-top: 1px dashed #e5e7eb;
}

/* 서식 아이템 개선 */
.form-download-item--user {
    border-left: 3px solid #7c3aed !important;
    background: #faf5ff;
}
.form-download-item--user:hover {
    border-color: #7c3aed;
    background: #f3e8ff;
}
.form-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}
.form-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
    line-height: 1.4;
}

/* 서식 아이템 액션 영역 */
.form-item-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}
/* 사용자 업로드 서식 다운로드 버튼 */
.form-download-btn--user {
    background: #7c3aed !important;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: none;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    min-width: 44px;
    min-height: 44px;
}
.form-download-btn--user:hover {
    background: #6d28d9 !important;
    transform: translateY(-1px);
}
.form-delete-btn {
    background: #fee2e2;
    color: var(--danger);
    border: none;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
}
.form-delete-btn:hover {
    background: var(--danger);
    color: white;
}

/* 부서별 인라인 서식 추가 버튼 */
.btn-add-form-inline {
    width: 100%;
    margin-top: 8px;
    padding: 10px 14px;
    background: white;
    color: var(--primary);
    border: 1.5px dashed var(--primary);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: all 0.2s;
}
.btn-add-form-inline:hover {
    background: var(--primary-light);
    border-style: solid;
}

/* 서식 추가 버튼 (하단 고정) */
.btn-add-form {
    position: sticky;
    bottom: 16px;
    width: 100%;
    margin-top: 12px;
    padding: 14px;
    background: linear-gradient(135deg, #1a56db, #7c3aed);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(26,86,219,0.35);
    transition: all 0.2s;
    z-index: 10;
}
.btn-add-form:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26,86,219,0.45);
}

/* 출처 배지 */
.form-source-badge {
    display: inline-block;
    font-size: 10px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    padding: 2px 7px;
    margin-top: 4px;
    font-weight: 500;
}

/* ============================================================
   base_forms 서식 아이템 (bf-item)
   ============================================================ */
.bf-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: #fff;
    transition: all 0.2s;
    margin-bottom: 8px;
}
.bf-item:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 2px 8px rgba(26,86,219,0.08);
}
.bf-left {
    flex: 1;
    min-width: 0;
}
.bf-btns {
    display: flex;
    flex-direction: row;   /* 가로 배치: PDF·HWP·XLSX 나란히 */
    flex-wrap: wrap;
    gap: 5px;
    flex-shrink: 0;
    justify-content: flex-end;
    align-items: flex-start;
    max-width: 260px;      /* 너무 넓어지지 않도록 */
}
/* 다운로드 버튼 공통 */
.bf-dl-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 58px;
    min-height: 52px;
    border: none;
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 17px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
    line-height: 1;
}
.bf-dl-btn span {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: -0.3px;
}
.bf-dl-btn small {
    font-size: 9px;
    font-weight: 500;
    opacity: 0.85;
}
/* PDF – 빨간 계열 */
.bf-btn-pdf { background: #fef2f2; color: #b91c1c; border: 1.5px solid #fca5a5; }
.bf-btn-pdf:hover { background: #b91c1c; color: #fff; transform: translateY(-1px); }
/* HWP – 파란 계열 */
.bf-btn-hwp { background: #eff6ff; color: #1d4ed8; border: 1.5px solid #93c5fd; }
.bf-btn-hwp:hover { background: #1d4ed8; color: #fff; transform: translateY(-1px); }
/* XLSX – 초록 계열 */
.bf-btn-xlsx { background: #f0fdf4; color: #15803d; border: 1.5px solid #86efac; }
.bf-btn-xlsx:hover { background: #15803d; color: #fff; transform: translateY(-1px); }
/* PPT – 주황 계열 */
.bf-btn-ppt { background: #fff7ed; color: #c2410c; border: 1.5px solid #fdba74; }
.bf-btn-ppt:hover { background: #c2410c; color: #fff; transform: translateY(-1px); }
/* 검색 버튼 – 초록 */
.bf-btn-search { background: #f0fdf4; color: #059669; border: 1.5px solid #6ee7b7; }
.bf-btn-search:hover { background: #059669; color: #fff; transform: translateY(-1px); }
/* 기본 */
.bf-btn-default { background: #f8fafc; color: #475569; border: 1.5px solid #e2e8f0; }
.bf-btn-default:hover { background: #475569; color: #fff; transform: translateY(-1px); }
/* 비활성 */
.bf-btn-none { background: #f1f5f9; color: #94a3b8; border: 1.5px solid #e2e8f0; cursor: not-allowed; opacity: 0.7; }
/* 로그인 필요 버튼 (비로그인 상태) – 파일 타입별 색상 유지하되 반투명 */
.bf-btn-need-login { opacity: 0.75; }
.bf-btn-need-login:hover { opacity: 1; transform: translateY(-1px); }
/* 잠금 */
.bf-btn-locked { background: #f1f5f9; color: #6b7280; border: 1.5px dashed #d1d5db;
    border-radius: 8px; padding: 7px 10px; font-size: 12px; cursor: pointer;
    font-family: var(--font); transition: all 0.2s; min-height: 36px; }
.bf-btn-locked:hover { background: #e5e7eb; color: var(--primary); border-color: var(--primary); }
/* 외부링크 표시 */
.bf-external::after { content: ''; }
/* bf-btn-wrap: 다운로드버튼 + 삭제버튼 묶음 */
.bf-btn-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}
/* bf-del-btn: 관리자 전용 삭제 버튼 (자료실 아이템) */
.bf-del-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1.5px solid #fca5a5;
    border-radius: 6px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    align-self: center;
}
.bf-del-btn:hover { background: #b91c1c; color: #fff; border-color: #b91c1c; transform: scale(1.1); }
/* 자료실 비로그인 안내 배너 */
.forms-login-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #eff6ff;
    border: 1.5px solid #bfdbfe;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #1e40af;
}
.forms-login-hint i { font-size: 18px; flex-shrink: 0; }
.forms-login-hint strong { display: block; font-size: 14px; margin-bottom: 2px; }
.forms-login-hint-btn {
    margin-left: auto;
    background: #1d4ed8;
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font);
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s;
}
.forms-login-hint-btn:hover { background: #1e3a8a; }

/* 다운로드/검색 버튼 공통 */
.form-download-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex-shrink: 0;
    border: none;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
    text-decoration: none;
    min-width: 54px;
    min-height: 48px;
    line-height: 1;
}
.form-download-btn span {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

/* 직접 열기 (파란색) */
.form-download-btn--direct {
    background: var(--primary);
    color: white;
}
.form-download-btn--direct:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(26,86,219,0.4);
}

/* 검색 페이지 (초록색) */
.form-download-btn--search {
    background: #059669;
    color: white;
}
.form-download-btn--search:hover {
    background: #047857;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(5,150,105,0.4);
}

/* 링크 없음 (회색) */
.form-download-btn--none {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: default;
}

/* 사용자 업로드 서식 - 배지 */
.form-user-badge {
    font-size: 10px;
    background: #7c3aed;
    color: white;
    border-radius: 6px;
    padding: 2px 6px;
    margin-left: 6px;
    vertical-align: middle;
}

/* ============================================================
   서식 업로드 모달
============================================================ */
.upload-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(3px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s ease;
}
.upload-modal-overlay.hidden { display: none !important; }

.upload-modal-box {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0,0,0,0.22);
    animation: slideUp 0.3s ease;
}
@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* 모달 헤더 */
.um-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #1a56db, #7c3aed);
    color: white;
}
.um-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
}
.um-header-left i { font-size: 18px; }
.um-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.um-close:hover { background: rgba(255,255,255,0.35); }

/* 단계 표시 */
.um-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    gap: 0;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}
.um-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    opacity: 0.4;
    transition: all 0.3s;
}
.um-step.active  { opacity: 1; }
.um-step.done    { opacity: 0.85; }
.um-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.3s;
}
.um-step.active .um-step-num {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(26,86,219,0.35);
}
.um-step.done .um-step-num {
    background: var(--success);
    color: white;
}
.um-step-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
}
.um-step.active .um-step-label { color: var(--primary); }
.um-step.done .um-step-label   { color: var(--success); }
.um-step-line {
    height: 2px;
    width: 28px;
    background: var(--border);
    margin: 0 2px;
    margin-bottom: 14px;
}

/* 패널 본문 */
.um-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
}
/* um-panel: hidden 클래스 충돌 방지를 위해 CSS 자체로만 표시 제어 */
.um-panel { display: none !important; flex-direction: column; align-items: center; text-align: center; }
.um-panel.active { display: flex !important; animation: fadeIn 0.25s ease; }
.um-panel-icon { font-size: 42px; margin-bottom: 10px; }
.um-panel-title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.um-panel-desc  { font-size: 13px; color: var(--text-secondary); margin-bottom: 18px; line-height: 1.6; }

/* 텍스트 입력 */
.um-text-input {
    width: 100%;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.2s;
    text-align: left;
}
.um-text-input:focus { border-color: var(--primary); }
.um-textarea { resize: none; margin-top: 10px; min-height: 60px; }
.um-input-footer { width: 100%; text-align: right; font-size: 11px; color: var(--text-muted); margin-top: 4px; margin-bottom: 0; }

/* 부서 선택 그리드 */
.um-dept-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    margin-bottom: 12px;
}
.um-dept-btn {
    padding: 12px 8px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: white;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.4;
}
.um-dept-btn:hover     { border-color: var(--primary); background: #eff6ff; }
.um-dept-btn.selected  { border-color: var(--primary); background: var(--primary); color: white; }
.um-selected-dept {
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    color: #166534;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    width: 100%;
    text-align: center;
}

/* 파일 드롭존 */
.um-file-drop {
    width: 100%;
    border: 2px dashed var(--border);
    border-radius: 14px;
    padding: 32px 16px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    color: var(--text-muted);
}
.um-file-drop:hover, .um-file-drop.drag-over {
    border-color: var(--primary);
    background: #eff6ff;
    color: var(--primary);
}
.um-file-drop i { font-size: 36px; }
.um-file-drop p { font-size: 14px; font-weight: 600; }
.um-file-hint   { font-size: 11px; }

.um-file-selected {
    width: 100%;
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}
.um-file-selected i { font-size: 22px; color: var(--success); }
.um-file-info { flex: 1; text-align: left; }
.um-file-name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.um-file-size { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.um-file-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
}

/* 확인 박스 */
.um-confirm-box {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 14px;
    text-align: left;
}
.um-confirm-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.um-confirm-row:last-child { border-bottom: none; }
.um-confirm-label { font-weight: 700; color: var(--text-secondary); flex-shrink: 0; min-width: 60px; }
.um-confirm-value { color: var(--text-primary); word-break: break-all; }
.um-saving {
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    display: none;    /* JS에서 style.display = 'flex' 로 표시 */
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

/* 완료 버튼 */
.um-done-btn { width: 100%; justify-content: center; margin-top: 12px; }

/* 오류 메시지 */
.um-error {
    color: var(--danger);
    font-size: 12px;
    font-weight: 600;
    margin-top: 6px;
    width: 100%;
    text-align: left;
    display: none;    /* JS에서 style.display = 'block' 으로 표시 */
}

/* 파일 선택 결과 - 초기 숨김 */
.um-file-selected--hidden { display: none !important; }

/* 모달 하단 버튼 */
.um-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: #f8fafc;
    gap: 10px;
}
.um-btn-prev, .um-btn-next {
    padding: 11px 22px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    border: none;
}
.um-btn-prev {
    background: white;
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
}
.um-btn-prev:hover { background: #f1f5f9; }
.um-btn-next {
    background: var(--primary);
    color: white;
    flex: 1;
    justify-content: center;
}
.um-btn-next:hover { background: var(--primary-dark); }
.um-btn-next:disabled { opacity: 0.4; cursor: not-allowed; }

/* ========================
   히스토리 페이지
======================== */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid var(--primary);
}

.history-item:hover {
    transform: translateX(3px);
    box-shadow: var(--shadow-md);
}

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

.hi-dept {
    font-size: 11px;
    padding: 3px 10px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 10px;
    font-weight: 600;
}

.hi-time {
    font-size: 11px;
    color: var(--text-muted);
}

.hi-q {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.5;
}

.hi-summary {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
}

/* ========================
   히스토리 페이지 – 부서 탭 + 검색
======================== */

/* 부서 탭 바 */
.hist-dept-tabs {
    display: flex;
    gap: 6px;
    padding: 12px 16px 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-wrap: nowrap;
    background: var(--bg);
    border-bottom: 1.5px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}
.hist-dept-tabs::-webkit-scrollbar { display: none; }

.hist-dept-tab {
    flex-shrink: 0;
    padding: 6px 13px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: white;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
}
.hist-dept-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}
.hist-dept-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}

/* 검색창 */
.hist-search-wrap {
    padding: 12px 16px 6px;
    background: var(--bg);
}
.hist-search-inner {
    display: flex;
    align-items: center;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 0 12px;
    gap: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.hist-search-inner:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.hist-search-icon {
    color: var(--text-muted);
    font-size: 13px;
    flex-shrink: 0;
}
.hist-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    color: var(--text-primary);
    padding: 10px 0;
}
.hist-search-input::placeholder { color: var(--text-muted); }
.hist-search-clear {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.hist-search-clear:hover { background: var(--bg); color: var(--text-primary); }
.hist-search-clear.hidden { display: none; }
.hist-search-stats {
    font-size: 11px;
    color: var(--text-muted);
    padding: 5px 2px 2px;
    display: none;
}

/* 히스토리 목록 (페이지 내) */
.history-list {
    padding: 12px 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* 부서별 섹션 */
.hist-dept-section {
    margin-bottom: 20px;
}
.hist-dept-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0 8px;
    border-bottom: 2px solid var(--primary-light);
    margin-bottom: 10px;
}
.hist-dept-heading-label {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary);
}
.hist-dept-heading-count {
    font-size: 11px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 10px;
    padding: 2px 8px;
    font-weight: 600;
}
.hist-dept-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 히스토리 카드 */
.history-item.hi-card {
    cursor: default;
    margin-bottom: 0;
}
.history-item.hi-card:hover {
    transform: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.09);
}
.hi-q {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.55;
    cursor: pointer;
}
.hi-q:hover { color: var(--primary); }

/* 액션 버튼 행 */
.hi-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.hi-continue-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 8px;
    border: 1.5px solid var(--primary-light);
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.hi-continue-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.hi-conv-btn { border-color: #d1fae5; background: #d1fae5; color: #065f46; }
.hi-conv-btn:hover { background: #059669; border-color: #059669; color: white; }
.hi-conv-count {
    background: rgba(0,0,0,0.12);
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 11px;
}

/* 검색 키워드 하이라이트 */
mark.hist-hl {
    background: #fef08a;
    color: #854d0e;
    border-radius: 3px;
    padding: 0 2px;
    font-weight: 700;
}

/* ========================
   좌측 세로 사이드바 네비게이션
======================== */
.left-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #1a56db 0%, #1344b0 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 200;
    box-shadow: 3px 0 16px rgba(26,86,219,0.18);
    padding: 0;
}

/* 사이드바 로고 */
.ls-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 0 10px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    width: 100%;
    cursor: pointer;
}
.ls-emoji { font-size: 22px; line-height: 1; }
.ls-title {
    font-size: 9px;
    font-weight: 800;
    color: rgba(255,255,255,0.9);
    margin-top: 4px;
    letter-spacing: -0.3px;
    text-align: center;
    line-height: 1.2;
}

/* 메뉴 버튼 목록 */
.ls-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 0;
    width: 100%;
    overflow-y: auto;
}

/* 개별 네비 아이템 */
.nav-item {
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: rgba(255,255,255,0.6);
    font-family: var(--font);
    font-size: 9.5px;
    font-weight: 600;
    transition: all 0.2s;
    position: relative;
    padding: 10px 4px;
    border-radius: 0;
}

.nav-item i {
    font-size: 19px;
    transition: transform 0.2s;
}

.nav-item:hover {
    color: white;
    background: rgba(255,255,255,0.12);
}

.nav-item.active {
    color: white;
    background: rgba(255,255,255,0.18);
}

.nav-item.active i {
    transform: scale(1.1);
}

/* 활성 표시 - 왼쪽 세로 바 */
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 4px;
    background: white;
    border-radius: 0 4px 4px 0;
}

/* 사이드바 하단 AI 상태 */
.ls-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 4px 14px;
    border-top: 1px solid rgba(255,255,255,0.15);
    width: 100%;
}
.ls-ai-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: block;
}
.ls-ai-dot.on  { background: #4ade80; box-shadow: 0 0 6px #4ade80; }
.ls-ai-dot.off { background: rgba(255,255,255,0.3); }
#ls-ai-label {
    font-size: 8px;
    color: rgba(255,255,255,0.6);
    text-align: center;
    line-height: 1.3;
}

/* ========================
   모달
======================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    width: 100%;
    max-width: 768px;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 800;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg);
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.modal-body {
    padding: 20px;
}

/* 도움말 단계 */
.help-step {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    align-items: flex-start;
}

.help-step-num {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    flex-shrink: 0;
}

.help-step-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.help-step-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ========================
   토스트
======================== */
.toast {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 16px);
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 400;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    white-space: nowrap;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ========================
   답변 내용 스타일
======================== */
.answer-list {
    list-style: none;
    padding: 0;
}

.answer-list li {
    display: flex;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 14px;
    line-height: 1.7;
}

.answer-list li:last-child {
    border-bottom: none;
}

.answer-list li::before {
    content: '▪';
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.answer-highlight {
    background: #fffbeb;
    border-left: 3px solid #f59e0b;
    padding: 10px 12px;
    border-radius: 0 8px 8px 0;
    font-size: 13px;
    line-height: 1.7;
    margin: 8px 0;
}

.answer-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin: 8px 0;
}

.answer-table th {
    background: var(--primary);
    color: white;
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
}

.answer-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
}

.answer-table tr:nth-child(even) td {
    background: var(--bg);
}

/* ========================
   반응형
======================== */
@media (min-width: 768px) {
    .quick-cards {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

/* ========================
   커뮤니티 게시판
======================== */
.board-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 1px solid #93c5fd;
    border-radius: 12px;
    padding: 14px 16px;
    margin: 0 16px 16px;
    font-size: 14px;
    color: #1e40af;
    line-height: 1.6;
}
.board-notice i { margin-top: 2px; font-size: 16px; flex-shrink: 0; }
.board-notice-sub { font-size: 12px; color: #3b82f6; }

.board-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 12px;
    gap: 8px;
    flex-wrap: wrap;
}
.board-filter-group { display: flex; gap: 6px; flex-wrap: wrap; }
.board-filter-btn {
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--card-bg);
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.board-filter-btn.active, .board-filter-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.board-write-btn { font-size: 13px; padding: 8px 16px; white-space: nowrap; }

.board-list { padding: 0 16px; display: flex; flex-direction: column; gap: 10px; min-height: 200px; }

.board-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.15s;
    position: relative;
}
.board-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.10); transform: translateY(-1px); }
.board-item-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.board-cat-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}
.cat-suggestion { background: #fef9c3; color: #854d0e; }
.cat-inquiry    { background: #dbeafe; color: #1d4ed8; }
.cat-request    { background: #dcfce7; color: #166534; }
.cat-general    { background: #f1f5f9; color: #475569; }

.board-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.board-item-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}
.board-item-meta .meta-author { color: var(--primary); font-weight: 500; }
.board-item-preview {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.board-delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 13px;
    padding: 4px 6px;
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}
.board-item:hover .board-delete-btn { opacity: 1; }

.board-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 16px;
}
.board-page-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.board-page-btn.active, .board-page-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 게시글 상세 */
.board-view-wrap { padding: 16px; }
.board-view-category { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 10px; font-weight: 600; margin-bottom: 10px; }
.board-view-title { font-size: 20px; font-weight: 700; color: var(--text-primary); margin-bottom: 10px; line-height: 1.4; }
.board-view-meta { display: flex; gap: 16px; font-size: 12px; color: var(--text-muted); padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.board-view-meta .meta-author { color: var(--primary); font-weight: 600; }
.board-view-body { font-size: 15px; line-height: 1.8; color: var(--text-primary); white-space: pre-wrap; word-break: break-word; }
.board-view-actions { display: flex; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); justify-content: flex-end; }
.board-edit-btn { background: var(--primary); color: #fff; border: none; padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.board-del-btn  { background: #ef4444; color: #fff; border: none; padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 13px; }

/* ─── 새 글쓰기 폼 (리디자인) ────────────────────────────── */
.bw-outer {
    padding: 0 12px 60px;
    max-width: 820px;
    margin: 0 auto;
}

/* 카테고리 선택 섹션 */
.bw-cat-section { margin-bottom: 18px; }
.bw-cat-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 10px;
    display: block;
}
.bw-cat-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}
@media (max-width: 540px) {
    .bw-cat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 360px) {
    .bw-cat-grid { grid-template-columns: repeat(2, 1fr); }
}
.bw-cat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px 12px;
    border: 2px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    background: var(--card-bg);
    transition: all 0.2s;
    position: relative;
    user-select: none;
}
.bw-cat-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.bw-cat-card:hover {
    border-color: var(--primary);
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(26,86,219,0.12);
}
.bw-cat-card.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg,#eff6ff,#dbeafe);
    box-shadow: 0 4px 16px rgba(26,86,219,0.18);
}
.bw-cat-card.selected .bw-cat-name { color: var(--primary); font-weight: 700; }

/* 카테고리별 선택 색상 */
.bw-cat-card[data-cat="general"].selected  { border-color:#64748b; background:linear-gradient(135deg,#f8fafc,#f1f5f9); box-shadow:0 4px 14px rgba(100,116,139,0.15); }
.bw-cat-card[data-cat="general"].selected .bw-cat-name { color:#475569; }
.bw-cat-card[data-cat="suggestion"].selected { border-color:#d97706; background:linear-gradient(135deg,#fffbeb,#fef3c7); box-shadow:0 4px 14px rgba(217,119,6,0.18); }
.bw-cat-card[data-cat="suggestion"].selected .bw-cat-name { color:#92400e; }
.bw-cat-card[data-cat="inquiry"].selected    { border-color:#2563eb; background:linear-gradient(135deg,#eff6ff,#dbeafe); box-shadow:0 4px 14px rgba(37,99,235,0.15); }
.bw-cat-card[data-cat="inquiry"].selected .bw-cat-name    { color:#1e40af; }
.bw-cat-card[data-cat="request"].selected    { border-color:#16a34a; background:linear-gradient(135deg,#f0fdf4,#dcfce7); box-shadow:0 4px 14px rgba(22,163,74,0.15); }
.bw-cat-card[data-cat="request"].selected .bw-cat-name    { color:#15803d; }
.bw-cat-card[data-cat="bugreport"].selected  { border-color:#dc2626; background:linear-gradient(135deg,#fff5f5,#fee2e2); box-shadow:0 4px 14px rgba(220,38,38,0.15); }
.bw-cat-card[data-cat="bugreport"].selected .bw-cat-name  { color:#b91c1c; }

.bw-cat-emoji { font-size: 26px; line-height: 1; }
.bw-cat-name  { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-align: center; }

/* 카테고리 안내 배너 */
.bw-guide-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 18px;
    border-left: 4px solid;
    transition: all 0.3s;
    animation: bannerIn 0.3s ease;
}
@keyframes bannerIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.bw-guide-icon { font-size: 24px; flex-shrink: 0; line-height: 1.3; }
.bw-guide-text { font-size: 13px; line-height: 1.7; color: var(--text-primary); }
.bw-guide-text strong { display: block; font-size: 14px; margin-bottom: 2px; }

.bw-guide-general   { background:#f8fafc; border-color:#94a3b8; }
.bw-guide-general .bw-guide-text strong { color:#475569; }
.bw-guide-suggestion{ background:#fffbeb; border-color:#f59e0b; }
.bw-guide-suggestion .bw-guide-text strong { color:#92400e; }
.bw-guide-inquiry   { background:#eff6ff; border-color:#3b82f6; }
.bw-guide-inquiry .bw-guide-text strong   { color:#1e40af; }
.bw-guide-request   { background:#f0fdf4; border-color:#22c55e; }
.bw-guide-request .bw-guide-text strong   { color:#15803d; }
.bw-guide-bugreport { background:#fff5f5; border-color:#ef4444; }
.bw-guide-bugreport .bw-guide-text strong { color:#b91c1c; }

/* 글쓰기 폼 카드 */
.bw-form-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px 24px 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.bw-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
    position: relative;
}
.bw-field-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}
.bw-input {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    transition: border 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.bw-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,0.10);
}
.bw-textarea {
    width: 100%;
    min-height: 240px;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.8;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    resize: vertical;
    transition: border 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.bw-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,0.10);
}
.bw-char-count {
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
    margin-top: -2px;
}
.bw-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 4px;
}
.bw-btn-cancel {
    padding: 11px 22px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}
.bw-btn-cancel:hover { background: var(--bg); border-color: #9ca3af; }
.bw-btn-submit {
    padding: 11px 28px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), #2563eb);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(26,86,219,0.30);
}
.bw-btn-submit:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(26,86,219,0.40); }
.bw-btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* 파일오류신고 카테고리 배지 */
.cat-bugreport { background: #fee2e2; color: #b91c1c; }

/* ─── 관리자 답변 UI ─────────────────────────────────────── */
.board-reply-section {
    margin-top: 24px;
    border-top: 2px dashed var(--border);
    padding-top: 20px;
}
.board-reply-box {
    background: linear-gradient(135deg,#f0f9ff,#e0f2fe);
    border: 1.5px solid #7dd3fc;
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 16px;
    position: relative;
}
.board-reply-box::before {
    content: '관리자 답변';
    position: absolute;
    top: -10px;
    left: 16px;
    background: #0284c7;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 10px;
}
.board-reply-meta {
    font-size: 12px;
    color: #0369a1;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.board-reply-body {
    font-size: 14px;
    line-height: 1.8;
    color: #0c4a6e;
    white-space: pre-wrap;
    word-break: break-word;
}
.board-reply-edit-btn,
.board-reply-del-btn {
    background: none;
    border: none;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.15s;
}
.board-reply-edit-btn { color: #0369a1; }
.board-reply-edit-btn:hover { background: rgba(3,105,161,0.1); }
.board-reply-del-btn  { color: #dc2626; }
.board-reply-del-btn:hover  { background: rgba(220,38,38,0.08); }

/* 관리자 답변 작성 폼 */
.board-reply-form {
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.board-reply-form-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.board-reply-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    resize: vertical;
    box-sizing: border-box;
    transition: border 0.2s;
}
.board-reply-textarea:focus { outline: none; border-color: #0ea5e9; box-shadow: 0 0 0 3px rgba(14,165,233,0.12); }
.board-reply-submit-btn {
    align-self: flex-end;
    background: linear-gradient(135deg,#0284c7,#0ea5e9);
    color: white;
    border: none;
    padding: 9px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    box-shadow: 0 3px 10px rgba(2,132,199,0.30);
}
.board-reply-submit-btn:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(2,132,199,0.40); }
.board-reply-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* 목록에서 답변 달린 게시글 표시 */
.board-item-replied {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: #0284c7;
    font-weight: 600;
    background: #e0f2fe;
    padding: 2px 7px;
    border-radius: 8px;
    margin-left: 4px;
}

/* 글쓰기 폼 (구형 호환) */
.board-write-form { padding: 0 16px 40px; }
.board-write-body { min-height: 200px; resize: vertical; }
.board-write-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ─── 백업 / 복구 탭 ─────────────────────────────────────── */
.backup-tab-wrap {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 4px 0 20px;
}
.backup-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px 18px 16px;
}
.backup-section-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}
.backup-section-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.backup-section-title {
    font-size: 14px; font-weight: 700; color: var(--text-primary);
    margin: 0 0 4px;
}
.backup-section-desc {
    font-size: 12px; color: var(--text-muted); line-height: 1.6; margin: 0;
}

/* 테이블 목록 카드 */
.backup-table-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}
.backup-table-card {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.backup-table-name { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.backup-table-count { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.backup-table-dl-btn {
    background: none; border: none; cursor: pointer;
    color: #3b82f6; font-size: 14px; padding: 3px 5px;
    border-radius: 6px; transition: background 0.15s;
    flex-shrink: 0;
}
.backup-table-dl-btn:hover { background: #eff6ff; }

.backup-btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.backup-btn-main {
    flex: 1;
    min-width: 200px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff; border: none; border-radius: 10px;
    padding: 11px 18px; font-size: 13px; font-weight: 700;
    cursor: pointer; font-family: var(--font);
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 3px 10px rgba(37,99,235,0.28);
}
.backup-btn-main:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(37,99,235,0.38); }
.backup-btn-main:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* 진행 바 */
.backup-progress-wrap { margin-top: 12px; }
.backup-progress-bar {
    height: 6px; background: #e5e7eb; border-radius: 4px; overflow: hidden; margin-bottom: 6px;
}
.backup-progress-fill {
    height: 100%; background: linear-gradient(90deg, #3b82f6, #6366f1);
    border-radius: 4px; width: 0%; transition: width 0.3s ease;
}
.backup-progress-text { font-size: 12px; color: var(--text-muted); text-align: center; }

/* 복구 드롭존 */
.restore-drop-zone {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    background: var(--bg);
    transition: all 0.2s;
    display: flex; flex-direction: column; align-items: center;
    margin-bottom: 10px;
}
.restore-drop-zone:hover, .restore-drop-zone.dragover {
    border-color: #f59e0b; background: #fffbeb;
}
.restore-select-label {
    display: inline-flex; align-items: center; gap: 6px;
    background: #f59e0b; color: #fff;
    padding: 8px 18px; border-radius: 10px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: background 0.2s;
}
.restore-select-label:hover { background: #d97706; }

/* 복구 미리보기 */
.restore-preview-box {
    background: var(--bg);
    border: 1.5px solid #fcd34d;
    border-radius: 12px;
    padding: 14px;
    margin-top: 8px;
}
.restore-preview-header {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 600; color: var(--text-primary);
    margin-bottom: 10px;
}
.restore-preview-list {
    display: flex; flex-direction: column; gap: 6px;
    margin-bottom: 12px;
    max-height: 160px; overflow-y: auto;
}
.restore-preview-row {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 12px; background: var(--card-bg);
    border: 1px solid var(--border); border-radius: 8px;
    padding: 7px 10px;
}
.restore-preview-row-name { font-weight: 600; color: var(--text-primary); }
.restore-preview-row-count { color: #3b82f6; font-weight: 700; }

.restore-warn-box {
    background: #fffbeb; border: 1px solid #fcd34d; border-radius: 8px;
    padding: 9px 12px; font-size: 12px; color: #92400e;
    display: flex; align-items: flex-start; gap: 8px;
    margin-bottom: 12px; line-height: 1.6;
}
.restore-btn-main {
    width: 100%;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff; border: none; border-radius: 10px;
    padding: 11px; font-size: 13px; font-weight: 700;
    cursor: pointer; font-family: var(--font);
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 3px 10px rgba(217,119,6,0.28);
}
.restore-btn-main:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(217,119,6,0.38); }
.restore-btn-main:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* 복구 순서 안내 */
.restore-guide-steps {
    display: flex; align-items: center; flex-wrap: wrap;
    gap: 6px; margin-bottom: 14px;
    background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 10px; padding: 10px 14px;
}
.restore-guide-step {
    display: flex; align-items: center; gap: 7px;
}
.restore-step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%;
    background: #f59e0b; color: #fff; font-size: 11px; font-weight: 800;
    flex-shrink: 0;
}
.restore-step-txt { font-size: 12px; color: #374151; font-weight: 500; }
.restore-guide-arrow { color: #d1d5db; font-size: 14px; font-weight: 700; }

/* 복구 버튼 영역 */
.restore-btn-area {
    margin-top: 10px;
    display: flex; flex-direction: column; gap: 10px;
}
.restore-btn-desc {
    display: flex; align-items: center; gap: 7px;
    font-size: 12px; padding: 6px 0;
}

/* 복구 방식 카드 */
.restore-mode-guide {
    display: flex; flex-direction: column; gap: 10px;
}
.restore-mode-card {
    display: flex; align-items: center; gap: 14px;
    background: var(--bg); border: 1.5px solid var(--border);
    border-radius: 12px; padding: 14px 16px;
    transition: box-shadow 0.2s;
}
.restore-mode-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
.restore-mode-replace { border-color: #bbf7d0; background: #f0fdf4; }
.restore-mode-add { border-color: #bfdbfe; background: #eff6ff; }
.restore-mode-icon {
    width: 42px; height: 42px; border-radius: 10px;
    background: #dcfce7; color: #16a34a;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.restore-mode-info { flex: 1; }
.restore-mode-info strong { font-size: 13px; color: var(--text-primary); display: flex; align-items: center; gap: 6px; }
.restore-mode-info p { font-size: 12px; color: #6b7280; margin: 4px 0 0; line-height: 1.5; }
.restore-mode-badge {
    font-size: 10px; padding: 2px 7px; border-radius: 20px;
    font-weight: 700; letter-spacing: 0.02em;
}
.restore-mode-badge-green { background: #dcfce7; color: #15803d; }

/* 복구 실행 버튼 */
.restore-action-btn {
    flex-shrink: 0; padding: 10px 16px;
    border: none; border-radius: 10px;
    font-size: 13px; font-weight: 700;
    cursor: pointer; font-family: var(--font);
    display: flex; align-items: center; gap: 7px;
    transition: all 0.2s; white-space: nowrap;
}
.restore-action-btn-green {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #fff; box-shadow: 0 3px 10px rgba(22,163,74,0.28);
}
.restore-action-btn-green:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(22,163,74,0.38); }
.restore-action-btn-blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff; box-shadow: 0 3px 10px rgba(59,130,246,0.28);
}
.restore-action-btn-blue:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(59,130,246,0.38); }
.restore-action-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

/* 개별 테이블 초기화 그리드 */
.clear-table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}
.clear-table-item {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--bg); border: 1.5px solid var(--border);
    border-radius: 10px; padding: 9px 12px; gap: 8px;
}
.clear-table-item-name { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.clear-table-item-btn {
    background: #fee2e2; color: #dc2626; border: none;
    border-radius: 6px; padding: 4px 8px; font-size: 11px;
    font-weight: 700; cursor: pointer; white-space: nowrap;
    font-family: var(--font); transition: background 0.15s;
}
.clear-table-item-btn:hover { background: #fca5a5; }
/* ─────────────────────────────────────────────────────────── */

/* 관리자 회원 수정 모달 */
.member-edit-modal {
    position: fixed; inset: 0; z-index: 3000;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.5);
}
.member-edit-modal.hidden { display: none; }
.member-edit-box {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    width: min(460px, 92vw);
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.member-edit-box h3 { font-size: 17px; font-weight: 700; margin-bottom: 18px; }
.member-edit-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.member-edit-row label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.member-edit-row input, .member-edit-row select {
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg);
    color: var(--text-primary);
}
.member-edit-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.me-save-btn { background: var(--primary); color: #fff; border: none; padding: 9px 20px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.me-cancel-btn { background: var(--border); color: var(--text-primary); border: none; padding: 9px 16px; border-radius: 8px; cursor: pointer; }

/* 모바일: 사이드바 더 좁게 */
@media (max-width: 480px) {
    :root { --sidebar-width: 64px; }
    .nav-item { font-size: 8.5px; padding: 9px 2px; }
    .nav-item i { font-size: 17px; }
    .ls-title { font-size: 8px; }
}

@media print {
    .app-header, .left-sidebar, .back-btn, .answer-actions, .feedback-section {
        display: none !important;
    }
    .main-content { margin: 0 !important; }
    .page { display: block !important; }
    #page-answer { display: block !important; }
}

/* ========================
   AI 상태 배지 (헤더)
======================== */
.ai-status-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    cursor: default;        /* 클릭 불가 */
    pointer-events: none;   /* 호버·클릭 이벤트 전체 차단 */
    user-select: none;
    border: 1.5px solid transparent;
}
.ai-on {
    background: #d1fae5;
    color: #065f46;
    border-color: #a7f3d0;
}
.ai-off {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
    /* 연결 안 됨 상태에서는 회진(pulse) 애니메이션 제거 – 단순 표시용 */
}
@keyframes pulseBadge {
    0%,100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ========================
   API 경고 배너 (홈)
======================== */
.api-warning {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff7ed;
    border: 1.5px solid #fed7aa;
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 16px;
}
.api-warning i {
    font-size: 20px;
    color: #ea580c;
    flex-shrink: 0;
}
.api-warning-title {
    font-size: 13px;
    font-weight: 700;
    color: #9a3412;
}
.api-warning-desc {
    font-size: 12px;
    color: #c2410c;
    margin-top: 2px;
}
.api-warning-btn {
    background: #ea580c;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s;
}
.api-warning-btn:hover { background: #c2410c; }

/* ========================
   질문 원문 표시
======================== */
.summary-original {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-secondary);
    background: var(--bg);
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 3px solid var(--border);
    font-style: italic;
}

/* ========================
   AI 로딩 카드
======================== */
.ai-loading-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-md);
    width: 100%;
}
.ai-loading-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}
.ai-spinner {
    font-size: 36px;
    animation: pulse 1.5s infinite;
    flex-shrink: 0;
}
.ai-loading-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.ai-loading-sub {
    font-size: 12px;
    color: var(--primary);
    font-weight: 500;
}

/* ========================
   AI 답변 카드 본문
======================== */
.ai-answer-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px 22px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    animation: cardSlideIn 0.4s ease;
}
.ai-answer-body {
    font-size: 16px;        /* 기존 14px → 16px (+2pt) */
    line-height: 1.9;
    color: var(--text-primary);
}

/* 마크다운 스타일 */
.ai-answer-body .md-h2 {
    font-size: 18px;        /* +2pt */
    font-weight: 800;
    color: var(--primary);
    margin: 20px 0 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--primary-light);
    display: flex;
    align-items: center;
    gap: 6px;
}
.ai-answer-body .md-h2:first-child { margin-top: 0; }

.ai-answer-body .md-h3 {
    font-size: 16px;        /* +2pt */
    font-weight: 700;
    color: var(--text-primary);
    margin: 14px 0 8px;
    padding-left: 10px;
    border-left: 3px solid var(--primary);
}
.ai-answer-body .md-h4 {
    font-size: 15px;        /* +2pt */
    font-weight: 700;
    color: var(--text-secondary);
    margin: 10px 0 6px;
}
.ai-answer-body .md-p {
    margin: 6px 0;
    line-height: 1.9;
    font-size: 16px;        /* +2pt */
}
.ai-answer-body .md-ul {
    list-style: none;
    padding: 0;
    margin: 8px 0;
}
.ai-answer-body .md-ul li {
    padding: 6px 0 6px 22px;
    position: relative;
    line-height: 1.85;
    font-size: 16px;        /* +2pt */
    border-bottom: 1px dashed var(--border);
}
.ai-answer-body .md-ul li:last-child { border-bottom: none; }
.ai-answer-body .md-ul li::before {
    content: '▪';
    color: var(--primary);
    position: absolute;
    left: 4px;
    top: 6px;
}
.ai-answer-body .md-ol {
    padding-left: 0;
    margin: 8px 0;
    counter-reset: ol-counter;
    list-style: none;
}
.ai-answer-body .md-ol li {
    padding: 8px 8px 8px 36px;
    position: relative;
    line-height: 1.7;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 6px;
    counter-increment: ol-counter;
}
.ai-answer-body .md-ol li::before {
    content: counter(ol-counter);
    position: absolute;
    left: 8px;
    top: 8px;
    width: 22px;
    height: 22px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* ============================================================
   AI 답변 본문 인라인 파일 다운로드 버튼 (ifl-*)
   ============================================================ */
/* li 항목이 버튼을 가졌을 때 flex 레이아웃으로 전환 */
.ai-answer-body .md-ul li.ifl-item,
.ai-answer-body .md-ol li.ifl-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-right: 4px;
}
/* 텍스트 영역 */
.ifl-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* 버튼 묶음 (다운로드 + 관리자 삭제) */
.ifl-btn-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
/* 공통 인라인 버튼 */
.ifl-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s;
    line-height: 1.2;
}
/* 다운로드 버튼 – 파일 형식별 */
.ifl-dl        { background: #2563eb; color: #fff; }
.ifl-dl:hover  { background: #1d4ed8; transform: translateY(-1px); box-shadow: 0 2px 8px rgba(37,99,235,.4); }
.ifl-dl.ifl-pdf  { background: #dc2626; }
.ifl-dl.ifl-pdf:hover  { background: #b91c1c; }
.ifl-dl.ifl-hwp  { background: #2563eb; }
.ifl-dl.ifl-hwp:hover  { background: #1d4ed8; }
.ifl-dl.ifl-xlsx { background: #16a34a; }
.ifl-dl.ifl-xlsx:hover { background: #15803d; }
.ifl-dl.ifl-ppt  { background: #ea580c; }
.ifl-dl.ifl-ppt:hover  { background: #c2410c; }
/* 검색 버튼 (메타데이터만 있을 때) */
.ifl-search        { background: #7c3aed; color: #fff; }
.ifl-search:hover  { background: #6d28d9; transform: translateY(-1px); box-shadow: 0 2px 8px rgba(124,58,237,.4); }
/* 로그인 필요 버튼 */
.ifl-lock          { background: #f59e0b; color: #fff; }
.ifl-lock:hover    { background: #d97706; }
/* 준비 중 버튼 */
.ifl-none          { background: #e2e8f0; color: #94a3b8; cursor: not-allowed; opacity: 0.7; }
/* 관리자 삭제 버튼 */
.ifl-del {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1.5px solid #fca5a5;
    border-radius: 5px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.18s;
    flex-shrink: 0;
}
.ifl-del:hover { background: #b91c1c; color: #fff; border-color: #b91c1c; }
/* 안내 문구 스타일 */
.ifl-notice-p {
    background: #eff6ff;
    border-left: 3px solid #2563eb;
    border-radius: 0 6px 6px 0;
    padding: 6px 10px;
    margin: 6px 0;
    font-size: 13px;
    color: #1d4ed8;
}
.ifl-notice { font-weight: 600; }

/* * 키: 값 형태의 인라인 항목 – 줄바꿈으로 분리 표시 */
.ai-answer-body .md-bullet-item {
    display: block;
    padding: 5px 0 5px 16px;
    position: relative;
    font-size: 16px;
    line-height: 1.85;
    border-bottom: 1px dashed var(--border);
}
.ai-answer-body .md-bullet-item:last-of-type { border-bottom: none; }
.ai-answer-body .md-bullet-key {
    font-weight: 700;
    color: var(--primary);
    margin-right: 2px;
}
.ai-answer-body .md-bullet-dot {
    color: var(--primary);
    font-weight: 700;
    margin-right: 4px;
}

.ai-answer-body .md-hr {
    border: none;
    border-top: 2px dashed var(--border);
    margin: 16px 0;
}
.ai-answer-body .md-code {
    background: #1e293b;
    color: #e2e8f0;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 12px;
    overflow-x: auto;
    margin: 10px 0;
}
.ai-answer-body .md-inline-code {
    background: var(--primary-light);
    color: var(--primary);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
}
.ai-answer-body strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* ============================================================
   첫 로그인 튜토리얼 모달
   ============================================================ */

/* 오버레이 */
.tutorial-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    /* 배경 – 앱 화면이 흐릿하게 보이도록 */
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: tutOverlayIn 0.4s ease;
}
.tutorial-overlay.hidden { display: none; }

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

/* 모달 박스 */
.tutorial-modal {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: tutModalIn 0.45s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes tutModalIn {
    from { opacity: 0; transform: scale(0.88) translateY(30px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* 진행 바 */
.tutorial-progress-bar {
    height: 4px;
    background: #e5e7eb;
    flex-shrink: 0;
}
.tutorial-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, #7c3aed 100%);
    border-radius: 0 2px 2px 0;
    transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
    width: 0%;
}

/* 단계 인디케이터 */
.tutorial-steps-indicator {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 14px 0 0;
    flex-shrink: 0;
}
.tut-step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d1d5db;
    transition: all 0.3s ease;
    cursor: pointer;
}
.tut-step-dot.active {
    background: var(--primary);
    width: 24px;
    border-radius: 4px;
}
.tut-step-dot.done {
    background: var(--success);
}

/* 슬라이드 공통 */
.tutorial-slide {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    padding: 20px 28px 12px;
    animation: tutSlideIn 0.35s ease;
}
.tutorial-slide.active {
    display: flex;
}
@keyframes tutSlideIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes tutSlideBack {
    from { opacity: 0; transform: translateX(-20px); }
    to   { opacity: 1; transform: translateX(0); }
}
.tutorial-slide.slide-back {
    animation: tutSlideBack 0.35s ease;
}

/* ── STEP 0 환영 ── */
.tut-welcome-icon {
    font-size: 64px;
    text-align: center;
    margin-bottom: 8px;
    animation: tutBounce 1.2s ease infinite alternate;
}
@keyframes tutBounce {
    from { transform: translateY(0); }
    to   { transform: translateY(-8px); }
}
.tut-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 6px;
    line-height: 1.3;
}
.tut-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.7;
    margin-bottom: 20px;
}
.tut-welcome-cards {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}
.tut-welcome-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    background: linear-gradient(135deg, #f0f4ff 0%, #ede9fe 100%);
    border-radius: 16px;
    border: 1.5px solid #e0e7ff;
    text-align: center;
}
.tut-wc-icon { font-size: 28px; }
.tut-wc-text { font-size: 11.5px; font-weight: 600; color: var(--text-primary); line-height: 1.5; }
.tut-welcome-note {
    text-align: center;
    font-size: 12.5px;
    color: var(--primary);
    font-weight: 600;
    background: var(--primary-light);
    border-radius: 10px;
    padding: 8px 14px;
}

/* ── 슬라이드 헤더 (STEP 1~3) ── */
.tut-slide-header { margin-bottom: 16px; }
.tut-step-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}
.tut-slide-header .tut-title {
    text-align: left;
    font-size: 19px;
}

/* ── 공통 섹션 ── */
.tut-section { display: flex; flex-direction: column; gap: 14px; }
.tut-section-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    padding-bottom: 4px;
    border-bottom: 2px solid var(--primary-light);
}

/* ── STEP 1 포인트 ── */
.tut-info-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px;
    background: var(--bg);
    border-radius: 14px;
    border: 1px solid var(--border);
}
.tut-info-icon { font-size: 24px; flex-shrink: 0; margin-top: 2px; }
.tut-info-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.tut-info-desc { font-size: 12.5px; color: var(--text-secondary); line-height: 1.6; }

.tut-point-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 4px;
}
.tut-point-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}
.tut-point-item.gain { background: #ecfdf5; }
.tut-point-item.lose { background: #fef2f2; }
.tut-pt-badge {
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}
.tut-pt-badge.plus { background: #d1fae5; color: #065f46; }
.tut-pt-badge.minus { background: #fee2e2; color: #991b1b; }

/* ── STEP 2 질문 ── */
.tut-tip-box {
    background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
    border: 1.5px solid #c7d2fe;
    border-radius: 14px;
    padding: 14px 16px;
}
.tut-tip-title { font-size: 13.5px; font-weight: 800; color: var(--primary); margin-bottom: 6px; }
.tut-tip-desc { font-size: 12.5px; color: var(--text-secondary); line-height: 1.65; margin-bottom: 10px; }
.tut-kw-example {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.tut-kw-tag {
    background: #0ea5e9;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
}

.tut-examples { display: flex; flex-direction: column; gap: 10px; }
.tut-ex-item {
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    transition: border-color 0.2s;
}
.tut-ex-item:hover { border-color: var(--primary); }
.tut-ex-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 8px;
    margin-bottom: 6px;
}
.tut-ex-badge.good { background: #d1fae5; color: #065f46; }
.tut-ex-text {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.65;
}
.tut-ex-highlight {
    color: var(--primary);
    font-weight: 700;
    font-style: normal;
    background: var(--primary-light);
    padding: 1px 4px;
    border-radius: 4px;
}

.tut-remind-box {
    background: #fff7ed;
    border: 1.5px solid #fed7aa;
    border-radius: 14px;
    padding: 14px 16px;
    text-align: center;
}
.tut-remind-box > p:first-child { font-size: 13px; font-weight: 700; color: #9a3412; margin-bottom: 8px; }
.tut-remind-quote {
    font-size: 13.5px;
    font-weight: 800;
    color: #ea580c;
    background: #fff;
    border: 1.5px dashed #fb923c;
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 8px;
    line-height: 1.5;
}
.tut-remind-sub { font-size: 12px; color: #c2410c; line-height: 1.5; }

/* ── STEP 3 히스토리 & 게시판 ── */
.tut-feature-block {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px;
    background: var(--bg);
    border-radius: 14px;
    border: 1px solid var(--border);
}
.tut-feature-icon-wrap {
    font-size: 32px;
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: #fff;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.tut-feature-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.tut-feature-desc { font-size: 12.5px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 10px; }
.tut-feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.tut-feature-list li { font-size: 12.5px; color: var(--text-secondary); line-height: 1.55; }

.tut-divider {
    height: 1px;
    background: var(--border);
    margin: 0;
}

.tut-board-cats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tut-board-cat {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid var(--border);
}
.tut-cat-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.tut-cat-name { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.tut-cat-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

.tut-finish-box {
    text-align: center;
    padding: 20px 16px;
    background: linear-gradient(135deg, #f0fdf4 0%, #eff6ff 100%);
    border-radius: 16px;
    border: 2px solid #bbf7d0;
    margin-top: 4px;
}
.tut-finish-emoji { font-size: 40px; margin-bottom: 8px; }
.tut-finish-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.tut-finish-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }

/* ── 하단 네비게이션 ── */
.tutorial-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px 18px;
    border-top: 1px solid var(--border);
    background: #fff;
    flex-shrink: 0;
}
.tut-nav-right { display: flex; gap: 8px; align-items: center; }

.tut-btn-skip {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-family: var(--font);
    cursor: pointer;
    padding: 8px 4px;
    transition: color 0.2s;
}
.tut-btn-skip:hover { color: var(--text-secondary); }

.tut-btn-prev {
    background: var(--bg);
    border: 1.5px solid var(--border);
    color: var(--text-primary);
    font-size: 13.5px;
    font-weight: 600;
    font-family: var(--font);
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}
.tut-btn-prev:hover { background: var(--border); }
.tut-btn-prev.hidden { display: none; }

.tut-btn-next {
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    border: none;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font);
    padding: 10px 22px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s;
    box-shadow: 0 4px 14px rgba(26,86,219,0.35);
}
.tut-btn-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(26,86,219,0.45);
}
.tut-btn-next.finish-btn {
    background: linear-gradient(135deg, #059669 0%, #0284c7 100%);
    box-shadow: 0 4px 14px rgba(5,150,105,0.35);
}
.tut-btn-next.finish-btn:hover {
    box-shadow: 0 6px 20px rgba(5,150,105,0.45);
}

/* 반응형 */
@media (max-width: 480px) {
    .tutorial-modal { border-radius: 20px; }
    .tutorial-slide { padding: 16px 18px 8px; }
    .tut-title { font-size: 19px; }
    .tut-welcome-cards { flex-direction: column; }
    .tut-point-grid { grid-template-columns: 1fr; }
    .tut-feature-block { flex-direction: column; }
    .tut-feature-icon-wrap { width: 40px; height: 40px; font-size: 24px; }
    .tut-nav-right { gap: 6px; }
    .tut-btn-next { padding: 9px 16px; font-size: 13px; }
}

/* 특수 섹션 색상 (이모지 기반) */
.ai-answer-body .md-h2:has-text("⚠️"),
.ai-answer-body .md-h2 {
    /* 섹션별 색상 오버라이드는 JS에서 처리 */
}

/* ========================
   오류 카드
======================== */
.error-card {
    background: white;
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
    box-shadow: var(--shadow-md);
    border-top: 4px solid var(--danger);
}
.error-icon { font-size: 48px; margin-bottom: 12px; }
.error-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 10px;
    white-space: pre-line;
}
.error-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
    white-space: pre-line;
}
.error-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* ========================
   AI 설정 화면
======================== */
.settings-hero {
    background: linear-gradient(135deg, #1a56db, #7c3aed);
    border-radius: var(--radius-lg);
    padding: 28px 20px;
    text-align: center;
    color: white;
    margin-bottom: 16px;
}
.settings-hero-icon { font-size: 48px; margin-bottom: 12px; }
.settings-hero-title { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.settings-hero-desc { font-size: 13px; opacity: 0.85; line-height: 1.7; }

.api-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.api-status-label { font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.ai-status-tag {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
}
.ai-on-tag { background: #d1fae5; color: #065f46; }
.ai-off-tag { background: #fee2e2; color: #991b1b; }

.api-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.api-input-wrapper {
    position: relative;
    margin-bottom: 6px;
}
.api-input {
    width: 100%;
    padding: 13px 44px 13px 14px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: all 0.2s;
    color: var(--text-primary);
    background: white;
}
.api-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,0.1); }
.api-eye-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 16px;
    padding: 4px;
}
.api-input-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 14px;
}
.api-btn-group { display: flex; flex-direction: column; gap: 0; }

.btn-danger {
    background: white;
    color: var(--danger);
    border: 1.5px solid var(--danger);
    border-radius: 12px;
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    width: 100%;
}
.btn-danger:hover { background: #fff5f5; }

/* 발급 안내 */
.guide-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.guide-steps { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.guide-step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.guide-num {
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}
.guide-step-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
}
.guide-step-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }

.btn-link-out {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    padding: 13px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-link-out:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* ========================
   API 입력창 마스킹 스타일
======================== */
.api-input-masked {
    /* 마스킹: -webkit-text-security:disc 로 ● 표시 (type=text 유지하면서 시각적 숨김) */
    -webkit-text-security: disc !important;
    font-family: monospace !important;
    letter-spacing: 2px;
    font-size: 16px !important;
    color: var(--text-primary) !important;
}

/* ========================
   설정 화면 인라인 결과 메시지
======================== */
.save-result-msg {
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.7;
    margin-bottom: 14px;
    white-space: pre-line;
}
/* 성공/오류/정보 타입일 때만 애니메이션 + 강제 표시 */
.save-result-success,
.save-result-error,
.save-result-info {
    animation: slideDown 0.3s ease;
    display: block !important;
}

.save-result-success {
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    color: #166534;
}

.save-result-error {
    background: #fff5f5;
    border: 1.5px solid #fca5a5;
    color: #991b1b;
}

.save-result-info {
    background: #eff6ff;
    border: 1.5px solid #93c5fd;
    color: #1e40af;
}

/* ============================================================
   AFTER 브랜딩 요소
============================================================ */
.after-logo-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #fff, rgba(255,255,255,0.7));
    border-radius: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    font-weight: 900;
    color: #1a56db;
    margin: 0 auto 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.splash-subtitle2 {
    font-size: 12px;
    opacity: 0.75;
    margin-top: 6px;
    letter-spacing: 0.5px;
}
.ls-emoji.after-logo-small {
    font-size: 18px;
    font-weight: 900;
    color: white;
    background: rgba(255,255,255,0.25);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.header-emoji.after-logo-header {
    font-size: 16px;
    font-weight: 900;
    color: white;
    background: linear-gradient(135deg, #1a56db, #7c3aed);
    border-radius: 8px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.header-title-wrap {
    display: flex;
    flex-direction: column;
}
.header-subtitle {
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.3px;
    line-height: 1.2;
    display: none;
}
@media (min-width: 400px) {
    .header-subtitle { display: block; }
}
.header-copyright {
    font-size: 9px;
    color: #a78bfa;          /* 연보라 – 브랜드 컬러와 어울리게 */
    font-weight: 500;
    letter-spacing: 0.2px;
    line-height: 1.2;
    display: none;
    white-space: nowrap;
    font-style: italic;
}
@media (min-width: 400px) {
    .header-copyright { display: block; }
}

/* 관리자 메뉴 버튼 */
.ls-divider {
    width: 40px;
    height: 1px;
    background: rgba(255,255,255,0.15);
    margin: 4px auto;
}
.nav-item-admin {
    margin-top: 2px;
}
.nav-item-admin i {
    color: #fca5a5 !important;
}
.nav-item-admin:hover,
.nav-item-admin:hover i {
    color: white !important;
}

/* 설정 관리자 안내 */
.settings-admin-note {
    margin-top: 12px;
    padding: 8px 14px;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}

/* ============================================================
   로그인 상태 버튼 (헤더)
============================================================ */
.login-status-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.login-status-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.login-status-btn.logged-in {
    background: linear-gradient(135deg, #e8f0fe, #ede9fe);
    border-color: var(--primary);
    color: var(--primary);
}

/* 헤더 포인트 배지 */
.header-points-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: linear-gradient(135deg, #fef9c3, #fef3c7);
    border: 1.5px solid #fcd34d;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: #92400e;
    white-space: nowrap;
    cursor: default;
    animation: pointPop 0.4s ease;
}
.header-points-badge i { color: #d97706; font-size: 13px; }
@keyframes pointPop {
    0%   { transform: scale(0.8); opacity: 0; }
    60%  { transform: scale(1.1); }
    100% { transform: scale(1);   opacity: 1; }
}

/* ============================================================
   인증 모달 (로그인 / 회원가입)
============================================================ */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 9500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s ease;
}

.auth-modal-box {
    background: white;
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 60px rgba(0,0,0,0.25);
    animation: slideUp 0.3s ease;
}

.auth-tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
}
.auth-tab {
    flex: 1;
    padding: 14px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.auth-tab.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    margin-bottom: -2px;
}

.auth-panel { display: none; }
.auth-panel.active { display: block; }

.auth-header {
    text-align: center;
    padding: 28px 24px 16px;
}
.auth-logo {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #1a56db, #7c3aed);
    border-radius: 18px;
    color: white;
    font-size: 24px;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    box-shadow: 0 6px 20px rgba(26,86,219,0.3);
}
.auth-header h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.auth-header p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.auth-form {
    padding: 8px 24px 28px;
}
.auth-field {
    margin-bottom: 14px;
}
.auth-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 6px;
}
.auth-field input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-family: var(--font);
    color: var(--text-primary);
    background: var(--bg);
    outline: none;
    transition: border-color 0.2s;
}
.auth-field input:focus {
    border-color: var(--primary);
    background: white;
}
.required {
    color: var(--danger);
    font-size: 12px;
}

.auth-error {
    font-size: 12px;
    color: var(--danger);
    background: #fff5f5;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
    line-height: 1.5;
}
/* 비밀번호 안내 문구 */
.pw-guide {
    font-size: 11px;
    color: #6b7280;
    margin-top: 5px;
    margin-bottom: 4px;
    line-height: 1.5;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 5px 8px;
}
.pw-guide i { color: #3b82f6; margin-right: 3px; }
/* 비밀번호 강도 바 */
.pw-strength-bar {
    height: 5px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 5px;
}
.pw-strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 10px;
    transition: width 0.3s, background 0.3s;
}
.pw-strength-text {
    font-size: 11px;
    font-weight: 600;
    margin-top: 3px;
    min-height: 16px;
}
.auth-success {
    font-size: 12px;
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.auth-submit-btn {
    width: 100%;
    justify-content: center;
    margin-top: 4px;
}

.auth-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 14px;
    align-items: center;
}
.auth-link-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    text-decoration: underline;
    padding: 2px;
}
.auth-link-danger {
    color: var(--danger) !important;
}

.auth-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    background: var(--bg);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 14px;
    z-index: 10;
    transition: all 0.2s;
}
.auth-close:hover {
    background: var(--border);
    color: var(--text-primary);
}

/* 개인정보 동의 박스 */
.auth-consent-box {
    background: #f9fafb;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 14px;
}
.auth-consent-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.auth-consent-body {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 12px;
}
.auth-consent-body p {
    margin-bottom: 2px;
}
.auth-consent-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
}
.auth-consent-check input {
    width: 16px !important;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* ============================================================
   관리자 모달
============================================================ */
.admin-modal-box {
    background: white;
    border-radius: 24px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease;
}

.admin-panel { display: none; }
.admin-panel.active { display: block; }

.admin-dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
}
.admin-dashboard-header h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.admin-dashboard-header p {
    font-size: 12px;
    color: var(--text-muted);
}

.admin-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
}
.admin-tab {
    padding: 12px 16px;
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
}
.admin-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.admin-tab-content { display: none; padding: 16px 24px 24px; }
.admin-tab-content.active { display: block; }
.admin-tab-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}
.admin-tab-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.admin-members-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}
.admin-member-card {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.admin-member-card.approved {
    border-color: #86efac;
    background: #f0fdf4;
}
.admin-member-card.pending {
    border-color: #fcd34d;
    background: #fffbeb;
}
.admin-member-info {
    flex: 1;
    min-width: 0;
}
.admin-member-id {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.admin-member-id strong {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}
.admin-member-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}
.badge-approved {
    background: #dcfce7;
    color: #166534;
}
.badge-pending {
    background: #fef9c3;
    color: #854d0e;
}
.badge-vip {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border: 1px solid #f59e0b;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
}
.admin-member-detail {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.admin-member-detail span {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}
.admin-member-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}
/* 관리자 업로드 검토용 다운로드 버튼 */
.btn-admin-dl {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.btn-admin-dl:hover { background: #1d4ed8; color: white; border-color: #1d4ed8; }

.btn-approve {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.btn-approve:hover { background: #166534; color: white; }

.btn-revoke {
    background: #fef9c3;
    color: #854d0e;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.btn-revoke:hover { background: #854d0e; color: white; }

.btn-del-member {
    background: #fee2e2;
    color: var(--danger);
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
}
.btn-del-member:hover { background: var(--danger); color: white; }

/* 탈퇴 처리 버튼 */
.btn-member-withdraw {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.btn-member-withdraw:hover { background: #991b1b; color: white; }

/* VIP 지정 버튼 */
.btn-member-vip {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.btn-member-vip:hover { background: #f59e0b; color: white; border-color: #d97706; }

/* VIP 해제 버튼 */
.btn-member-unvip {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.btn-member-unvip:hover { background: #6b7280; color: white; }

/* VIP 회원 카드 강조 */
.admin-member-card.vip {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
}

/* ============================================================
   자료실 로그인 유도 박스
============================================================ */
.forms-login-prompt {
    text-align: center;
    padding: 48px 20px;
    background: white;
    border-radius: var(--radius-lg);
    margin: 16px 0;
    box-shadow: var(--shadow);
}
.flp-icon {
    font-size: 52px;
    margin-bottom: 16px;
}
.forms-login-prompt h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.forms-login-prompt p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* 업로더 배지 */
.form-uploader-badge {
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 6px;
    margin-top: 4px;
    display: inline-block;
}

/* 잠금 다운로드 버튼 */
.form-download-btn--locked {
    background: #f3f4f6;
    color: var(--text-muted);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 16px;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.form-download-btn--locked:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

/* ============================================================
   AI 답변 후 관련 서식 섹션
============================================================ */
.related-forms-section {
    background: linear-gradient(135deg, #f0f7ff, #f5f3ff);
    border: 1.5px solid #c7d2fe;
    border-radius: 14px;
    padding: 16px;
    margin: 16px 0;
}
.related-forms-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 800;
    color: #3730a3;
    margin-bottom: 6px;
}
.related-forms-header i { color: #6366f1; }
.related-forms-count {
    font-size: 11px;
    background: #6366f1;
    color: white;
    border-radius: 20px;
    padding: 1px 8px;
    font-weight: 700;
}
.related-forms-desc {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 10px;
}
.related-forms-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.rf-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: white;
    border: 1.5px solid #e0e7ff;
    border-radius: 10px;
    padding: 9px 12px;
    transition: all 0.2s;
}
.rf-item:hover {
    border-color: #6366f1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
}
.rf-item-left {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
}
.rf-dept-tag {
    font-size: 10px;
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 5px;
    padding: 2px 6px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.rf-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 80px;
}
.rf-ext-badge {
    font-size: 10px;
    font-weight: 700;
    background: #f1f5f9;
    color: #475569;
    border-radius: 4px;
    padding: 1px 5px;
    flex-shrink: 0;
}
/* 관련 서식 다운로드 버튼 */
.rf-dl-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 52px;
    min-height: 44px;
    border: none;
    border-radius: 8px;
    padding: 5px 7px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
    flex-shrink: 0;
}
.rf-dl-btn span { font-size: 9px; font-weight: 700; }
.rf-btn-pdf  { background: #fef2f2; color: #b91c1c; border: 1.5px solid #fca5a5; }
.rf-btn-pdf:hover  { background: #b91c1c; color: #fff; transform: translateY(-1px); }
.rf-btn-hwp  { background: #eff6ff; color: #1d4ed8; border: 1.5px solid #93c5fd; }
.rf-btn-hwp:hover  { background: #1d4ed8; color: #fff; transform: translateY(-1px); }
.rf-btn-xlsx { background: #f0fdf4; color: #15803d; border: 1.5px solid #86efac; }
.rf-btn-xlsx:hover { background: #15803d; color: #fff; transform: translateY(-1px); }
.rf-btn-ppt  { background: #fff7ed; color: #c2410c; border: 1.5px solid #fdba74; }
.rf-btn-ppt:hover  { background: #c2410c; color: #fff; transform: translateY(-1px); }
.rf-btn-link { background: #f0fdf4; color: #059669; border: 1.5px solid #6ee7b7; }
.rf-btn-link:hover { background: #059669; color: #fff; transform: translateY(-1px); }
.rf-btn-default { background: #f8fafc; color: #475569; border: 1.5px solid #e2e8f0; }
.rf-btn-default:hover { background: #475569; color: #fff; }
.rf-btn-none { background: #f1f5f9; color: #94a3b8; border: 1.5px solid #e2e8f0; cursor: not-allowed; opacity: 0.6; }
.rf-btn-locked { background: #fef9c3; color: #92400e; border: 1.5px solid #fde68a; }
.rf-btn-locked:hover { background: #92400e; color: #fff; transform: translateY(-1px); }
/* 관련 서식 섹션 – 액션 그룹 (다운로드 + 관리자 삭제) */
.rf-item-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}
/* 관련 서식 섹션 – 관리자 삭제 버튼 */
.rf-del-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1.5px solid #fca5a5;
    border-radius: 7px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}
.rf-del-btn:hover { background: #b91c1c; color: #fff; border-color: #b91c1c; transform: scale(1.1); }

/* ============================================================
   관리자 서식 DB (admin-bf) 스타일
============================================================ */
.admin-bf-upload {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}
.admin-bf-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
/* 업로드 모드 탭 */
.abf-mode-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.abf-mode-tab {
    flex: 1;
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.abf-mode-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.abf-mode-tab:not(.active):hover {
    border-color: var(--primary);
    color: var(--primary);
}
/* 다중 업로드 파일 목록 */
.abf-multi-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 5px;
    font-size: 12px;
}
.abf-multi-item-error { border-color: #fca5a5; background: #fff5f5; }
.abf-multi-icon { font-size: 18px; flex-shrink: 0; }
.abf-multi-info { flex: 1; min-width: 0; }
.abf-multi-title { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.abf-multi-meta  { font-size: 10px; color: #9ca3af; }
.abf-multi-badge { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 5px; white-space: nowrap; }
.abf-multi-badge.ok  { background: #dcfce7; color: #166534; }
.abf-multi-badge.err { background: #fee2e2; color: #b91c1c; }
/* 진행 바 */
.abf-progress-bar-wrap {
    background: #e5e7eb;
    border-radius: 6px;
    height: 8px;
    overflow: hidden;
}
.abf-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #7c3aed);
    border-radius: 6px;
    width: 0%;
    transition: width 0.3s;
}
.abf-multi-drop { cursor: pointer; }
.admin-bf-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 380px;
    overflow-y: auto;
}
.admin-bf-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
}
.admin-bf-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}
.admin-bf-dept {
    font-size: 11px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 5px;
    padding: 1px 7px;
    font-weight: 600;
    white-space: nowrap;
}
.admin-bf-ext {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}
.ext-pdf  { background: #fef2f2; color: #b91c1c; }
.ext-hwp  { background: #eff6ff; color: #1d4ed8; }
.ext-other { background: #f0fdf4; color: #15803d; }
/* 파일/URL 타입 배지 */
.abf-type-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 5px;
    white-space: nowrap;
}
.abf-has-file { background: #dcfce7; color: #166534; }
.abf-has-url  { background: #dbeafe; color: #1d4ed8; }
.abf-no-data  { background: #fef9c3; color: #854d0e; }
/* 파일 드롭존 */
.abf-file-drop {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
    font-size: 13px;
    color: #6b7280;
}
.abf-file-drop:hover, .abf-file-drop.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}
.abf-file-selected {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    border-radius: 8px;
    font-size: 13px;
}
.abf-file-name { font-weight: 600; color: #166534; flex: 1; }
.abf-file-size { font-size: 11px; color: #6b7280; }
.abf-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ============================================================
   프로필 모달
============================================================ */
.profile-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 14px;
}
.profile-info-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.pi-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}
.pi-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

/* 이용 기간 연장 버튼 */
.btn-purchase-access-btn {
    width: 100%;
    padding: 13px 18px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.btn-purchase-access-btn:hover {
    background: linear-gradient(135deg, #4f46e5, #3730a3);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99,102,241,0.4);
}
.btn-purchase-access-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 프로필 섹션 토글 버튼 */
.profile-section-toggle {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    transition: all 0.2s;
}
.profile-section-toggle:hover {
    background: white;
    border-color: var(--primary);
    color: var(--primary);
}

/* ============================================================
   사용자 업로드 승인 대기 배지
============================================================ */
.form-pending-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 600;
    background: #fef9c3;
    color: #854d0e;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    padding: 2px 7px;
    margin-left: 4px;
}

/* ============================================================
   자료실 – 관리자/사용자 업로드 구분 헤더
============================================================ */
.forms-section-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #6366f1;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    padding: 7px 12px;
    margin: 8px 0;
}

/* 만료일 경고 배너 */
.expiry-warning-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff7ed;
    border: 1.5px solid #fed7aa;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 14px;
    cursor: pointer;
}
.expiry-warning-banner.expired {
    background: #fef2f2;
    border-color: #fca5a5;
}
.expiry-warning-banner i { font-size: 18px; color: #ea580c; }
.expiry-warning-banner.expired i { color: #dc2626; }
.expiry-warning-text { flex: 1; }
.expiry-warning-title { font-size: 13px; font-weight: 700; color: #9a3412; }
.expiry-warning-desc  { font-size: 12px; color: #c2410c; }
.expired .expiry-warning-title { color: #7f1d1d; }
.expired .expiry-warning-desc  { color: #991b1b; }

/* 관리자 탭 작게 */
@media (max-width: 480px) {
    .admin-tab { padding: 10px 8px; font-size: 11px; gap: 3px; }
    .admin-tab i { font-size: 12px; }
}

/* ============================================================
   공지사항 티커 (홈 화면 – 좌→우 마퀴 스크롤)
============================================================ */
.notice-ticker-wrap {
    display: flex;
    align-items: center;
    background: linear-gradient(90deg, #eef2ff 0%, #f5f3ff 100%);
    border: 1.5px solid #c7d2fe;
    border-radius: 10px;
    margin-bottom: 10px;
    padding: 0;
    overflow: hidden;
    height: 36px;
}
.notice-ticker-label {
    flex-shrink: 0;
    background: #6366f1;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 0 12px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    letter-spacing: 0.3px;
}
.notice-ticker-track {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 100%;
}
.notice-ticker-inner {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    /* JS가 픽셀 단위로 직접 이동시킴 – CSS animation 사용 안 함 */
}
.notice-ticker-inner:hover { /* JS에서 paused 처리 */ }

.notice-ticker-item {
    font-size: 13px;
    color: #3730a3;
    font-weight: 600;
    padding: 0 24px 0 0;
    cursor: default;
}
.notice-ticker-sub {
    font-size: 12px;
    color: #6366f1;
    font-weight: 400;
}
.notice-ticker-sep {
    color: #a5b4fc;
    font-size: 14px;
    padding: 0 16px 0 0;
}

/* ============================================================
   게시판 고정 공지
============================================================ */
#board-pinned-notices {
    padding: 0 16px 0;
    margin-bottom: 8px;
}
.board-pinned-notice-item {
    background: linear-gradient(90deg, #fefce8 0%, #fef9c3 100%);
    border: 1.5px solid #fcd34d;
    border-left: 4px solid #f59e0b;
    border-radius: 10px;
    margin-bottom: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.2s;
}
.board-pinned-notice-item:hover { box-shadow: 0 2px 10px rgba(245,158,11,0.2); }
.bpn-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
}
.bpn-badge {
    flex-shrink: 0;
    background: #f59e0b;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
}
.bpn-title {
    flex: 1;
    font-size: 13px;
    font-weight: 700;
    color: #78350f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bpn-date {
    font-size: 11px;
    color: #92400e;
    white-space: nowrap;
    flex-shrink: 0;
}
.bpn-arrow {
    color: #d97706;
    font-size: 11px;
    flex-shrink: 0;
    transition: transform 0.25s;
}
.board-pinned-notice-item.expanded .bpn-arrow { transform: rotate(180deg); }
.bpn-body {
    display: none;
    padding: 0 14px 12px;
    font-size: 13px;
    line-height: 1.7;
    color: #78350f;
    border-top: 1px solid #fde68a;
    padding-top: 10px;
    margin-top: 0;
}
.board-pinned-notice-item.expanded .bpn-body { display: block; }

/* ============================================================
   관리자 공지사항 관리 스타일
============================================================ */
.notice-write-wrap {
    background: var(--bg);
    border: 1.5px solid #c7d2fe;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 4px;
}
.notice-admin-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    transition: box-shadow 0.2s;
}
.notice-admin-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.notice-inactive { opacity: 0.55; }
.notice-status-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}
.notice-badge-on  { background: #dcfce7; color: #166534; }
.notice-badge-off { background: #f1f5f9; color: #64748b; }
