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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a1a;
    color: #e0e0e0;
    height: 100vh;
    overflow: hidden;
}

.screen {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none !important;
}

/* ── Login ── */

.login-container {
    text-align: center;
    width: 100%;
    max-width: 320px;
    padding: 0 20px;
}

.login-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    background: radial-gradient(circle, #1e3a5f, #0d1b2a);
    border: 2px solid #1a5276;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
    color: #00d4ff;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.15);
}

.login-title {
    font-size: 24px;
    font-weight: 300;
    color: #c0c0c0;
    margin-bottom: 32px;
    letter-spacing: 4px;
    text-transform: uppercase;
}

#login-form input {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: #111122;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

#login-form input:focus {
    border-color: #00d4ff;
}

#login-form input::placeholder {
    color: #555;
}

#login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #1a3a5c, #0d4a6b);
    border: 1px solid #1a5276;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
}

#login-btn:hover {
    background: linear-gradient(135deg, #1e4a6c, #0d5a8b);
    border-color: #00d4ff;
}

#login-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.error-text {
    color: #ff4757;
    font-size: 13px;
    margin-top: 12px;
    min-height: 20px;
}

/* ── Main Screen (flex row) ── */

#main-screen {
    align-items: stretch;
    justify-content: flex-start;
    background: #0a0a1a;
    flex-direction: row;
}

/* ── Sidebar ── */

.sidebar {
    width: 280px;
    min-width: 0;
    height: 100vh;
    background: #0d0d1f;
    border-right: 1px solid #1a1a2e;
    display: flex;
    flex-direction: column;
    z-index: 100;
    position: relative;
    overflow: hidden;
    transition: width 0.2s ease;
}

.sidebar.collapsed {
    width: 0 !important;
    border-right: none;
}

.resize-handle {
    position: absolute;
    top: 0;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    z-index: 110;
    background: transparent;
}

.resize-handle:hover,
.resize-handle.active {
    background: #00d4ff44;
}

.sidebar .resize-handle {
    right: 0;
}

.artifact-panel .resize-handle {
    left: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid #1a1a2e;
}

.sidebar-title {
    font-size: 14px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-new-btn {
    flex: 1;
    padding: 8px 12px;
    background: none;
    border: 1px solid #2a2a4a;
    border-radius: 6px;
    color: #888;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.sidebar-new-btn:hover {
    border-color: #00d4ff;
    color: #00d4ff;
}

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

.conv-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    margin-bottom: 2px;
}

.conv-item:hover {
    background: #151530;
}

.conv-item.active {
    background: #1a1a3a;
}

.conv-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.conv-item-title {
    font-size: 13px;
    color: #c0c0c0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conv-item.active .conv-item-title {
    color: #e0e0e0;
}

.conv-item-meta {
    font-size: 11px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
}

.conv-item-meta .agent-dot {
    width: 6px;
    height: 6px;
}

.conv-item-delete {
    opacity: 0;
    background: none;
    border: none;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.15s;
    flex-shrink: 0;
}

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

.conv-item-delete:hover {
    color: #ff4757;
    background: rgba(255, 71, 87, 0.1);
}

/* ── Sidebar Agents ── */

.sidebar-section-title {
    font-size: 11px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 12px 4px;
}

.agents-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 8px 8px;
    border-bottom: 1px solid #1a1a2e;
}

.agent-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: default;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    color: #a0a0b0;
    font-size: 13px;
}

.agent-item-new {
    background: none;
    border: 1px solid #2a2a4a;
    border-radius: 4px;
    color: #666;
    width: 22px;
    height: 22px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}

.agent-item-new:hover {
    border-color: #00d4ff;
    color: #00d4ff;
}

.agent-item-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #a0a0b0;
}

