/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* HTML hidden 속성은 항상 존중 — CSS display 지정에 의해 무시되지 않도록 */
[hidden] {
    display: none !important;
}

:root {
    --bg-primary: rgba(255, 255, 255, 0.85);
    --bg-secondary: rgba(255, 255, 255, 0.4);
    --bg-sidebar: rgba(228, 236, 251, 0.6);
    --bg-hover: rgba(255, 255, 255, 0.45);
    --bg-active: rgba(255, 255, 255, 0.6);
    --bg-input: rgba(255, 255, 255, 0.5);
    --bg-assistant: rgba(255, 255, 255, 0.5);
    --topbar-bg: transparent;
    --topbar-text: #1a1a1a;
    --topbar-text-muted: #666666;
    --topbar-hover: rgba(0, 0, 0, 0.06);
    --topbar-active: rgba(0, 0, 0, 0.1);
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --border-color: rgba(0, 0, 0, 0.08);
    --accent: #6390ea;
    --accent-hover: #3670e4;
    --accent-light: #eef3fd;
    --accent-surface: #f0f4fe;
    --accent-muted: #dfe8fa;
    --accent-text: #3060c0;
    --green: #10b981;
    --red: #ef4444;
    --orange: #f59e0b;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --sidebar-width: 280px;
    --topbar-height: 56px;
    --transition: 0.2s ease;

    /* DSM 윈도우 패널 토큰 — 배경이 확실히 비치면서 떠있는 창 느낌 */
    --glass-bg: rgba(255, 255, 255, 0.28);
    --glass-bg-strong: rgba(255, 255, 255, 0.28);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-blur: 20px;
    --glass-shadow: 0 8px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
}

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
    font-size: 14px;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
}

/* 인증된 상태(로그인 후)에서 body에 배경 이미지를 적용한다.
   CSS custom property --app-bg 는 app.js 에서 동적으로 설정된다.
   배경색은 이미지 로드 전 fallback으로 사용되며 테마별로 다르다. */
body.eve-authed {
    background-color: var(--bg-primary);
    background-image: var(--app-bg, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* ===== Layout ===== */
#app {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: transparent;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition);
    overflow: hidden;
    border-radius: 14px;
    margin: 20px 10px 20px 20px;
    box-shadow: var(--glass-shadow);
}

.sidebar.collapsed {
    margin-left: calc(-1 * var(--sidebar-width));
}

/* sidebar가 없는 탭에서 main-content 좌우 margin 동일하게 */
#app.no-sidebar-mode .main-content {
    margin: 20px;
    transition: margin 0.3s ease;
}

.sidebar-header {
    padding: 16px;
}

.btn-new-chat {
    width: 100%;
    padding: 9px 16px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition);
}

.btn-new-chat:hover {
    background: rgba(255, 255, 255, 0.92);
    color: var(--accent-hover);
    transform: translateY(-1px);
}

.sidebar-section {
    padding: 0 16px 12px;
}

.section-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.project-select, .model-select {
    width: 100%;
    padding: 9px 32px 9px 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    font-size: 13px;
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    outline: none;
    font-family: inherit;
    transition: border-color var(--transition), background-color var(--transition), box-shadow var(--transition);
}

.project-select:hover, .model-select:hover {
    border-color: rgba(0, 0, 0, 0.15);
    background-color: rgba(255, 255, 255, 0.9);
}

.project-select:focus, .model-select:focus {
    border-color: var(--accent);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(99, 144, 234, 0.1);
}

.sidebar-section:has(.project-select) {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.sidebar-section:has(.project-select) .section-label {
    width: 100%;
}

.sidebar-section:has(.project-select) .project-select {
    flex: 1;
}

.btn-manage-projects {
    flex-shrink: 0;
}

.conversation-list-section {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 8px;
}

.conversation-item {
    padding: 9px 12px;
    margin: 2px 8px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition);
    position: relative;
}

.conversation-item:hover {
    background: rgba(255, 255, 255, 0.4);
}

.conversation-item.active {
    background: rgba(255, 255, 255, 0.65);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.conversation-item .conv-title {
    flex: 1;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-item .conv-delete {
    opacity: 0;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: opacity var(--transition);
    font-size: 16px;
}

.conversation-item:hover .conv-delete {
    opacity: 1;
}

.conversation-item .conv-delete:hover {
    color: var(--red);
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar-link {
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background var(--transition);
}

.sidebar-link:hover {
    background: var(--bg-hover);
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    position: relative;
    background: var(--glass-bg-strong);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    margin: 20px 20px 20px 10px;
    box-shadow: var(--glass-shadow);
    overflow: hidden;
    transition: margin 0.3s ease, flex 0.3s ease;
}

/* ===== Topbar (DSM 윈도우 타이틀바 스타일) ===== */
.topbar {
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    border-bottom: none;
    background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 100%);
}

/* topbar-brand-chip: DSM 앱 아이콘 + 이름 */
.topbar-brand-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    border-radius: 8px;
    background: transparent;
    border: none;
    transition: background var(--transition);
}
.topbar-brand-chip:hover {
    background: rgba(0, 0, 0, 0.04);
}
.topbar-brand-logo {
    border-radius: 8px;
    flex-shrink: 0;
    object-fit: contain;
}
.topbar-brand-name {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}
/* 프로젝트가 선택되었을 때 accent 강조 */
.topbar-brand-chip.has-project .topbar-brand-name {
    color: var(--accent);
}
.topbar-brand-chip.has-project .topbar-brand-logo {
}

/* ===== Topbar Tabs ===== */
.topbar-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: center;
}

