/* ==================== Design Tokens (Liner-style Monochrome) ==================== */
:root {
    /* Colors - Monochrome flat */
    --color-bg-primary: #FFFFFF;
    --color-bg-secondary: #FAFAFA;
    --color-bg-tertiary: #F5F5F5;
    --color-bg-hover: #F0F0F0;
    --color-text-primary: #18181B;
    --color-text-secondary: #71717A;
    --color-text-tertiary: #A1A1AA;
    --color-border: #E4E4E7;
    --color-border-light: #F4F4F5;
    --color-border-focus: #059669;
    --color-accent: #059669;
    --color-accent-light: #ECFDF5;
    --color-accent-hover: #047857;
    --color-success: #10B981;
    --color-warning: #71717A;
    --color-error: #DC2626;

    /* Typography (mobile-first, scaled up for readability) */
    --font-sans: 'Inter', 'Noto Sans KR', sans-serif;
    --text-xs: 0.8125rem;
    --text-sm: 0.9375rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.375rem;
    --text-2xl: 1.75rem;

    /* Spacing (8px grid) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 28px;
    --space-8: 32px;

    /* Radius / Shadow - flat, minimal */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow-sm: none;
    --shadow-md: 0 1px 3px 0 rgba(0, 0, 0, 0.06);

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 0px;
    --header-height: 48px;
    --transition-fast: 150ms ease;
    --transition-normal: 200ms ease;
}

/* ==================== Base Styles ==================== */
body {
    font-family: var(--font-sans);
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Login page: center card */
body.no-sidebar {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* App shell: no centering */
body.has-sidebar {
    display: block;
}

/* ==================== App Shell Layout ==================== */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: var(--sidebar-width);
    background: var(--color-bg-primary);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 30;
    transition: transform var(--transition-normal);
}

.app-sidebar.collapsed {
    transform: translateX(-100%);
}

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-normal);
}

body.sidebar-collapsed .app-main {
    margin-left: 0;
}

.app-header {
    height: var(--header-height);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-6);
    background: var(--color-bg-primary);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 20;
}

.app-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.app-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-6);
    overflow-y: auto;
}

/* ==================== Sidebar Components ==================== */
.sidebar-logo {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-5);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.sidebar-logo-text {
    font-size: var(--text-lg);
    font-weight: 800;
    color: var(--color-text-primary);
    letter-spacing: -0.03em;
}

.sidebar-toggle-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sidebar-toggle-btn:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

/* ==================== Sidebar Navigation ==================== */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-3) var(--space-3);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.sidebar-nav-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-2) var(--space-3);
    background: transparent;
    color: var(--color-text-secondary);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
}

.sidebar-nav-btn:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

/* ==================== Sidebar Tabs ==================== */
.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
    padding: 0 var(--space-4);
}

.sidebar-tab {
    flex: 1;
    padding: var(--space-2) 0;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-tertiary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.sidebar-tab:hover {
    color: var(--color-text-secondary);
}

.sidebar-tab.active {
    color: var(--color-text-primary);
    border-bottom-color: var(--color-accent);
}

/* ==================== Sidebar Search ==================== */
.sidebar-search {
    padding: var(--space-3) var(--space-4);
    flex-shrink: 0;
}

.sidebar-search-input {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    color: var(--color-text-primary);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color var(--transition-fast);
    box-sizing: border-box;
}

.sidebar-search-input::placeholder {
    color: var(--color-text-tertiary);
}

.sidebar-search-input:focus {
    border-color: var(--color-border-focus);
    background: var(--color-bg-primary);
}

.sidebar-discussions {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-1) var(--space-3);
}

.sidebar-date-group {
    padding: var(--space-2) var(--space-2) var(--space-1);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.discussion-item {
    display: flex;
    flex-direction: column;
    padding: var(--space-3) var(--space-3);
    margin: 1px 0;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
    gap: var(--space-1);
}

.discussion-item:hover {
    background: var(--color-bg-hover);
}

.discussion-item.active {
    background: var(--color-bg-tertiary);
}

.discussion-item-title {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.discussion-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.discussion-item-time {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
}

/* Context Menu */
.context-menu {
    position: fixed;
    z-index: 100;
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    padding: 4px 0;
    min-width: 160px;
    display: none;
}

.context-menu.visible {
    display: block;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 14px;
    border: none;
    background: none;
    font-size: var(--text-sm);
    color: var(--color-text-primary);
    cursor: pointer;
    text-align: left;
}

.context-menu-item:hover {
    background: var(--color-bg-hover);
}

.context-menu-item.danger {
    color: var(--color-error);
}

.context-menu-item.danger:hover {
    background: #FEF2F2;
}

.context-menu-divider {
    height: 1px;
    background: var(--color-border);
    margin: 4px 0;
}

.sidebar-footer {
    border-top: 1px solid var(--color-border);
    padding: var(--space-3) var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    flex-shrink: 0;
}

.sidebar-footer-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.sidebar-footer-link:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

/* ==================== Badges ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: var(--text-xs);
    font-weight: 600;
    white-space: nowrap;
}

.badge-status-completed {
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
}

.badge-status-active {
    background: var(--color-accent);
    color: #FFFFFF;
}

.badge-status-preparing {
    background: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
}

.badge-status-archived {
    background: var(--color-bg-tertiary);
    color: var(--color-text-tertiary);
}

.badge-plan {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 600;
    background: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
}

/* ==================== Buttons ==================== */
.btn-new {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    line-height: 1.5;
}

.btn-accent {
    background: var(--color-accent);
    color: #FFFFFF;
}

.btn-accent:hover {
    background: var(--color-accent-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
}

.btn-ghost:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
}

.btn-outline:hover {
    background: var(--color-bg-hover);
    border-color: var(--color-text-tertiary);
}

/* ==================== Avatar ==================== */
.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-accent);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
}

