﻿﻿﻿﻿:root {
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'SFMono-Regular', 'Fira Code', 'Consolas', monospace;
    --max-content-width: 980px;
    --accent: #0a84ff;
    --accent-hover: #0066d6;
    --accent-rgb: 10, 132, 255;
    --success: #30d158;
    --warning: #ff9f0a;
    --error: #ff453a;
    --bg-app: #0e1117;
    --bg-app-secondary: #151a24;
    --bg-panel: rgba(22, 28, 39, 0.78);
    --bg-panel-strong: rgba(18, 23, 32, 0.94);
    --bg-input: rgba(18, 23, 32, 0.9);
    --bg-elevated: rgba(34, 41, 56, 0.78);
    --bg-tertiary: rgba(255, 255, 255, 0.08);
    --bg-hover: rgba(255, 255, 255, 0.08);
    --bg-active: rgba(10, 132, 255, 0.16);
    --border: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.2);
    --border-highlight: rgba(10, 132, 255, 0.34);
    --text-main: #f5f7fb;
    --text-secondary: #d8e0ee;
    --text-muted: #95a3b8;
    --text-inverse: #0f172a;
    --overlay-scrim: rgba(5, 8, 16, 0.56);
    --panel-backdrop: saturate(180%) blur(22px);
    --shadow-soft: 0 18px 48px rgba(2, 6, 23, 0.24);
    --shadow-panel: 0 30px 80px rgba(2, 6, 23, 0.4);
    --shadow-control: 0 1px 2px rgba(15, 23, 42, 0.16), 0 10px 24px rgba(15, 23, 42, 0.22);
    --radius-control: 14px;
    --radius-panel: 24px;
    --radius-card: 18px;
    --snapshot-page-bg: rgba(13, 17, 24, 0.92);
    --snapshot-text-primary: #f5f5f7;
    --snapshot-text-secondary: #d7dde8;
    --snapshot-text-tertiary: #98a2b3;
    --snapshot-heading: #ffffff;
    --snapshot-link: #5ac8fa;
    --snapshot-surface: rgba(255, 255, 255, 0.06);
    --snapshot-surface-strong: rgba(32, 39, 52, 0.82);
    --snapshot-code-bg: rgba(7, 13, 24, 0.82);
    --snapshot-code-text: #f5f9ff;
    --snapshot-border: rgba(255, 255, 255, 0.14);
    --snapshot-border-strong: rgba(255, 255, 255, 0.24);
    --snapshot-control-bg: rgba(255, 255, 255, 0.08);
    --snapshot-control-hover: rgba(255, 255, 255, 0.12);
    --snapshot-user-bubble-bg: rgba(10, 132, 255, 0.18);
    --snapshot-user-bubble-border: rgba(10, 132, 255, 0.28);
    --snapshot-user-bubble-text: #f7fbff;
    --snapshot-notice-bg: rgba(10, 132, 255, 0.08);
    --snapshot-notice-border: rgba(10, 132, 255, 0.18);
}

html[data-theme="dark"],
body[data-theme="dark"] {
    --bg-app: #0e1117;
    --bg-app-secondary: #151a24;
    --bg-panel: rgba(22, 28, 39, 0.78);
    --bg-panel-strong: rgba(18, 23, 32, 0.94);
    --bg-input: rgba(18, 23, 32, 0.9);
    --bg-elevated: rgba(34, 41, 56, 0.78);
    --bg-tertiary: rgba(255, 255, 255, 0.08);
    --bg-hover: rgba(255, 255, 255, 0.08);
    --bg-active: rgba(10, 132, 255, 0.16);
    --border: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.2);
    --border-highlight: rgba(10, 132, 255, 0.34);
    --text-main: #f5f7fb;
    --text-secondary: #d8e0ee;
    --text-muted: #95a3b8;
    --text-inverse: #0f172a;
    --overlay-scrim: rgba(5, 8, 16, 0.56);
    --shadow-soft: 0 18px 48px rgba(2, 6, 23, 0.24);
    --shadow-panel: 0 30px 80px rgba(2, 6, 23, 0.4);
    --shadow-control: 0 1px 2px rgba(15, 23, 42, 0.16), 0 10px 24px rgba(15, 23, 42, 0.22);
    --snapshot-page-bg: rgba(13, 17, 24, 0.92);
    --snapshot-text-primary: #f5f5f7;
    --snapshot-text-secondary: #d7dde8;
    --snapshot-text-tertiary: #98a2b3;
    --snapshot-heading: #ffffff;
    --snapshot-link: #5ac8fa;
    --snapshot-surface: rgba(255, 255, 255, 0.06);
    --snapshot-surface-strong: rgba(32, 39, 52, 0.82);
    --snapshot-code-bg: rgba(7, 13, 24, 0.82);
    --snapshot-code-text: #f5f9ff;
    --snapshot-border: rgba(255, 255, 255, 0.14);
    --snapshot-border-strong: rgba(255, 255, 255, 0.24);
    --snapshot-control-bg: rgba(255, 255, 255, 0.08);
    --snapshot-control-hover: rgba(255, 255, 255, 0.12);
    --snapshot-user-bubble-bg: rgba(10, 132, 255, 0.18);
    --snapshot-user-bubble-border: rgba(10, 132, 255, 0.28);
    --snapshot-user-bubble-text: #f7fbff;
    --snapshot-notice-bg: rgba(10, 132, 255, 0.08);
    --snapshot-notice-border: rgba(10, 132, 255, 0.18);
}

