/* ==========================================================================
   AURA DESIGN SYSTEM & HIGH-FIDELITY WATCH SIMULATOR STYLES
   ========================================================================== */

:root {
    /* Color Palette */
    --color-bg-dark: #070c14;
    --color-panel-glass: rgba(13, 21, 34, 0.65);
    --color-border-glass: rgba(255, 255, 255, 0.08);
    
    --color-brand-blue: #0b1528;
    --color-brand-blue-glow: rgba(11, 21, 40, 0.4);
    --color-silver-text: #e2e8f0;
    --color-silver-sub: #94a3b8;
    
    /* State-machine colors matching context and mockups */
    --color-state-baseline: #16ec06;     /* Green (#16EC06) */
    --color-state-baseline-cyan: #00f0ff; /* Cyan/Teal (Alternate Baseline/Calm) */
    --color-state-prealert: #ffc933;     /* Amber Yellow/Mango (#FFC933) */
    --color-state-critical: #ff0026;     /* Neon Red (#FF0026) */
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--color-bg-dark);
    color: var(--color-silver-text);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Ambient glow nodes */
.ambient-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.08) 0%, rgba(22, 236, 6, 0.02) 60%, transparent 100%);
    top: -200px;
    left: -200px;
    z-index: 0;
    pointer-events: none;
    transition: background 1.5s ease-in-out;
}

/* ==========================================================================
   HEADER SECTION
   ========================================================================== */

.main-header {
    background: rgba(11, 20, 36, 0.5);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border-glass);
    padding: 12px 24px;
    position: relative;
    z-index: 10;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.header-logo {
    width: 38px;
    height: 32px;
    color: var(--color-silver-text);
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.2));
}

.brand-text h1 {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-text span {
    font-size: 7px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--color-silver-sub);
    display: block;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--color-state-baseline);
}

.pulse-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--color-state-baseline);
    box-shadow: 0 0 8px var(--color-state-baseline);
    animation: blink 1.5s infinite alternate;
}

@keyframes blink {
    0% { opacity: 0.3; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1.1); }
}

/* ==========================================================================
   GRID LAYOUT
   ========================================================================== */

.dashboard-grid {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 24px;
    flex-grow: 1;
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 32px;
    z-index: 5;
    position: relative;
}

@media (max-width: 1000px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .simulator-panel {
        justify-content: center;
    }
}

/* ==========================================================================
   LEFT PANEL: PHYSICAL APPLE WATCH ASSEMBLY
   ========================================================================== */

.simulator-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.watch-assembly {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 30px 0;
}

/* Premium Ribbed Ocean Band */
.ocean-band {
    width: 120px;
    height: 180px;
    background: #0f1c2d;
    background-image: repeating-linear-gradient(
        0deg,
        #0b1322,
        #0b1322 8px,
        #15253a 8px,
        #15253a 14px
    );
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    z-index: 1;
}

.top-band {
    margin-bottom: -50px;
    border-bottom: 2px solid #080d1a;
}

.bottom-band {
    margin-top: -50px;
    border-top: 2px solid #080d1a;
}