.agent-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.agent-dot.traffic { background: #00d4ff; }
.agent-dot.copy { background: #a78bfa; }

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

/* ── Chat Container ── */

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-width: 0;
    background: radial-gradient(ellipse at 50% 30%, #0d1a2e 0%, #0a0a1a 70%);
}

.top-bar {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    font-size: 13px;
    color: #666;
    border-bottom: 1px solid #1a1a2e;
    gap: 12px;
    flex-shrink: 0;
}

.hamburger-btn {
    display: block;
    background: none;
    border: none;
    color: #888;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
}

.hamburger-btn:hover {
    color: #00d4ff;
}

.top-bar-spacer {
    flex: 1;
}


.user-menu-btn {
    background: none;
    border: 1px solid #2a2a4a;
    border-radius: 50%;
    color: #666;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 8px;
    padding: 0;
    flex-shrink: 0;
}

.user-menu-btn:hover {
    border-color: #00d4ff;
    color: #00d4ff;
}

.user-dropdown {
    position: absolute;
    top: 48px;
    right: 16px;
    background: #151530;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
    min-width: 180px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.user-dropdown.hidden {
    display: none;
}

.dropdown-name {
    font-size: 14px;
    color: #e0e0e0;
    font-weight: 500;
}

.dropdown-email {
    font-size: 12px;
    color: #888;
    padding-bottom: 6px;
    border-bottom: 1px solid #2a2a4a;
    word-break: break-all;
}

.dropdown-logout {
    background: none;
    border: none;
    color: #ff4466;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    padding: 4px 0;
    transition: color 0.2s;
}

.dropdown-logout:hover {
    color: #ff6688;
}

/* ── Messages Area ── */

.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.welcome-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ── Orb ── */

.orb-area {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#waveform-canvas {
    position: absolute;
    width: 250px;
    height: 250px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.orb {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.4s;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.orb-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transition: background 0.4s;
}

.orb.sleeping .orb-inner {
    background: radial-gradient(circle at 40% 35%, #2a5a8c, #1a3a5c, #0d1b2a);
    box-shadow: 0 0 40px rgba(26, 58, 92, 0.4);
    animation: pulse-slow 3s ease-in-out infinite;
}

.orb.listening .orb-inner {
    background: radial-gradient(circle at 40% 35%, #00e5ff, #00b4d8, #0077b6);
    box-shadow: 0 0 60px rgba(0, 212, 255, 0.5);
    animation: pulse-fast 0.8s ease-in-out infinite;
}

.orb.transcribing .orb-inner {
    background: radial-gradient(circle at 40% 35%, #00c4e0, #0090b0, #006080);
    box-shadow: 0 0 50px rgba(0, 180, 216, 0.4);
    animation: pulse-medium 1.2s ease-in-out infinite;
}

.orb.thinking .orb-inner {
    background: radial-gradient(circle at 40% 35%, #a78bfa, #8b5cf6, #6d28d9);
    box-shadow: 0 0 60px rgba(139, 92, 246, 0.5);
    animation: rotate-glow 2s linear infinite;
}

.orb.speaking .orb-inner {
    background: radial-gradient(circle at 40% 35%, #4ade80, #22c55e, #15803d);
    box-shadow: 0 0 60px rgba(34, 197, 94, 0.5);
    animation: pulse-speak 0.6s ease-in-out infinite;
}

.orb.error .orb-inner {
    background: radial-gradient(circle at 40% 35%, #f87171, #ef4444, #b91c1c);
    box-shadow: 0 0 60px rgba(239, 68, 68, 0.5);
    animation: pulse-slow 2s ease-in-out infinite;
}

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

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

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

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

@keyframes rotate-glow {
    0% { box-shadow: 0 0 60px rgba(139, 92, 246, 0.5), 10px 0 40px rgba(139, 92, 246, 0.3); }
    25% { box-shadow: 0 0 60px rgba(139, 92, 246, 0.5), 0 10px 40px rgba(139, 92, 246, 0.3); }
    50% { box-shadow: 0 0 60px rgba(139, 92, 246, 0.5), -10px 0 40px rgba(139, 92, 246, 0.3); }
    75% { box-shadow: 0 0 60px rgba(139, 92, 246, 0.5), 0 -10px 40px rgba(139, 92, 246, 0.3); }
    100% { box-shadow: 0 0 60px rgba(139, 92, 246, 0.5), 10px 0 40px rgba(139, 92, 246, 0.3); }
}

.status-text {
    margin-top: 20px;
    font-size: 14px;
    color: #666;
    letter-spacing: 1px;
    text-align: center;
}

/* ── Chat Bubbles ── */

.msg-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
}

.msg-bubble.user {
    align-self: flex-end;
    background: #1a3a5c;
    color: #d0e0f0;
    border-bottom-right-radius: 4px;
}

.msg-bubble.assistant {
    align-self: flex-start;
    background: #1a1a30;
    color: #d0d0d0;
    border-bottom-left-radius: 4px;
}

.msg-bubble.assistant.error {
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.msg-terminal-toggle {
    display: inline-block;
    margin-top: 8px;
    background: none;
    border: 1px solid #2a2a4a;
    border-radius: 4px;
    color: #555;
    padding: 3px 10px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.msg-terminal-toggle:hover {
    border-color: #00d4ff;
    color: #888;
}

.msg-terminal-content {
    margin-top: 8px;
    background: #0d0d1a;
    border: 1px solid #1a1a2e;
    border-radius: 6px;
    padding: 12px;
    font-size: 13px;
    color: #a0a0b0;
    line-height: 1.7;
    word-break: break-word;
    max-height: 400px;
    overflow-y: auto;
}

/* Terminal markdown styles */
.msg-terminal-content h1,
.msg-terminal-content h2,
.msg-terminal-content h3,
.msg-terminal-content h4 {
    color: #00d4ff;
    margin: 12px 0 6px;
    font-weight: 600;
}
.msg-terminal-content h1 { font-size: 16px; }
.msg-terminal-content h2 { font-size: 14px; }
.msg-terminal-content h3 { font-size: 13px; }
.msg-terminal-content p { margin: 6px 0; }
.msg-terminal-content ul, .msg-terminal-content ol { padding-left: 20px; margin: 6px 0; }
.msg-terminal-content li { margin: 3px 0; }
.msg-terminal-content strong { color: #d0d0e0; }
.msg-terminal-content code {
    background: #1a1a30;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    color: #c0c0d0;
}
.msg-terminal-content pre {
    background: #0a0a18;
    border: 1px solid #1a1a2e;
    border-radius: 6px;
    padding: 10px;
    overflow-x: auto;
    margin: 8px 0;
}
.msg-terminal-content pre code { background: none; padding: 0; }
.msg-terminal-content table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 12px; }
.msg-terminal-content th, .msg-terminal-content td { border: 1px solid #1a1a2e; padding: 5px 8px; text-align: left; }
.msg-terminal-content th { background: #111125; color: #00d4ff; font-weight: 600; }
.msg-terminal-content tr:nth-child(even) { background: #0e0e20; }
.msg-terminal-content a { color: #00d4ff; text-decoration: none; }
.msg-terminal-content hr { border: none; border-top: 1px solid #1a1a2e; margin: 10px 0; }

/* ── Message Content (markdown) ── */

.msg-content h1, .msg-content h2, .msg-content h3, .msg-content h4 {
    color: #00d4ff;
    margin: 12px 0 6px;
    font-weight: 600;
}
.msg-content h1 { font-size: 16px; }
.msg-content h2 { font-size: 14px; }
.msg-content h3 { font-size: 13px; }
.msg-content p { margin: 6px 0; }
.msg-content ul, .msg-content ol { padding-left: 20px; margin: 6px 0; }
.msg-content li { margin: 3px 0; }
.msg-content strong { color: #d0d0e0; }
.msg-content code {
    background: #1a1a30;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    color: #c0c0d0;
}
.msg-content pre {
    background: #0a0a18;
    border: 1px solid #1a1a2e;
    border-radius: 6px;
    padding: 10px;
    overflow-x: auto;
    margin: 8px 0;
}
.msg-content pre code { background: none; padding: 0; }
.msg-content table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 12px; }
.msg-content th, .msg-content td { border: 1px solid #1a1a2e; padding: 5px 8px; text-align: left; }
.msg-content th { background: #111125; color: #00d4ff; font-weight: 600; }
.msg-content tr:nth-child(even) { background: #0e0e20; }
.msg-content a { color: #00d4ff; text-decoration: none; }
.msg-content hr { border: none; border-top: 1px solid #1a1a2e; margin: 10px 0; }

/* ── Artifact Buttons (in chat bubble) ── */

.msg-artifact-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    margin-right: 6px;
    padding: 5px 12px;
    background: rgba(0, 212, 255, 0.06);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 6px;
    color: #00d4ff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.msg-artifact-btn:hover {
    background: rgba(0, 212, 255, 0.12);
    border-color: rgba(0, 212, 255, 0.4);
}

.msg-artifact-btn .artifact-icon {
    font-size: 14px;
    opacity: 0.7;
}

/* ── Artifact Side Panel ── */

.artifact-panel {
    width: 0;
    min-width: 0;
    height: 100vh;
    background: #0d0d1f;
    border-left: 1px solid #1a1a2e;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 50;
    position: relative;
}

.artifact-panel:not(.hidden) {
    width: 50%;
    min-width: 200px;
}

.chat-container.panel-open {
    flex: 1;
    min-width: 0;
}

.artifact-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #1a1a2e;
    flex-shrink: 0;
}

.artifact-panel-title {
    font-size: 13px;
    font-weight: 600;
    color: #c0c0c0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.artifact-panel-close {
    background: none;
    border: none;
    color: #666;
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
    flex-shrink: 0;
}

.artifact-panel-close:hover {
    color: #e0e0e0;
}

.artifact-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    font-size: 13px;
    color: #c0c0d0;
    line-height: 1.7;
}

/* Artifact panel markdown styles */
.artifact-panel-content h1, .artifact-panel-content h2, .artifact-panel-content h3 {
    color: #00d4ff;
    margin: 12px 0 6px;
    font-weight: 600;
}
.artifact-panel-content h1 { font-size: 18px; }
.artifact-panel-content h2 { font-size: 16px; }
.artifact-panel-content h3 { font-size: 14px; }
.artifact-panel-content p { margin: 6px 0; }
.artifact-panel-content table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 13px; }
.artifact-panel-content th, .artifact-panel-content td { border: 1px solid #1a1a2e; padding: 8px 12px; text-align: left; }
.artifact-panel-content th { background: #111125; color: #00d4ff; font-weight: 600; white-space: nowrap; }
.artifact-panel-content tr:nth-child(even) { background: #0e0e20; }
.artifact-panel-content tr:hover { background: #151530; }
.artifact-panel-content pre {
    background: #0a0a18;
    border: 1px solid #1a1a2e;
    border-radius: 6px;
    padding: 12px;
    overflow-x: auto;
    margin: 8px 0;
    font-size: 13px;
}
.artifact-panel-content code {
    font-family: 'Menlo', 'Consolas', monospace;
    font-size: 13px;
}
.artifact-panel-content pre code { background: none; padding: 0; }

.artifact-overlay {
    display: none;
}

/* ── Streaming Progress ── */

.msg-bubble.streaming {
    min-height: 32px;
}

.streaming-tokens {
    font-size: 11px;
    color: #555;
    text-align: right;
    font-variant-numeric: tabular-nums;
    margin-bottom: 4px;
}

.streaming-tokens:empty {
    display: none;
}

.streaming-text {
    color: #a0a0b8;
    transition: color 0.3s;
}

.streaming-text:empty {
    display: none;
}

.streaming-text p {
    margin: 4px 0;
}

.streaming-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.streaming-tools:empty {
    display: none;
}

.msg-progress-tool {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: #1a1a35;
    border: 1px solid #2a2a4a;
    border-radius: 12px;
    font-size: 11px;
    color: #8b8ba0;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    animation: pill-appear 0.2s ease-out;
}

.msg-progress-tool .tool-icon {
    font-size: 12px;
    flex-shrink: 0;
}

.msg-progress-tool .tool-preview {
    color: #555;
    margin-left: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-progress-tool.done {
    border-color: rgba(34, 197, 94, 0.3);
    color: #4ade80;
    background: rgba(34, 197, 94, 0.08);
}

.msg-progress-tool.done .tool-icon {
    color: #4ade80;
}

@keyframes pill-appear {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Thinking indicator in chat */
.msg-thinking {
    align-self: flex-start;
    padding: 10px 14px;
    margin-bottom: 8px;
}

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

.thinking-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #8b5cf6;
    animation: thinking-bounce 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-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* ── Input Area ── */

.input-area {
    padding: 12px 16px 16px;
    border-top: 1px solid #1a1a2e;
    flex-shrink: 0;
}

.stop-speaking-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px;
    margin-bottom: 8px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #f87171;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.stop-speaking-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

#text-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mic-btn {
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid #2a2a4a;
    border-radius: 50%;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.mic-btn:hover {
    border-color: #00d4ff;
    color: #00d4ff;
}

.mic-btn.recording {
    border-color: #ef4444;
    color: #ef4444;
    animation: pulse-fast 0.8s ease-in-out infinite;
}

#text-input {
    flex: 1;
    padding: 10px 14px;
    background: #111122;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    resize: none;
    overflow-y: auto;
    max-height: 150px;
    line-height: 1.4;
}

#text-input:focus {
    border-color: #00d4ff;
}

#text-input::placeholder {
    color: #444;
}

#text-send {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #1a3a5c, #0d4a6b);
    border: 1px solid #1a5276;
    border-radius: 50%;
    color: #c0c0c0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

#text-send:hover {
    border-color: #00d4ff;
    color: #e0e0e0;
}

#text-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Scrollbar ── */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2a4a; border-radius: 3px; }

/* ── Mobile ── */

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        transition: left 0.25s ease;
        width: 280px !important;
    }

    .sidebar.collapsed {
        width: 280px !important;
        left: -280px;
        border-right: 1px solid #1a1a2e;
    }

    .sidebar.open {
        left: 0;
        width: 280px !important;
    }

    .resize-handle {
        display: none;
    }

    .msg-bubble {
        max-width: 90%;
    }

    .orb {
        width: 100px;
        height: 100px;
    }

    #waveform-canvas {
        width: 200px;
        height: 200px;
    }

    .artifact-panel:not(.hidden) {
        position: fixed;
        right: 0;
        top: 0;
        width: 100%;
        min-width: 0;
        z-index: 200;
    }

    .artifact-overlay:not(.hidden) {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 199;
    }
}
