:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a2332;
    --bg-input: #0f1a2e;
    --bg-user-msg: #1e3a5f;
    --bg-assistant-msg: #1a2332;
    --border: #1e3a5f;
    --border-active: #3b82f6;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.3);
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --quantum-purple: #8b5cf6;
    --quantum-cyan: #06b6d4;
}

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

body {
    font-family: 'Google Sans Text', 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    font-variation-settings: 'GRAD' -35;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
}

.content-row {
    display: flex;
    flex: 1;
    min-height: 0;
}

.main-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.history-sidebar {
    width: 56px;
    min-width: 56px;
    background: linear-gradient(180deg, rgba(13, 17, 28, 0.45) 0%, rgba(15, 23, 42, 0.4) 40%, rgba(20, 27, 50, 0.35) 100%);
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    border-right: 1px solid rgba(59, 130, 246, 0.12);
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease, min-width 0.25s ease;
    z-index: 30;
    position: relative;
    flex-shrink: 0;
}

.history-sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--accent), var(--quantum-purple), var(--quantum-cyan), transparent);
    opacity: 0.4;
}

.history-sidebar:hover {
    width: 280px;
    min-width: 280px;
}

.sidebar-header {
    padding: 10px 0;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
}

.history-sidebar:hover .sidebar-header {
    padding: 10px 12px;
}

.sidebar-new-chat {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.12);
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Google Sans', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.history-sidebar:hover .sidebar-new-chat {
    width: 100%;
    justify-content: flex-start;
    padding: 0 12px;
    gap: 10px;
}

.sidebar-new-chat svg {
    flex-shrink: 0;
}

.sidebar-new-chat:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
}

.sidebar-label {
    display: none;
}

.history-sidebar:hover .sidebar-label {
    display: inline;
}

.sidebar-search {
    padding: 0 8px 8px;
    flex-shrink: 0;
    display: none;
}

.history-sidebar:hover .sidebar-search {
    display: block;
}

.sidebar-search-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    background: rgba(15, 26, 46, 0.6);
}

.sidebar-search-wrap:focus-within {
    border-color: rgba(59, 130, 246, 0.3);
}

.sidebar-search-wrap svg {
    flex-shrink: 0;
    color: var(--text-muted);
}

.sidebar-search-input {
    flex: 1;
    border: none;
    background: none;
    color: var(--text-primary);
    font-size: 12px;
    font-family: inherit;
    outline: none;
    padding: 0;
    min-width: 0;
}

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

.sidebar-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: none;
}

.history-sidebar:hover .sidebar-list {
    display: block;
    padding: 0 8px 12px;
}

.sidebar-list::-webkit-scrollbar {
    width: 3px;
}

.sidebar-list::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.2);
    border-radius: 3px;
}

.sidebar-empty {
    padding: 16px 12px;
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
    white-space: nowrap;
}

.sidebar-chat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 2px;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.sidebar-chat-item:hover {
    background: rgba(59, 130, 246, 0.08);
}

.sidebar-chat-item.active {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.sidebar-chat-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent);
}

.sidebar-chat-info {
    flex: 1;
    min-width: 0;
}

.sidebar-chat-title {
    font-size: 13px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-chat-meta {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

.sidebar-chat-delete {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.15s;
}

.sidebar-chat-item:hover .sidebar-chat-delete {
    opacity: 0.6;
}

.sidebar-chat-delete:hover {
    opacity: 1 !important;
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

.bg-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.bg-layer.active {
    opacity: 1;
}

.space-bg {
    background: url('/static/space-bg.png') center center / cover no-repeat;
    opacity: 0;
    animation: spaceDrift 60s linear infinite;
}

.space-bg.active {
    opacity: 0.3;
}

.lava-bg {
    width: 100vw;
    height: 100vh;
}

@keyframes spaceDrift {
    0% { transform: scale(1.05) translate(0, 0); }
    25% { transform: scale(1.08) translate(-1%, -0.5%); }
    50% { transform: scale(1.05) translate(-0.5%, -1%); }
    75% { transform: scale(1.08) translate(0.5%, -0.5%); }
    100% { transform: scale(1.05) translate(0, 0); }
}

.space-gradient-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(10, 14, 23, 0.8) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 100%, rgba(10, 14, 23, 0.9) 0%, transparent 50%),
        linear-gradient(180deg, rgba(10, 14, 23, 0.6) 0%, rgba(10, 14, 23, 0.3) 40%, rgba(10, 14, 23, 0.6) 100%);
}

.app-header {
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(59, 130, 246, 0.15);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    z-index: 20;
    position: relative;
}

.app-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--quantum-purple), var(--quantum-cyan), transparent);
    opacity: 0.5;
}

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

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