html[data-theme="light"],
body[data-theme="light"] {
    --bg-app: #eef2f8;
    --bg-app-secondary: #f9fbff;
    --bg-panel: rgba(255, 255, 255, 0.8);
    --bg-panel-strong: rgba(255, 255, 255, 0.96);
    --bg-input: rgba(255, 255, 255, 0.92);
    --bg-elevated: rgba(248, 250, 255, 0.94);
    --bg-tertiary: rgba(15, 23, 42, 0.05);
    --bg-hover: rgba(10, 132, 255, 0.08);
    --bg-active: rgba(10, 132, 255, 0.12);
    --border: rgba(15, 23, 42, 0.1);
    --border-strong: rgba(15, 23, 42, 0.16);
    --border-highlight: rgba(10, 132, 255, 0.22);
    --text-main: #111827;
    --text-secondary: #334155;
    --text-muted: #6b7280;
    --text-inverse: #ffffff;
    --overlay-scrim: rgba(226, 232, 240, 0.56);
    --shadow-soft: 0 20px 60px rgba(15, 23, 42, 0.12);
    --shadow-panel: 0 32px 84px rgba(15, 23, 42, 0.16);
    --shadow-control: 0 1px 2px rgba(15, 23, 42, 0.05), 0 12px 28px rgba(15, 23, 42, 0.1);
    --snapshot-page-bg: rgba(255, 255, 255, 0.94);
    --snapshot-text-primary: #1d1d1f;
    --snapshot-text-secondary: #3c3c43;
    --snapshot-text-tertiary: #6e6e73;
    --snapshot-heading: #111827;
    --snapshot-link: #0a84ff;
    --snapshot-surface: rgba(255, 255, 255, 0.78);
    --snapshot-surface-strong: rgba(255, 255, 255, 0.96);
    --snapshot-code-bg: rgba(242, 245, 250, 0.96);
    --snapshot-code-text: #111827;
    --snapshot-border: rgba(60, 60, 67, 0.16);
    --snapshot-border-strong: rgba(60, 60, 67, 0.24);
    --snapshot-control-bg: rgba(120, 120, 128, 0.12);
    --snapshot-control-hover: rgba(120, 120, 128, 0.18);
    --snapshot-user-bubble-bg: rgba(10, 132, 255, 0.1);
    --snapshot-user-bubble-border: rgba(10, 132, 255, 0.2);
    --snapshot-user-bubble-text: #0f172a;
    --snapshot-notice-bg: rgba(10, 132, 255, 0.06);
    --snapshot-notice-border: rgba(10, 132, 255, 0.14);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

body {
    font-family: var(--font-main);
    background:
        radial-gradient(circle at top, rgba(var(--accent-rgb), 0.12), transparent 34%),
        linear-gradient(180deg, var(--bg-app-secondary) 0%, var(--bg-app) 100%);
    color: var(--text-main);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Codex-only visual tuning (activated by body.session-codex) */
body.session-codex .chat-content {
    padding: 0;
    display: block;
    min-height: auto;
    flex: 0 0 auto;
    align-items: stretch;
}

body.session-claudecode .chat-content {
    padding: 0;
    display: block;
    min-height: auto;
}

html[data-theme] body.session-antigravity,
html[data-theme] body.session-claudecode,
html[data-theme] body.session-codex {
    background:
        radial-gradient(circle at top, rgba(var(--accent-rgb), 0.12), transparent 34%),
        linear-gradient(180deg, var(--bg-app-secondary) 0%, var(--bg-app) 100%) !important;
    background-color: var(--bg-app) !important;
}

html[data-theme] body.session-antigravity .chat-container,
html[data-theme] body.session-antigravity .chat-content[data-window-type="antigravity"],
html[data-theme] body.session-claudecode .chat-container,
html[data-theme] body.session-claudecode .chat-content[data-window-type="claudecode"],
html[data-theme] body.session-codex .chat-container,
html[data-theme] body.session-codex .chat-content[data-window-type="codex"] {
    background:
        linear-gradient(180deg, rgba(var(--accent-rgb), 0.03) 0%, transparent 18%),
        var(--bg-app) !important;
    background-color: var(--bg-app) !important;
}

body.session-claudecode .chat-content .snapshot-root {
    padding: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
}

body.session-claudecode .chat-content .snapshot-root > *:first-child {
    margin-top: 0 !important;
}

body.session-claudecode .chat-content .snapshot-root > *:last-child {
    margin-bottom: 0 !important;
}

body.session-codex .chat-content .snapshot-root {
    padding: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
}

body.session-codex .chat-content .snapshot-root > *:first-child {
    margin-top: 0 !important;
}

body.session-codex .chat-content .snapshot-root > *:last-child {
    margin-bottom: 0 !important;
}

body.session-codex #modelDropdown,
body.session-codex .composer-model-wrapper .dropdown-menu {
    display: none !important;
}

/* --- Layout Container for Centering --- */
/* We wrap everything in a max-width container to center it like a document/app */
body > header,
body > .header,
body > .settings-bar,
body > .chat-container,
body > .snapshot-action-dock,
body > .input-section,
body > .quick-actions {
    width: 100%;
    max-width: var(--max-content-width);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

@media (min-width: 921px) {
    body > .header {
        margin-top: 14px;
        border-top-left-radius: 26px;
        border-top-right-radius: 26px;
    }

    body > .input-section {
        margin-bottom: 14px;
        border-bottom-left-radius: 26px;
        border-bottom-right-radius: 26px;
    }
}

/* Tablet: Full width, no side borders */
@media (max-width: 920px) {
    body > header,
    body > .header,
    body > .settings-bar,
    body > .chat-container,
    body > .snapshot-action-dock,
    body > .input-section,
    body > .quick-actions {
        max-width: 100%;
        border-left: none;
        border-right: none;
    }
}

/* Mobile: Full width, compact layout */
@media (max-width: 600px) {
    :root {
        --max-content-width: 100%;
    }
    
    body {
        align-items: stretch;
    }
    
    body > header,
    body > .header,
    body > .settings-bar,
    body > .chat-container,
    body > .snapshot-action-dock,
    body > .input-section,
    body > .quick-actions {
        max-width: 100%;
        border-left: none;
        border-right: none;
    }
    
    .header {
        padding: 10px 12px;
        height: 50px;
    }
    
    .header h1 {
        font-size: 12px;
    }
    
    .header-controls {
        gap: 6px;
    }
    
    .header-btn {
        padding: 4px 8px;
        font-size: 10px;
        height: 26px;
    }
    
    .new-chat-btn {
        padding: 6px;
    }
    
    .settings-bar {
        padding: 8px 12px;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .chat-container {
        min-height: 0;
    }
    
    .input-section {
        padding: 8px 12px;
    }
    
    .quick-actions {
        padding: 8px 12px;
        gap: 6px;
        flex-wrap: wrap;
    }
    
    .action-chip {
        padding: 4px 10px;
        font-size: 11px;
    }
}

/* Small mobile: iPhone SE / small phones */
@media (max-width: 380px) {
    .header {
        padding: 8px 10px;
        height: 46px;
    }
    
    .header h1 span {
        display: none;
    }
    
    .header-controls {
        gap: 4px;
    }
    
    .header-btn {
        padding: 3px 6px;
        font-size: 9px;
    }
    
    .status-text {
        display: none;
    }
}

/* --- Global SVG Styles --- */
/* Ensure app chrome SVGs in buttons inherit parent color */
.header-btn svg,
.model-btn svg,
.new-chat-btn svg,
.refresh-btn svg,
.history-btn svg,
.stop-btn svg,
.file-btn svg,
.send-btn svg,
.status-badge svg,
.ide-modal-refresh svg,
.ide-modal-close svg {
    stroke: currentColor !important;
    fill: none !important;
}

.fab svg,
.fab svg path {
    stroke: currentColor !important;
    fill: none !important;
}

/* --- Header --- */
.header {
    background: var(--bg-panel);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    z-index: 50;
    height: 56px;
    backdrop-filter: var(--panel-backdrop);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.header h1 {
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-main);
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.01em;
}

.brand-text-short {
    display: none;
}

.header-device-btn {
    height: 28px;
    width: 28px;
    min-width: 28px;
    padding: 0;
    font-size: 11px;
    margin-right: 8px;
    gap: 0;
    justify-content: center;
}

.header-device-btn svg {
    width: 13px;
    height: 13px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Wireframe Buttons */
.header-btn {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 4px 10px;
    border-radius: var(--radius-control);
    font-size: 11px;
    font-family: var(--font-main);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
    height: 28px;
    box-shadow: var(--shadow-control);
    backdrop-filter: var(--panel-backdrop);
}

.header-btn svg {
    stroke: currentColor;
    fill: none;
}

.header-btn:hover {
    border-color: var(--border-highlight);
    color: var(--accent);
    background: var(--bg-hover);
}

.header-btn.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: var(--border);
    color: var(--text-muted);
}

.header-btn.is-disabled:hover {
    border-color: var(--border);
    color: var(--text-muted);
}

/* Model button specific styles */
.model-btn svg {
    stroke: currentColor;
    fill: none;
    width: 14px;
    height: 14px;
}

.header-btn:active {
    background: var(--bg-active);
    transform: translateY(1px) scale(0.98);
}

.editor-btn {
    min-width: 56px;
}

.editor-btn-icon {
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
    flex-shrink: 0;
}

.editor-btn-icon svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.editor-btn[data-editor="solo"] .editor-btn-icon {
    color: var(--accent);
}

.editor-btn.is-loading .editor-btn-icon {
    opacity: 0.68;
}

/* Specific Header Buttons */
.window-switch-btn {
    min-width: 170px;
    max-width: 280px;
    justify-content: space-between;
}

.window-switch-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
}

.window-switch-icon {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
    overflow: hidden;
}

.window-switch-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.window-switch-label {
    min-width: 0;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.window-switch-btn > svg {
    flex-shrink: 0;
}

.model-btn {
    min-width: 100px;
}

#modelHeaderText {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-wrapper {
    position: relative;
}

/* Icon Buttons */
.new-chat-btn, .refresh-btn, .history-btn, .stop-btn {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 28px;
    height: 28px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-control);
    backdrop-filter: var(--panel-backdrop);
}

.new-chat-btn svg, .refresh-btn svg, .history-btn svg {
    stroke: currentColor;
    fill: none;
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.new-chat-btn:hover, .refresh-btn:hover, .history-btn:hover {
    border-color: var(--border-highlight);
    color: var(--accent);
    background: var(--bg-hover);
}

.stop-btn {
    border-color: var(--error);
    color: var(--error);
    width: auto;
    padding: 0 8px;
    display: none; /* Toggled by JS */
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.stop-btn:hover {
    background: rgba(255, 69, 58, 0.12);
}

/* Status Badge */
.status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-family: var(--font-main);
    font-weight: 600;
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    height: 24px;
    background: var(--bg-elevated);
    box-shadow: var(--shadow-control);
    backdrop-filter: var(--panel-backdrop);
}

.status-badge svg {
    stroke: currentColor;
    fill: none;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-dot.connected { background: var(--success); box-shadow: 0 0 0 4px rgba(48, 209, 88, 0.14); }
.status-dot.disconnected { background: var(--warning); }

/* --- Settings Bar --- */
.settings-bar {
    background: var(--bg-panel);
    padding: 6px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 8px;
    overflow-x: auto;
    flex-shrink: 0;
    align-items: center;
    height: 40px;
    backdrop-filter: var(--panel-backdrop);
}

#syncStats {
    flex-shrink: 0;
    white-space: nowrap;
}

.settings-session-title {
    font-family: var(--font-main);
    font-size: 11px;
    color: var(--text-main);
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex-shrink: 0;
    background: var(--bg-elevated);
    box-shadow: var(--shadow-control);
}

#sessionTitleText {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-session-title.is-history-enabled {
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.settings-session-title.is-history-enabled:hover,
.settings-session-title.is-history-enabled:focus-visible {
    border-color: var(--border-highlight);
    background: var(--bg-hover);
    outline: none;
}

.settings-session-title-chevron {
    flex-shrink: 0;
    opacity: 0.58;
    display: none;
}

.settings-session-title.is-history-enabled .settings-session-title-chevron {
    display: inline-block;
}

.setting-chip {
    font-family: var(--font-main);
    font-size: 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: var(--shadow-control);
}

.setting-chip:hover {
    border-color: var(--border-highlight);
    color: var(--text-main);
    background: var(--bg-hover);
}

.history-top-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    max-width: 220px;
}

.history-top-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-top-btn svg {
    flex-shrink: 0;
}

/* --- Chat Container --- */
.chat-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.03) 0%, transparent 18%), var(--bg-app);
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Center the content inside the chat container */
.chat-content {
    width: 100%;
    /* No max-width here, let parent handle it */
    padding: 20px 0; /* Vertical padding only */
    display: flex;
    flex-direction: column;
    align-items: center; /* Center children horizontally */
    min-height: 100%;
    position: relative;
}

