html, body {
    overflow: hidden;
    height: 100vh;
}

body {
    background:
        radial-gradient(ellipse at 50% 0%, rgba(92, 42, 160, 0.22), transparent 42%),
        radial-gradient(circle at 20% 80%, rgba(15, 54, 95, 0.18), transparent 35%),
        radial-gradient(circle at 80% 15%, rgba(102, 54, 155, 0.12), transparent 30%),
        #050312;
}

.main-content {
    padding: 0 !important;
    margin: 0 !important;
    min-height: auto !important;
    overflow: hidden !important;
}

.bk-shell {
    position: relative;
    height: calc(100vh - 56px);
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 50%, #0f0a1a 0%, #080810 60%, #050508 100%);
}

#genome-container {
    position: absolute;
    inset: 0;
}

#dws-hud-title {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
    pointer-events: none;
    text-align: center;
}

#dws-hud-title h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: rgba(196, 181, 253, 0.88);
    letter-spacing: 1px;
    text-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
    white-space: nowrap;
}

#dws-hud-title p {
    margin: 4px 0 0;
    font-size: 11px;
    color: rgba(160, 160, 180, 0.62);
    letter-spacing: 0.5px;
}

.bk-top-actions {
    position: absolute;
    top: 14px;
    z-index: 35;
    display: flex;
    gap: 8px;
}

.bk-top-actions-left {
    left: 14px;
}

.bk-top-actions-right {
    right: 14px;
}

.ot-loop-bar,
.ot-vitals-strip,
.ot-meta-drawer {
    position: absolute;
    z-index: 26;
    background: rgba(10, 10, 15, 0.76);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(139, 92, 246, 0.14);
    border-radius: 12px;
    color: #e0e0e0;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

.ot-loop-bar {
    top: 64px;
    left: 50%;
    transform: translateX(-50%);
    width: min(760px, calc(100vw - 420px));
    padding: 10px 14px;
}

.ot-loop-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #c4b5fd;
    margin-bottom: 8px;
}

.ot-loop-head b {
    color: #d8cfff;
    font-weight: 600;
    font-size: 11px;
}

.ot-loop-track {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 6px;
}

.ot-loop-node {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.03);
    font-size: 11px;
}

.ot-loop-node .ot-loop-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.8);
    flex: none;
}

.ot-loop-node.is-done .ot-loop-dot {
    background: #4ade80;
}

.ot-loop-node.is-active {
    border-color: rgba(168, 85, 247, 0.5);
    background: rgba(168, 85, 247, 0.12);
}

.ot-loop-node.is-active .ot-loop-dot {
    background: #a855f7;
}

.ot-loop-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ot-vitals-strip {
    left: 16px;
    right: 16px;
    bottom: 16px;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
}

.ot-vital-item {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: #ddd6fe;
    padding: 8px 10px;
    min-height: 66px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    text-align: left;
    cursor: pointer;
}

.ot-vital-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #f59e0b;
}

.ot-vital-item.is-green .ot-vital-dot { background: #4ade80; }
.ot-vital-item.is-amber .ot-vital-dot { background: #f59e0b; }
.ot-vital-item.is-red .ot-vital-dot { background: #f87171; }

.ot-vital-label {
    font-size: 11px;
    color: #c4b5fd;
}

.ot-vital-headline {
    font-size: 11px;
    color: #d1d5db;
}

.ot-meta-drawer {
    left: 50%;
    bottom: 96px;
    transform: translateX(-50%);
    width: min(760px, calc(100vw - 420px));
    overflow: hidden;
}

.ot-meta-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    color: #c4b5fd;
    text-align: left;
    padding: 10px 14px;
    font-size: 12px;
    cursor: pointer;
}

.ot-meta-body {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 14px 14px;
}

.ot-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.ot-meta-card {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
}

.ot-meta-card h4 {
    margin: 0 0 6px;
    font-size: 12px;
    color: #ddd6fe;
}

.ot-meta-card p {
    margin: 0;
    font-size: 11px;
    color: #9ca3af;
}

.bk-action-btn,
.bk-inline-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(139, 92, 246, 0.25);
    background: rgba(139, 92, 246, 0.15);
    border-radius: 8px;
    color: #c4b5fd;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
}

.bk-action-btn {
    padding: 6px 10px;
    font-size: 13px;
    line-height: 1;
}

a.bk-action-btn {
    text-decoration: none;
}

.bk-pill {
    border-radius: 999px;
    padding: 8px 16px;
}

.bk-action-btn:hover,
.bk-inline-btn:hover,
.clickable:hover {
    background: rgba(139, 92, 246, 0.28);
    border-color: rgba(139, 92, 246, 0.4);
}

#capability-overview,
#dws-north-card,
#dws-kernel-feed {
    position: absolute;
    z-index: 24;
    background: rgba(10, 10, 15, 0.76);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(139, 92, 246, 0.14);
    border-radius: 12px;
    color: #e0e0e0;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
    overflow: hidden;
}