.topbar-tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    position: relative;
    height: 100%;
    align-items: center;
}
.topbar-tab:not([hidden]) {
    display: inline-flex;
}

.topbar-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #2563eb;
    border-radius: 2px 2px 0 0;
    transition: width var(--transition);
}

.topbar-tab:hover:not(.disabled) {
    color: var(--text-primary);
}
.topbar-tab:hover:not(.disabled)::after {
    width: 60%;
}

.topbar-tab.active {
    color: #2563eb;
    font-weight: 700;
}
.topbar-tab.active::after {
    width: 80%;
}

.topbar-tab.disabled {
    opacity: 0.4;
    cursor: default;
}

.tab-badge-dev {
    font-size: 10px;
    margin-left: 4px;
    padding: 1px 6px;
    background: var(--accent-light);
    border-radius: var(--radius-full);
    color: var(--accent);
}

/* ===== Tab Panels ===== */
.tab-panel {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.tab-panel.active {
    display: flex;
}

/* ===== Placeholder Panels ===== */
.placeholder-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    gap: 12px;
}

.placeholder-panel i {
    font-size: 56px;
    opacity: 0.5;
}

.placeholder-panel h2 {
    font-size: 20px;
    font-weight: 600;
}

.placeholder-panel p {
    font-size: 14px;
}

/* 패널 투명도 조절 슬라이더 */
.topbar-opacity-ctrl {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 14px;
    color: var(--text-secondary);
    cursor: default;
}
.topbar-opacity-ctrl i {
    font-size: 15px;
    flex-shrink: 0;
}
.opacity-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 72px;
    height: 4px;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.12);
    outline: none;
    cursor: pointer;
}
.opacity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}
.opacity-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.topbar-actions .btn-icon {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
}
.topbar-actions .btn-icon:hover {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(0, 0, 0, 0.12);
    color: var(--accent);
}

/*
   채팅 탭의 토픽바 `#model-select` 가 입력창 내부(`#chat-model-pill`)로
   이동하면서, 이전에 토픽바 전용으로 폭을 강제하던
   `.model-select { width: auto; min-width: 160px; }` 규칙은 매칭 대상이
   사라져 dead 규칙이 되어 제거했다. 사이드바와의 공유 규칙
   `.project-select, .model-select` (위쪽) 는 `.project-select` 가 여전히
   살아있어 그대로 둔다.
*/

.btn-toggle-sidebar {
    color: var(--text-primary) !important;
}

.btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 7px;
    cursor: pointer;
    color: var(--text-tertiary);
    font-size: 17px;
    transition: all var(--transition);
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

/* ===== Chat Container ===== */
.chat-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* ===== Welcome Screen ===== */
.welcome-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    color: var(--text-primary);
}

.welcome-screen.hidden {
    display: none;
}

.welcome-logo {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.welcome-logo i {
    font-size: 36px;
    color: white;
}

/* Generic Eve logo styling — rounded-corner mask + clean rendering.
   Applied to every `<img>` we use as a logo (login card, sidebar
   brand, welcome screen). The 22% radius matches the spec. */
.eve-logo {
    border-radius: 22%;
    object-fit: cover;
    /* The mascot artwork is square; preserve the aspect ratio
       regardless of the surrounding container size. */
    aspect-ratio: 1 / 1;
}
/* When the GIF is used in the sidebar brand, anchor it to the
   left of the section header next to the brand text. */
.sidebar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-weight: 700;
    color: var(--accent);
}
.sidebar-brand-text {
    font-size: 15px;
    letter-spacing: 0.3px;
}

/* Full-app loading state — used by long-running AI calls
   (inquiry analysis, sync) where a spinner alone feels light.
   Inject `<div class="eve-loading">…</div>` and the children show
   the looping mascot + a caption. */
.eve-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    color: var(--text-secondary, #555);
}
.eve-loading img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}
.eve-loading--lg img { width: 120px; height: 120px; }
.eve-loading .eve-loading-caption {
    font-size: 13px;
    text-align: center;
}

.welcome-screen h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
}

.welcome-screen p {
    font-size: 15px;
    line-height: 1.6;
}

/* ===== Messages ===== */
.messages {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 20px;
}

.message {
    margin-bottom: 24px;
    display: flex;
    gap: 12px;
}

.message-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-top: 2px;
}

.message.user .message-avatar {
    background: var(--accent-light);
    color: var(--accent);
}

.message.assistant .message-avatar {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
}

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