/* Snapshot Root - The main content from Antigravity */
.chat-content .snapshot-root {
    width: 100%;
    padding: 0 16px; /* Horizontal padding for text */
}

/* Snapshot Root - The main content from Antigravity */
.chat-content .snapshot-root {
    width: 100%;
    padding: 0 16px;
    font-family: var(--font-main);
    font-size: 14px;
    line-height: 1.6;
    background: var(--snapshot-page-bg);
    border: 1px solid var(--snapshot-border);
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    position: relative;
}

.chat-content[data-window-type="antigravity"] {
    padding: 0;
    min-height: 100%;
    align-items: stretch;
}

.chat-content[data-window-type="claudecode"] {
    padding: 0;
    display: block;
    min-height: auto;
}

.chat-content[data-window-type="codex"] {
    padding: 0;
    display: block;
    min-height: auto;
    flex: 0 0 auto;
    align-items: stretch;
}

.chat-content[data-window-type="trae"] {
    padding: 0;
    display: block;
    min-height: 100%;
    align-items: stretch;
    background:
        linear-gradient(180deg, rgba(var(--accent-rgb), 0.03) 0%, transparent 18%),
        var(--bg-app) !important;
    background-color: var(--bg-app) !important;
    color: var(--text-main);
}

.chat-content[data-window-type="trae"] .loading-state,
.chat-content[data-window-type="trae"] .empty-state {
    background: transparent;
    color: var(--text-muted);
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae {
    min-height: 100%;
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae,
.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae * {
    box-sizing: border-box;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae #cascade,
.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae #chat-virtua-inner-width-limiter,
.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .chat-content-container,
.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae [id*="chat-virtua-inner-width-limiter"] {
    position: static !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    visibility: visible !important;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae #chat-virtua-inner-width-limiter > div[style*="overflow-anchor"],
.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae [id*="chat-virtua-inner-width-limiter"] > div[style*="overflow-anchor"] {
    position: static !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    flex: initial !important;
    overflow-anchor: auto !important;
    visibility: visible !important;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae #chat-virtua-inner-width-limiter > div[style*="overflow-anchor"] > div[style*="position: absolute"],
.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae [id*="chat-virtua-inner-width-limiter"] > div[style*="overflow-anchor"] > div[style*="position: absolute"] {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    margin: 0 !important;
    visibility: visible !important;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .actions-group.floating-actions,
.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .user-query__more-action,
.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .icon-wrapper[data-state],
.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .chat-markdown-memory-reference {
    display: none !important;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae section.chat-turn {
    position: relative;
    margin: 0;
    padding: 0;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae section.chat-turn.user {
    min-height: 84px;
    margin-bottom: 8px;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae section.chat-turn.user .chat-turn-heading.user {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 0 12px;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae section.chat-turn.user .user-chat-timestamp {
    color: #d4deff;
    font-size: 12px;
    line-height: 1;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .icd-avatar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .icd-avatar-img {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    border-radius: 6px;
    overflow: hidden;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .icd-avatar-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .icd-avatar-img svg,
.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .agent-avatar-container,
.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .agent-avatar-container svg,
.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .ai-agent-task-section-indicator__icon,
.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .ai-agent-task-section-indicator__icon svg,
.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .chat-markdown-memory-reference svg,
.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .ai-task-memory-card-container svg,
.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .mention-symbol svg {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    flex: 0 0 16px !important;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .agent-avatar-container {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .icd-avatar-name {
    color: #f4f7ff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae section.chat-turn.user .user-chat-turn-content-bubble-wrapper {
    display: flex;
    justify-content: flex-end;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae section.chat-turn.user .user-chat-bubble {
    position: relative;
    display: block !important;
    max-width: min(72%, 260px);
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid rgba(100, 208, 255, 0.22);
    background: rgba(29, 54, 84, 0.82);
    color: #f4f7ff;
    white-space: normal;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae section.chat-turn.user .user-chat-bubble-request-group,
.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae section.chat-turn.user .user-chat-bubble-request,
.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae section.chat-turn.user .user-chat-bubble-request__content-wrapper {
    margin: 0 !important;
    padding: 0 !important;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae section.chat-turn.user .user-chat-line {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    line-height: 1.35;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae section.chat-turn.user .mention-symbol.rule-attached-info-symbol {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #d6e1ff;
    font-size: 11px;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae section.chat-turn.assistant {
    padding-top: 8px;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae section.chat-turn.assistant .chat-turn-heading.assistant {
    display: flex;
    align-items: center;
    padding: 0;
    min-height: 20px;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .icube-references-container {
    display: block;
    margin: 8px 0 10px;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .icube-references-header {
    display: block;
    padding: 0;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .ai-deep-thinking-state-bar.state-reasoning {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 8px 1px 6px;
    border-radius: 999px;
    background: rgba(102, 117, 158, 0.16);
    color: #d8e0f7;
    font-size: 12px;
    line-height: 18px;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .assistant-chat-turn-content,
.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .assistant-chat-turn-content-inner-agent-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .agent-plan-items.assistant-chat-turn-element > .ai-agent-task:empty {
    display: none;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .ai-agent-task-section,
.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .ai-agent-task-section-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .ai-agent-task-section-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 0 0 18px;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .ai-agent-task-section-indicator__line {
    width: 1px;
    min-height: 18px;
    background: rgba(149, 162, 196, 0.22);
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .ai-agent-task-section-main {
    min-width: 0;
    flex: 1 1 auto;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .ai-agent-task-section-header {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 20px;
    margin-bottom: 6px;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .ai-agent-task-section-header__title,
.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .ai-agent-task-section-header__desc {
    display: inline-block !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .ai-task-memory-card-container,
.chat-content[data-window-type="trae"] .snapshot-root.snapshot-trae .trae-memory-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0 12px;
    padding: 0 0 0 2px;
    color: #9da9cb;
    font-size: 12px;
    line-height: 18px;
}

.chat-content[data-window-type="codex"] .snapshot-root.snapshot-codex {
    margin: 0;
    padding: 0;
    min-height: auto;
    height: auto;
    max-height: none;
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
}

.chat-content[data-window-type="codex"] .snapshot-root.snapshot-codex > *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.chat-content[data-window-type="codex"] .snapshot-root.snapshot-codex > *:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.chat-content[data-window-type="claudecode"] .snapshot-root.snapshot-claudecode {
    margin: 0;
    padding: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
}

.chat-content[data-window-type="claudecode"] .snapshot-root.snapshot-claudecode > *:first-child {
    margin-top: 0 !important;
}

.chat-content[data-window-type="claudecode"] .snapshot-root.snapshot-claudecode > *:last-child {
    margin-bottom: 0 !important;
}

.chat-content[data-window-type="claudecode"] .snapshot-root.snapshot-claudecode > .messagesContainer_07S1Yg,
.chat-content[data-window-type="claudecode"] .snapshot-root.snapshot-claudecode > [data-snapshot-source="claudecode"] {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.chat-content[data-window-type="antigravity"] .snapshot-root.snapshot-antigravity {
    min-height: 100%;
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
}

/* Antigravity snapshot specific styles */
.snapshot-antigravity {
    color: var(--text-main);
    background: var(--snapshot-page-bg) !important;
}

.snapshot-antigravity * {
    box-sizing: border-box;
}

.chat-content .snapshot-root {
    color: var(--snapshot-text-primary);
}

html[data-theme="dark"] .chat-content .snapshot-root,
body[data-theme="dark"] .chat-content .snapshot-root {
    --background: 224 32% 10%;
    --background-primary: #0d1118;
    --background-secondary: #161d28;
    --background-tertiary: #202938;
    --surface: #161d28;
    --surface-background: #161d28;
    --card: 222 27% 14%;
    --card-background: #161d28;
    --card-foreground: 210 40% 98%;
    --popover: 222 27% 14%;
    --popover-background: #161d28;
    --popover-foreground: 210 40% 98%;
    --panel-background: #202938;
    --muted: 223 24% 18%;
    --muted-background: #161d28;
    --foreground: 210 40% 98%;
    --foreground-secondary: var(--snapshot-text-secondary);
    --text-primary: var(--snapshot-text-primary);
    --text-secondary: var(--snapshot-text-secondary);
    --text-muted: var(--snapshot-text-tertiary);
    --muted-foreground: 215 20% 70%;
    --primary: 211 100% 56%;
    --primary-foreground: 210 40% 98%;
    --secondary: 223 24% 18%;
    --secondary-foreground: 210 40% 96%;
    --accent: 223 24% 18%;
    --accent-foreground: 210 40% 96%;
    --destructive: 4 90% 58%;
    --destructive-foreground: 210 40% 98%;
    --border: 220 16% 24%;
    --border-color: #2a3443;
    --input: 220 16% 24%;
    --ring: 211 100% 56%;
    --radius: 1rem;
    --editor-background: #0d1118;
    --editor-foreground: var(--snapshot-text-primary);
    --input-background: #202938;
    --input-foreground: var(--snapshot-text-primary);
    --vscode-editor-background: #0d1118;
    --vscode-editor-foreground: var(--snapshot-text-primary);
    --vscode-sideBar-background: #0d1118;
    --vscode-panel-background: #161d28;
    --vscode-editorWidget-background: #202938;
    --vscode-input-background: #202938;
    --vscode-input-foreground: var(--snapshot-text-primary);
    --vscode-button-background: #202938;
    --vscode-button-foreground: var(--snapshot-text-primary);
}

html[data-theme="light"] .chat-content .snapshot-root,
body[data-theme="light"] .chat-content .snapshot-root {
    --background: 0 0% 100%;
    --background-primary: #ffffff;
    --background-secondary: #f7f8fa;
    --background-tertiary: #eff2f7;
    --surface: #ffffff;
    --surface-background: #ffffff;
    --card: 0 0% 100%;
    --card-background: #ffffff;
    --card-foreground: 222 47% 11%;
    --popover: 0 0% 100%;
    --popover-background: #ffffff;
    --popover-foreground: 222 47% 11%;
    --panel-background: #f7f8fa;
    --muted: 210 20% 96%;
    --muted-background: #f7f8fa;
    --foreground: 222 47% 11%;
    --foreground-secondary: var(--snapshot-text-secondary);
    --text-primary: var(--snapshot-text-primary);
    --text-secondary: var(--snapshot-text-secondary);
    --text-muted: var(--snapshot-text-tertiary);
    --muted-foreground: 215 16% 47%;
    --primary: 211 100% 50%;
    --primary-foreground: 0 0% 100%;
    --secondary: 210 20% 96%;
    --secondary-foreground: 222 47% 11%;
    --accent: 210 20% 96%;
    --accent-foreground: 222 47% 11%;
    --destructive: 4 90% 58%;
    --destructive-foreground: 0 0% 100%;
    --border: 214 16% 85%;
    --border-color: #d8dee8;
    --input: 214 16% 85%;
    --ring: 211 100% 50%;
    --radius: 1rem;
    --editor-background: #ffffff;
    --editor-foreground: var(--snapshot-text-primary);
    --input-background: #ffffff;
    --input-foreground: var(--snapshot-text-primary);
    --vscode-editor-background: #ffffff;
    --vscode-editor-foreground: var(--snapshot-text-primary);
    --vscode-sideBar-background: #ffffff;
    --vscode-panel-background: #f7f8fa;
    --vscode-editorWidget-background: #ffffff;
    --vscode-input-background: #ffffff;
    --vscode-input-foreground: var(--snapshot-text-primary);
    --vscode-button-background: #f2f4f8;
    --vscode-button-foreground: var(--snapshot-text-primary);
}

html[data-theme="dark"] .chat-content .snapshot-root,
body[data-theme="dark"] .chat-content .snapshot-root {
    color-scheme: dark;
}

html[data-theme="light"] .chat-content .snapshot-root,
body[data-theme="light"] .chat-content .snapshot-root {
    color-scheme: light;
}

.snapshot-root .message {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
    color: var(--snapshot-text-primary);
}

.snapshot-root .message-user {
    align-items: flex-end;
}

.snapshot-root .message-assistant {
    align-items: stretch;
}

.snapshot-root .message-user > * {
    max-width: min(82%, 720px);
}

.snapshot-root .message-assistant > * {
    max-width: 100%;
}

.snapshot-root .text-block,
.snapshot-root .markdown-content,
.snapshot-root .thought-block,
.snapshot-root .tool-event,
.snapshot-root .progress-updates,
.snapshot-root .error-banner,
.snapshot-root .feedback-actions,
.snapshot-root .citation-list {
    width: 100%;
}

.snapshot-root .message-user .text-block {
    background: var(--snapshot-user-bubble-bg);
    border: 1px solid var(--snapshot-user-bubble-border);
    color: var(--snapshot-user-bubble-text);
    border-radius: 18px;
    padding: 12px 14px;
    box-shadow: var(--shadow-control);
}

.snapshot-root .message-assistant .text-block {
    color: var(--snapshot-text-primary);
    white-space: pre-wrap;
}

.snapshot-root .markdown-content,
.snapshot-root .text-block {
    font-size: 14px;
    line-height: 1.7;
}

.snapshot-root .markdown-content :is(p, li, td, th, span, div, strong, em, small, label) {
    color: var(--snapshot-text-primary);
}

.snapshot-root .markdown-content :is(h1, h2, h3, h4, h5, h6) {
    color: var(--snapshot-heading);
    margin: 0 0 10px;
}

.snapshot-root .markdown-content :is(ul, ol) {
    padding-left: 20px;
}

.snapshot-root .markdown-content a,
.snapshot-root .citation-item a {
    color: var(--snapshot-link);
}

.snapshot-root .markdown-content pre,
.snapshot-root .markdown-content code,
.snapshot-root .markdown-content kbd {
    color: var(--snapshot-code-text);
    background: var(--snapshot-code-bg);
    border: 1px solid var(--snapshot-border);
}

.snapshot-root .markdown-content pre {
    border-radius: 16px;
    padding: 12px 14px;
    overflow: auto;
}

.snapshot-root .markdown-content code,
.snapshot-root .markdown-content kbd {
    border-radius: 10px;
    padding: 2px 6px;
}

.snapshot-root .markdown-content blockquote {
    margin: 10px 0;
    padding: 10px 12px;
    border-left: 3px solid var(--snapshot-notice-border);
    border-radius: 14px;
    background: var(--snapshot-notice-bg);
    color: var(--snapshot-text-secondary);
}

.snapshot-root .markdown-content hr {
    border: 0;
    border-top: 1px solid var(--snapshot-border);
    margin: 14px 0;
}

.snapshot-root .thought-block {
    background: var(--snapshot-notice-bg);
    border: 1px solid var(--snapshot-notice-border);
    border-radius: 16px;
    padding: 10px 12px;
}

.snapshot-root .thought-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--snapshot-text-secondary);
}

.snapshot-root .thought-icon {
    width: 16px;
    height: 16px;
    color: var(--snapshot-link);
    flex-shrink: 0;
}

.snapshot-root .thought-content {
    margin-top: 8px;
    color: var(--snapshot-text-primary);
    white-space: pre-wrap;
}

.snapshot-root .tool-event {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--snapshot-border);
    border-radius: 16px;
    background: var(--snapshot-surface);
    color: var(--snapshot-text-secondary);
}

.snapshot-root .tool-title {
    color: var(--snapshot-heading);
    font-weight: 600;
}

.snapshot-root .tool-detail {
    color: var(--snapshot-text-secondary);
}

.snapshot-root .progress-updates {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.snapshot-root .progress-item {
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--snapshot-border);
    background: var(--snapshot-surface);
    color: var(--snapshot-text-secondary);
}

.snapshot-root .error-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 69, 58, 0.22);
    background: rgba(255, 69, 58, 0.08);
    color: var(--snapshot-text-primary);
}

.snapshot-root .error-banner.warning {
    border-color: rgba(255, 159, 10, 0.22);
    background: rgba(255, 159, 10, 0.08);
}

.snapshot-root .error-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.snapshot-root .feedback-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.snapshot-root .action-btn {
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid var(--snapshot-border);
    background: var(--snapshot-control-bg);
    color: var(--snapshot-text-primary);
    font: inherit;
}

.snapshot-root .action-btn:disabled {
    opacity: 0.5;
}

.snapshot-root .citation-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.snapshot-root .citation-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--snapshot-border);
    background: var(--snapshot-surface);
    color: var(--snapshot-text-secondary);
}

/* Keep native message cards; avoid forcing synthetic user/assistant borders. */
.snapshot-antigravity .snapshot-user-message,
.snapshot-antigravity .snapshot-assistant-message {
    background: inherit !important;
    border: none !important;
    border-radius: 0 !important;
}

/* Images in snapshot */
.snapshot-antigravity img {
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 4px;
}

/* Keep snapshot icon sizing native; only normalize baseline alignment */
.snapshot-antigravity svg {
    vertical-align: middle;
    max-width: 100%;
    max-height: 100%;
}

.chat-content .snapshot-root .snapshot-inline-icon {
    width: 1em !important;
    height: 1em !important;
    min-width: 1em !important;
    min-height: 1em !important;
    max-width: 1em !important;
    max-height: 1em !important;
    display: inline-block !important;
    vertical-align: text-bottom !important;
    object-fit: contain;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Keep native Antigravity layout semantics; do not force flex/button containers globally. */

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 12px;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

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

.loading-state.buffered-loading {
    width: 100%;
    min-height: clamp(280px, 52vh, 520px);
    padding: 26px 18px;
    justify-content: center;
}

.buffered-loading-card {
    width: min(100%, 440px);
    padding: 22px 22px 20px;
    border-radius: 24px;
    border: 1px solid rgba(var(--accent-rgb), 0.14);
    background:
        radial-gradient(circle at top right, rgba(var(--accent-rgb), 0.14), transparent 42%),
        linear-gradient(180deg, rgba(var(--accent-rgb), 0.05) 0%, rgba(var(--accent-rgb), 0.02) 100%),
        var(--bg-card);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(14px);
}

.buffered-loading-ribbon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(var(--accent-rgb), 0.12);
    border: 1px solid rgba(var(--accent-rgb), 0.14);
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.buffered-loading-ribbon__dot,
.snapshot-sync-badge__dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.35);
    animation: bufferedPulse 1.45s ease-in-out infinite;
}

.buffered-loading-spinner {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 18px 0 14px;
}

.buffered-loading-spinner span {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    background: rgba(var(--accent-rgb), 0.72);
    animation: bufferedBounce 1.1s ease-in-out infinite;
}

.buffered-loading-spinner span:nth-child(2) {
    animation-delay: 0.14s;
}

.buffered-loading-spinner span:nth-child(3) {
    animation-delay: 0.28s;
}

.buffered-loading-title {
    margin: 0;
    color: var(--text-main);
    font-size: 16px;
    font-weight: 600;
    text-align: left;
}

.buffered-loading-desc {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.6;
    text-align: left;
}

.buffered-loading-bars {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.buffered-loading-bar {
    height: 12px;
    border-radius: 999px;
    background:
        linear-gradient(90deg, rgba(var(--accent-rgb), 0.06), rgba(var(--accent-rgb), 0.14), rgba(var(--accent-rgb), 0.06));
    background-size: 220% 100%;
    animation: bufferedShimmer 1.6s linear infinite;
}

.buffered-loading-bar.wide {
    width: 100%;
}

.buffered-loading-bar.medium {
    width: 82%;
}

.buffered-loading-bar.short {
    width: 58%;
}

.snapshot-sync-badge {
    position: absolute;
    top: 10px;
    left: 50%;
    right: auto;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    max-width: min(78vw, 360px);
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(var(--accent-rgb), 0.16);
    background: rgba(var(--bg-card-rgb), 0.92);
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(10px);
    pointer-events: none;
    transform: translateX(-50%);
}

.snapshot-sync-badge__text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.snapshot-gap-placeholder {
    position: absolute;
    left: 14px;
    right: 14px;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
    padding: 18px 14px;
    border-radius: 24px;
    border: 1px solid rgba(255, 86, 86, 0.12);
    background:
        linear-gradient(180deg, rgba(255, 86, 86, 0.05), rgba(255, 86, 86, 0.02)),
        rgba(11, 15, 23, 0.18);
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.02),
        0 10px 28px rgba(2, 6, 23, 0.08);
    backdrop-filter: blur(8px);
}

.snapshot-gap-placeholder.is-subtle {
    opacity: 0.94;
}

.snapshot-gap-placeholder.is-dense {
    padding-top: 22px;
    padding-bottom: 22px;
}

.snapshot-gap-placeholder__wash {
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            180deg,
            rgba(255,255,255,0.03) 0px,
            rgba(255,255,255,0.03) 18px,
            transparent 18px,
            transparent 52px
        ),
        linear-gradient(
            90deg,
            transparent 0%,
            rgba(255,255,255,0.02) 30%,
            rgba(255, 86, 86, 0.08) 50%,
            rgba(255,255,255,0.02) 70%,
            transparent 100%
        );
    background-size: 100% 100%, 180% 100%;
    animation: bufferedShimmer 2.4s linear infinite;
}

.snapshot-gap-placeholder__stack {
    position: relative;
    z-index: 1;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    gap: 16px;
}

.snapshot-gap-placeholder__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: min(340px, 100%);
    margin: 0 auto;
    padding: 20px 18px;
    border-radius: 20px;
    border: 1px dashed rgba(255, 86, 86, 0.28);
    background:
        radial-gradient(circle at top, rgba(255, 86, 86, 0.16), transparent 60%),
        linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

.snapshot-gap-placeholder.is-subtle .snapshot-gap-placeholder__card,
.snapshot-gap-placeholder__card.is-subtle {
    padding: 16px 16px 14px;
    border-radius: 18px;
    opacity: 0.92;
}

.snapshot-gap-placeholder__spinner {
    position: relative;
    width: 42px;
    height: 42px;
}

.snapshot-gap-placeholder__spinner::before,
.snapshot-gap-placeholder__spinner::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 999px;
    border: 2px solid rgba(255, 86, 86, 0.18);
}

.snapshot-gap-placeholder__spinner::after {
    border-top-color: rgba(255, 86, 86, 0.92);
    border-right-color: rgba(255, 86, 86, 0.48);
    animation: spin 1.1s linear infinite;
}

.snapshot-gap-placeholder__title {
    margin: 0;
    color: #ff5757;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.snapshot-gap-placeholder__desc {
    margin: 0;
    color: rgba(255,255,255,0.68);
    font-size: 11px;
    line-height: 1.55;
    text-align: center;
}

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

@keyframes bufferedBounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.42;
    }
    40% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

@keyframes bufferedPulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.24);
    }
    70% {
        transform: scale(1.03);
        box-shadow: 0 0 0 8px rgba(var(--accent-rgb), 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0);
    }
}

body.ide-switching {
    overflow: hidden;
}

.ide-switch-progress-overlay {
    position: fixed;
    inset: 0;
    z-index: 760;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background: rgba(2, 6, 14, 0.64);
    backdrop-filter: blur(14px) saturate(140%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.ide-switch-progress-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.ide-switch-progress-card {
    position: relative;
    width: min(360px, calc(100vw - 40px));
    padding: 22px 20px 18px;
    border-radius: 24px;
    border: 1px solid rgba(104, 132, 184, 0.22);
    background:
        radial-gradient(circle at top right, rgba(var(--accent-rgb), 0.18), transparent 42%),
        linear-gradient(180deg, rgba(15, 21, 33, 0.98) 0%, rgba(9, 14, 24, 0.96) 100%);
    box-shadow: 0 28px 90px rgba(2, 6, 23, 0.42);
    overflow: hidden;
}

.ide-switch-progress-card::before {
    content: '';
    position: absolute;
    inset: -20% auto auto -12%;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--accent-rgb), 0.26) 0%, rgba(var(--accent-rgb), 0.04) 52%, transparent 72%);
    filter: blur(8px);
    animation: ide-switch-glow 3.2s ease-in-out infinite;
    pointer-events: none;
}

.ide-switch-progress-head {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.ide-switch-progress-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-main);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ide-switch-progress-icon img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.ide-switch-progress-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ide-switch-progress-title {
    color: var(--text-main);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.ide-switch-progress-target,
.ide-switch-progress-stage,
.ide-switch-progress-percent {
    color: var(--text-secondary);
}

.ide-switch-progress-target {
    font-size: 12px;
    line-height: 1.45;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.ide-switch-progress-stage {
    position: relative;
    z-index: 1;
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.ide-switch-progress-bar {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ide-switch-progress-fill {
    position: relative;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(90, 200, 250, 0.95) 0%, rgba(10, 132, 255, 1) 58%, rgba(99, 102, 241, 0.96) 100%);
    box-shadow: 0 0 20px rgba(10, 132, 255, 0.28);
    transition: width 0.24s ease;
}

.ide-switch-progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.24) 42%, transparent 100%);
    animation: ide-switch-sheen 1.35s linear infinite;
}

.ide-switch-progress-meta {
    position: relative;
    z-index: 1;
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ide-switch-progress-glow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ide-switch-progress-glow span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(90, 200, 250, 0.92);
    box-shadow: 0 0 12px rgba(90, 200, 250, 0.32);
    animation: ide-switch-dot 1s ease-in-out infinite;
}

.ide-switch-progress-glow span:nth-child(2) {
    animation-delay: 0.18s;
}

.ide-switch-progress-glow span:nth-child(3) {
    animation-delay: 0.36s;
}

@keyframes ide-switch-glow {
    0%, 100% { transform: translate3d(0, 0, 0) scale(0.96); opacity: 0.72; }
    50% { transform: translate3d(14px, 12px, 0) scale(1.08); opacity: 1; }
}

@keyframes ide-switch-sheen {
    from { transform: translateX(-100%); }
    to { transform: translateX(200%); }
}

@keyframes ide-switch-dot {
    0%, 80%, 100% { transform: translateY(0) scale(0.9); opacity: 0.42; }
    40% { transform: translateY(-3px) scale(1); opacity: 1; }
}

/* --- Quick Actions --- */
.quick-actions {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-panel);
    border-top: 1px solid var(--border);
    overflow-x: auto;
    backdrop-filter: var(--panel-backdrop);
}

/* --- Antigravity Action Dock (Review Changes + icons) --- */
.snapshot-action-dock {
    display: none;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-panel);
    border-top: 1px solid var(--border);
    overflow-x: auto;
    overflow-y: hidden;
    flex-shrink: 0;
    backdrop-filter: var(--panel-backdrop);
}

.snapshot-action-dock.show {
    display: flex;
}

.snapshot-action-dock .snapshot-action-dock-inner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: max-content;
}

.snapshot-action-dock button,
.snapshot-action-dock [role="button"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    min-height: 28px;
    padding: 4px 8px !important;
    border-radius: 14px !important;
    border: 1px solid var(--border) !important;
    background: var(--bg-elevated) !important;
    color: var(--text-main) !important;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: var(--shadow-control);
    backdrop-filter: var(--panel-backdrop);
}

.snapshot-action-dock button:hover,
.snapshot-action-dock [role="button"]:hover {
    border-color: var(--border-highlight) !important;
    color: var(--accent) !important;
    background: var(--bg-hover) !important;
}

.snapshot-action-dock button svg,
.snapshot-action-dock [role="button"] svg {
    width: 16px !important;
    height: 16px !important;
}

.action-chip {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-family: var(--font-main);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    box-shadow: var(--shadow-control);
}

.action-chip:hover {
    border-color: var(--border-highlight);
    color: var(--accent);
    background: var(--bg-hover);
}

/* --- Input Section --- */
.input-section {
    background: var(--bg-panel);
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    backdrop-filter: var(--panel-backdrop);
}

.input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end; /* Align bottom for multiline */
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 10px 14px;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-shadow: var(--shadow-control);
    backdrop-filter: var(--panel-backdrop);
}

.input-wrapper:focus-within {
    border-color: var(--border-highlight);
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12);
}

.composer-meta-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    min-height: 30px;
    flex-wrap: wrap;
}

.composer-meta-right {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.composer-meta-bar .window-switch-btn,
.composer-meta-bar .new-chat-btn {
    flex-shrink: 0;
}

.composer-meta-bar .window-switch-btn {
    min-width: 80px;
    font-size: 10px;
    padding: 4px 8px;
}

.composer-model-wrapper {
    min-width: 0;
}

.composer-mode-btn {
    min-width: 0;
    max-width: 170px;
    justify-content: space-between;
}

.composer-mode-btn #modeHeaderText,
#modeHeaderText {
    max-width: 95px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.composer-model-wrapper .model-btn {
    min-width: 0;
    width: 100%;
    justify-content: space-between;
}

.composer-meta-btn {
    flex-shrink: 0;
}

.meta-caret-icon {
    flex-shrink: 0;
}

.composer-history-btn {
    min-width: 0;
    max-width: 220px;
    justify-content: space-between;
    gap: 6px;
}

.composer-history-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-btn.is-claude-slash {
    min-width: 0;
    width: auto;
    padding: 4px 8px;
    gap: 4px;
}

.model-btn.is-claude-slash > svg:first-child {
    display: none;
}

.model-btn.is-claude-slash #modelHeaderText {
    max-width: none;
    font-size: 14px;
    line-height: 1;
}

.model-btn.is-claude-slash > svg:last-child {
    margin-left: 0 !important;
}

.composer-status-badge {
    margin-left: 0;
    flex-shrink: 0;
}

.theme-toggle-btn {
    width: 30px;
    min-width: 30px;
    padding: 0;
    justify-content: center;
}

.theme-toggle-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.theme-icon {
    position: absolute;
    inset: 0;
    width: 16px;
    height: 16px;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.theme-icon-sun {
    opacity: 0;
    transform: scale(0.68) rotate(-24deg);
}

.theme-icon-moon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

html[data-theme="light"] .theme-icon-sun,
body[data-theme="light"] .theme-icon-sun {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

html[data-theme="light"] .theme-icon-moon,
body[data-theme="light"] .theme-icon-moon {
    opacity: 0;
    transform: scale(0.72) rotate(24deg);
}

html[data-theme="light"] .theme-toggle-btn,
body[data-theme="light"] .theme-toggle-btn {
    color: var(--accent);
}

textarea {
    flex: 1;
    background: transparent !important;
    border: none !important;
    color: var(--text-main) !important;
    font-family: var(--font-main);
    font-size: 13px;
    resize: none;
    min-height: 24px;
    max-height: 200px;
    line-height: 1.5;
    padding: 0;
    outline: none !important;
    box-shadow: none !important;
}

textarea::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.file-btn {
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s;
}

.file-btn svg {
    stroke: currentColor;
    fill: none;
}

.file-btn:hover {
    color: var(--accent);
    border-color: var(--border-highlight);
    background: var(--bg-hover);
}

.send-btn {
    background: rgba(var(--accent-rgb), 0.12);
    border: 1px solid rgba(var(--accent-rgb), 0.18);
    color: var(--accent);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s;
}

.send-btn svg {
    stroke: currentColor;
    fill: none;
}

.send-btn:hover {
    background: rgba(var(--accent-rgb), 0.18);
    border-color: rgba(var(--accent-rgb), 0.28);
}

.send-btn:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    background: transparent;
    border-color: transparent;
}

@media (max-width: 600px) {
    .brand-text-full {
        display: none;
    }

    .brand-text-short {
        display: inline;
    }

    .header h1 {
        min-width: 0;
        flex: 1;
    }

    .header h1 .brand-text {
        white-space: nowrap;
    }

    .header-controls {
        flex-shrink: 0;
    }

    .settings-bar {
        flex-wrap: nowrap;
        overflow-x: hidden;
    }

    #syncStats {
        min-width: max-content;
    }

    .settings-session-title {
        flex: 1 1 auto;
        max-width: none;
        min-width: 0;
    }

    .composer-meta-bar {
        gap: 6px;
        flex-wrap: nowrap;
        overflow: hidden;
    }

    .composer-meta-right {
        gap: 6px;
    }

.composer-meta-bar #editorBtn,
.composer-meta-bar #claudeAskBtn,
.composer-meta-bar #modeHeaderBtn,
.composer-meta-bar #modelHeaderBtn,
.composer-meta-bar #historyBtn,
.composer-meta-bar #themeToggleBtn {
        width: 32px;
        min-width: 32px;
        padding: 0;
        justify-content: center;
        gap: 0;
    }

    .composer-meta-bar #editorBtn #editorText,
    .composer-meta-bar #claudeAskBtn span,
    .composer-meta-bar #modeHeaderText,
    .composer-meta-bar #modelHeaderText,
    .composer-meta-bar .meta-caret-icon {
        display: none;
    }

    .composer-meta-bar #editorBtn .editor-btn-icon {
        width: 15px;
        height: 15px;
    }

    .composer-meta-bar #editorBtn .editor-btn-icon svg {
        width: 15px;
        height: 15px;
        stroke-width: 1.85;
    }

    .composer-model-wrapper {
        width: auto;
        flex-shrink: 0;
    }

    .composer-model-wrapper .model-btn {
        width: 30px;
    }

    .composer-status-badge {
        max-width: none;
    }

    .composer-status-badge #statusText {
        overflow: visible;
        text-overflow: clip;
        white-space: nowrap;
    }
}

@media (max-width: 380px) {
    .brand-text-full {
        display: none;
    }

    .brand-text-short {
        display: inline;
    }

    .settings-bar {
        padding: 6px 10px;
        gap: 4px;
    }

    #syncStats #statsText {
        font-size: 9px !important;
    }
}

/* --- FABs (Floating Action Buttons) --- */
.fab {
    position: fixed;
    width: 36px;
    height: 36px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: 4px; /* Square with slight radius for wireframe look */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    transition: all 0.2s;
}

.fab:hover {
    border-color: var(--accent);
    color: var(--accent);
}

#scrollToBottom {
    bottom: 140px; /* Adjusted for input height */
    right: max(20px, calc(50vw - var(--max-content-width)/2 + 20px)); /* Align relative to centered content */
    border-color: var(--success);
    color: var(--success);
    opacity: 0;
    pointer-events: none;
}

#scrollToBottom.show {
    opacity: 1;
    pointer-events: auto;
}

.windows-fab {
    bottom: 90px;
    right: max(20px, calc(50vw - var(--max-content-width)/2 + 20px));
    border-color: var(--accent);
    color: var(--accent);
}

/* IDE Switcher FAB - Always Visible */
.ide-switcher-fab {
    bottom: 140px;
    right: max(20px, calc(50vw - var(--max-content-width)/2 + 20px));
    border-color: var(--success);
    color: var(--success);
}

/* --- Modals (Wireframe Style) --- */
.modal-overlay, .ide-modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-scrim);
    backdrop-filter: var(--panel-backdrop);
    z-index: 720;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px 14px;
}