.header-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.2));
    transition: filter 0.3s ease;
}

.header-logo:hover {
    filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.4));
}

.header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.05);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.header-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    opacity: 0;
    transition: opacity 0.25s ease;
}

.header-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--text-primary);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.15), inset 0 0 16px rgba(59, 130, 246, 0.05);
    transform: translateY(-1px);
}

.header-btn:hover::before {
    opacity: 1;
}

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

.settings-panel {
    position: fixed;
    top: 0;
    right: -380px;
    width: 380px;
    height: 100vh;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(59, 130, 246, 0.15);
    z-index: 100;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 32px rgba(0,0,0,0.4);
}

.settings-panel.open {
    right: 0;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.settings-header h3 {
    font-size: 16px;
    font-weight: 700;
    font-family: 'Google Sans', sans-serif;
}

.settings-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.15s;
}

.settings-close:hover {
    color: var(--text-primary);
}

.settings-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.settings-section {
    margin-bottom: 24px;
}

.settings-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--quantum-cyan);
}

.settings-section-header h4 {
    font-size: 13px;
    font-weight: 700;
    font-family: 'Google Sans', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.setting-row {
    margin-bottom: 16px;
}

.setting-row label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.setting-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-control input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    border-radius: 2px;
    outline: none;
}

.setting-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--quantum-purple));
    cursor: pointer;
    border: 2px solid var(--bg-secondary);
    box-shadow: 0 0 6px var(--accent-glow);
}

.slider-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--accent);
    min-width: 48px;
    text-align: right;
    font-weight: 500;
}

.setting-hint {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.setting-select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    transition: border-color 0.15s;
}

.setting-select:focus {
    border-color: var(--border-active);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.setting-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.setting-select option:disabled {
    color: var(--text-muted);
}

.depth-buttons {
    display: flex;
    gap: 4px;
}

.depth-btn {
    flex: 1;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.depth-btn:hover {
    border-color: var(--border-active);
    color: var(--text-primary);
}

.depth-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--quantum-purple));
    color: white;
    border-color: transparent;
}

.bg-picker {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.bg-option {
    flex: 1;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 10px;
    border: 2px solid var(--border);
    background: rgba(17, 24, 39, 0.5);
    cursor: pointer;
    transition: all 0.25s ease;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    font-family: 'Google Sans', sans-serif;
}

.bg-option:hover {
    border-color: var(--border-active);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.bg-option.active {
    border-color: var(--accent);
    color: var(--text-primary);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.2);
}

.bg-option-preview {
    width: 100%;
    height: 56px;
    border-radius: 6px;
    overflow: hidden;
}

.bg-preview-space {
    background: url('/static/space-bg.png') center center / cover no-repeat;
}

.bg-preview-lava {
    background: linear-gradient(160deg, #0a0e17 0%, #1a0a2e 25%, #2d1b69 40%, #1e3a5f 55%, #0a2540 70%, #0d1117 100%);
    position: relative;
    overflow: hidden;
}

.bg-preview-lava::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 40% 50% at 30% 60%, rgba(139, 92, 246, 0.6), transparent),
        radial-gradient(ellipse 35% 45% at 70% 35%, rgba(59, 130, 246, 0.5), transparent),
        radial-gradient(ellipse 30% 40% at 50% 80%, rgba(6, 182, 212, 0.4), transparent);
    animation: lavaPreview 4s ease-in-out infinite alternate;
}

@keyframes lavaPreview {
    0% { transform: scale(1) translateY(0); }
    100% { transform: scale(1.1) translateY(-3px); }
}

.settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    display: none;
}

.settings-overlay.open {
    display: block;
}

.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    position: relative;
    z-index: 2;
}

.welcome-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 180px);
    padding: 40px 24px;
    text-align: center;
}