#capability-overview {
    left: 16px;
    bottom: 16px;
    width: 338px;
}

#dws-north-card {
    top: 44px;
    right: 16px;
    width: 320px;
}

#dws-kernel-feed {
    top: 64px;
    left: 16px;
    width: 348px;
}

.co-header,
.kf-header,
.kf-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 12px;
    color: #c4b5fd;
    font-weight: 600;
}

.kf-section-btn,
.kf-gauge,
.kf-star-chip {
    appearance: none;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
}

.clickable {
    cursor: pointer;
}

.co-body {
    max-height: 360px;
    overflow-y: auto;
    padding: 10px 14px 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.22) transparent;
}

.co-body::-webkit-scrollbar,
#bk-card-body::-webkit-scrollbar {
    width: 5px;
}

.co-body::-webkit-scrollbar-thumb,
#bk-card-body::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 999px;
}

.co-stats-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    font-size: 11px;
}

.s-m { color: #22c55e; }
.s-e { color: #f59e0b; }
.s-v { color: #7f77a1; }
.legend-stats {
    margin-left: auto;
    color: #7f77a1;
}

.co-chain-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 10px;
}

.co-section-label {
    grid-column: 1 / -1;
    margin: 6px 0 2px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: #7f77a1;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.co-chain-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 32px;
    padding: 7px 8px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 8px;
    color: #e5dff5;
    background: rgba(255, 255, 255, 0.04);
    text-align: left;
    font-size: 11px;
}

button.co-chain-row {
    cursor: pointer;
}

button.co-chain-row:hover,
.co-chain-row.active {
    border-color: rgba(139, 92, 246, 0.35);
    background: rgba(139, 92, 246, 0.12);
}

.co-chain-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    flex: none;
}

.co-chain-name {
    min-width: 0;
    flex: 1;
}

.co-chain-score {
    font-weight: 700;
    color: #c5b7ff;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.color-intelligence { background: #f97316; }
.color-trust { background: #22c55e; }
.color-cognitive { background: #3b82f6; }
.color-governance { background: #f59e0b; }
.color-evolution { background: #a855f7; }
.color-business { background: #ec4899; }
.color-observable { background: #06b6d4; }
.color-dev { background: #eab308; }
.color-infra { background: #94a3b8; }

.kf-north-card,
.kf-star-section,
.kf-gauges,
.bk-summary-copy,
.bk-runtime-strip,
.bk-inline-actions {
    padding: 12px 14px;
}

.bk-dipper-scale-hint {
    margin: 4px 0 8px;
    font-size: 10px;
    line-height: 1.35;
    color: rgba(196, 181, 253, 0.55);
    letter-spacing: 0.02em;
}

.kf-north-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.kf-gauges {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.kf-mini,
.kf-gauge {
    padding: 10px 8px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.12);
    text-align: center;
}

.kf-mini-val,
.kf-gauge-val {
    font-size: 18px;
    font-weight: 700;
    color: #f3e8ff;
}

.kf-mini-lbl,
.kf-gauge-label {
    margin-top: 6px;
    font-size: 10px;
    color: #8f87ab;
    letter-spacing: 0.06em;
}

.kf-north-reason,
.bk-summary-copy {
    color: #c2bdd8;
    font-size: 12px;
    line-height: 1.6;
}

.kf-star-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.kf-star-chip {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.12);
    cursor: pointer;
}

.kf-star-chip.is-healthy { border-color: rgba(74, 222, 128, 0.35); }
.kf-star-chip.is-watch { border-color: rgba(245, 158, 11, 0.35); }
.kf-star-chip.is-alert,
.kf-star-chip.is-offline { border-color: rgba(248, 113, 113, 0.35); }

.kf-star-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    margin-bottom: 4px;
}

.kf-star-name,
.kf-star-score {
    color: #efe7ff;
    font-size: 12px;
    font-weight: 600;
}

.kf-star-label {
    color: #8f87ab;
    font-size: 11px;
}

#bk-view-chip {
    color: #8fd3ff;
}

.bk-inline-actions {
    display: flex;
    gap: 8px;
    padding-top: 0;
}

.bk-runtime-strip {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 0;
}

.bk-runtime-chip {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(139, 92, 246, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: #d8cfff;
    font-size: 11px;
    line-height: 1.2;
}

.bk-inline-btn {
    flex: 1;
    min-height: 34px;
    font-size: 12px;
}

#genome-tooltip {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(139, 92, 246, 0.12);
    border-radius: 8px;
    padding: 8px 20px;
    color: rgba(224, 224, 224, 0.7);
    font-size: 12px;
    text-align: center;
    pointer-events: none;
    max-width: 540px;
}

#bk-floating-overlay {
    position: fixed;
    inset: 0;
    z-index: 1099;
    background: transparent;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#bk-floating-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

#bk-floating-card {
    position: fixed;
    top: 120px;
    left: 392px;
    z-index: 1100;
    width: 500px;
    max-height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
    background: rgba(15, 10, 30, 0.85);
    backdrop-filter: blur(20px) saturate(1.5);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(139, 92, 246, 0.15);
    color: #e2e8f0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.3) rotateY(-15deg) rotateX(10deg);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

#bk-floating-card.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1) rotateY(0) rotateX(0);
}

#bk-floating-card .card-pulse-border {
    position: absolute;
    inset: -2px;
    border-radius: 18px;
    pointer-events: none;
    border: 2px solid transparent;
    animation: cardPulse var(--pulse-speed, 2s) ease-in-out infinite;
}

#bk-floating-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px 8px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.15);
    flex-shrink: 0;
}

#bk-floating-card .card-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.bk-card-tab {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(139, 92, 246, 0.15);
    background: rgba(255, 255, 255, 0.04);
    color: #bfb7db;
    font-size: 11px;
    cursor: pointer;
}

.bk-card-tab.active {
    border-color: rgba(139, 92, 246, 0.4);
    background: rgba(139, 92, 246, 0.16);
    color: #e9ddff;
}

#bk-floating-card .card-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
}

#bk-card-title {
    padding: 10px 16px 0;
    color: #c4b5fd;
    font-size: 15px;
    font-weight: 600;
}

#bk-card-subtitle {
    padding: 4px 16px 0;
    color: #8f87ab;
    font-size: 11px;
}

