/* ==========================================================
   DGxOne Mission Runtime Banner
   Brain Lab live mission telemetry
   ========================================================== */

.dgx-cognitive-canvas {
    position: relative;
    z-index: 8;

    flex: 0 0 auto;
    width: 100%;
    min-height: 0;
    margin: 0 0 10px;
    padding: 10px 12px 11px;

    transform: none;
    box-sizing: border-box;

    border: 1px solid rgba(77, 198, 241, 0.13);
    border-radius: 14px;

    background:
        radial-gradient(
            circle at 50% -30%,
            rgba(50, 178, 238, 0.12),
            transparent 52%
        ),
        linear-gradient(
            145deg,
            rgba(12, 24, 38, 0.57),
            rgba(7, 17, 29, 0.33)
        );

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.025),
        0 12px 34px rgba(0,0,0,0.10);

    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);

    transition:
        opacity 240ms ease,
        border-color 300ms ease,
        box-shadow 300ms ease;
    overflow: visible;
}

.dgx-cognitive-canvas::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(77, 221, 255, 0.025),
            transparent
        );

    background-size: 220% 100%;
    animation: dgxCognitiveSurfaceSweep 8s linear infinite;
}

.dgx-runtime-banner-row {
    position: relative;
    z-index: 2;

    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 28px;
}

.dgx-cognitive-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.dgx-cognitive-core {
    position: relative;
    display: grid;
    place-items: center;

    width: 22px;
    height: 22px;

    border: 1px solid rgba(58, 215, 255, 0.28);
    border-radius: 50%;

    box-shadow:
        inset 0 0 18px rgba(51, 205, 255, 0.12),
        0 0 20px rgba(51, 205, 255, 0.08);
}

.dgx-cognitive-core-ring {
    position: absolute;
    inset: 4px;
    border: 1px dashed rgba(64, 226, 255, 0.72);
    border-radius: 50%;
    animation: dgxCognitiveRing 7s linear infinite;
}

.dgx-cognitive-core-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;

    background: #aef7ff;

    box-shadow:
        0 0 6px #72e6ff,
        0 0 17px rgba(70, 223, 255, 0.65);

    animation: dgxCognitiveCorePulse 2.4s ease-in-out infinite;
}

.dgx-cognitive-eyebrow {
    display: block;
    margin-bottom: 2px;

    color: rgba(141, 193, 221, 0.66);

    font-size: 7px;
    font-weight: 700;
    letter-spacing: 0.20em;
}

#dgxCognitiveState {
    display: block;
    max-width: min(320px, 42vw);
    overflow: hidden;
    color: rgba(236, 249, 255, 0.94);
    font-size: 12px;
    font-weight: 680;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dgx-cognitive-telemetry {
    min-width: 0;
    margin-left: auto;
    overflow: hidden;
    color: rgba(121, 175, 202, 0.65);

    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dgx-signal-panel {
    position: relative;
    z-index: 2;
    margin-top: 8px;
}

.dgx-cognitive-scope {
    display: block;
    width: 100%;
    height: 58px;

    overflow: hidden;

    border: 1px solid rgba(74, 196, 233, 0.08);
    border-radius: 14px;

    background:
        radial-gradient(
            circle at center,
            rgba(25, 123, 161, 0.055),
            transparent 68%
        ),
        rgba(3, 12, 22, 0.42);
}

.dgx-scope-grid path {
    fill: none;
    stroke: rgba(91, 176, 208, 0.08);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.dgx-cognitive-trace {
    fill: none;
    stroke: url(#dgxSignalGradient);
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;

    vector-effect: non-scaling-stroke;
}

.dgx-cognitive-trace-glow {
    stroke-width: 6;
    opacity: 0.24;
    filter: url(#dgxSignalGlow);
}

.dgx-scope-sweep {
    stroke: rgba(100, 235, 255, 0.28);
    stroke-width: 1;
    filter: drop-shadow(0 0 6px rgba(87, 228, 255, 0.5));
}

.dgx-spectrum {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 20px;

    margin-top: 12px;
}

.dgx-spectrum-band {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr) 58px;
    align-items: center;
    gap: 9px;

    min-width: 0;
}

.dgx-spectrum-band > span,
.dgx-spectrum-band > em {
    color: rgba(135, 181, 205, 0.67);
    font-size: 9px;
    font-style: normal;
    font-weight: 620;
}

.dgx-spectrum-band > em {
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dgx-spectrum-track {
    height: 4px;
    overflow: hidden;

    border-radius: 999px;
    background: rgba(59, 131, 163, 0.12);
}

.dgx-spectrum-track i {
    display: block;
    width: 18%;
    height: 100%;
    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            rgba(45, 191, 255, 0.50),
            rgba(84, 235, 216, 0.90)
        );

    box-shadow: 0 0 12px rgba(72, 221, 240, 0.28);

    transition: width 320ms cubic-bezier(.22,.8,.25,1);
}

/* Runtime states */

.dgx-cognitive-canvas[data-state="typing"] {
    border-color: rgba(66, 205, 250, 0.22);
}

.dgx-cognitive-canvas[data-state="thinking"],
.dgx-cognitive-canvas[data-state="running"] {
    border-color: rgba(74, 226, 207, 0.24);

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.03),
        0 24px 75px rgba(0,0,0,0.15),
        0 0 34px rgba(49, 211, 224, 0.05);
}

.dgx-cognitive-canvas.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px) scale(0.98);
}

.dgx-cognitive-canvas .dgx-spectrum,
.dgx-cognitive-canvas .dgx-cognitive-footer,
.dgx-cognitive-canvas .dgx-runtime-banner-grid {
    display: none !important;
}

/* Ensure the Brain Lab provides positioning context */

.dgx-brain-v60 .dgx-v60-chat {
    position: relative;
}

@keyframes dgxCognitiveRing {
    to {
        transform: rotate(360deg);
    }
}

@keyframes dgxCognitiveCorePulse {
    0%,
    100% {
        opacity: 0.66;
        transform: scale(0.84);
    }

    50% {
        opacity: 1;
        transform: scale(1.12);
    }
}

@keyframes dgxCognitiveLive {
    0%,
    100% {
        opacity: 0.45;
        transform: scale(0.82);
    }

    50% {
        opacity: 1;
        transform: scale(1.18);
    }
}

@keyframes dgxCognitiveSurfaceSweep {
    from {
        background-position: 180% 0;
    }

    to {
        background-position: -40% 0;
    }
}

@media (max-width: 900px) {
    .dgx-cognitive-canvas {
        padding: 8px 10px;
    }

    .dgx-runtime-banner-row {
        gap: 9px;
    }

    #dgxCognitiveState {
        max-width: 34vw;
    }

    .dgx-cognitive-telemetry {
        max-width: 28vw;
    }

    .dgx-runtime-detail-panel {
        left: 0;
        right: 0;
        width: auto;
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dgx-cognitive-canvas::before,
    .dgx-cognitive-core-ring,
    .dgx-cognitive-core-dot,
    .dgx-cognitive-live i {
        animation: none !important;
    }
}