.welcome-logo {
    width: 220px;
    height: auto;
    object-fit: contain;
    margin-bottom: 20px;
    filter: drop-shadow(0 8px 32px rgba(59, 130, 246, 0.3));
}

.welcome-title {
    font-family: 'Google Sans', sans-serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
    background: linear-gradient(135deg, var(--accent), var(--quantum-purple), var(--quantum-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 10px 0;
}

.welcome-container > p {
    color: var(--text-primary);
    font-size: 14px;
    max-width: 500px;
    line-height: 1.6;
    margin-bottom: 28px;
    opacity: 0.85;
}

.example-prompts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 640px;
    width: 100%;
}

.example-btn {
    padding: 16px 18px;
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 12px;
    background: rgba(26, 35, 50, 0.6);
    backdrop-filter: blur(8px);
    color: var(--text-primary);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1.5;
    position: relative;
    overflow: hidden;
}

.example-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(139, 92, 246, 0.2), rgba(6, 182, 212, 0.3));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.example-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(59, 130, 246, 0.08) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.example-btn .tile-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.1));
    margin-bottom: 10px;
    color: var(--quantum-cyan);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.example-btn:hover {
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--text-primary);
    background: rgba(26, 35, 50, 0.8);
    transform: translateY(-3px);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(59, 130, 246, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.example-btn:hover::before {
    opacity: 1;
}

.example-btn:hover::after {
    opacity: 1;
}

.example-btn:hover .tile-icon {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(139, 92, 246, 0.2));
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.2);
}

.example-btn:active {
    transform: translateY(-1px);
}

.messages {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
}

.message {
    margin-bottom: 24px;
    animation: fadeIn 0.3s ease-out;
}

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

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

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

.message-avatar.assistant {
    width: 32px;
    height: 32px;
    background: transparent;
    border-radius: 8px;
    padding: 0;
    object-fit: contain;
}

.message-avatar.assistant.spinning {
    animation: orbit-spin 2s ease-in-out infinite;
    transform-style: preserve-3d;
}

@keyframes orbit-spin {
    0% {
        transform: perspective(120px) rotateY(0deg) rotateX(8deg);
    }
    50% {
        transform: perspective(120px) rotateY(180deg) rotateX(-8deg);
    }
    100% {
        transform: perspective(120px) rotateY(360deg) rotateX(8deg);
    }
}

.message-sender {
    font-size: 13px;
    font-weight: 500;
    font-family: 'Google Sans', 'Google Sans Text', sans-serif;
}

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

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

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

.message-content strong {
    color: var(--accent);
    font-weight: 600;
}

.message-content code {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.message-content pre {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.5;
}

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

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

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

.thinking-chain {
    padding-left: 36px;
    margin-top: 8px;
}

.thinking-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
    position: relative;
}

.thinking-step::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 22px;
    bottom: -6px;
    width: 1px;
    background: var(--border);
}

.thinking-step:last-child::before {
    display: none;
}

.thinking-step-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 10px;
    position: relative;
    z-index: 1;
}

.thinking-step-icon.pending {
    background: var(--bg-card);
    border: 2px solid var(--border);
    color: var(--text-muted);
}

.thinking-step-icon.active {
    background: var(--accent);
    border: 2px solid var(--accent);
    color: white;
    animation: pulseIcon 1.5s ease-in-out infinite;
}

.thinking-step-icon.done {
    background: var(--success);
    border: 2px solid var(--success);
    color: white;
}

@keyframes pulseIcon {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
}

.thinking-step-content {
    flex: 1;
    min-width: 0;
}

.thinking-step-label {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 20px;
}

.thinking-step.active .thinking-step-label {
    color: var(--text-primary);
    font-weight: 500;
}

.thinking-step.done .thinking-step-label {
    color: var(--text-muted);
}

.thinking-step-detail {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    margin-top: 2px;
    word-break: break-all;
}

.response-section {
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 12px;
    margin: 12px 0;
    overflow: hidden;
    background: rgba(17, 24, 39, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    animation: sectionFadeIn 0.4s ease-out both;
}

.response-section.quantum {
    animation-delay: 0.05s;
}

.response-section.ai {
    animation-delay: 0.15s;
}

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

.response-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Google Sans', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.response-section-header .section-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}

.response-section.quantum .response-section-header {
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.1), rgba(139, 92, 246, 0.05));
    color: var(--quantum-cyan);
    border-bottom: 1px solid rgba(6, 182, 212, 0.2);
}