.modal-overlay.show, .ide-modal-overlay.show {
    display: flex !important;
}

.modal-overlay[style*="display: flex"],
.ide-modal-overlay[style*="display: flex"] {
    display: flex !important;
}

/* --- SSL Banner Modal --- */
.ssl-banner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 599;
    display: none;
}

.ssl-banner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-panel);
    border: 1px solid var(--warning);
    border-radius: 12px;
    padding: 24px 32px;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    z-index: 600;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    min-width: 320px;
    text-align: center;
}

.ssl-banner span {
    font-family: var(--font-main);
    font-size: 14px;
    color: var(--text-main);
}

.ssl-banner button {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: white;
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 13px;
    transition: all 0.2s;
}

.ssl-banner button:hover {
    background: var(--accent-hover);
}

.ssl-banner .dismiss-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
}

.ssl-banner .dismiss-btn:hover {
    color: var(--text-main);
}

.modal-panel, .ide-modal-sheet {
    background: var(--bg-panel-strong);
    border: 1px solid var(--border);
    border-radius: var(--radius-panel);
    box-shadow: var(--shadow-panel);
    width: 90%;
    max-width: 520px;
    min-width: 0;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--text-main);
    backdrop-filter: var(--panel-backdrop);
    isolation: isolate;
}

.modal-title, .ide-modal-title {
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    padding: 16px;
    border-bottom: 1px solid var(--border);
    letter-spacing: 0.01em;
}

