/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    scrollbar-width: thin;
    scrollbar-color: rgba(56, 213, 255, 0.2) transparent;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(56, 213, 255, 0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 213, 255, 0.45);
}

:root {
    --bg: #030811;
    --panel: rgba(6, 14, 28, 0.74);
    --panel-border: rgba(56, 213, 255, 0.16);
    --panel-border-hover: rgba(56, 213, 255, 0.38);
    --ink: #f2f9ff;
    --soft: #bce1ff;
    --muted: #6f8fa8;
    
    /* Neon Accents */
    --cyan: #38d5ff;
    --blue: #2b7cff;
    --green: #29e6a7;
    --red: #ff665f;
    --gold: #f0b84a;
    --violet: #a586ff;

    --shadow-glow: 0 0 20px rgba(56, 213, 255, 0.06);
    --shadow-glow-hover: 0 0 30px rgba(56, 213, 255, 0.14);
}

/* Full Screen Height Lock (Desktop Only) */
html, body {
    height: 100vh;
    overflow: hidden;
    background-color: var(--bg);
}

body {
    /* Digital Cybernetic grid backdrop */
    background: 
        radial-gradient(circle at 50% 50%, #020710 0%, #010205 100%),
        linear-gradient(rgba(56, 213, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 213, 255, 0.015) 1px, transparent 1px);
    background-size: 100% 100%, 36px 36px, 36px 36px;
    color: var(--ink);
    position: relative;
}

/* Helper utilities */
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-3 { margin-top: 12px; }
.green-text { color: var(--green); }
.red-text { color: var(--red); }
.text-cyan { color: var(--cyan); }
.text-gold { color: var(--gold); }

/* Accent Dots */
.accent-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}
.cyan-glow { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.violet-glow { background: var(--violet); box-shadow: 0 0 6px var(--violet); }
.green-glow { background: var(--green); box-shadow: 0 0 6px var(--green); }
.blue-glow { background: var(--blue); box-shadow: 0 0 6px var(--blue); }
.red-glow { background: var(--red); box-shadow: 0 0 6px var(--red); }
.gold-glow { background: var(--gold); box-shadow: 0 0 6px var(--gold); }

/* ----------------------------------------------------
   Splash Screen Bootloader
   ---------------------------------------------------- */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #010409;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease-in-out, visibility 0.8s;
}

.terminal-loader {
    width: 90%;
    max-width: 580px;
    background: rgba(3, 8, 18, 0.98);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 213, 255, 0.12);
    overflow: hidden;
}

.terminal-header {
    background: rgba(13, 27, 46, 0.85);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--panel-border);
}

.terminal-header .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    display: inline-block;
}

.dot.red { background: var(--red); }
.dot.yellow { background: var(--gold); }
.dot.green { background: var(--green); }

.terminal-title {
    margin-left: auto;
    margin-right: auto;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    color: var(--muted);
}

.terminal-body {
    padding: 16px;
    height: 260px;
    overflow-y: auto;
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    line-height: 1.5;
    color: var(--soft);
}

.term-line {
    margin-bottom: 4px;
    opacity: 0;
    animation: fadeIn 0.1s forwards;
}

.term-line.cmd::before {
    content: "operator@signalforge:~$ ";
    color: var(--cyan);
}

.term-line.success { color: var(--green); }
.term-line.warning { color: var(--gold); }

/* ----------------------------------------------------
   Main Navigation Header
   ---------------------------------------------------- */