.response-section.quantum .section-icon {
    background: linear-gradient(135deg, var(--quantum-cyan), var(--quantum-purple));
    color: white;
}

.response-section.quantum .section-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--quantum-cyan);
    animation: pulse 2s ease-in-out infinite;
    margin-left: auto;
}

.response-section.ai .response-section-header {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.05));
    color: var(--accent);
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.response-section.ai .section-icon {
    background: linear-gradient(135deg, var(--accent), var(--quantum-purple));
    color: white;
}

.response-section-body {
    padding: 14px;
    background: rgba(10, 14, 23, 0.3);
}

.quantum-result-card {
    background: rgba(26, 35, 50, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 20px;
    margin: 10px 0;
    position: relative;
    overflow: hidden;
    animation: quantumCardFadeIn 0.5s ease-out both;
}

.quantum-result-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 15px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.4), rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.3), rgba(6, 182, 212, 0.2));
    background-size: 200% 200%;
    animation: quantumBorderShift 8s ease infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.quantum-result-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.5), rgba(139, 92, 246, 0.3), transparent);
    pointer-events: none;
}

@keyframes quantumCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.quantum-result-card h4 {
    font-size: 13px;
    color: var(--quantum-cyan);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(6, 182, 212, 0.12);
}

.quantum-result-card h4::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--quantum-cyan);
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.5);
}

.quantum-chart-container {
    position: relative;
    width: 100%;
    height: 260px;
    margin: 14px 0;
    padding: 10px;
    background: rgba(10, 14, 23, 0.5);
    border: 1px solid rgba(59, 130, 246, 0.08);
    border-radius: 10px;
    animation: chartFadeIn 0.6s ease-out 0.2s both;
}

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

.quantum-chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

.quantum-chart-container.quantum-chart-small {
    height: 220px;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.result-bar-row {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    gap: 8px;
}

.result-bar-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    width: 70px;
    text-align: right;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.result-bar-track {
    flex: 1;
    height: 20px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
}

.result-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent), var(--quantum-purple));
    transition: width 0.5s ease-out;
}

.result-bar-fill.low {
    background: var(--border);
}

.result-bar-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    width: 50px;
    text-align: right;
    color: var(--text-muted);
    flex-shrink: 0;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(59, 130, 246, 0.08);
}

.result-stat {
    background: rgba(15, 26, 46, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.08);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    transition: all 0.2s ease;
    animation: statFadeIn 0.4s ease-out both;
}

.result-stat:nth-child(1) { animation-delay: 0.1s; }
.result-stat:nth-child(2) { animation-delay: 0.15s; }
.result-stat:nth-child(3) { animation-delay: 0.2s; }
.result-stat:nth-child(4) { animation-delay: 0.25s; }
.result-stat:nth-child(5) { animation-delay: 0.3s; }
.result-stat:nth-child(6) { animation-delay: 0.35s; }

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

.result-stat:hover {
    background: rgba(15, 26, 46, 0.8);
    border-color: rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.result-stat-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 13px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.1));
    color: var(--quantum-cyan);
}

.result-stat-content {
    flex: 1;
    min-width: 0;
}

.result-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.result-stat-value {
    font-size: 15px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent);
    margin-top: 3px;
}

.result-stat-value.prob-high {
    color: var(--success);
}

.result-stat-value.prob-medium {
    color: var(--warning);
}

.result-stat-value.prob-low {
    color: var(--error);
}

.thinking-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 36px;
    color: var(--text-muted);
    font-size: 13px;
}

.thinking-dots {
    display: flex;
    gap: 4px;
}

.thinking-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: thinking 1.4s ease-in-out infinite;
}

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

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

.input-area {
    padding: 16px 24px 20px;
    border-top: none;
    background: transparent;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.file-preview-area {
    max-width: 800px;
    margin: 0 auto 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 14px;
}

.file-preview-area:empty {
    display: none;
}

.file-preview-area:not(:empty) {
    margin-bottom: 8px;
}

.file-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 12px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 10px;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.25s ease-out;
    max-width: 280px;
}

.file-chip-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--quantum-cyan);
}

.file-chip-info {
    flex: 1;
    min-width: 0;
}