.ide-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.06) 0%, transparent 100%);
}

.ide-modal-body {
    padding: 0;
    overflow-y: auto;
    flex: 1;
}

/* List Items */
.dropdown-item, .window-item, .ide-session-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    font-family: var(--font-main);
    font-size: 12px;
    color: var(--text-main);
}

.dropdown-item:hover, .window-item:hover, .ide-session-item:hover {
    background: var(--bg-hover);
}

.dropdown-item.active {
    background: var(--bg-active);
    border-left: 3px solid var(--accent);
}

.modal-option {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    font-family: var(--font-main);
    font-size: 12px;
    color: var(--text-main);
}

.modal-option:hover {
    background: var(--bg-hover);
}

.modal-option.active {
    background: var(--bg-active);
    border-left: 3px solid var(--accent);
}

.modal-option.active:hover {
    background: rgba(var(--accent-rgb), 0.18);
}

.modal-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 12px;
}

.ide-session-item.active {
    background: var(--bg-active);
    border-left: 3px solid var(--accent);
}

/* Brand Icons */
.ide-brand-icon, .ide-session-icon {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    background: var(--bg-input);
}

/* --- Dropdowns --- */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: var(--bg-panel-strong);
    border: 1px solid var(--border);
    border-radius: 18px;
    min-width: 240px;
    max-width: min(360px, calc(100vw - 32px));
    max-height: min(60vh, 420px);
    overflow-y: auto;
    z-index: 730;
    box-shadow: var(--shadow-panel);
    color: var(--text-main);
    backdrop-filter: var(--panel-backdrop);
    isolation: isolate;
}