/* Rugged Deep-Blue Titanium Case (Apple Watch Ultra Style) */
.watch-case {
    width: 250px;
    height: 290px;
    background: linear-gradient(145deg, #182c42 0%, #0d1a29 50%, #060e18 100%);
    border: 4px solid #233a52;
    border-radius: 48px;
    position: relative;
    z-index: 2;
    box-shadow: 
        0 15px 35px rgba(0,0,0,0.6),
        inset 0 2px 4px rgba(255,255,255,0.1),
        inset 0 -2px 4px rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: border-color 0.8s ease;
}

/* Left Orange Action Button */
.action-button-left {
    position: absolute;
    width: 5px;
    height: 60px;
    background: #ff5722; /* Safety orange */
    left: -8px;
    top: 110px;
    border-radius: 3px 0 0 3px;
    box-shadow: -1px 0 3px rgba(0,0,0,0.3);
}

/* Antenna bezel protrusions on sides */
.bezel-protrusion {
    position: absolute;
    width: 254px;
    height: 160px;
    border-left: 2px solid #28445e;
    border-right: 2px solid #28445e;
    left: -6px;
    top: 65px;
    pointer-events: none;
}

/* Right Digital Crown */
.digital-crown {
    position: absolute;
    width: 14px;
    height: 60px;
    background: linear-gradient(0deg, #101a24 0%, #2f4b66 50%, #101a24 100%);
    right: -10px;
    top: 80px;
    border-radius: 0 4px 4px 0;
    border-left: 2px solid #091018;
    box-shadow: 2px 0 5px rgba(0,0,0,0.4);
}

/* Side button under crown */
.side-button {
    position: absolute;
    width: 5px;
    height: 44px;
    background: #182c42;
    border: 1px solid #233a52;
    right: -7px;
    top: 155px;
    border-radius: 0 2px 2px 0;
}

/* Curved Bezel Glass OLED screen */
.watch-screen {
    width: 218px;
    height: 254px;
    background-color: #050a12;
    border-radius: 38px;
    border: 10px solid #000000;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.9);
    cursor: grab;
}

.watch-screen:active {
    cursor: grabbing;
}

/* Swipable content wrapper */
.screen-content {
    display: flex;
    width: 400%; /* 4 horizontal tabs */
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Tab screens inside Watch */
.watch-tab {
    width: 25%;
    height: 100%;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background-color: var(--color-brand-blue);
    flex-shrink: 0;
    position: relative;
    user-select: none;
}

/* Header style in WatchOS */
.watch-header {
    display: flex;
    justify-content: center;
    margin-bottom: 6px;
}

.watch-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    width: 100%;
}

.watch-time {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
}

.back-arrow {
    font-size: 11px;
    font-weight: 800;
    color: var(--color-state-prealert);
    cursor: pointer;
}

.watch-page-dots {
    position: absolute;
    bottom: 6px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 4px;
    pointer-events: none;
    z-index: 10;
}

.watch-page-dots .dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.25);
    transition: background-color 0.3s ease;
}

.watch-page-dots .dot.active {
    background-color: #ffffff;
}

.watch-tip-instruction {
    font-size: 10px;
    color: var(--color-silver-sub);
    margin-top: 14px;
    font-weight: 500;
    text-align: center;
}

/* ==========================================================================
   TAB 1: DYNAMIC TELEMETRY STATE LAYOUTS
   ========================================================================== */

.telemetry-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
    justify-content: space-between;
    padding-bottom: 12px;
}

/* Concentric Smart Ring */
.ring-container {
    position: relative;
    width: 110px;
    height: 110px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ring-svg {
    width: 100%;
    height: 100%;
}

.ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 9px;
}

.ring-active {
    fill: none;
    stroke: var(--color-state-baseline-cyan);
    stroke-width: 9px;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    stroke-dasharray: 314; /* 2 * PI * r (r=50) = 314 */
    stroke-dashoffset: 31.4; /* Default 90% full (31.4 offset) */
    transition: stroke-dashoffset 0.8s ease, stroke 0.8s ease;
    filter: drop-shadow(0 0 4px var(--color-state-baseline-cyan));
}

.ring-label-wrapper {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ring-label {
    font-size: 14px;
    font-weight: 800;
    color: var(--color-state-baseline-cyan);
    letter-spacing: 1px;
    text-shadow: 0 0 6px rgba(0, 240, 255, 0.4);
}

.ring-bsi-val {
    font-size: 18px;
    font-weight: 900;
    font-family: var(--font-mono);
}

/* Bottom Stats Grid inside watch */
.mini-stats-grid {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0 4px;
}

.mini-card {
    display: flex;
    flex-direction: column;
    width: 48%;
}

.mini-card.align-left { align-items: flex-start; }
.mini-card.align-right { align-items: flex-end; }

.card-title {
    font-size: 9px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 2px;
}

.sparkline-wrapper {
    width: 100%;
    height: 16px;
    background: rgba(255,255,255,0.03);
    border-radius: 3px;
    overflow: hidden;
}

.sparkline-svg {
    width: 100%;
    height: 100%;
}

.screen-footer {
    font-size: 5px;
    font-weight: 700;
    color: rgba(255,255,255,0.3);
    text-align: center;
}

/* ==========================================================================
   TAB 2 & 3 & 4 CONTENT STYLES
   ========================================================================== */

.tab-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-grow: 1;
    overflow-y: auto;
    padding-bottom: 12px;
}