.layout {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.topbar {
    height: 52px;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(3, 8, 17, 0.75);
    border-bottom: 1px solid var(--panel-border);
    backdrop-filter: blur(12px);
    z-index: 100;
}

.brand-logo {
    height: 28px;
    filter: drop-shadow(0 0 6px rgba(56, 213, 255, 0.25));
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(43, 124, 255, 0.06);
    border: 1px solid rgba(56, 213, 255, 0.16);
    padding: 4px 12px;
    border-radius: 20px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
}

.pulse-led {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.pulse-led.green {
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
    animation: pulseGlow 2s infinite;
}

.status-text {
    color: var(--soft);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-btn {
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.primary-btn {
    background: linear-gradient(180deg, var(--blue), #1852cc);
    color: #fff;
    border: 1px solid rgba(56, 213, 255, 0.25);
}

.primary-btn:hover {
    border-color: var(--cyan);
    box-shadow: 0 0 12px rgba(56, 213, 255, 0.35);
}

.secondary-btn {
    background: rgba(13, 27, 46, 0.5);
    color: var(--soft);
    border: 1px solid var(--panel-border);
}

.secondary-btn:hover {
    color: #fff;
    border-color: rgba(56, 213, 255, 0.3);
}

/* ----------------------------------------------------
   Dashboard Container (Rigid Grid System)
   ---------------------------------------------------- */
.dashboard-container {
    flex-grow: 1;
    height: calc(100vh - 52px - 28px);
    padding: 16px;
    position: relative;
    overflow: hidden;
}

/* On desktop, side-col acts as a full-screen overlay so javascript can place cards anywhere */
.side-col {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: auto; /* Allow children to stack globally */
    pointer-events: none; /* Let clicks pass through to canvas/console */
}

/* ----------------------------------------------------
   Glassmorphic Widgets styling
   ---------------------------------------------------- */
.card {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    box-shadow: var(--shadow-glow);
    backdrop-filter: blur(16px);
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.1s linear, opacity 0.3s ease;
    pointer-events: auto; /* enable click events on the cards */
}

.card:hover {
    border-color: var(--panel-border-hover);
    box-shadow: var(--shadow-glow-hover);
}

.card-header {
    padding: 10px 14px;
    background: rgba(4, 11, 22, 0.6);
    border-bottom: 1px solid var(--panel-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h3 {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--soft);
}

.card-body {
    padding: 12px 14px;
}

/* Widgets default absolute positioning for JS-based orbit layout */
#widget-bot {
    position: absolute;
    width: 320px;
    height: 375px;
}

#widget-research {
    position: absolute;
    width: 320px;
    height: 250px;
}

#widget-ops {
    position: absolute;
    width: 380px;
    height: 270px;
}

#widget-market {
    position: absolute;
    width: 340px;
    height: 220px;
}

#widget-risk {
    position: absolute;
    width: 340px;
    height: 220px;
}

/* ----------------------------------------------------
   Metrics typography & micro layouts
   ---------------------------------------------------- */
.lbl {
    font-size: 9px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: block;
    margin-bottom: 2px;
}

.val {
    font-size: 18px;
    font-weight: 800;
    color: var(--ink);
    font-family: 'Outfit', sans-serif;
}

.val-s {
    font-size: 12px;
    font-weight: 700;
    color: var(--soft);
}

.change {
    font-size: 9px;
    font-weight: 600;
    margin-left: 2px;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.metric-col {
    display: flex;
    flex-direction: column;
}

/* Chart block wrapper */
.chart-container {
    background: rgba(3, 9, 18, 0.55);
    border: 1px solid rgba(56, 213, 255, 0.08);
    border-radius: 6px;
    padding: 8px 6px;
    margin-bottom: 10px;
    height: 90px;
}

.equity-chart {
    width: 100%;
    height: 100%;
}

.card-footer-metrics {
    display: flex;
    justify-content: space-between;
    background: rgba(5, 14, 27, 0.45);
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(79, 195, 255, 0.06);
    margin-bottom: 10px;
}

.mini-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Interactive Halt button */
.btn-action {
    width: 100%;
    padding: 8px;
    font-size: 10px;
    font-weight: 800;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--panel-border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.start-stop-btn {
    background: linear-gradient(180deg, rgba(86, 31, 32, 0.55), rgba(66, 15, 16, 0.65));
    border-color: rgba(255, 102, 95, 0.3);
    color: var(--red);
    box-shadow: 0 0 10px rgba(255, 102, 95, 0.05);
}

.start-stop-btn:hover {
    background: rgba(116, 41, 42, 0.75);
    border-color: rgba(255, 102, 95, 0.45);
    box-shadow: 0 0 15px rgba(255, 102, 95, 0.15);
}

.start-stop-btn.stopped-state {
    background: linear-gradient(180deg, rgba(25, 67, 43, 0.55), rgba(15, 47, 28, 0.65));
    border-color: rgba(41, 230, 167, 0.3);
    color: var(--green);
    box-shadow: 0 0 10px rgba(41, 230, 167, 0.05);
}

.start-stop-btn.stopped-state:hover {
    background: rgba(35, 97, 63, 0.75);
    border-color: rgba(41, 230, 167, 0.45);
    box-shadow: 0 0 15px rgba(41, 230, 167, 0.15);
}

/* Research progress layouts */
.progress-box {
    background: rgba(5, 14, 27, 0.45);
    border: 1px solid rgba(79, 195, 255, 0.06);
    padding: 8px 10px;
    border-radius: 6px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), var(--blue));
    box-shadow: 0 0 6px var(--cyan);
}

.credits-box {
    background: rgba(165, 134, 255, 0.04);
    border: 1px solid rgba(165, 134, 255, 0.12);
    padding: 8px 10px;
    border-radius: 6px;
}

.credits-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ----------------------------------------------------
   Right Column Widget layouts
   ---------------------------------------------------- */
.heartbeat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.flex-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 10px;
}

