﻿/* ---- Global shell ------------------------------------------------------ */

html, body {
    height: 100%;
    margin: 0;
    background: radial-gradient(circle at top, #0b1020 0, #020617 55%, #000 100%);
    color: #e5e7eb;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.os-root {
    min-height: 100vh;
}

.os-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, #111827, #1d2760, #0b1120);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.75);
    z-index: 100;
}

.os-main {
    padding: 80px 24px 24px; /* clear the topbar */
}

/* Brand */

.os-brand {
    display: flex;
    gap: 12px;
    align-items: center;
}

.os-logo {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.7);
}

.os-title {
    font-weight: 600;
    font-size: 18px;
}

.os-subtitle {
    font-size: 11px;
    color: #9ca3af;
}

.os-topbar-right {
    display: flex;
    gap: 16px;
    align-items: center;
    font-size: 11px;
}

.os-nav {
    display: flex;
    gap: 4px;
    margin-right: 8px;
}

.os-nav-link {
    padding: 6px 12px;
    border-radius: 6px;
    color: #9ca3af;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

    .os-nav-link:hover {
        background: rgba(59, 130, 246, 0.15);
        color: #60a5fa;
    }

.os-pill {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.35);
}

    .os-pill.muted {
        opacity: 0.7;
    }

/* ---- Kernel Grid ------------------------------------------------------- */

.kernel-grid {
    display: grid;
    grid-template-columns: 240px minmax(0, 3.2fr) 260px;
    gap: 18px;
    height: calc(100vh - 100px);
    align-items: stretch;
}


/* Panels */

.kernel-panel {
    background: radial-gradient(circle at top left, #111827 0, #020617 65%);
    border-radius: 18px;
    padding: 16px 16px 18px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
}

.kernel-panel-left {
    width: 240px;
    max-width: none;
}

.kernel-panel-right {
    width: 260px;
    max-width: none;
}


.kernel-panel-center {
    min-width: 0;
}

/* Panel headers, chips */

.panel-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 10px;
}

.panel-title {
    font-size: 14px;
    font-weight: 600;
}

.panel-chip {
    font-size: 11px;
    color: #9ca3af;
}

.param-group {
    margin-bottom: 12px;
    font-size: 12px;
}

    .param-group label {
        display: flex;
        justify-content: space-between;
        margin-bottom: 4px;
        color: #d1d5db;
    }

    .param-group input[type="range"] {
        width: 100%;
    }

.param-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    margin-bottom: 14px;
}

.param-footer {
    margin-top: auto;
    font-size: 11px;
    color: #9ca3af;
}

.param-footer-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
    align-items: center;
    font-size: 10px;
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-right: 4px;
    flex-shrink: 0;
}

    .dot.alive {
        background: #a3a3a3;
    }

    .dot.stressed {
        background: #f59e0b;
    }

    .dot.apoptotic {
        background: #ef4444;
    }

    .dot.cleared {
        background: #22c55e;
    }

/* Center panel */

.center-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.center-title {
    font-size: 18px;
    font-weight: 600;
}

.center-subtitle {
    font-size: 11px;
    color: #9ca3af;
}

.center-tags {
    display: flex;
    gap: 6px;
    align-items: center;
}

.chip {
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.35);
    font-size: 11px;
}

    .chip.muted {
        opacity: 0.7;
    }

/* Canvas */

.kernel-canvas-shell {
    flex: 1;
    min-height: 560px;
    border-radius: 14px;
    overflow: hidden;
    background: radial-gradient(circle at top, #020617 0, #020617 100%);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.85);
}

.kernel-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Right panel cards */

.analytics-card,
.console-card {
    border-radius: 14px;
    background: radial-gradient(circle at top, rgba(15,23,42,0.98) 0, rgba(15,23,42,0.96) 60%, #020617 100%);
    padding: 12px 14px;
    margin-bottom: 12px;
    box-shadow: inset 0 0 0 1px rgba(30, 64, 175, 0.45);
    font-size: 12px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    margin-bottom: 8px;
}

.card-tag {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(59,130,246,0.15);
    color: #93c5fd;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
}

.metric-bar {
    height: 4px;
    border-radius: 999px;
    background: rgba(31,41,55,0.9);
    overflow: hidden;
    margin-bottom: 4px;
}

    .metric-bar > div {
        height: 100%;
        background: linear-gradient(90deg, #22c55e, #3b82f6);
    }

.metric-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 10px;
    margin-top: 6px;
    font-size: 11px;
    color: #9ca3af;
}

/* Console */

.agent-console {
    min-height: 140px;
    max-height: 260px;
    overflow-y: auto;
    font-family: "JetBrains Mono", "Fira Code", monospace;
    font-size: 11px;
    line-height: 1.4;
    padding: 8px 6px;
    border-radius: 10px;
    background: rgba(2,6,23,0.9);
    box-shadow: inset 0 0 0 1px rgba(15,23,42,0.9);
}

    .agent-console .system-line {
        color: #7dd3fc;
    }

    .agent-console .tumor {
        color: #f97373;
    }

    .agent-console .immune {
        color: #bbf7d0;
    }

/* Voice toggle */

.voice-toggle {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    font-size: 11px;
    color: #9ca3af;
}

/* Responsiveness */

@media (max-width: 1100px) {
    .kernel-grid {
        grid-template-columns: minmax(0, 1fr);
        height: auto;
    }

    .kernel-panel {
        max-width: none;
    }

    .kernel-panel-center {
        order: -1;
    }
}

.kernel-status {
    display: flex;
    gap: 14px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.25);
    font-size: 11px;
    color: #e5e7eb;
    backdrop-filter: blur(6px);
}
.telemetry-hud {
    position: absolute;
    top: 10px;
    right: 12px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(10, 15, 30, 0.75);
    border: 1px solid rgba(59,130,246,0.25);
    font-size: 11px;
    color: #cbd5e1;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.45);
    display: grid;
    grid-template-columns: auto auto;
    gap: 4px 10px;
    z-index: 40;
}

.kernel-panel-center {
    position: relative;
}

