:root {
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --accent: #f97316;
    --surface: #0b172a;
    --panel-bg: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.08);
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --error: #ef4444;
    --success: #22c55e;
    --radius: 16px;
}

[data-theme="light"] {
    --surface: #f8fafc;
    --panel-bg: rgba(15, 23, 42, 0.03);
    --border: rgba(15, 23, 42, 0.08);
    --text-main: #0f172a;
    --text-muted: #475569;
}

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

body {
    font-family: 'Manrope', sans-serif;
    background: var(--surface);
    color: var(--text-main);
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
}

.lab-shell {
    max-width: 1400px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.lab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0 20px;
}

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

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 15px var(--primary);
}

.dot-static {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dot-static.green {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.dot-static.gray {
    background: #666;
}

.workbench {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    flex: 1;
    min-height: 0;
}

/* Sidebar Panels */
.panel {
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    color: var(--primary);
}

.control-group {
    margin-bottom: 15px;
}

label {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 6px;
    color: var(--text-muted);
}

input,
select,
textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    padding: 10px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

input:focus,
textarea:focus {
    border-color: var(--primary);
}

small {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

/* Metrics Gauge */
.gauge-container {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.gauge {
    width: 50px;
    height: 120px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--border);
    border-radius: 25px;
    position: relative;
    overflow: hidden;
}

.fill {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: linear-gradient(to top, var(--primary), var(--accent));
    transition: height 0.3s ease;
}

.readout .value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    display: block;
}

.readout .label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.mini-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.m-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
}

/* Execution Chamber */
.execution-chamber {
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-viewport {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Custom Scrollbar */
.chat-viewport::-webkit-scrollbar {
    width: 6px;
}

.chat-viewport::-webkit-scrollbar-track {
    background: transparent;
}

.chat-viewport::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.entry {
    max-width: 85%;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 0.95rem;
    animation: slideUp 0.3s ease-out;
}

.entry.system {
    align-self: center;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-style: italic;
    border: 1px dashed var(--border);
    text-align: center;
}

.entry.user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
}

.entry.assistant {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
}

.input-area {
    padding: 20px 30px;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.1);
}

#chat-form {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

#user-input {
    resize: none;
    max-height: 150px;
}

.pill {
    padding: 10px 24px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.pill.primary {
    background: var(--primary);
    color: white;
}

.pill.primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#send-btn {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}

#send-btn:disabled {
    background: var(--border);
    cursor: not-allowed;
}

/* GDPR Banner */
.gdpr-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: #1e293b;
    border: 1px solid var(--primary);
    border-radius: 12px;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.hidden {
    display: none !important;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 900px) {
    .workbench {
        grid-template-columns: 1fr;
    }

    .workbench-sidebar {
        display: none;
    }

    /* Focus on mobile execution */
}