/* Hide scrollbars on simulated watch */
.tab-body::-webkit-scrollbar {
    display: none;
}

.tab-body.scrollable {
    overflow-y: auto;
}

.tab-body.align-center {
    align-items: center;
}

/* Connectivity cards */
.edge-card {
    border-radius: 8px;
    padding: 5px 6px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.esim-card {
    background: rgba(255, 201, 51, 0.08);
    border: 0.8px solid rgba(255, 201, 51, 0.4);
}

.subghz-card {
    background: rgba(255, 255, 255, 0.03);
    border: 0.5px solid rgba(255, 255, 255, 0.1);
}

.card-header {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 4px;
}

.card-header .icon {
    font-size: 11px;
}

.card-header .title {
    font-size: 8px;
    font-weight: 800;
    color: var(--color-state-prealert);
}

.subghz-card .card-header .title {
    color: rgba(255,255,255,0.9);
}

.status-icon {
    margin-left: auto;
    font-size: 9px;
    color: var(--color-state-prealert);
}

.esim-card .subtitle {
    font-size: 6px;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    margin-top: 1px;
}

.subghz-card .frequency {
    font-size: 6.5px;
    font-family: var(--font-mono);
    color: rgba(255,255,255,0.6);
    padding-left: 12px;
}

.subghz-card .bypass {
    font-size: 5.5px;
    font-weight: 800;
    color: var(--color-state-baseline);
    padding-left: 12px;
}

.citation {
    font-size: 4px;
    font-weight: 700;
    color: rgba(255,255,255,0.3);
    align-self: flex-end;
    margin-top: 2px;
}

/* BAA Vault security screen */
.vault-icon-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0, 170, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2px;
}

.vault-shield {
    width: 18px;
    height: 18px;
}

.vault-title {
    font-size: 8px;
    font-weight: 900;
    color: #ffffff;
    text-align: center;
}

.vault-subtitle {
    font-size: 6.5px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: rgba(255,255,255,0.5);
    text-align: center;
}

.crossover-container {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 5px 0;
    width: 100%;
}

.crossover-box {
    flex-grow: 1;
    background: rgba(255,255,255,0.03);
    border-radius: 4px;
    padding: 3px 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.crossover-box .label {
    font-size: 4.8px;
    font-weight: 800;
    color: rgba(255,255,255,0.85);
}

.crossover-box .label.font-green {
    color: var(--color-state-baseline);
}

.crossover-box .sublabel {
    font-size: 4.2px;
    font-weight: 700;
    color: rgba(255,255,255,0.4);
}

.crossover-arrow {
    font-size: 8px;
    font-weight: 800;
    color: rgba(255,255,255,0.25);
}

.audit-row {
    display: flex;
    align-items: center;
    gap: 3px;
    width: 100%;
    padding: 0 4px;
}

.green-dot {
    width: 3.5px;
    height: 3.5px;
    border-radius: 50%;
    background-color: var(--color-state-baseline);
}

.audit-text {
    font-size: 5.5px;
    font-weight: 900;
    color: var(--color-state-baseline);
}

.audit-row .citation {
    margin-left: auto;
    margin-top: 0;
}

/* Incident correlation list */
.incident-row {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.03);
    border: 0.5px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    padding: 4px 5px;
}

.incident-row.row-danger {
    background: rgba(255, 0, 38, 0.06);
    border-color: rgba(255, 0, 38, 0.25);
}

.incident-row .hazard-icon {
    font-size: 12px;
    font-weight: 800;
    color: var(--color-state-critical);
}

.incident-row .heart-icon {
    font-size: 11px;
    color: #ff9800;
}

.incident-row .keyboard-icon {
    font-size: 11px;
    color: #ff9800;
}

.row-details {
    display: flex;
    flex-direction: column;
}

.row-title {
    font-size: 7px;
    font-weight: 900;
    color: #ffffff;
}

.row-sub {
    font-size: 6px;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
}

.font-orange { color: #ff9800 !important; }
.font-red { color: var(--color-state-critical) !important; }
.font-mono { font-family: var(--font-mono); }

.incident-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 2px;
    margin-top: 2px;
}