.message-role {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.message-content {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    word-break: break-word;
}

.message.assistant .message-content {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 14px 18px;
    border-radius: 12px;
}

/* Markdown styles in messages */
.message-content h1,
.message-content h2,
.message-content h3 {
    margin-top: 16px;
    margin-bottom: 8px;
}

.message-content h1 { font-size: 18px; }
.message-content h2 { font-size: 16px; }
.message-content h3 { font-size: 15px; }

.message-content p {
    margin-bottom: 8px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 13px;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.message-content pre {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 8px 0;
    font-size: 13px;
    line-height: 1.5;
}

.message-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.message-content ul,
.message-content ol {
    padding-left: 20px;
    margin-bottom: 8px;
}

.message-content li {
    margin-bottom: 4px;
}

.message-content table {
    border-collapse: collapse;
    width: auto;
    max-width: 100%;
    margin: 8px 0;
    font-size: 13px;
    table-layout: auto;
}

.message-content th,
.message-content td {
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 8px 12px;
    text-align: left;
    /* Without an explicit whitespace rule the parent's `word-break:
     * break-word` was kicking in and breaking column headers character-
     * by-character once the table outgrew its container. `normal` +
     * `anywhere` only allows breaks when a single token literally
     * can't fit; combined with the horizontal-scroll wrapper below
     * this gives us "wide tables scroll, narrow tables flow". */
    white-space: normal;
    overflow-wrap: anywhere;
    vertical-align: top;
}

.message-content th {
    background: rgba(0, 0, 0, 0.04);
    font-weight: 600;
}

/* Horizontal-scroll wrapper applied by `wrapTablesForScroll()` to every
 * rendered <table>. Keeps the table at its natural width while
 * containing overflow to the bubble's width — fixes the user-reported
 * "column headers cut letter-by-letter" symptom that surfaced when a
 * SQL-result table was promoted into the narrow assistant bubble. */
.md-table-wrap {
    overflow-x: auto;
    max-width: 100%;
    margin: 8px 0;
}
.md-table-wrap > table {
    margin: 0;
}

/* Apply the same table treatment inside trace narration segments
 * (thought bodies + legacy text segments) so a wide table in a thought
 * looks identical to one in the promoted final answer. */
.trace-text-seg table {
    border-collapse: collapse;
    width: auto;
    max-width: 100%;
    margin: 8px 0;
    font-size: 13px;
    table-layout: auto;
}
.trace-text-seg th,
.trace-text-seg td {
    border: 1px solid var(--border-color);
    padding: 6px 10px;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    vertical-align: top;
}
.trace-text-seg th {
    background: var(--bg-secondary);
    font-weight: 600;
}

.message-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 12px;
    color: var(--text-secondary);
    margin: 8px 0;
}

/* Loading indicator (legacy) */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-tertiary);
    animation: typing 1.4s infinite;
}

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

@keyframes typing {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-4px); }
}

/* ===== Processing / Thinking Indicator ===== */
.processing-indicator,
.thinking-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    font-size: 13px;
    color: var(--text-primary);
}

.thinking-indicator {
    margin-top: 10px;
    background: transparent;
    padding: 8px 0;
}

/* ----- "Running" text shimmer (cursor-style) ---------------------
 * Replaces the legacy rotating spinner. Any element tagged with
 * `.is-running` (or alias `.cot-running`) becomes its own moving
 * gradient masked to the text — a low-key signal that the agent is
 * still doing work without an attention-grabbing spinner. Tokens
 * are pure semantic vars so dark mode adapts automatically. */
.is-running,
.cot-running {
    background-image: linear-gradient(
        90deg,
        var(--text-tertiary) 0%,
        var(--text-primary)  45%,
        var(--text-primary)  55%,
        var(--text-tertiary) 100%
    );
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: cot-running-shimmer 2.4s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
    .is-running,
    .cot-running {
        animation: none;
        background-image: none;
        color: var(--text-secondary);
        -webkit-text-fill-color: var(--text-secondary);
    }
}

.processing-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.processing-timer {
    margin-left: auto;
    color: var(--text-tertiary);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

/* ===== Input Area ===== */
.input-area {
    padding: 0 20px 16px;
    max-width: 840px;
    width: 100%;
    margin: 0 auto;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 10px 14px;
    transition: border-color var(--transition), box-shadow var(--transition);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 144, 234, 0.1), 0 2px 6px rgba(0, 0, 0, 0.04);
}

.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    max-height: 200px;
    padding: 4px 0;
}

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

.btn-send {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border: none;
    background: var(--accent);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all var(--transition);
}

.btn-send:disabled {
    background: var(--bg-active);
    color: var(--text-tertiary);
    cursor: not-allowed;
}

.btn-send:not(:disabled):hover {
    background: var(--accent-hover);
}

.input-footer {
    text-align: center;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 8px;
}

/* ===== Chat tab — model pill (in input-wrapper) =====
   채팅 입력창 우측(전송 버튼 왼쪽)에 위치하는 모델 셀렉트.
   외형은 코드 탭의 `.code-model-pill` / `.code-model-menu`(code.css) 와
   1:1 로 맞추되, ID/클래스는 `chat-` prefix 로 분리해 코드 탭과 동작
   의존성을 끊는다. 메뉴는 absolute 로 입력창 위쪽에 띄우며 우측 정렬
   (전송 버튼 쪽 모서리에 화살촉이 놓이도록). */
.chat-model-pill-wrap {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.chat-model-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
    line-height: 1.2;
    max-width: 220px;
}

.chat-model-pill:hover {
    background: var(--bg-input);
}

.chat-model-pill i {
    font-size: 14px;
    opacity: 0.7;
}

.chat-model-pill.open {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}

#chat-model-pill-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 168px;
}

.chat-model-menu {
    position: absolute;
    bottom: calc(100% + 14px);
    right: 0;
    width: 280px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 6px;
    z-index: 50;
    max-height: 340px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-model-menu[hidden] {
    display: none !important;
}

/* 화살촉 — pill 우측 위에 작은 ◇ 모양. */
.chat-model-menu::after {
    content: "";
    position: absolute;
    bottom: -6px;
    right: 24px;
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.88);
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    transform: rotate(45deg);
}

.chat-model-menu button {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
}

.chat-model-menu button:hover {
    background: rgba(255, 255, 255, 0.5);
}

.chat-model-menu button[data-active="1"] {
    background: var(--accent-light);
    color: var(--accent);
}