/* Model dropdown should open upward from composer bar */
#modelDropdown {
    top: auto;
    bottom: 100%;
    left: 0;
    margin-top: 0;
    margin-bottom: 6px;
}

.dropdown-header {
    padding: 8px 12px;
    font-size: 10px;
    font-family: var(--font-main);
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.06) 0%, transparent 100%);
}

/* --- Empty States --- */
.empty-state, .ide-empty {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 12px;
}

.dropdown-empty {
    padding: 14px 12px;
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 11px;
    text-align: center;
}

.modal-panel input,
.modal-panel textarea,
.ide-modal-sheet input,
.ide-modal-sheet textarea {
    background: var(--bg-input);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 12px;
    font-family: var(--font-main);
    outline: none;
    box-shadow: none;
}

.modal-panel input:focus,
.modal-panel textarea:focus,
.ide-modal-sheet input:focus,
.ide-modal-sheet textarea:focus {
    border-color: var(--border-highlight);
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12);
}

/* --- Scrollbars --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-app);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

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

/* --- IDE Modal Styles --- */
.ide-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.ide-modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ide-modal-refresh,
.ide-modal-close {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.ide-modal-refresh:hover,
.ide-modal-close:hover {
    border-color: var(--border-highlight);
    color: var(--accent);
    background: var(--bg-hover);
}

/* --- IDE Brand Header --- */
.ide-brand-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.05) 0%, transparent 100%);
    border-bottom: 1px solid var(--border);
    width: 100%;
}