.ops-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.ops-cell {
    background: rgba(5, 14, 27, 0.45);
    border: 1px solid rgba(79, 195, 255, 0.05);
    padding: 6px 10px;
    border-radius: 6px;
}

.ops-log-panel {
    border: 1px solid rgba(79, 195, 255, 0.08);
    border-radius: 6px;
    background: #010409;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.log-header {
    background: rgba(13, 27, 46, 0.6);
    font-family: 'Share Tech Mono', monospace;
    font-size: 8px;
    color: var(--muted);
    padding: 4px 8px;
    border-bottom: 1px solid rgba(79, 195, 255, 0.08);
}

.log-screen {
    flex-grow: 1;
    height: 125px;
    padding: 6px 8px;
    overflow-y: auto;
    overflow-x: hidden;
    word-wrap: break-word;
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    color: var(--cyan);
    line-height: 1.45;
}

/* Market block layouts */
.market-tabs {
    display: flex;
    gap: 4px;
}

.m-tab {
    background: rgba(13, 27, 46, 0.35);
    border: 1px solid var(--panel-border);
    color: var(--muted);
    font-size: 8px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.m-tab:hover {
    color: #fff;
    border-color: rgba(56, 213, 255, 0.25);
}

.m-tab.active {
    background: rgba(43, 124, 255, 0.15);
    border-color: rgba(56, 213, 255, 0.3);
    color: var(--cyan);
}

.ticker-box {
    background: rgba(5, 14, 27, 0.45);
    border: 1px solid rgba(79, 195, 255, 0.05);
    border-radius: 6px;
    padding: 6px 10px;
    margin-bottom: 8px;
}

.ticker-price-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.market-chart-container {
    height: 80px;
    padding: 0;
}

#marketCanvas {
    width: 100%;
    height: 100%;
}

/* Risk Gauges layouts */
.flex-layout-row {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;
}

.gauge-container {
    width: 85px;
    height: 85px;
    flex-shrink: 0;
}