.avatar-sm {
    width: 24px;
    height: 24px;
    font-size: var(--text-xs);
}

/* ==================== Dropdown ==================== */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 180px;
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    z-index: 50;
    display: none;
    padding: var(--space-1) 0;
}

.dropdown-menu.open {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    color: var(--color-text-primary);
    cursor: pointer;
    transition: background var(--transition-fast);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: var(--color-bg-hover);
}

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

/* ==================== Sidebar Mobile Overlay ==================== */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 35;
}

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

/* ==================== Screen Transition ==================== */
.screen-fade-enter {
    animation: screenFadeIn var(--transition-fast);
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ==================== Mobile Hamburger ==================== */
.mobile-menu-btn {
    display: none;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--color-text-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.mobile-open {
        transform: translateX(0);
        z-index: 40;
    }

    .app-main {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .sidebar-toggle-btn {
        display: none;
    }
}

/* ==================== Report Cards ==================== */
.report-card {
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
}
.report-card > div:first-child {
    flex: 1;
}

.report-card:hover {
    background: var(--color-bg-secondary);
    border-color: var(--color-text-tertiary);
}

.report-card-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.report-card-summary {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin-top: 6px;
    margin-bottom: var(--space-3);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.report-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: var(--space-3);
}

.report-card-date {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
}

.report-card-actions {
    display: flex;
    gap: var(--space-2);
}

.report-card-action {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.report-card-action:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

/* ==================== Sidebar Report Items ==================== */
.sidebar-report-item {
    display: flex;
    flex-direction: column;
    padding: var(--space-3);
    margin: 1px 0;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
    gap: 2px;
}

.sidebar-report-item:hover {
    background: var(--color-bg-hover);
}

.sidebar-report-title {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-report-date {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
}

/* ==================== Empty State ==================== */
.empty-state {
    text-align: center;
    padding: 48px 16px;
    color: var(--color-text-tertiary);
    font-size: var(--text-sm);
}

/* ==================== Login Page (full-screen centered) ==================== */
.screen-login-page {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.screen-login-page .screen-body {
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-8) var(--space-6);
}

/* ==================== Original Styles (kept for compatibility) ==================== */
        .screen { display: none; }
        .screen.active { display: block; }
        #screen-topic.active {
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: calc(100vh - var(--header-height) - 32px);
        }

        .screen-card {
            background-color: transparent;
            width: 100%;
            max-width: 48rem; /* 768px */
            overflow: hidden;
        }
        /* 모달 내 screen-card는 배경 + 둥근 모서리 적용 */
        .modal .screen-card {
            background-color: var(--color-bg-primary, #ffffff);
            border-radius: var(--radius-lg, 1rem);
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
            padding: 0;
        }
        .screen-header {
            background: none;
            padding: 1rem 0;
            font-weight: 700;
            color: #334155;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        /* 모달 내 screen-header는 패딩 + 하단 구분선 */
        .modal .screen-header {
            padding: 1.25rem 1.5rem;
            border-bottom: 1px solid var(--color-border, #e5e7eb);
            font-size: 1.125rem;
        }
        .screen-body { padding: 2rem 0; }
        /* 모달 내 screen-body는 패딩 적용 */
        .modal .screen-body {
            padding: 1.5rem;
        }
        .text-primary { color: var(--color-text-primary); }
        .btn { border-radius: 0.75rem; font-weight: 700; padding: 0.75rem 1.5rem; transition: all 0.2s ease; cursor: pointer; }
        .btn-primary { background-color: var(--color-accent); color: white; }
        .btn-primary:hover { background-color: var(--color-accent-hover); }
        .btn-primary:disabled { background-color: var(--color-text-tertiary); cursor: not-allowed; }

        /* 토론 흐름도 화살표 스타일 */
        .flow-line {
            position: absolute;
            height: 3px; /* 기본 두께를 약간 두껍게 조정 */
            transform-origin: 0 0;
            transition: all 0.2s ease-in-out; /* 부드러운 효과를 위한 트랜지션 */
            z-index: 10; /* 기본 화살표 z-index 설정 */
        }
        .flow-line::after {
            content: '';
            position: absolute;
            right: -1px;
            top: -3.5px; /* 두께에 맞춰 위치 조정 */
            border-style: solid;
            border-width: 0 3px 3px 0;
            display: inline-block;
            padding: 3.5px;
            transform: rotate(-45deg);
        }

        /* 마우스 오버 시 비활성화된 화살표 스타일 */
        .flow-line.dimmed {
            opacity: 0.15;
            z-index: 5; /* 흐려진 화살표는 뒤로 보냄 */
        }

        /* 마우스 오버 시 강조되는 화살표 스타일 */
        .flow-line.highlighted {
            height: 5px; /* 두께를 더 두껍게 */
            opacity: 1;
            z-index: 20; /* 강조된 화살표를 가장 위로 보냄 */
        }
        .flow-line.highlighted::after {
            top: -4.5px; /* 강조된 두께에 맞춰 위치 재조정 */
        }

        /* 에이전트별 화살표 색상 정의 (7개) */
        .flow-line-color-0 { background-color: #ef4444; } /* red-500 */
        .flow-line-color-0::after { border-color: #ef4444; }
        .flow-line-color-1 { background-color: #3b82f6; } /* blue-500 */
        .flow-line-color-1::after { border-color: #3b82f6; }
        .flow-line-color-2 { background-color: #22c55e; } /* green-500 */
        .flow-line-color-2::after { border-color: #22c55e; }
        .flow-line-color-3 { background-color: #eab308; } /* yellow-500 */
        .flow-line-color-3::after { border-color: #eab308; }
        .flow-line-color-4 { background-color: #8b5cf6; } /* violet-500 */
        .flow-line-color-4::after { border-color: #8b5cf6; }
        .flow-line-color-5 { background-color: #ec4899; } /* pink-500 */
        .flow-line-color-5::after { border-color: #ec4899; }
        .flow-line-color-6 { background-color: #f97316; } /* orange-500 */
        .flow-line-color-6::after { border-color: #f97316; }

        /* 긴 텍스트 (주로 URL) 줄바꿈 처리 */
        .break-word-container {
            word-wrap: break-word; /* 오래된 브라우저 호환 */
            word-break: break-word; /* 최신 브라우저 (Chrome, Firefox 등) */
        }

        /* 토론 흐름도 화살표 스타일 개선 */
        .flow-line {
            position: absolute;
            background-color: #cbd5e1; /* slate-300 */
            height: 2px;
            transform-origin: 0 0;
            transition: all 0.3s ease-in-out;
            z-index: 10;
            opacity: 0.15; /* 기본 상태를 흐리게 (요청사항 3) */
        }
        .flow-line::after {
            content: '';
            position: absolute;
            right: -1px;
            top: -3.5px;
            border-style: solid;
            border-width: 0 2px 2px 0;
            display: inline-block;
            padding: 3px;
            transform: rotate(-45deg);
            border-color: #cbd5e1; /* slate-300 */
        }
        /* 마우스 오버 시 하이라이트 스타일 */
        .flow-line.highlighted {
            height: 3px;
            opacity: 1;
            z-index: 20;
        }
        .flow-line.highlighted::after {
            right: -1.5px;
            top: -4.5px;
            padding: 4px;
        }
        /* 다른 에이전트 오버 시 숨김 처리 */
        .flow-line.hidden {
            opacity: 0;
        }
        /* 상호작용 유형별 색상 */
        .flow-line-agreement { background-color: #22c55e; } /* green-500 */
        .flow-line-agreement::after { border-color: #22c55e; }
        .flow-line-disagreement { background-color: #ef4444; } /* red-500 */
        .flow-line-disagreement::after { border-color: #ef4444; }

        /* 단순화된 토론 흐름도 리스트 스타일 */
        .flow-list-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 8px 0;
            border-bottom: 1px solid #f1f5f9; /* slate-100 */
        }
        .flow-agent-box {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-basis: 40%; /* 양쪽 에이전트 박스가 공간을 차지하도록 */
        }
        .flow-agent-box.from {
            justify-content: flex-start;
        }
        .flow-agent-box.to {
            justify-content: flex-end;
            text-align: right;
        }
        .flow-arrow {
            flex-grow: 1;
            text-align: center;
        }
        .flow-arrow svg {
            width: 100%;
            height: 16px;
        }
        .arrow-agreement path {
            stroke: #22c55e; /* green-500 */
        }
        .arrow-disagreement path {
            stroke: #ef4444; /* red-500 */
        }

        /* ==================== v2.0: 실시간 피드백 UI 스타일 ==================== */
        .preparation-feedback {
            max-width: 800px;
            margin: 2rem auto;
            padding: 2rem;
            background: #ffffff;
            border-radius: 1rem;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }

        .overall-progress {
            margin-bottom: 2rem;
        }

        .overall-progress h3 {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
            font-size: 1.25rem;
            color: #1f2937;
        }

        .progress-bar {
            height: 24px;
            background: #e5e7eb;
            border-radius: 12px;
            overflow: hidden;
            position: relative;
        }

        .progress-fill {
            height: 100%;
            background: var(--color-accent);
            transition: width 0.3s ease;
            position: relative;
        }

        .progress-fill::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(
                90deg,
                transparent,
                rgba(255, 255, 255, 0.3),
                transparent
            );
            animation: shimmer 2s infinite;
        }

        @keyframes shimmer {
            0% { transform: translateX(-100%); }
            100% { transform: translateX(100%); }
        }

        .steps-list {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
            margin-bottom: 2rem;
        }

        .step-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 1rem;
            background: #f9fafb;
            border-radius: 0.5rem;
            border-left: 4px solid #d1d5db;
            transition: all 0.3s ease;
        }

        .step-item.step-pending {
            opacity: 0.6;
        }

        .step-item.step-in_progress {
            background: var(--color-accent-light);
            border-left-color: var(--color-accent);
            box-shadow: none;
        }

        .step-item.step-completed {
            background: var(--color-bg-tertiary);
            border-left-color: var(--color-text-secondary);
        }

        .step-status-icon {
            font-size: 1.5rem;
        }

        .step-icon {
            font-size: 1.75rem;
        }

        .step-name {
            flex: 1;
            font-weight: 600;
            color: #1f2937;
        }

        .step-progress {
            font-size: 0.875rem;
            color: #6b7280;
        }

        .detail-log {
            max-height: 300px;
            overflow-y: auto;
            padding: 1rem;
            background: #f9fafb;
            border-radius: 0.5rem;
            font-family: 'Courier New', monospace;
            font-size: 0.875rem;
        }

        .log-entry {
            display: flex;
            gap: 0.5rem;
            padding: 0.25rem 0;
            line-height: 1.5;
        }

        .log-timestamp {
            color: #6b7280;
        }

        .log-message {
            color: #1f2937;
        }

        .log-entry.log-success {
            color: #059669;
        }

        .log-entry.log-error {
            color: #dc2626;
        }

        /* 애니메이션 */
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.7;  }
        }

        .step-in_progress .step-status-icon {
            animation: pulse 1.5s infinite;
        }

        /* ==================== v2.0: 검색 결과 표시 UI 스타일 ==================== */
        .search-result-announcement {
            background: var(--color-accent);
            color: white;
            padding: 1rem;
            border-radius: 0.5rem;
            margin: 1rem 0;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }

        .search-header {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-weight: bold;
        }

        .search-query {
            margin-top: 0.5rem;
            font-size: 0.9rem;
            opacity: 0.9;
        }

        .view-details {
            margin-top: 0.5rem;
            background: rgba(255,255,255,0.2);
            border: 1px solid rgba(255,255,255,0.3);
            color: white;
            padding: 0.5rem 1rem;
            border-radius: 0.25rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .view-details:hover {
            background: rgba(255,255,255,0.3);
        }

        /* ==================== v2.0: 토론 준비 과정 사이드바 스타일 ==================== */
        .prep-step {
            transition: all 0.3s ease-in-out;
            cursor: default;
        }

        .prep-step.active {
            background-color: var(--color-accent-light);
            border-left-color: var(--color-accent) !important;
            color: var(--color-text-primary);
        }

        .prep-step.completed {
            border-left-color: var(--color-text-secondary) !important;
        }

        .prep-step.completed .prep-step-icon {
            background-color: var(--color-text-secondary) !important;
            color: white;
        }

        .prep-step-icon {
            transition: all 0.3s ease-in-out;
        }

        .prep-step.active .prep-step-icon {
            background-color: var(--color-accent);
            color: white;
        }

        /* Fade-in animation */
        .fade-in {
            animation: fadeIn 0.5s ease-in-out;
        }

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

        /* v2.0: screen-analysis 및 screen-jury - 수직 중앙 정렬 (active일 때만 flex) */
        #screen-analysis.active,
        #screen-jury.active {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            width: 100%;
            min-height: calc(100vh - var(--header-height, 64px) - 100px);
        }

        /* v2.0: 메인 컨텐츠 영역 - 너비만 제약, 높이는 자유 */
        #prep-main-content {
            width: 100%;
            box-sizing: border-box;
            transition: opacity 0.3s ease-in-out;
            /* min-height, max-height, overflow 제거 */
        }

        /* 자식 요소들 - 전체 너비 유지만 */
        #prep-main-content > * {
            width: 100% !important;
            max-width: 100% !important;
            box-sizing: border-box !important;
            /* min-height 제거 - 컨텐츠에 따라 자동 */
            padding-left: 0 !important;
            padding-right: 0 !important;
            margin-left: 0 !important;
            margin-right: 0 !important;
        }

        /* text-center가 있어도 너비 유지 */
        #prep-main-content > div.text-center {
            text-align: center;
        }

        /* fade-in 애니메이션이 있어도 너비 유지 */
        #prep-main-content > .fade-in {
            display: block !important;
        }

        /* ==================== Phase 1: Discussion Chat Layout ==================== */
        .discussion-layout {
            display: flex;
            flex-direction: row;
            height: calc(100vh - var(--header-height) - 24px);
            padding: 0;
            gap: 0;
            overflow: hidden;
        }

        .discussion-chat-area {
            flex: 1;
            min-width: 0;
            min-height: 0;
            display: flex;
            flex-direction: column;
            position: relative;
            overflow: hidden;
        }

        .chat-area-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 16px;
            border-bottom: 1px solid var(--color-border);
            background: var(--color-bg-primary);
            flex-shrink: 0;
        }

        /* === 토론 네비게이터 === */
        .discussion-navigator {
            width: 260px;
            min-width: 260px;
            border-left: 1px solid var(--color-border);
            background: var(--color-bg-secondary);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            transition: width 0.2s ease, min-width 0.2s ease, opacity 0.2s ease;
        }

        .discussion-navigator.collapsed {
            width: 0;
            min-width: 0;
            opacity: 0;
            border-left: none;
            overflow: hidden;
        }

        .nav-header {
            padding: 10px 14px;
            border-bottom: 1px solid var(--color-border);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .nav-title {
            font-weight: 600;
            font-size: 0.8125rem;
            color: var(--color-text-primary);
        }

        .btn-icon {
            width: 28px;
            height: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            border: none;
            background: transparent;
            color: var(--color-text-secondary);
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-size: 0.875rem;
            transition: all var(--transition-fast);
        }

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

        .nav-entries {
            flex: 1;
            overflow-y: auto;
            padding: 6px 0;
        }

        .nav-entry {
            padding: 7px 14px;
            cursor: pointer;
            border-left: 3px solid transparent;
            transition: background 0.15s ease;
            font-size: 0.8125rem;
            line-height: 1.4;
        }

        .nav-entry:hover {
            background: var(--color-bg-hover);
        }

        .nav-entry.active {
            background: var(--color-accent-light);
            border-left-color: var(--color-accent);
        }

        .nav-entry.nav-entry-info {
            border-left-color: var(--color-text-tertiary);
            opacity: 0.85;
        }
        .nav-entry.nav-entry-info:hover {
            opacity: 1;
        }

        .nav-entry-agent {
            font-weight: 600;
            color: var(--color-text-primary);
            margin-bottom: 2px;
            display: flex;
            align-items: center;
            gap: 4px;
            font-size: 0.75rem;
        }

        .nav-entry-summary {
            color: var(--color-text-secondary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            font-size: 0.75rem;
        }

        .nav-round-divider {
            padding: 5px 14px;
            font-size: 0.6875rem;
            font-weight: 700;
            color: var(--color-text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            border-bottom: 1px solid var(--color-border-light);
            margin-top: 4px;
        }

        /* v17.0: 사회자 라운드 요약 — 네비게이터 */
        .nav-moderator-summary {
            border-left-color: var(--color-accent) !important;
            background: var(--color-accent-light);
            padding: 8px 14px !important;
        }
        .nav-moderator-text {
            color: var(--color-text-secondary);
            font-size: 0.7rem;
            line-height: 1.5;
            white-space: normal;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
            margin-top: 2px;
        }

        /* v17.0: 라운드별 접힘 그룹 */
        .nav-round-group {
            margin: 0;
        }
        .nav-round-toggle {
            padding: 4px 14px;
            font-size: 0.6875rem;
            color: var(--color-text-tertiary);
            cursor: pointer;
            list-style: none;
            user-select: none;
        }
        .nav-round-toggle::-webkit-details-marker { display: none; }
        .nav-round-toggle::before {
            content: '▶ ';
            font-size: 0.6rem;
        }
        details[open] > .nav-round-toggle::before {
            content: '▼ ';
        }
        .nav-round-toggle:hover {
            color: var(--color-text-secondary);
            background: var(--color-bg-hover);
        }

        /* v17.0: 사회자 요약 카드 — 채팅박스 */
        .moderator-summary-card {
            margin: 16px 0;
            padding: 14px 18px;
            background: var(--color-accent-light);
            border-left: 3px solid var(--color-accent);
            border-radius: 8px;
        }
        .moderator-summary-header {
            font-weight: 700;
            font-size: var(--text-sm);
            color: var(--color-accent);
            margin-bottom: 6px;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .moderator-summary-body {
            font-size: var(--text-sm);
            color: var(--color-text-primary);
            line-height: 1.65;
        }

        @media (max-width: 1024px) {
            .discussion-navigator {
                display: none;
            }
        }

        .skip-animation-btn {
            position: sticky;
            bottom: 16px;
            align-self: center;
            display: none;
            align-items: center;
            gap: 4px;
            padding: 8px 20px;
            background: var(--color-accent);
            color: #fff;
            border: none;
            border-radius: 20px;
            font-size: var(--text-sm);
            font-weight: 600;
            cursor: pointer;
            box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
            z-index: 10;
            transition: transform 0.15s, box-shadow 0.15s;
        }

        .skip-animation-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 16px rgba(5, 150, 105, 0.4);
        }

        .discussion-chatbox {
            flex: 1;
            overflow-y: auto;
            padding: 0;
            width: 100%;
            margin: 0 auto;
        }

        /* Chat message (ChatGPT/Claude style — full-width rows with agent background) */
        .chat-message {
            display: flex;
            gap: 12px;
            padding: 20px 24px;
            align-items: flex-start;
            border-bottom: 1px solid var(--color-border-light);
            position: relative;
        }

        /* Agent Direct Chat 버튼 (hover 시 표시) */
        .chat-message .btn-agent-chat {
            position: absolute;
            top: 8px;
            right: 12px;
            opacity: 0;
            transition: opacity 0.15s ease;
            font-size: 0.6875rem;
            padding: 3px 8px;
            border-radius: var(--radius-sm);
            background: var(--color-bg-primary);
            border: 1px solid var(--color-border);
            cursor: pointer;
            color: var(--color-text-secondary);
            white-space: nowrap;
        }
        .chat-message:hover .btn-agent-chat {
            opacity: 1;
        }
        .chat-message .btn-agent-chat:hover {
            background: var(--color-bg-hover);
            color: var(--color-text-primary);
        }

        /* Agent Chat 모달 메시지 스타일 */
        .agent-chat-msg-user {
            padding: 10px 14px;
            margin: 6px 0;
            border-radius: var(--radius-md);
            font-size: var(--text-sm);
            line-height: 1.5;
            background: var(--color-accent-light);
            margin-left: 48px;
        }
        .agent-chat-msg-agent {
            padding: 10px 14px;
            margin: 6px 0;
            border-radius: var(--radius-md);
            font-size: var(--text-sm);
            line-height: 1.5;
            background: var(--color-bg-secondary);
            margin-right: 48px;
        }
        .agent-chat-sender {
            font-weight: 600;
            font-size: 0.6875rem;
            margin-bottom: 3px;
            color: var(--color-text-secondary);
        }

        /* 에이전트별 배경색 (파스텔, 극미세 차이) */
        .chat-message[data-agent-idx="0"] { background: #FFFFFF; }
        .chat-message[data-agent-idx="1"] { background: #F0FDF4; }  /* emerald-50 */
        .chat-message[data-agent-idx="2"] { background: #FFF7ED; }  /* orange-50 */
        .chat-message[data-agent-idx="3"] { background: #EFF6FF; }  /* blue-50 */
        .chat-message[data-agent-idx="4"] { background: #FDF4FF; }  /* fuchsia-50 */
        .chat-message[data-agent-idx="5"] { background: #FFFBEB; }  /* amber-50 */

        .chat-message-icon {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: var(--color-bg-tertiary);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            flex-shrink: 0;
        }

        .chat-message-body {
            flex: 1;
            min-width: 0;
        }

        .chat-message-name {
            font-size: var(--text-sm);
            font-weight: 600;
            color: var(--color-text-primary);
            margin-bottom: 2px;
        }

        .chat-message-model {
            font-size: var(--text-xs);
            color: var(--color-text-tertiary);
            margin-bottom: 6px;
        }

        .chat-message-text {
            font-size: var(--text-base);
            line-height: 1.7;
            color: var(--color-text-primary);
            overflow-wrap: break-word;
            word-break: break-word;
        }

        .chat-message-text .message-content {
            display: block;
            overflow-wrap: break-word;
            word-break: break-word;
        }

        /* 채팅 메시지 내 링크 (URL) 줄바꿈 처리 */
        .chat-message-text a,
        .chat-message-text .message-content a {
            word-break: break-all;
        }

        .chat-message-sources {
            margin-top: 8px;
            padding-top: 8px;
            border-top: 1px solid var(--color-border-light);
            font-size: var(--text-xs);
            color: var(--color-text-secondary);
        }

        .chat-message-sources a {
            color: var(--color-text-secondary);
            text-decoration: none;
        }

        .chat-message-sources a:hover {
            color: var(--color-text-primary);
            text-decoration: underline;
        }

        /* Discussion Insights Bar — REMOVED (인사이트 바 완전 제거) */

        /* ==================== Phase 2: Horizontal Stepper ==================== */
        .prep-stepper {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 16px 24px;
            gap: 0;
            margin-bottom: 8px;
        }

        .prep-stepper-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            position: relative;
            z-index: 1;
        }

        .prep-stepper-icon {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: var(--text-sm);
            font-weight: 700;
            color: var(--color-text-tertiary);
            background: var(--color-bg-tertiary);
            border: 2px solid var(--color-border);
            transition: all 0.3s ease;
        }

        .prep-stepper-icon.active {
            color: #FFFFFF;
            background: var(--color-accent);
            border-color: var(--color-accent);
        }

        .prep-stepper-icon.completed {
            color: #FFFFFF;
            background: var(--color-text-secondary);
            border-color: var(--color-text-secondary);
        }

        .prep-stepper-label {
            font-size: var(--text-xs);
            color: var(--color-text-tertiary);
            text-align: center;
            max-width: 80px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .prep-stepper-label.active {
            color: var(--color-text-primary);
            font-weight: 600;
        }

        .prep-stepper-label.completed {
            color: var(--color-text-secondary);
        }

        .prep-stepper-line {
            width: 40px;
            height: 2px;
            background: var(--color-border);
            flex-shrink: 0;
            margin: 0 4px;
            margin-bottom: 24px; /* align with icon center */
            transition: background 0.3s ease;
        }

        .prep-stepper-line.completed {
            background: var(--color-text-secondary);
        }

        /* ==================== Phase 3: iframe auto-height ==================== */
        #report-inline-iframe {
            width: 100%;
            border: none;
            overflow: hidden;
        }

        /* 모바일 대응 */
        @media (max-width: 768px) {
            .prep-stepper {
                gap: 0;
                padding: 12px 8px;
            }
            .prep-stepper-line {
                width: 20px;
            }
            .prep-stepper-label {
                font-size: 0.6875rem;
                max-width: 56px;
            }
        }

        /* ==================== Design Token Utility Classes ==================== */
        /* 텍스트 색상 */
        .dt-text-primary { color: var(--color-text-primary) !important; }
        .dt-text-secondary { color: var(--color-text-secondary) !important; }
        .dt-text-tertiary { color: var(--color-text-tertiary) !important; }

        /* 배경 색상 */
        .dt-bg-primary { background: var(--color-bg-primary) !important; }
        .dt-bg-secondary { background: var(--color-bg-secondary) !important; }
        .dt-bg-tertiary { background: var(--color-bg-tertiary) !important; }

        /* 테두리 */
        .dt-border { border-color: var(--color-border) !important; }
        .dt-border-light { border-color: var(--color-border-light) !important; }

        /* 액센트 (버튼/강조) */
        .dt-accent { background: var(--color-accent) !important; color: var(--color-bg-primary) !important; }
        .dt-accent:hover { background: var(--color-accent-hover) !important; }

        /* 진행률 바 */
        .dt-progress-track { background: var(--color-bg-tertiary); border-radius: 9999px; overflow: hidden; }
        .dt-progress-bar { background: var(--color-accent); border-radius: 9999px; transition: width 0.5s ease; }

        /* 카드/패널 */
        .dt-card { background: var(--color-bg-primary); border: 1px solid var(--color-border); border-radius: var(--radius-lg); }
        .dt-panel { background: var(--color-bg-secondary); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 1rem; }

        /* 인용문/강조 블록 */
        .dt-blockquote { background: var(--color-bg-secondary); border-left: 4px solid var(--color-border); padding: 1rem; border-radius: 0 var(--radius-md) var(--radius-md) 0; }

        /* 투표/선택 옵션 */
        .dt-vote-option { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 12px 16px; cursor: pointer; transition: all 0.15s ease; }
        .dt-vote-option:hover { border-color: var(--color-text-tertiary); }
        .dt-vote-option.selected { background: var(--color-accent); color: var(--color-bg-primary); border-color: var(--color-accent); }

        /* 알림/토스트 */
        .dt-toast { background: var(--color-bg-primary); border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

/* ==================== Phase 5: Mobile Improvements ==================== */
@media (max-width: 768px) {
    /* 터치 타겟 최소 44px */
    .btn-new, .btn-icon, button {
        min-height: 44px;
        min-width: 44px;
    }

    /* 채팅 메시지 가독성 */
    .chat-message-text {
        font-size: var(--text-base);
        line-height: 1.6;
    }

    /* 모달 풀스크린 */
    .modal > div {
        max-width: 100vw;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }

    /* 토론 상태 패널 수평 스크롤 */
    .chat-area-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* 사이드바 토론 목록 */
    .sidebar-discussion-item {
        padding: 12px 16px;
    }

    /* 주제 입력 영역 */
    #screen-topic-inner {
        padding: 0 16px;
    }
}

@media (max-width: 480px) {
    /* 초소형 화면 */
    :root {
        --text-base: 0.9375rem;
        --text-lg: 1rem;
    }

    .app-header {
        padding: 0 12px;
    }

    .chat-message {
        padding: 8px 12px;
    }
}

/* ==================== Phase 6: Share Button ==================== */
.btn-share {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.btn-share:hover {
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
}
.btn-share.copied {
    background: var(--color-accent-light);
    color: var(--color-accent);
    border-color: var(--color-accent);
}

/* 토스트 알림 */
.share-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--color-text-primary);
    color: var(--color-bg-primary);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    z-index: 9999;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.share-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ==================== Phase 4: 토론 플로우 UX ==================== */

/* 화면 전환: 슬라이드 + 페이드 */
.screen-slide-enter {
    animation: screenSlideIn 0.25s ease-out;
}
@keyframes screenSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* v14.0: 보고서 생성 중 센터 프로그레스 카드 */
.report-generating-center-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    margin: 40px auto;
    max-width: 400px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    text-align: center;
}
.report-gen-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-text-primary);
    border-radius: 50%;
    animation: reportSpin 0.8s linear infinite;
}
@keyframes reportSpin {
    to { transform: rotate(360deg); }
}
.report-gen-progress-bar {
    width: 100%;
    height: 4px;
    background: var(--color-border);
    border-radius: 2px;
    overflow: hidden;
}
.report-gen-progress-fill {
    width: 30%;
    height: 100%;
    background: var(--color-text-primary);
    border-radius: 2px;
    animation: reportProgress 3s ease-in-out infinite;
}
@keyframes reportProgress {
    0% { width: 10%; }
    50% { width: 70%; }
    100% { width: 10%; }
}

/* v19.0: 메시지 등장 애니메이션 */
.msg-enter {
    animation: msgEnter 0.25s ease;
}
@keyframes msgEnter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* v19.0: 에이전트별 타이핑 인디케이터 */
.agent-typing-indicator {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    align-items: flex-start;
    border-bottom: 1px solid var(--color-border-light);
    background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-primary) 100%);
    position: relative;
}
.agent-typing-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.agent-typing-body {
    flex: 1;
    min-width: 0;
}
.agent-typing-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.agent-typing-name {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--color-text-primary);
}
.agent-typing-progress {
    font-size: 0.6875rem;
    color: var(--color-text-tertiary);
    background: var(--color-bg-tertiary);
    padding: 1px 8px;
    border-radius: 999px;
}
.agent-typing-dots {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 1px;
}
.agent-typing-dots .partial-text-preview {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    line-height: 1.4;
    max-height: 3em;
    overflow: hidden;
}
.agent-typing-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-border-light);
}
.agent-typing-bar-fill {
    height: 100%;
    background: var(--color-accent, #6366f1);
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* 토론 주제 입력 화면 */
.topic-page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0;
    text-align: center;
}
.topic-page-subtitle {
    color: var(--color-text-secondary);
    margin-top: 10px;
    margin-bottom: 36px;
    text-align: center;
    font-size: var(--text-lg);
}
.purpose-section-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 12px;
}
.topic-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    color: var(--color-text-primary);
    background: var(--color-bg-primary);
    resize: vertical;
    outline: none;
    box-sizing: border-box;
    font-family: var(--font-sans);
    transition: border-color 0.15s;
}
.topic-textarea:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}
.topic-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    flex-wrap: wrap;
    gap: 12px;
}
.file-attach-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: color 0.15s;
}
.file-attach-label:hover {
    color: var(--color-text-primary);
}

/* 드래그앤드롭 오버레이 */
.topic-input-wrapper {
    position: relative;
}
.drop-overlay {
    position: absolute;
    inset: 0;
    background: rgba(var(--color-accent-rgb, 99, 102, 241), 0.08);
    border: 2px dashed var(--color-accent, #6366f1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}
.drop-overlay-content {
    text-align: center;
    color: var(--color-accent, #6366f1);
}
.drop-overlay-content p {
    margin: 4px 0;
}
.drop-overlay-content .text-sm {
    font-size: var(--text-xs);
    opacity: 0.7;
}

/* 파일 개수 뱃지 */
.file-count-badge {
    background: var(--color-accent, #6366f1);
    color: white;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 4px;
}

/* 파일 목록 칩 */
.file-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.file-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 2px 10px 2px 8px;
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
}
.file-chip-remove {
    cursor: pointer;
    opacity: 0.5;
    font-size: 14px;
    line-height: 1;
}
.file-chip-remove:hover {
    opacity: 1;
    color: var(--color-danger, #ef4444);
}

.selected-purpose-label {
    font-size: var(--text-sm);
    color: var(--color-text-primary);
    font-weight: 500;
    margin-top: 8px;
    display: none;
}

/* ==================== Phase 5: 로그인 스타일 강화 ==================== */

.screen-login-page .login-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
}
.screen-login-page .login-subtitle {
    color: var(--color-text-secondary);
    margin-top: 8px;
    margin-bottom: 24px;
    font-size: var(--text-sm);
}
.screen-login-page .input-field {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    color: var(--color-text-primary);
    background: var(--color-bg-primary);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}
.screen-login-page .input-field:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}
.screen-login-page .remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}
.screen-login-page .remember-row input[type="checkbox"] {
    accent-color: var(--color-accent);
}

/* --- Auth 공통 스타일 (회원가입/인증/비밀번호찾기) --- */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--color-text-tertiary);
    font-size: var(--text-sm);
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}
.auth-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: color 0.15s;
}
.auth-link:hover {
    color: var(--color-accent);
}
.auth-link-accent {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 600;
}
.auth-link-accent:hover {
    text-decoration: underline;
}
.auth-footer {
    margin-top: 20px;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

/* Google 로그인 버튼 */
.google-btn-wrapper {
    margin-bottom: 4px;
}
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 24px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    font-size: var(--text-base);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}
.btn-google:hover {
    background: var(--color-bg-secondary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* 준비 화면 헤더 */
.analysis-page-title {
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--color-text-primary);
}

/* 토론 채팅 헤더 인라인 → 클래스 */
.chat-area-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    flex-wrap: wrap;
}
.chat-header-id {
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
    cursor: pointer;
}

/* ==================== z-index 체계 정리 ==================== */
/*
    5   : 흐려진 화살표
    10  : 기본 화살표, flow-line
    20  : header, 강조 화살표
    30  : sidebar
    35  : sidebar-backdrop (모바일)
    40  : sidebar 모바일 열림
    50  : dropdown, modal 배경
    55  : report-generating-wrapper
    60  : modal card (report-modal, agent-chat-modal)
    100 : context-menu
    9999: toast
*/