.ide-brand-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.ide-brand-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    background: var(--bg-input);
    overflow: hidden;
}

.ide-brand-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ide-brand-name {
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.ide-brand-count {
    font-family: var(--font-main);
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-elevated);
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
}

/* --- IDE Instance Group --- */
.ide-instance-group {
    border-bottom: 1px solid var(--border);
}

.ide-instance-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px;
    background: var(--bg-tertiary);
    width: 100%;
}

.ide-instance-header.clickable {
    cursor: pointer;
    transition: background 0.15s;
}

.ide-instance-header.clickable:hover {
    background: var(--bg-hover);
}

.ide-instance-header.active-inst {
    background: var(--bg-active);
}

.ide-instance-name {
    font-family: var(--font-main);
    font-size: 12px;
    color: var(--text-main);
    flex: 1;
}

.ide-instance-badge {
    font-family: var(--font-main);
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg-elevated);
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid var(--border);
}

.ide-instance-count {
    font-family: var(--font-main);
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg-elevated);
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid var(--border);
}

/* --- IDE Session Item --- */
.ide-session-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px 10px 32px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border);
}

.ide-session-item:hover {
    background: var(--bg-hover);
}

.ide-session-item.active {
    background: var(--bg-active);
    border-left: 3px solid var(--accent);
    padding-left: 29px;
}

.ide-session-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    background: var(--bg-input);
    overflow: hidden;
    flex-shrink: 0;
}

.ide-session-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ide-session-icon-text {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: bold;
}

.ide-session-name {
    font-family: var(--font-main);
    font-size: 12px;
    color: var(--text-main);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ide-session-check {
    width: 16px;
    height: 16px;
    color: var(--accent);
    flex-shrink: 0;
}

/* --- IDE Divider --- */
.ide-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

/* --- Snapshot Image Lightbox --- */
.snapshot-image-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 600;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 40px;
}

.snapshot-image-lightbox.show {
    display: flex;
}

.snapshot-image-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 14px;
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 12px;
    transition: all 0.2s;
    z-index: 601;
}

.snapshot-image-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.snapshot-image-lightbox-img {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.snapshot-image-lightbox-caption {
    margin-top: 16px;
    font-family: var(--font-main);
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    max-width: 80%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Body lock when lightbox is open */
body.snapshot-lightbox-open {
    overflow: hidden;
}

/* --- History Layer --- */
.history-layer {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(100%, var(--max-content-width));
    background: linear-gradient(180deg, var(--bg-app-secondary) 0%, var(--bg-app) 100%);
    z-index: 710;
    display: none;
    flex-direction: column;
    max-width: var(--max-content-width);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow-panel);
}

@media (max-width: 920px) {
    .history-layer {
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        transform: none;
        width: 100%;
        max-width: 100%;
        border-left: none;
        border-right: none;
    }
}

.history-layer.show {
    display: flex;
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-panel);
    backdrop-filter: var(--panel-backdrop);
}

