:root {
    --primary: #6366F1;
    --secondary: #818CF8;
    --accent: #F59E0B;
    --bg-main: #0F1219;

    --glass-bg: rgba(20, 25, 35, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-panel: rgba(30, 35, 45, 0.6);

    --text-main: #F8FAFC;
    --text-muted: #94A3B8;

    --font-sans: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg-main);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    border-right: 1px solid var(--glass-border);
}

.glass-panel {
    background: var(--glass-panel);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
}

/* Header */
.top-header {
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    z-index: 20;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary);
}

.brand svg {
    width: 24px;
    height: 24px;
}

.brand h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

/* Layout */
.app-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 320px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 1.5rem;
    gap: 2rem;
}

.control-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.form-group label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
}

.form-group small {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.8;
}

/* Inputs */
.premium-input,
.premium-select {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.premium-input:focus,
.premium-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.premium-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    cursor: pointer;
}

/* Workspace */
.workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.5rem;
    overflow: hidden;
}

/* Command Bar */
.command-bar {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.term-header {
    background: rgba(0, 0, 0, 0.4);
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.red {
    background: #EF4444;
}

.dot.yellow {
    background: #F59E0B;
}

.dot.green {
    background: #10B981;
}

.term-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
    font-weight: 500;
}

.code-container {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent);
    overflow-x: auto;
    white-space: nowrap;
}

.prompt {
    color: var(--text-muted);
    user-select: none;
}

/* Split View */
.split-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    flex: 1;
    overflow: hidden;
}

.editor-pane {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--glass-border);
}

.pane-header h3 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
}

.code-editor {
    flex: 1;
    width: 100%;
    background: transparent;
    border: none;
    padding: 1rem;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
    resize: none;
    outline: none;
    overflow-y: auto;
}

.code-editor.readonly {
    color: var(--primary);
    opacity: 0.9;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.btn.primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn.primary:hover {
    background: var(--secondary);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.btn.ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
}

.btn.ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.btn.small {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 100;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Dynamic field layouts */
.row {
    display: flex;
    gap: 0.75rem;
}

.col {
    flex: 1;
}