#bk-card-body {
    padding: 12px 16px 10px;
    overflow-y: auto;
    min-height: 0;
    flex: 1;
}

#bk-card-actions {
    display: flex;
    gap: 8px;
    padding: 0 16px 16px;
    flex-wrap: wrap;
}

.bk-card-action {
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(139, 92, 246, 0.22);
    background: rgba(139, 92, 246, 0.12);
    color: #ddd6fe;
    text-decoration: none;
    font-size: 12px;
    cursor: pointer;
}

.bk-card-section {
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.bk-card-section-title {
    margin-bottom: 8px;
    color: #d9cfff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.bk-card-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.bk-card-kpi,
.bk-card-pill {
    padding: 10px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.bk-card-kpi-value {
    color: #f5ecff;
    font-size: 16px;
    font-weight: 700;
}

.bk-card-kpi-label {
    margin-top: 4px;
    color: #8f87ab;
    font-size: 10px;
}

.bk-card-copy,
.bk-card-list {
    color: #c2bdd8;
    font-size: 12px;
    line-height: 1.65;
}

.bk-card-list {
    margin: 0;
    padding-left: 16px;
}

.bk-card-bar-wrap {
    margin-top: 8px;
    height: 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.bk-card-bar {
    height: 100%;
    border-radius: inherit;
    background: #a78bfa;
}

.bk-card-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.bk-card-chip-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.bk-card-chip {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    border: 1px solid rgba(139, 92, 246, 0.25);
    background: rgba(139, 92, 246, 0.1);
    color: #d8cfff;
}

.bk-panel-empty {
    color: #8f87ab;
    font-size: 12px;
}

@keyframes cardPulse {
    0%, 100% {
        box-shadow: 0 0 8px var(--pulse-color, #8b5cf6), inset 0 0 8px var(--pulse-color, #8b5cf6);
        opacity: 0.6;
    }
    50% {
        box-shadow: 0 0 20px var(--pulse-color, #8b5cf6), inset 0 0 20px var(--pulse-color, #8b5cf6);
        opacity: 1;
    }
}

@media (max-width: 1280px) {
    #capability-overview {
        width: 320px;
    }

    #dws-kernel-feed {
        width: 332px;
    }

    #bk-floating-card {
        left: 360px;
        width: 460px;
    }
}

@media (max-width: 1080px) {
    .bk-shell {
        height: auto;
        min-height: calc(100vh - 56px);
        overflow-y: auto;
    }

    #genome-container {
        position: relative;
        height: 58vh;
    }

    #dws-hud-title,
    .bk-top-actions,
    #capability-overview,
    #dws-north-card,
    #dws-kernel-feed,
    #genome-tooltip,
    .ot-loop-bar,
    .ot-vitals-strip,
    .ot-meta-drawer {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
        transform: none;
        margin: 16px;
    }

    #capability-overview,
    #dws-north-card,
    #dws-kernel-feed,
    .ot-loop-bar,
    .ot-vitals-strip,
    .ot-meta-drawer {
        width: auto;
        transform: none;
    }

    .ot-loop-track {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ot-vitals-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ot-meta-grid {
        grid-template-columns: 1fr;
    }

    #bk-floating-card {
        left: 16px;
        right: 16px;
        top: 84px;
        width: auto;
    }
}