.chat-model-menu button .hint {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.modal-overlay.active {
    display: flex;
    animation: modalOverlayIn 0.2s ease;
}

.modal {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.15),
        0 8px 24px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: linear-gradient(180deg, rgba(99, 144, 234, 0.04) 0%, transparent 100%);
}

.modal-header h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.modal-header .btn-icon {
    color: var(--text-tertiary);
    transition: color 0.15s ease, background 0.15s ease;
}
.modal-header .btn-icon:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.05);
}

.modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 28px 28px 24px;
}

/* Sticky action bar at the bottom of every dialog. Empty footers
   auto-collapse so info-only dialogs (e.g. AI 분석 결과 preview)
   don't show a phantom bar. */
.modal-footer {
    flex-shrink: 0;
    padding: 16px 28px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    background: rgba(247, 248, 250, 0.5);
}
.modal-footer:empty { display: none; }

/* Nested modal overlay (`#modal-overlay-2`) — used for the AI
   inquiry-analysis result shown ON TOP of the inquiry detail
   modal. Higher z-index than the primary overlay so it stacks
   correctly; Escape / outside-click handlers in app.js close the
   topmost overlay first. */
.modal-overlay-2 {
    z-index: 1100;
    /* Slightly darker dim than the primary, so the nesting is
       visually obvious even when both overlays are open. */
    background: rgba(0, 0, 0, 0.5);
}

/* Help / 사용 가이드 modal — one section per tab. */
.help-section {
    margin-bottom: 18px;
}
.help-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.help-section h3 i {
    color: var(--accent, #6390ea);
    font-size: 16px;
}
.help-section p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.65;
    margin: 0;
}

/* ===== 글로벌 select 스타일 — 앱 내 모든 <select>에 커스텀 화살표 적용 ===== */
select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    padding-right: 32px;
    cursor: pointer;
}

/* ===== Form styles ===== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

.form-label.required::after {
    content: " *";
    color: #ef4444;
    font-weight: 700;
}

.form-label-desc {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-tertiary);
    text-transform: none;
    letter-spacing: 0;
    margin-top: 2px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-primary);
    background: rgba(245, 247, 250, 0.8);
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-tertiary);
}

/* select 요소 전용: 커스텀 화살표 표시 */
.form-select,
select.form-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    cursor: pointer;
}

.form-input:hover,
.form-textarea:hover,
.form-select:hover {
    border-color: rgba(0, 0, 0, 0.18);
    background: rgba(250, 251, 253, 0.9);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(99, 144, 234, 0.1);
}

.form-textarea {
    min-height: 80px;
    resize: vertical;
}

.form-input.is-invalid,
.form-textarea.is-invalid,
.form-select.is-invalid {
    border-color: var(--red) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.form-input.is-invalid:focus,
.form-textarea.is-invalid:focus,
.form-select.is-invalid:focus {
    border-color: var(--red) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 24px 0 14px;
    padding-top: 18px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    letter-spacing: -0.1px;
}

.form-section-title:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.btn-primary {
    padding: 9px 20px;
    background: rgba(255, 255, 255, 0.75);
    color: var(--accent);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition), transform 0.1s ease;
}

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

.btn-secondary {
    padding: 9px 20px;
    background: rgba(255, 255, 255, 0.75);
    color: var(--text-primary);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(0, 0, 0, 0.12);
}

.btn-danger {
    padding: 10px 24px;
    background: var(--red);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition);
}

.btn-danger:hover {
    background: #dc2626;
}

.form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* Project list in modal */
.project-list-modal {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-card {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
}

.project-card:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.project-card-info {
    flex: 1;
}

.project-card-name {
    font-size: 14px;
    font-weight: 600;
}

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

.project-card-actions {
    display: flex;
    gap: 4px;
}

.sync-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 8px;
}