.file-chip-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-chip-size {
    font-size: 10px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.file-chip-remove {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
    padding: 0;
}

.file-chip-remove:hover {
    background: rgba(239, 68, 68, 0.25);
    color: var(--error);
}

.file-chip-progress {
    width: 100%;
    height: 2px;
    background: var(--border);
    border-radius: 1px;
    margin-top: 4px;
    overflow: hidden;
}

.file-chip-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--quantum-cyan));
    border-radius: 1px;
    transition: width 0.3s ease;
}

.attach-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.attach-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
}

.attach-btn.has-file {
    color: var(--quantum-cyan);
}

.input-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 26, 46, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid transparent;
    border-radius: 16px;
    padding: 8px 14px;
    transition: all 0.3s ease;
    position: relative;
}

.input-container::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 17px;
    padding: 1px;
    background: linear-gradient(135deg, var(--accent), var(--quantum-purple), var(--quantum-cyan), var(--accent));
    background-size: 300% 300%;
    animation: gradientShift 6s ease infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.35;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

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

.input-container:focus-within {
    box-shadow:
        0 0 20px rgba(59, 130, 246, 0.1),
        0 0 40px rgba(59, 130, 246, 0.05),
        0 4px 16px rgba(0, 0, 0, 0.2);
    background: rgba(15, 26, 46, 0.9);
}

.input-container:focus-within::before {
    opacity: 0.7;
}

.input-container textarea {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    line-height: 1.5;
    max-height: 150px;
    padding: 0;
    margin: 0;
    vertical-align: middle;
}

.input-container textarea::placeholder {
    color: var(--text-muted);
}

.send-btn {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--quantum-purple));
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.send-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--quantum-purple), var(--quantum-cyan));
    opacity: 0;
    transition: opacity 0.25s ease;
    border-radius: 10px;
}

.send-btn svg {
    position: relative;
    z-index: 1;
}

.send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px var(--accent-glow), 0 0 24px rgba(139, 92, 246, 0.2);
}

.send-btn:hover::after {
    opacity: 1;
}

.send-btn:active:not(:disabled) {
    transform: scale(0.88);
    box-shadow: 0 0 20px var(--accent-glow), 0 0 40px rgba(139, 92, 246, 0.3);
}

.send-btn.sending {
    animation: sendPulse 0.6s ease-out;
}

@keyframes sendPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5);
    }
    30% {
        transform: scale(0.85);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 0 12px rgba(59, 130, 246, 0), 0 4px 20px var(--accent-glow);
    }
    70% {
        transform: scale(0.97);
    }
    100% {
        transform: scale(1);
        box-shadow: none;
    }
}

.send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.send-btn:disabled::after {
    opacity: 0;
}

.input-hint {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    opacity: 0.7;
}

.run-quantum-wrap {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(139, 92, 246, 0.15);
    display: flex;
    justify-content: center;
}

.run-quantum-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(59, 130, 246, 0.08));
    color: #a78bfa;
    font-size: 13px;
    font-family: 'Google Sans', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.run-quantum-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(59, 130, 246, 0.15));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.run-quantum-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(59, 130, 246, 0.15));
    border-color: rgba(139, 92, 246, 0.5);
    color: #c4b5fd;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.2), 0 0 30px rgba(139, 92, 246, 0.08);
}

.run-quantum-btn:hover:not(:disabled)::before {
    opacity: 1;
}

.run-quantum-btn:active:not(:disabled) {
    transform: translateY(0);
}

.run-quantum-btn:disabled {
    cursor: default;
}

.run-quantum-btn svg {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.download-report-wrap {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(59, 130, 246, 0.1);
    display: flex;
    justify-content: flex-end;
}

.download-report-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.08);
    color: var(--text-secondary);
    font-size: 12px;
    font-family: 'Google Sans', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.download-report-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.1));
    opacity: 0;
    transition: opacity 0.25s ease;
}

.download-report-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15), 0 0 20px rgba(59, 130, 246, 0.08);
}

.download-report-btn:hover::before {
    opacity: 1;
}

.download-report-btn:active {
    transform: translateY(0);
}