.radial-gauge {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.gauge-bg { stroke: rgba(255, 255, 255, 0.04); }

.gauge-fill-green { stroke: var(--green); filter: drop-shadow(0 0 4px var(--green)); }
.gauge-fill-orange { stroke: var(--gold); filter: drop-shadow(0 0 4px var(--gold)); }
.gauge-fill-red { stroke: var(--red); filter: drop-shadow(0 0 4px var(--red)); }

.gauge-val {
    font-size: 15px;
    font-weight: 800;
    fill: var(--ink);
    text-anchor: middle;
    transform: rotate(90deg) translate(0px, -43px);
}

.gauge-lbl {
    font-size: 6px;
    font-weight: 800;
    fill: var(--muted);
    text-anchor: middle;
    letter-spacing: 0.5px;
    transform: rotate(90deg) translate(0px, -45px);
}

.risk-params {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.param-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 2px;
}

.risk-toggles {
    display: flex;
    gap: 3px;
    background: rgba(3, 9, 18, 0.5);
    border: 1px solid rgba(79, 195, 255, 0.08);
    padding: 2px;
    border-radius: 5px;
}

.risk-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 8px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.risk-btn.active {
    background: rgba(79, 195, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(79, 195, 255, 0.15);
}

.status-pill {
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: bold;
}

.active-pill {
    background: rgba(41, 230, 167, 0.08);
    border: 1px solid rgba(41, 230, 167, 0.25);
    color: var(--green);
    animation: blinkLight 3s infinite;
}

.inactive-pill {
    background: rgba(255, 102, 95, 0.08);
    border: 1px solid rgba(255, 102, 95, 0.25);
    color: var(--red);
}

.badge {
    background: rgba(165, 134, 255, 0.06);
    border: 1px solid rgba(165, 134, 255, 0.2);
    color: var(--violet);
    font-size: 8px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

/* ----------------------------------------------------
   Center Column / Canvas Neural Net Hero
   ---------------------------------------------------- */
.center-col {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    z-index: auto; /* Allow children to stack globally */
    pointer-events: none; /* Let pointer events pass through to canvas nodes */
}

.canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: auto; /* Allow children (brain & canvas) to stack globally */
}

#neuralCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.brain-glow-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85vh; /* Massive background centerpiece */
    height: 85vh;
    object-fit: contain;
    opacity: 0.35; /* Soft opacity for background integration */
    z-index: 5; /* Stack between background pass and foreground pass widgets */
    animation: brainGlowPulse 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes brainGlowPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.28; filter: drop-shadow(0 0 20px rgba(56, 213, 255, 0.15)); }
    50% { transform: translate(-50%, -50%) scale(1.03); opacity: 0.42; filter: drop-shadow(0 0 40px rgba(56, 213, 255, 0.35)); }
}

.center-hero-title {
    position: absolute;
    top: 14vh; /* Moved to top above brain centerpiece */
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 20; /* Elevated above widgets and signup section */
    pointer-events: none;
    width: 100%;
}

.center-hero-title h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 64px; /* Cinematic scale */
    font-weight: 900; /* Extra bold/black */
    text-transform: uppercase;
    letter-spacing: 14px; /* Futuristic letter spacing */
    color: #fff;
    background: linear-gradient(135deg, #ffffff 10%, #a3f4ff 50%, #38d5ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(56, 213, 255, 0.65)) drop-shadow(0 0 25px rgba(8, 119, 255, 0.5));
    animation: textPulse 4s ease-in-out infinite;
}

@keyframes textPulse {
    0%, 100% { 
        transform: scale(1); 
        filter: drop-shadow(0 0 10px rgba(56, 213, 255, 0.65)) drop-shadow(0 0 25px rgba(8, 119, 255, 0.5));
    }
    50% { 
        transform: scale(1.03); 
        filter: drop-shadow(0 0 20px rgba(56, 213, 255, 0.95)) drop-shadow(0 0 45px rgba(8, 119, 255, 0.85)) drop-shadow(0 0 75px rgba(8, 119, 255, 0.65));
    }
}

/* Center Invite Console positioning */
.signup-section {
    position: absolute;
    top: 48%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    z-index: 15; /* Elevated above all widgets and the brain centerpiece */
    pointer-events: auto; /* Enable clicks and inputs for signup form */
}