.incident-footer span {
    font-size: 5.2px;
    font-weight: 900;
}

/* ==========================================================================
   DYNAMIC HARDWARE AND APP OVERLAYS (PRE-ALERT & MELTDOWN STATES)
   ========================================================================== */

/* State 2: PRE-ALERT View over Hub (Aumento Neuro-Tensione) */
.prealert-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: space-between;
    padding-bottom: 8px;
}

.brain-icon-alert {
    font-size: 18px;
    color: var(--color-state-prealert);
    animation: slow-float 2s infinite alternate ease-in-out;
}

@keyframes slow-float {
    0% { transform: translateY(0); }
    100% { transform: translateY(-3px); }
}

.prealert-title {
    font-size: 9px;
    font-weight: 900;
    color: var(--color-state-prealert);
    letter-spacing: 0.5px;
    text-align: center;
}

.biovitals-card {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 0.5px solid rgba(255, 201, 51, 0.25);
    border-radius: 6px;
    padding: 3px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.biovitals-card .title {
    font-size: 6.5px;
    font-weight: 700;
    color: rgba(255,255,255,0.7);
}

.biovitals-val-row {
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.biovitals-val-row .val {
    font-size: 21px;
    font-weight: 900;
    font-family: var(--font-mono);
    color: var(--color-state-prealert);
}

.meltdown-estimate {
    font-size: 7.8px;
    font-weight: 900;
    color: rgba(255,255,255,0.95);
    text-align: center;
}

.btn-deescalate-watch {
    width: 100%;
    border: none;
    background: rgba(255, 201, 51, 0.12);
    color: var(--color-state-prealert);
    font-size: 6.8px;
    font-weight: 900;
    padding: 5px 0;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
}

.btn-deescalate-watch:hover {
    background: rgba(255, 201, 51, 0.22);
}

/* State 3: CRITICAL ALERT / MELTDOWN IMMINENTE Screen Frame flashing! */
.critical-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: space-between;
    padding: 10px 8px 8px 8px;
    border-radius: 28px;
    box-shadow: inset 0 0 12px rgba(255, 0, 38, 0.5);
    animation: screen-border-flash 0.5s infinite alternate;
}

@keyframes screen-border-flash {
    0% { border: 2.5px solid var(--color-state-critical); }
    100% { border: 2.5px solid rgba(255, 0, 38, 0.15); }
}

.critical-view .title {
    font-size: 10.5px;
    font-weight: 900;
    color: var(--color-state-critical);
    letter-spacing: 0.3px;
    text-align: center;
}

.critical-bi-row {
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.critical-bi-row .val {
    font-size: 25px;
    font-weight: 900;
    color: #ffffff;
    font-family: var(--font-mono);
}

.critical-view .ecg-label {
    font-size: 5.5px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--color-state-critical);
}

.critical-ecg-wrapper {
    width: 100%;
    height: 22px;
}

.btn-critical-caregiver {
    width: 100%;
    border: none;
    background-color: var(--color-state-critical);
    color: #ffffff;
    border-radius: 5px;
    padding: 4px 6px;
    font-size: 5.8px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 0, 38, 0.3);
}

.btn-critical-caregiver span {
    text-align: center;
    flex-grow: 1;
    line-height: 1.2;
}

.btn-critical-caregiver .chevron {
    font-size: 8px;
    font-weight: 900;
}

/* ==========================================================================
   RIGHT PANEL: DEVELOPER TELEMETRY CONTROLS & MONITOR
   ========================================================================== */

.control-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Glassmorphism containers */
.card-glass {
    background: var(--color-panel-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-border-glass);
    border-radius: 16px;
    padding: 18px 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.control-panel h2 {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--color-silver-sub);
    text-transform: uppercase;
    margin-bottom: 14px;
    border-left: 3.5px solid var(--color-silver-sub);
    padding-left: 8px;
    line-height: 1.1;
    transition: border-color 0.4s ease;
}

/* Preset buttons */
.preset-buttons {
    display: flex;
    gap: 12px;
}