.download-report-btn svg {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.follow-up-suggestions {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(59, 130, 246, 0.1);
}

.follow-up-label {
    font-size: 11px;
    font-weight: 700;
    font-family: 'Google Sans', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.follow-up-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.follow-up-btn {
    padding: 8px 14px;
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 10px;
    background: rgba(17, 24, 39, 0.5);
    backdrop-filter: blur(8px);
    color: var(--text-secondary);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    line-height: 1.4;
    text-align: left;
    max-width: 100%;
}

.follow-up-btn:hover {
    border-color: rgba(59, 130, 246, 0.35);
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), 0 0 12px rgba(59, 130, 246, 0.1);
}

.follow-up-btn:active {
    transform: translateY(0);
}

.mode-toggle-row {
    max-width: 800px;
    margin: 0 auto 6px;
    display: flex;
    justify-content: flex-end;
    padding: 0 14px;
}

.mode-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mode-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
}

.mode-toggle-track {
    width: 32px;
    height: 18px;
    border-radius: 9px;
    background: rgba(100, 116, 139, 0.3);
    border: 1px solid rgba(100, 116, 139, 0.3);
    position: relative;
    transition: all 0.25s ease;
    display: inline-block;
}

.mode-toggle.active .mode-toggle-track {
    background: rgba(245, 158, 11, 0.25);
    border-color: rgba(245, 158, 11, 0.5);
}

.mode-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all 0.25s ease;
}

.mode-toggle.active .mode-toggle-thumb {
    left: 16px;
    background: var(--warning);
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

.mode-toggle-label {
    font-size: 11px;
    letter-spacing: 0.3px;
    color: var(--text-muted);
    transition: color 0.2s;
}

.mode-toggle.active .mode-toggle-label {
    color: var(--warning);
}


.simulation-plan-card {
    background: rgba(26, 35, 50, 0.8);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    padding: 0;
    margin: 8px 0 14px;
    overflow: hidden;
    animation: planCardIn 0.4s ease-out;
    position: relative;
}

.simulation-plan-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--warning), #d97706, var(--warning));
}

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

.plan-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(245, 158, 11, 0.06);
    border-bottom: 1px solid rgba(245, 158, 11, 0.12);
}

.plan-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--warning);
}

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

.plan-title {
    font-size: 14px;
    font-weight: 600;
    font-family: 'Google Sans', sans-serif;
    color: var(--text-primary);
}

.plan-algo {
    font-size: 12px;
    color: var(--warning);
    text-transform: capitalize;
    margin-top: 2px;
}

.plan-confidence {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.plan-confidence-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
}

.plan-params-table {
    padding: 12px 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 6px;
    border-bottom: 1px solid rgba(245, 158, 11, 0.08);
}

.plan-param-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: rgba(15, 26, 46, 0.5);
    border-radius: 6px;
    border: 1px solid rgba(245, 158, 11, 0.08);
}

.plan-param-key {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: capitalize;
}

.plan-param-val {
    font-size: 12px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    color: var(--warning);
}

.plan-section {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(245, 158, 11, 0.06);
}

.plan-section:last-of-type {
    border-bottom: none;
}

.plan-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.plan-section-text {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.plan-actions {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(10, 14, 23, 0.3);
}

.plan-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Google Sans', sans-serif;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid transparent;
}

.plan-btn-run {
    background: linear-gradient(135deg, var(--warning), #d97706);
    color: #1a1a2e;
    border: none;
}

.plan-btn-run:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3), 0 0 20px rgba(245, 158, 11, 0.15);
}

.plan-btn-run:active {
    transform: translateY(0);
}

.plan-btn-run:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.plan-btn-modify {
    background: rgba(245, 158, 11, 0.08);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.plan-btn-modify:hover {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
    transform: translateY(-1px);
}

.plan-btn-modify:active {
    transform: translateY(0);
}

.plan-btn-modify:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 640px) {
    .example-prompts {
        grid-template-columns: 1fr;
    }
    .app-header {
        padding: 12px 16px;
    }
    .messages {
        padding: 16px;
    }
    .input-area {
        padding: 12px 16px 16px;
    }
    .settings-panel {
        width: 100%;
        right: -100%;
    }
    .history-sidebar {
        width: 0;
        min-width: 0;
        border: none;
    }
    .history-sidebar:hover {
        width: 260px;
        min-width: 260px;
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        box-shadow: 8px 0 32px rgba(0,0,0,0.5);
    }
}