.history-header h2 {
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.history-header .icon-btn {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-control);
}

.history-header .icon-btn:hover {
    border-color: var(--border-highlight);
    color: var(--accent);
    background: var(--bg-hover);
}

.history-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.history-search-wrap {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 8px 8px 4px;
    background: linear-gradient(180deg, var(--bg-panel-strong) 0%, rgba(var(--accent-rgb), 0.03) 100%);
    backdrop-filter: var(--panel-backdrop);
}

.history-search-field {
    position: relative;
}

.history-search-input {
    width: 100%;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0 38px 0 12px;
    outline: none;
    color: var(--text-main);
    background: var(--bg-input);
    font-family: var(--font-main);
    font-size: 12px;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    box-shadow: var(--shadow-control);
}

.history-search-input:focus {
    border-color: var(--border-highlight);
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12);
    background: var(--bg-input);
}

.history-search-btn {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 4px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: transparent;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}

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

.history-search-btn svg {
    width: 14px;
    height: 14px;
    pointer-events: none;
}

.history-section-title {
    margin: 12px 12px 8px;
    font-family: var(--font-main);
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    opacity: 0.95;
}

.history-item {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.15s;
    background: var(--bg-panel);
    box-shadow: var(--shadow-control);
    backdrop-filter: var(--panel-backdrop);
}

.history-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.history-item-main {
    min-width: 0;
    flex: 1;
}

.history-item:hover {
    border-color: var(--border-highlight);
    background: var(--bg-hover);
}

.history-item-title {
    font-family: var(--font-main);
    font-size: 12px;
    color: var(--text-main);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item-subtitle {
    font-family: var(--font-main);
    font-size: 10px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item-time {
    font-family: var(--font-main);
    font-size: 10px;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-left: 8px;
}

.history-show-more {
    margin: 0 12px 10px;
    border: 1px dashed var(--border);
    border-radius: 16px;
    padding: 8px 10px;
    text-align: center;
    font-family: var(--font-main);
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    background: var(--bg-elevated);
}

.history-show-more:hover {
    border-color: var(--border-highlight);
    color: var(--accent);
    background: var(--bg-hover);
}

/* Prevent injected remote snapshot styles from blowing up history-layer icons */
.history-layer svg {
    width: 16px;
    height: 16px;
    max-width: 16px;
    max-height: 16px;
}



.claude-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 740;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px 14px;
    background: var(--overlay-scrim);
    backdrop-filter: var(--panel-backdrop);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.claude-sheet-overlay.show {
    display: flex !important;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.claude-sheet {
    width: min(460px, calc(100vw - 28px));
    max-height: min(78vh, 640px);
    border: 1px solid var(--border);
    border-radius: var(--radius-panel);
    background: linear-gradient(180deg, var(--bg-panel-strong) 0%, var(--bg-panel) 100%);
    box-shadow: var(--shadow-panel);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.96) translateY(12px);
    opacity: 0;
    transition: transform 0.18s ease, opacity 0.18s ease;
    backdrop-filter: var(--panel-backdrop);
}

.claude-sheet-overlay.show .claude-sheet {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.claude-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 14px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.06) 0%, transparent 100%);
}

.claude-sheet-header-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.claude-sheet-title-wrap {
    min-width: 0;
}

.claude-sheet-title {
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: 0.01em;
}

.claude-sheet-subtitle {
    margin-top: 5px;
    font-family: var(--font-main);
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.45;
}

.claude-sheet-back,
.claude-sheet-close {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
    box-shadow: var(--shadow-control);
}

.claude-sheet-back:hover,
.claude-sheet-close:hover,
.claude-sheet-back:focus-visible,
.claude-sheet-close:focus-visible {
    border-color: var(--border-highlight);
    background: var(--bg-hover);
    color: var(--accent);
    outline: none;
}

.claude-sheet-search {
    display: none;
    padding: 12px 18px 0;
}

.claude-sheet-search.is-visible {
    display: block;
}

.claude-sheet-search input {
    width: 100%;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-input);
    color: var(--text-main);
    padding: 0 12px;
    outline: none;
    font-family: var(--font-main);
    font-size: 12px;
    box-shadow: var(--shadow-control);
}

.claude-sheet-search input:focus {
    border-color: var(--border-highlight);
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12);
}

.claude-sheet-body {
    overflow-y: auto;
    padding: 16px 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.claude-sheet-item {
    width: 100%;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-panel) 100%);
    border-radius: 18px;
    padding: 14px 15px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    text-align: left;
    cursor: pointer;
    font-family: var(--font-main);
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.claude-sheet-item:hover,
.claude-sheet-item:focus-visible {
    border-color: var(--border-highlight);
    background: linear-gradient(180deg, var(--bg-hover) 0%, var(--bg-panel) 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-control);
    outline: none;
}

.claude-sheet-item.is-active {
    border-color: var(--border-highlight);
    background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.16) 0%, var(--bg-panel) 100%);
}

.claude-sheet-item.is-disabled {
    opacity: 0.68;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.claude-sheet-item-copy {
    min-width: 0;
    flex: 1;
}

.claude-sheet-item-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.35;
}

.claude-sheet-item-desc {
    display: block;
    margin-top: 5px;
    font-size: 11px;
    line-height: 1.45;
    color: var(--text-muted);
}

.claude-sheet-item-trailing {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.claude-sheet-item-meta {
    font-size: 10px;
    color: var(--accent);
    letter-spacing: 0.1em;
    flex-shrink: 0;
}

.claude-sheet-item-check {
    font-size: 18px;
    line-height: 1;
    color: var(--accent);
}

.claude-sheet-switch {
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.32);
    position: relative;
    transition: background 0.16s ease;
    box-shadow: inset 0 0 0 1px var(--border);
}

.claude-sheet-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-inverse);
    transition: transform 0.16s ease;
    box-shadow: 0 2px 10px rgba(2, 6, 23, 0.35);
}

.claude-sheet-item.is-active .claude-sheet-switch {
    background: linear-gradient(90deg, var(--accent) 0%, #5ac8fa 100%);
}

.claude-sheet-item.is-active .claude-sheet-switch::after {
    transform: translateX(18px);
}

.claude-sheet-empty {
    padding: 22px 14px;
    text-align: center;
    font-family: var(--font-main);
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    border-radius: 18px;
    background: var(--bg-elevated);
}

body.claude-slash-active {
    overflow: hidden;
}

body.claude-dialog-active {
    overflow: hidden;
}

.claude-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 650;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px 14px;
    background: rgba(1, 4, 12, 0.9);
    backdrop-filter: blur(10px);
}

.claude-dialog-overlay.show {
    display: flex;
}

.claude-dialog-sheet {
    width: min(520px, calc(100vw - 28px));
    max-height: min(82vh, 680px);
    border: 1px solid rgba(125, 211, 252, 0.28);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(10, 15, 28, 0.99) 0%, rgba(15, 23, 42, 1) 100%);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(15, 23, 42, 0.35);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.claude-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.72) 0%, rgba(15, 23, 42, 0.24) 100%);
}

.claude-dialog-title-wrap {
    min-width: 0;
    flex: 1;
}

.claude-dialog-title {
    font-family: var(--font-main);
    font-size: 24px;
    font-weight: 700;
    color: #f8fbff;
    line-height: 1.2;
}

.claude-dialog-subtitle {
    margin-top: 8px;
    font-family: var(--font-main);
    font-size: 14px;
    line-height: 1.55;
    color: #d4deee;
}

.claude-dialog-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.72);
    color: #dbe7ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.claude-dialog-body {
    padding: 16px 18px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.claude-dialog-line {
    font-family: var(--font-main);
    font-size: 14px;
    line-height: 1.6;
    color: #d4deee;
}

.claude-dialog-actions {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.claude-dialog-action {
    width: 100%;
    min-height: 48px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.9);
    color: #f8fbff;
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    padding: 12px 14px;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.claude-dialog-action.is-primary {
    background: linear-gradient(180deg, rgba(19, 78, 141, 0.86) 0%, rgba(29, 78, 216, 0.92) 100%);
    border-color: rgba(96, 165, 250, 0.72);
}

.claude-dialog-action.is-secondary {
    background: rgba(30, 41, 59, 0.88);
}

[data-claude-popup-overlay="1"] {
    display: none !important;
}

[data-snapshot-source="claudecode"] [role="menu"],
[data-snapshot-source="claudecode"] [role="listbox"],
[data-snapshot-source="claudecode"] [data-radix-popper-content-wrapper],
[data-snapshot-source="claudecode"] [class*="context-menu"],
[data-snapshot-source="claudecode"] [class*="popover"] {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}