.btn-preset {
    flex: 1;
    background: rgba(255,255,255,0.03);
    border: 1.5px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    color: var(--color-silver-sub);
    padding: 10px 8px;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-preset:hover {
    background: rgba(255,255,255,0.06);
    color: var(--color-silver-text);
}

.btn-preset.active {
    background: rgba(255,255,255,0.09);
}

.btn-preset.active#btnPresetBaseline {
    border-color: var(--color-state-baseline);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(22, 236, 6, 0.15);
}

.btn-preset.active#btnPresetWarning {
    border-color: var(--color-state-prealert);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(255, 201, 51, 0.15);
}

.btn-preset.active#btnPresetCritical {
    border-color: var(--color-state-critical);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(255, 0, 38, 0.15);
}

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

.badge.green { background-color: var(--color-state-baseline); box-shadow: 0 0 6px var(--color-state-baseline); }
.badge.yellow { background-color: var(--color-state-prealert); box-shadow: 0 0 6px var(--color-state-prealert); }
.badge.red { background-color: var(--color-state-critical); box-shadow: 0 0 6px var(--color-state-critical); }

/* Parameter Sliders */
.sliders-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.slider-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slider-header label {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-silver-sub);
}

.slider-value {
    font-size: 12px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--color-silver-text);
}

/* Custom Slider thumb */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 5px;
    border-radius: 3px;
    background: rgba(255,255,255,0.08);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--color-silver-text);
    cursor: pointer;
    box-shadow: 0 0 4px rgba(0,0,0,0.5);
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 8px;
    font-weight: 600;
    color: rgba(255,255,255,0.3);
}

/* Live Mathematics Output Grid */
.math-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.math-card {
    background: rgba(255,255,255,0.02);
    border: 0.5px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
}

.math-card .label {
    font-size: 9px;
    font-weight: 800;
    color: var(--color-silver-sub);
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.value-large {
    font-size: 28px;
    font-weight: 900;
    font-family: var(--font-mono);
    line-height: 1.1;
    margin-bottom: 4px;
}

.font-green { color: var(--color-state-baseline); }
.font-cyan { color: var(--color-state-baseline-cyan); }

.formula {
    font-size: 8.5px;
    font-family: var(--font-mono);
    color: rgba(255,255,255,0.35);
}

/* Deescalation panel controls */
.deescalation-engine-control {
    background: rgba(255,255,255,0.02);
    border: 1px dashed rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.deescalation-info {
    flex-grow: 1;
}

.deescalation-info h3 {
    font-size: 11px;
    font-weight: 800;
    color: var(--color-silver-text);
    margin-bottom: 2px;
}

.deescalation-info p {
    font-size: 8.5px;
    line-height: 1.3;
    color: var(--color-silver-sub);
}

.btn-deescalate {
    border: none;
    background: #0088ff;
    color: #ffffff;
    font-size: 10px;
    font-weight: 900;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(0, 136, 255, 0.2);
}

.btn-deescalate:hover {
    background: #2196f3;
    transform: translateY(-1px);
}

.btn-deescalate:active {
    transform: translateY(0);
}

/* SQS Stream Terminal Console */
.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.btn-clear-console {
    background: transparent;
    border: 0.5px solid rgba(255,255,255,0.15);
    border-radius: 5px;
    color: var(--color-silver-sub);
    font-size: 9px;
    font-weight: 700;
    padding: 3px 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-clear-console:hover {
    border-color: rgba(255,255,255,0.4);
    color: #ffffff;
}

.console-terminal {
    background: #040810;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 12px;
    height: 120px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 8.5px;
    line-height: 1.4;
    color: #cbd5e1;
}

.console-line {
    white-space: pre-wrap;
    word-break: break-all;
}

.console-line.system { color: #8494a5; font-weight: bold; }
.console-line.inbound { color: #10b981; } /* Emerald */
.console-line.warning { color: #f59e0b; } /* Orange */
.console-line.critical { color: #ef4444; } /* Red */

/* ==========================================================================
   PAGE FOOTER
   ========================================================================== */

.page-footer {
    background: rgba(4, 8, 16, 0.8);
    border-top: 1px solid var(--color-border-glass);
    padding: 14px;
    text-align: center;
    z-index: 10;
}

.page-footer p {
    font-size: 9px;
    font-weight: 600;
    color: var(--color-silver-sub);
}