.signup-card {
    background: rgba(13, 27, 46, 0.55);
    border: 1px solid var(--panel-border);
}

.inline-status {
    background: rgba(240, 184, 74, 0.08);
    border: 1px solid rgba(240, 184, 74, 0.25);
    color: var(--gold);
}

.invite-form {
    display: flex;
}

.invite-form .input-group {
    display: flex;
    width: 100%;
    gap: 8px;
}

.invite-form input[type="email"] {
    flex-grow: 1;
    background: #010409;
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    padding: 8px 12px;
    color: #fff;
    font-size: 11px;
}

.invite-form input[type="email"]:focus {
    outline: none;
    border-color: var(--cyan);
}

.invite-form button {
    width: auto;
    padding: 8px 16px;
    font-size: 10px;
}

.signup-console-output {
    border: 1px solid rgba(79, 195, 255, 0.12);
    border-radius: 4px;
    background: #010409;
    margin-top: 8px;
}

.console-header {
    background: rgba(13, 27, 46, 0.5);
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    color: var(--cyan);
    padding: 4px 8px;
    border-bottom: 1px solid rgba(79, 195, 255, 0.08);
}

.console-lines {
    padding: 6px 8px;
    height: 75px;
    overflow-y: auto;
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    color: var(--soft);
    line-height: 1.4;
}

/* ----------------------------------------------------
   Footer Strip & Compliance disclosures
   ---------------------------------------------------- */
.footer-strip {
    height: 28px;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(3, 8, 17, 0.85);
    border-top: 1px solid var(--panel-border);
    font-size: 10px;
    color: var(--muted);
    z-index: 100;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-logo {
    height: 14px;
    filter: drop-shadow(0 0 4px rgba(56, 213, 255, 0.15));
}

.footer-link-btn {
    background: transparent;
    border: none;
    color: var(--cyan);
    font-weight: bold;
    cursor: pointer;
    font-size: 10px;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.footer-link-btn:hover {
    color: #fff;
}

/* Modal Popover */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(1, 4, 9, 0.75);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-card {
    background: rgba(10, 20, 34, 0.95);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    width: 90%;
    max-width: 580px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.7);
}

.modal-header {
    background: rgba(13, 27, 46, 0.8);
    padding: 12px 16px;
    border-bottom: 1px solid var(--panel-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.modal-header h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--cyan);
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: #fff;
}

.modal-body {
    padding: 20px;
    font-size: 12px;
    color: var(--soft);
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
}

/* Keyframes animations */
@keyframes fadeIn {
    to { opacity: 1; }
}

@keyframes pulseGlow {
    0% { opacity: 0.85; box-shadow: 0 0 6px var(--green); }
    50% { opacity: 1; box-shadow: 0 0 12px var(--green); }
    100% { opacity: 0.85; box-shadow: 0 0 6px var(--green); }
}

@keyframes blinkLight {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes flashGreen {
    0% { background-color: rgba(41, 230, 167, 0.18); }
    100% { background-color: transparent; }
}
@keyframes flashRed {
    0% { background-color: rgba(255, 102, 95, 0.18); }
    100% { background-color: transparent; }
}
.flash-up { animation: flashGreen 0.6s ease-out; }
.flash-down { animation: flashRed 0.6s ease-out; }

/* ----------------------------------------------------
   Responsive Layout (Mobile & Tablet)
   ---------------------------------------------------- */
@media (max-width: 1199px) {
    html, body {
        height: auto;
        overflow-y: auto;
    }
    
    .layout {
        height: auto;
        min-height: 100vh;
    }
    
    .dashboard-container {
        display: block; /* Reset grid to block flow */
        height: auto;
        padding: 72px 14px 40px; /* Space for header */
        overflow: visible;
    }

    .side-col {
        position: relative;
        top: auto;
        bottom: auto;
        left: auto;
        right: auto;
        width: 100% !important;
        height: auto;
        display: flex;
        flex-direction: column;
        gap: 20px;
        pointer-events: auto; /* restore pointer events on mobile */
    }

    .left-col, .right-col {
        position: relative;
        left: auto;
        right: auto;
        width: 100%;
        z-index: 10;
    }

    .center-col {
        position: relative;
        left: auto;
        right: auto;
        width: 100%;
        height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        order: -1; /* Render central signup above sidebar lists */
        z-index: 20;
        margin-bottom: 24px;
    }

    /* Reset absolute position and floating animations on mobile */
    #widget-bot, #widget-research, #widget-ops, #widget-market, #widget-risk {
        position: relative;
        top: auto;
        bottom: auto;
        left: auto;
        right: auto;
        width: 100%;
        height: auto;
        animation: none !important;
        transform: none !important;
        margin-bottom: 0;
    }

    .canvas-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: 1;
        pointer-events: none;
    }

    .brain-glow-img {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 280px; /* Slightly smaller for mobile viewports */
        height: 280px;
        opacity: 0.5; /* Fade out slightly on mobile to avoid clashing with text */
    }

    .center-hero-title {
        position: relative;
        top: auto;
        left: auto;
        bottom: auto;
        transform: none;
        margin-top: 16px;
        margin-bottom: 16px;
        text-align: center;
        width: 100%;
        order: 1;
    }

    .center-hero-title h1 {
        font-size: 28px;
        letter-spacing: 2px;
        animation: none !important;
        transform: none !important;
    }

    .signup-section {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        margin: 0 auto;
        width: 100%;
        max-width: 440px;
        z-index: 20;
        order: 2;
    }
}