.sync-badge.synced { background: #d1fae5; color: #065f46; }
.sync-badge.syncing { background: #fef3c7; color: #92400e; }
.sync-badge.pending { background: #f3f4f6; color: #6b7280; }
.sync-badge.error { background: #fee2e2; color: #991b1b; }

.checkbox-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    vertical-align: middle;
    accent-color: var(--accent);
}

.checkbox-wrapper label {
    margin: 0;
    padding: 0;
    font-size: 13px;
    line-height: 16px;
    vertical-align: middle;
    cursor: pointer;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* ===== Custom Dropdown (native select 대체) ===== */
.custom-dropdown {
    position: relative;
    display: inline-block;
}

.custom-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 32px 9px 12px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    min-width: 120px;
    outline: none;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
}

.custom-dropdown-trigger:hover {
    border-color: rgba(0, 0, 0, 0.15);
    background-color: rgba(255, 255, 255, 0.92);
}

.custom-dropdown-trigger:focus,
.custom-dropdown.open .custom-dropdown-trigger {
    border-color: var(--accent);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(99, 144, 234, 0.1);
}

.custom-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 100%;
    max-height: 240px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
    padding: 6px;
    z-index: 2000;
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.custom-dropdown.open .custom-dropdown-menu {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.custom-dropdown-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    transition: background 0.1s ease;
}

.custom-dropdown-item:hover {
    background: rgba(99, 144, 234, 0.08);
}

.custom-dropdown-item.selected {
    color: var(--accent);
    font-weight: 600;
    background: rgba(99, 144, 234, 0.06);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 100;
        box-shadow: var(--shadow-lg);
        transform: translateX(0);
        transition: transform var(--transition);
    }

    .sidebar.collapsed {
        transform: translateX(-100%);
        margin-left: 0;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ===== Tool Blocks ===== */
.tool-block {
    margin: 12px 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    font-size: 13px;
}

.tool-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    font-weight: 500;
    color: var(--text-secondary);
}

.tool-header i {
    color: var(--primary);
    font-size: 16px;
}

.tool-status {
    margin-left: auto;
    font-size: 12px;
    font-weight: 400;
}

.tool-status.loading {
    color: var(--primary);
}

.tool-status.loading::after {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 2px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 6px;
    vertical-align: middle;
}

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

.tool-status.success {
    color: #16a34a;
}

.tool-status.error {
    color: #dc2626;
}

.tool-query {
    padding: 8px 14px;
    background: #1e1e2e;
    border-bottom: 1px solid var(--border);
}

.tool-query code {
    color: #cdd6f4;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-all;
}

.tool-result-area {
    max-height: 400px;
    overflow: auto;
}

.tool-details {
    padding: 0;
}

.tool-details summary {
    padding: 8px 14px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 12px;
    user-select: none;
}

.tool-details summary:hover {
    background: var(--bg-hover);
}

.tool-result-content {
    padding: 10px 14px;
    overflow-x: auto;
}

.tool-result-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.tool-result-content th,
.tool-result-content td {
    padding: 6px 10px;
    border: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

.tool-result-content th {
    background: var(--bg-secondary);
    font-weight: 600;
}

.tool-error {
    padding: 10px 14px;
    color: #dc2626;
    background: #fef2f2;
}

/* ===== Dark Theme ===== */
[data-theme="dark"] {
    --bg-primary: #1a1b1e;
    --bg-secondary: #25262b;
    --bg-sidebar: #1c2236;
    --bg-hover: #2c2d33;
    --bg-active: #373840;
    --bg-input: #25262b;
    --bg-assistant: #25262b;
    --topbar-bg: transparent;
    --topbar-text: #e1e2e5;
    --topbar-text-muted: #a0a1a7;
    --topbar-hover: rgba(255, 255, 255, 0.08);
    --topbar-active: rgba(255, 255, 255, 0.14);
    --text-primary: #e1e2e5;
    --text-secondary: #a0a1a7;
    --text-tertiary: #6b6d76;
    --border-color: #373840;
    --accent: #6390ea;
    --accent-hover: #3670e4;
    --accent-light: rgba(99, 144, 234, 0.15);
    --accent-surface: #1e2338;
    --accent-muted: #2a3454;
    --accent-text: #8fb8f8;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);

    /* 다크모드 DSM 윈도우 패널 토큰 */
    --glass-bg: rgba(30, 32, 36, 0.92);
    --glass-bg-strong: rgba(30, 32, 36, 0.95);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-shadow: 0 8px 40px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 다크모드에서 배경 이미지 밝기를 낮춰 가독성 보장.
   z-index: 0 으로 #app 아래에 위치시키되
   body 배경 이미지 위에 오도록 한다. */
[data-theme="dark"] body.eve-authed::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    pointer-events: none;
    z-index: 0;
}
/* #app을 dark overlay(::after) 위에 올리기 위해 stacking context 생성 (다크모드 전용) */
[data-theme="dark"] body.eve-authed #app {
    position: relative;
    z-index: 1;
}

[data-theme="dark"] .btn-new-chat {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}
[data-theme="dark"] .btn-new-chat:hover {
    background: rgba(255, 255, 255, 0.18);
}

[data-theme="dark"] .sync-badge.synced { background: #065f46; color: #6ee7b7; }
[data-theme="dark"] .sync-badge.syncing { background: #78350f; color: #fcd34d; }
[data-theme="dark"] .sync-badge.pending { background: #374151; color: #9ca3af; }
[data-theme="dark"] .sync-badge.error { background: #7f1d1d; color: #fca5a5; }

[data-theme="dark"] .tool-error {
    background: #3b1111;
    color: #fca5a5;
}

[data-theme="dark"] .message-content code {
    background: #2c2d33;
}

[data-theme="dark"] .modal-overlay {
    background: rgba(0, 0, 0, 0.55);
}
[data-theme="dark"] .modal {
    background: rgba(42, 44, 48, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ===== Token Usage Badge ===== */
.token-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 6px;
    font-size: 11px;
    color: var(--text-primary);
}

.token-badge i {
    font-size: 12px;
}

/* ===== Permission Request Dialog ===== */
.permission-request {
    margin: 12px 0;
    padding: 14px 18px;
    border: 1px solid var(--orange);
    border-radius: var(--radius-md);
    background: rgba(245, 158, 11, 0.08);
}

.permission-request-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--orange);
    margin-bottom: 8px;
}

.permission-request-header i {
    font-size: 16px;
}

.permission-request-body {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.permission-request-body code {
    display: inline-block;
    max-width: 100%;
    background: var(--bg-input);
    padding: 4px 8px;
    margin-top: 4px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-wrap: anywhere;
    overflow-x: auto;
    box-sizing: border-box;
}

.permission-advisory {
    margin-top: 8px;
    padding: 8px 10px;
    background: rgba(59, 130, 246, 0.08);
    border-left: 3px solid var(--primary);
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    gap: 6px;
    align-items: flex-start;
}

.permission-advisory i {
    margin-top: 2px;
    color: var(--primary);
}

.permission-result {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 4px;
}

.permission-result.allow {
    background: rgba(16, 185, 129, 0.1);
    color: var(--green);
}

.permission-result.deny {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
}

.permission-request-actions button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.permission-request-actions {
    display: flex;
    gap: 8px;
}

.permission-request-actions button {
    padding: 6px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition);
}

.btn-approve {
    background: var(--green);
    color: white;
}

.btn-approve:hover {
    background: #059669;
}

.btn-deny {
    background: var(--red);
    color: white;
}

.btn-deny:hover {
    background: #dc2626;
}

/* ===== Compact Notification ===== */
.compact-notice {
    margin: 12px 0;
    padding: 10px 14px;
    background: var(--accent-light);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 8px;
}

.compact-notice i {
    font-size: 14px;
}

/* ===== File Path Links ===== */
.file-path-link {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent);
    cursor: pointer;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
}

.file-path-link:hover {
    border-bottom-style: solid;
}

/* =====================================================================
 * Chain-of-Thought (ReAct trace) UI
 *
 * Renders the agent's intermediate reasoning loop — text narration,
 * tool calls/results, "thought for Ns" markers, auto-compact notices,
 * and permission prompts — as a single vertical timeline above the
 * final answer. Inspired by Cursor's Agent activity panel and Claude's
 * Extended-Thinking blocks. Uses existing eve-cowork tokens (--accent,
 * --bg-secondary, etc.) so light/dark themes adapt automatically.
 * ===================================================================== */

.cot-trace {
    margin: 8px 0 14px;
    border-left: 2px solid rgba(0, 0, 0, 0.08);
    padding-left: 14px;
}

/* The header is a one-line summary ("DB 조회 2회 · 4.2s") that doubles
 * as a toggle. Hidden until the turn produces at least one tool call;
 * after `done` the trace auto-collapses so finished turns read like a
 * normal chat reply with a small expandable activity log. */
.trace-header {
    display: none;
    align-items: center;
    gap: 8px;
    margin-left: -14px;
    padding: 6px 10px 6px 12px;
    margin-bottom: 6px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    transition: background var(--transition), border-color var(--transition);
}

.trace-header.visible {
    display: inline-flex;
}

.trace-header:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(0, 0, 0, 0.06);
}

.trace-header .trace-caret {
    display: inline-block;
    font-size: 10px;
    line-height: 1;
    color: var(--text-tertiary);
    transition: transform var(--transition);
}

.cot-trace.collapsed .trace-header .trace-caret {
    transform: rotate(-90deg);
}

.cot-trace.collapsed .trace-body {
    display: none;
}

.trace-header .trace-summary-text {
    font-weight: 500;
}

.trace-header .trace-summary-time {
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
}

.trace-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ----- Text narration segment (the agent's inline commentary) ----- */
.trace-text-seg {
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-primary);
}

.trace-text-seg:empty {
    display: none;
}

/* Markdown inside narration shouldn't add extra outer margins or it
 * fights the timeline gap. */
.trace-text-seg > *:first-child { margin-top: 0; }
.trace-text-seg > *:last-child { margin-bottom: 0; }
.trace-text-seg p { margin: 4px 0; }

/* ----- Tool segment (cursor-style one-line collapsible card) -----
 * Replaces the older boxy .tool-block layout for trace rendering.
 * Collapsed: row of [icon] [name] · [query preview] [status][time]
 * Expanded:  the full arguments and result drawer below. */
.trace-tool-seg {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    overflow: hidden;
    font-size: 13px;
    transition: border-color var(--transition);
}

.trace-tool-seg.is-error {
    border-color: rgba(239, 68, 68, 0.4);
}

.trace-tool-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    user-select: none;
    color: var(--text-secondary);
}

.trace-tool-summary:hover {
    background: var(--bg-hover);
}

.trace-tool-summary .trace-caret {
    display: inline-block;
    font-size: 10px;
    line-height: 1;
    color: var(--text-tertiary);
    transition: transform var(--transition);
    flex-shrink: 0;
}

.trace-tool-seg.expanded .trace-tool-summary .trace-caret {
    transform: rotate(90deg);
}

.trace-tool-summary .trace-tool-name {
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0;
}

.trace-tool-summary .trace-tool-preview {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 12px;
    color: var(--text-tertiary);
}

.trace-tool-summary .trace-tool-status {
    font-size: 12px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.trace-tool-summary .trace-tool-status.loading { color: var(--text-secondary); }
.trace-tool-summary .trace-tool-status.success { color: #16a34a; }
.trace-tool-summary .trace-tool-status.error   { color: #dc2626; }

.trace-tool-summary .trace-tool-elapsed {
    font-size: 11px;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.trace-tool-detail {
    display: none;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.trace-tool-seg.expanded .trace-tool-detail {
    display: block;
}

.trace-tool-args {
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 200px;
    overflow: auto;
}

.trace-tool-result {
    padding: 10px 12px;
    max-height: 360px;
    overflow: auto;
    font-size: 13px;
}

.trace-tool-result table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.trace-tool-result th,
.trace-tool-result td {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    text-align: left;
    white-space: nowrap;
}

.trace-tool-result th {
    background: var(--bg-secondary);
    font-weight: 600;
}

.trace-tool-result-error {
    padding: 10px 12px;
    color: #dc2626;
    background: rgba(239, 68, 68, 0.06);
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-word;
}

[data-theme="dark"] .trace-tool-result-error {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
}

/* ----- Static "Thought for Ns" label, replaces the live spinner
 * once the next token starts streaming (claude/cursor parity). ----- */
.trace-thinking-static {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 4px;
    font-size: 12px;
    color: var(--text-tertiary);
    font-style: italic;
}

/* Live "thinking" label reused inside the trace. The legacy rotating
 * dot has been replaced by a text shimmer (`.is-running`) on the
 * label itself, so this rule only owns layout/typography now. */
.trace-thinking-live {
    display: inline-flex;
    align-items: baseline;
    padding: 4px 0;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Compact / permission segments — reuse existing visuals but shrink
 * the outer margin so they sit cleanly inside the timeline. */
.trace-body .compact-notice,
.trace-body .permission-request {
    margin: 0;
}

/* =====================================================================
 * Activity labels (cursor's Agent Activity panel parity)
 *
 * Each activity is a one-line summary with an expandable body. Verbs
 * stay slightly bolder than the secondary detail text so the eye can
 * scan the column quickly: "Ran git", "Explored 3 files, 2 searches",
 * "Edited 2 files (+12/-3)", "Thought for 4s".
 * ===================================================================== */

.trace-activity {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-sm);
}

.trace-activity-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    margin-left: -4px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    user-select: none;
    color: var(--text-secondary);
    transition: background var(--transition);
}

.trace-activity-header:hover {
    background: rgba(255, 255, 255, 0.3);
}

.trace-activity-header .trace-caret {
    display: inline-block;
    font-size: 12px;
    line-height: 1;
    color: var(--text-tertiary);
    transition: transform var(--transition);
    flex-shrink: 0;
}

/* Make the caret feel clickable on hover — small but unambiguous
 * affordance cue. The rotation below already handles the open/closed
 * state ("▸" → "▾"). */
.trace-activity-header:hover .trace-caret {
    color: var(--text-secondary);
}

.trace-activity.expanded .trace-activity-header .trace-caret {
    transform: rotate(90deg);
}

.trace-activity-label {
    display: inline-flex;
    gap: 6px;
    align-items: baseline;
    min-width: 0;
    font-size: 13px;
}

.trace-activity-verb {
    font-weight: 500;
    color: var(--text-primary);
}

.trace-activity-detail {
    color: var(--text-secondary);
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trace-activity-elapsed {
    font-size: 11px;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
    margin-left: auto;
    flex-shrink: 0;
}

.trace-activity-elapsed.error {
    color: #dc2626;
}

/* When the activity finalised with an error, recolor the verb/detail
 * red as well — cursor pattern is "no ✗ icon, just red text". */
.trace-activity.is-error .trace-activity-verb,
.trace-activity.is-error .trace-activity-detail {
    color: #dc2626;
}

[data-theme="dark"] .trace-activity.is-error .trace-activity-verb,
[data-theme="dark"] .trace-activity.is-error .trace-activity-detail {
    color: #f87171;
}

.trace-activity-body {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 6px 0 4px 18px;
}

.trace-activity.expanded .trace-activity-body {
    display: flex;
}

/* ----- Per-activity-type touch-ups ----- */

/* Thought body: cursor's "회색 추론 본문" pattern. Secondary text
 * color so it reads as a side-note relative to the final answer
 * (which uses --text-primary), and a roomier line-height so longer
 * reasoning paragraphs stay scannable. Light/dark adaption is
 * automatic because we only consume design tokens. */
.trace-act-thought .trace-activity-body {
    padding: 6px 0 6px 18px;
}

.trace-act-thought .trace-thought-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    padding: 6px 0;
}

/* Markdown leaves <p>/<pre>/<code> children; tighten their default
 * margins so the secondary-color paragraph keeps the relaxed
 * line-height we just set, without inheriting big block gaps. */
.trace-act-thought .trace-thought-text p {
    margin: 0 0 8px 0;
}
.trace-act-thought .trace-thought-text p:last-child {
    margin-bottom: 0;
}
.trace-act-thought .trace-thought-text code {
    color: var(--text-primary);
}

/* The sub-cards (.trace-tool-seg) inside an activity body are
 * pre-styled by their own rules. Tighten the font a hair so they read
 * as "details under a header". */
.trace-activity-body .trace-tool-seg {
    font-size: 12.5px;
}

/* ----- TodoWrite checklist (rendered inside the activity body) ----- */
.trace-todo-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 0;
}

.trace-todo-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.45;
}

.trace-todo-marker {
    flex-shrink: 0;
    width: 14px;
    text-align: center;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
}

.trace-todo-completed   .trace-todo-marker { color: #16a34a; }
.trace-todo-in_progress .trace-todo-marker { color: var(--accent); }

.trace-todo-completed .trace-todo-text {
    color: var(--text-tertiary);
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}

/* =====================================================================
 * 채팅탭 UI 정리 — 사용자 요구 사항.
 *
 * (1) 우측 Artifacts 사이드바가 열리면 채팅이 좌측으로 밀린다.
 *     `.artifacts-pane` 자체는 absolute 로 떠 있으므로, 채팅 탭 컨테이너
 *     에 padding-right 를 걸어 .messages (max-width 800px + margin auto)
 *     가 좁아진 폭의 가운데로 재정렬되며 시각적으로 좌측 이동한다.
 *     artifacts.js 가 body 에 `.artifacts-open-{sidebar,detail,both}` 를
 *     실어주므로 상태별로 정확한 폭을 매칭한다.
 *
 * (2) 채팅 메시지의 user / Eve 프로필(아바타·라벨)을 숨긴다. DOM 구조는
 *     유지(`appendMessage` 템플릿과 `artifacts.js` 의 인라인 카드 attach
 *     로직이 `.message-body` 를 참조), 시각적으로만 제거.
 *
 * (3) 사용자 메시지는 보라색 말풍선(우측 정렬, accent 배경).
 *
 * (4) 모달 외부 페이지 스크롤 락 — `.modal-overlay.active` 가 떠 있을
 *     때 body 가 같이 스크롤되지 않도록. 모든 toolbar 모달이 단일
 *     `#modal-overlay` 를 공유하므로 일관 적용.
 * ===================================================================== */

/* (1) 우측 사이드바가 채팅을 밀어낸다 — 상태별 폭 매칭. */
body.artifacts-open .tab-panel[data-panel="chat"] {
    transition: padding-right 200ms ease;
}
body.artifacts-open-sidebar .tab-panel[data-panel="chat"] {
    padding-right: 280px;
}
body.artifacts-open-detail .tab-panel[data-panel="chat"] {
    padding-right: var(--artifacts-detail-w, clamp(420px, 48vw, 760px));
}
body.artifacts-open-both .tab-panel[data-panel="chat"] {
    padding-right: calc(280px + var(--artifacts-detail-w, clamp(420px, 48vw, 760px)));
}

/* (2) 프로필(아바타·라벨) 제거 — DOM 은 그대로, 시각적으로만 숨김. */
.messages .message > .message-avatar,
.messages .message > .message-body > .message-role {
    display: none;
}
.messages .message {
    gap: 0;
}

/* (3) 사용자 말풍선: 우측 정렬 + accent 보라색 배경. */
.messages .message.user {
    justify-content: flex-end;
}
.messages .message.user .message-body {
    flex: 0 1 auto;
    max-width: 75%;
}
.messages .message.user .message-content {
    background: var(--accent);
    color: #fff;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    /* 마크다운 미적용 user 텍스트라 줄바꿈을 보존. */
    white-space: pre-wrap;
    word-break: break-word;
}

/* (4) 모달 열림 시 body 스크롤 락 + 모달 내부 스크롤만 작동. */
body:has(.modal-overlay.active) {
    overflow: hidden;
}
.modal-overlay,
.modal-body {
    overscroll-behavior: contain;
}

/* ===== 모바일 성능: 768px 이하에서 backdrop-filter 비활성화 ===== */
@media (max-width: 768px) {
    .sidebar,
    .main-content,
    .code-fullheight-sidebar {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-radius: 0;
        margin: 0;
    }
    .sidebar,
    .code-fullheight-sidebar {
        background: var(--bg-sidebar);
    }
    .main-content {
        background: var(--bg-primary);
    }
}

/* ===== 배경 설정 모달 ===== */
.bg-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.bg-thumb-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color var(--transition), transform var(--transition);
    aspect-ratio: 16 / 10;
}

.bg-thumb-item:hover {
    transform: scale(1.03);
}

.bg-thumb-item.selected {
    border-color: #2563eb;
    border-width: 3px;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.bg-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bg-thumb-item .bg-thumb-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4px 6px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 10px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bg-thumb-item .bg-thumb-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition);
}

.bg-thumb-item:hover .bg-thumb-delete {
    opacity: 1;
}

.bg-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-tertiary);
    font-size: 12px;
    transition: border-color var(--transition), color var(--transition);
    aspect-ratio: 16 / 10;
}

.bg-upload-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.bg-upload-btn i {
    font-size: 24px;
}

/* 배경 설정 섹션 */
.bg-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 16px 0 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bg-section-title:first-child {
    margin-top: 0;
}

/* ===== Global Toast System ===== */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.toast-item {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
    animation: toastSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    max-width: 420px;
    min-width: 200px;
}

.toast-item.toast-exit {
    animation: toastSlideOut 0.25s ease-in forwards;
}

.toast-item .toast-icon {
    font-size: 17px;
    flex-shrink: 0;
}

.toast-item.toast-success .toast-icon { color: #10b981; }
.toast-item.toast-error .toast-icon { color: #ef4444; }
.toast-item.toast-warning .toast-icon { color: #f59e0b; }
.toast-item.toast-info .toast-icon { color: #6390ea; }

.toast-item .toast-msg {
    flex: 1;
    word-break: break-word;
}

.toast-item .toast-close {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.15s, color 0.15s;
}

.toast-item .toast-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-12px) scale(0.9);
    }
}

/* ===== 커스텀 Confirm 다이얼로그 ===== */
.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    animation: confirmFadeIn 0.15s ease;
}
.confirm-overlay.confirm-exit {
    animation: confirmFadeOut 0.15s ease forwards;
}
.confirm-dialog {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px 28px;
    min-width: 320px;
    max-width: 440px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
    animation: confirmScaleIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.confirm-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}
.confirm-message {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 20px;
    word-break: break-word;
}
.prompt-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    outline: none;
    background: #f9fafb;
    color: var(--text-primary);
    margin-bottom: 18px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.prompt-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 144, 234, 0.12);
    background: #ffffff;
}
.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.confirm-actions .confirm-ok.confirm-danger {
    background: #ef4444;
    color: #fff;
    border: none;
}
.confirm-actions .confirm-ok.confirm-danger:hover {
    background: #dc2626;
}
.confirm-actions .confirm-ok.confirm-warning {
    background: #f59e0b;
    color: #fff;
    border: none;
}
.confirm-actions .confirm-ok.confirm-warning:hover {
    background: #d97706;
}
@keyframes confirmFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes confirmFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}
@keyframes confirmScaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