@media (max-width: 768px) {
    .topbar {
        padding: 0 16px;
    }
    .status-indicator {
        display: none; /* Hide indicator to save width space on small mobiles */
    }
    
    .center-hero-title h1 {
        font-size: 20px;
        letter-spacing: 1.5px;
    }

    .gauge-container {
        width: 75px;
        height: 75px;
    }

    .flex-layout-row {
        gap: 10px;
    }
}

/* ----------------------------------------------------
   Quirky Toast Notification
   ---------------------------------------------------- */
.quirky-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: rgba(4, 9, 20, 0.95);
    border: 1px solid rgba(255, 76, 76, 0.45);
    box-shadow: 
        0 0 20px rgba(255, 76, 76, 0.2),
        inset 0 0 10px rgba(255, 76, 76, 0.08);
    border-radius: 8px;
    padding: 14px 18px;
    width: 320px;
    z-index: 9999;
    transform: translateY(-20px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
    pointer-events: none;
    backdrop-filter: blur(12px);
}

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

.quirky-toast .toast-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    letter-spacing: 1px;
    color: #ff4c4c;
    text-shadow: 0 0 5px rgba(255, 76, 76, 0.4);
}

.quirky-toast .toast-body {
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    color: #e2eeff;
    line-height: 1.4;
}

.quirky-toast .pulse-led.red {
    background-color: #ff4c4c;
    box-shadow: 0 0 8px #ff4c4c;
    display: inline-block;
    border-radius: 50%;
}

/* Mission Statement specific styles */
.mission-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
    background: linear-gradient(90deg, #38d5ff, #29e6a7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mission-text {
    font-size: 11px;
    color: var(--cyan);
    line-height: 1.5;
    margin-bottom: 12px;
}

.compliance-notice-box {
    background: rgba(3, 8, 17, 0.45);
    border: 1px solid rgba(255, 102, 95, 0.12);
    border-radius: 6px;
    padding: 10px 14px;
    margin-top: 16px;
}

.notice-tag {
    font-size: 8px;
    font-weight: 800;
    color: #ff665f;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 4px;
}

.compliance-notice-box p {
    margin: 0;
    font-size: 9px;
    color: var(--muted);
    line-height: 1.45;
}
