:root {
    /* RED TEAM PALETTE - Tactical Operations */
    /* Dark theme base: slightly cooler + higher perceived contrast (less crushed blacks). */
    --void-black: #07080b;
    --tactical-black: #0b0d12;
    --panel-black: #10141b;
    --grid-gray: #151a23;
    --border-tactical: rgba(255, 255, 255, 0.10);
    
    /* Alert Colors - Operational Status */
    /* Alerts */
    --blood-red: #ff2a2a;
    --crimson: #e11d48;
    --alert-amber: #ff7a18;
    --warning-yellow: #ffc233;
    --tactical-cyan: #00d4ff;
    --signal-green: #22ff6a;
    --stealth-gray: #6b7280;
    --ghost-white: #9ca3af;
    
    /* Glow Effects */
    --glow-red: 0 0 20px rgba(255, 26, 26, 0.6);
    --glow-amber: 0 0 20px rgba(255, 107, 0, 0.5);
    --glow-cyan: 0 0 20px rgba(0, 212, 255, 0.4);
    --glow-green: 0 0 20px rgba(0, 255, 65, 0.4);
    
    /* Tactical Grid */
    --grid-line: rgba(255, 42, 42, 0.020);
    --scan-line: rgba(0, 212, 255, 0.085);
    
    /* Typography */
    --font-mono: 'JetBrains Mono', monospace;
    --font-tactical: 'Rajdhani', sans-serif;
    --font-ui: var(--font-mono);
    
    /* Spacing */
    --header-height: 46px;
    --sidebar-width: 280px;
    --operation-panel: 236px;
    --desktop-ui-scale: 0.92;

    /* Polish tokens */
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --focus-ring: rgba(0, 212, 255, 0.22);
    --focus-ring-soft: rgba(0, 212, 255, 0.08);
    --elev-1: 0 10px 30px rgba(0, 0, 0, 0.28);
    --elev-2: 0 24px 70px rgba(0, 0, 0, 0.42);

    /* Sidebar chrome (theme-adaptive) */
    --sidebar-surface: linear-gradient(180deg, rgba(16, 18, 24, 0.98), rgba(10, 12, 18, 0.98));
    --sidebar-divider: rgba(255, 255, 255, 0.06);
    --sidebar-pill-bg: rgba(255, 255, 255, 0.03);
    --sidebar-pill-border: rgba(255, 255, 255, 0.10);
    --sidebar-btn-bg: rgba(255, 255, 255, 0.04);
    --sidebar-btn-bg-hover: rgba(255, 255, 255, 0.06);
    --sidebar-btn-border: rgba(255, 255, 255, 0.10);
    --sidebar-btn-border-hover: rgba(255, 255, 255, 0.14);
    --sidebar-title-color: rgba(229, 231, 235, 0.78);
    --sidebar-fg: rgba(229, 231, 235, 0.92);
    --rail-bg: rgba(10, 12, 18, 0.72);
    --rail-border: rgba(255, 255, 255, 0.10);

    /* Landing / briefing card (theme-adaptive) */
    --landing-border: rgba(255, 255, 255, 0.10);
    --landing-surface:
        radial-gradient(900px 420px at 40% 0%, rgba(0, 212, 255, 0.08), transparent 62%),
        radial-gradient(820px 520px at 80% 70%, rgba(255, 140, 0, 0.06), transparent 62%),
        linear-gradient(180deg, rgba(10, 12, 18, 0.82), rgba(10, 12, 18, 0.62));
    --landing-shadow: 0 34px 120px rgba(0, 0, 0, 0.58);
    --landing-title: rgba(255, 255, 255, 0.98);
    --landing-title-shadow: 0 24px 90px rgba(0, 0, 0, 0.82);
}

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

*::before, *::after {
    box-sizing: border-box;
}

*:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible {
    box-shadow: 0 0 0 3px var(--focus-ring-soft);
}

html {
    scroll-behavior: smooth;
    font-size: 13.5px;
    height: 100%;
}

/* Shared chrome (used by login + pricing) */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 10px 16px;
    border-bottom: 1px solid var(--chrome-border, rgba(255, 255, 255, 0.10));
    background: var(--chrome-surface, rgba(10, 12, 18, 0.86));
    background: color-mix(in srgb, var(--chrome-surface, rgba(10, 12, 18, 0.86)) 62%, rgba(0, 0, 0, 0.35));
    backdrop-filter: blur(16px);
}

.site-header-inner {
    max-width: var(--chrome-max, 1240px);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--chrome-text, rgba(229, 231, 235, 0.94));
    min-width: 0;
}

.site-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid var(--chrome-border, rgba(255, 255, 255, 0.10));
    background: var(--chrome-surface-2, rgba(255, 255, 255, 0.03));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    overflow: hidden;
    flex: 0 0 auto;
}

.site-brand-mark img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.site-brand-meta {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.site-brand-name {
    font-family: var(--font-ui, var(--font-mono));
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 11px;
    opacity: 0.82;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-brand-sub {
    font-size: 12px;
    color: var(--chrome-muted, rgba(156, 163, 175, 0.80));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-nav {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.site-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid transparent;
    text-decoration: none;
    color: var(--chrome-text, rgba(229, 231, 235, 0.94));
    background: transparent;
    opacity: 0.88;
    transition: opacity 0.18s ease, border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
    font-size: 12px;
}

.site-nav-link:hover {
    opacity: 1;
    border-color: var(--chrome-border, rgba(255, 255, 255, 0.10));
    background: var(--chrome-surface-2, rgba(255, 255, 255, 0.03));
    transform: translateY(-1px);
}

.site-footer {
    padding: 18px 16px 28px;
    border-top: 1px solid var(--chrome-border, rgba(255, 255, 255, 0.10));
    background: var(--chrome-surface, rgba(10, 12, 18, 0.86));
    background: color-mix(in srgb, var(--chrome-surface, rgba(10, 12, 18, 0.86)) 52%, rgba(0, 0, 0, 0.35));
    backdrop-filter: blur(12px);
}

.site-footer-inner {
    max-width: var(--chrome-max, 1240px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr minmax(260px, 2fr) 1fr;
    align-items: center;
    gap: 14px 18px;
    color: var(--chrome-muted, rgba(156, 163, 175, 0.80));
    font-size: 12px;
}

.site-footer-note {
    opacity: 0.9;
}

.site-footer-copy {
    color: var(--chrome-text, rgba(229, 231, 235, 0.94));
    opacity: 0.86;
    white-space: nowrap;
    min-width: 0;
}

.site-footer-meta {
    opacity: 0.85;
    text-align: center;
    min-width: 0;
}

.site-footer-legal {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    opacity: 0.78;
    white-space: nowrap;
    justify-self: end;
    min-width: 0;
}

.site-footer-link {
    color: var(--chrome-text, rgba(229, 231, 235, 0.94));
    opacity: 0.82;
    text-decoration: none;
    transition: opacity 0.18s ease, text-decoration-color 0.18s ease;
}

.site-footer-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.site-footer-sep {
    opacity: 0.6;
}

.site-footer-links {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.site-footer-links a {
    color: var(--chrome-text, rgba(229, 231, 235, 0.94));
    opacity: 0.84;
    text-decoration: none;
}

.site-footer-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

.site-footer-links span {
    opacity: 0.88;
}

@media (max-width: 560px) {
    .site-brand-sub {
        display: none;
    }

    .site-footer-inner {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .site-footer-copy,
    .site-footer-meta,
    .site-footer-legal {
        white-space: normal;
    }
}

body {
    font-family: var(--font-ui, var(--font-mono));
    /* Dark theme background: depth + subtle color separation (keeps NOCTIS vibe). */
    background:
        radial-gradient(1200px 720px at 18% -10%, rgba(0, 212, 255, 0.06), transparent 62%),
        radial-gradient(1000px 820px at 115% 10%, rgba(255, 42, 42, 0.035), transparent 62%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 26%),
        var(--void-black);
    color: var(--ghost-white);
    min-height: 100%;
    overflow: hidden;
    line-height: 1.5;
    position: relative;
}

:root {
    /* Mobile browsers can report an inflated 100vh (address bar), causing awkward vertical gaps.
       Use dynamic viewport units where supported. */
    --app-vh: 100vh;
}

@supports (height: 100dvh) {
    :root { --app-vh: 100dvh; }
}

@supports (height: 100svh) {
    :root { --app-vh: 100svh; }
}

body.system {
    /* SYSTEM BLACK (ChatGPT-like): neutral grays, modern sans UI, soft surfaces */
    --font-ui: 'Manrope', sans-serif;

    /* Blacks: keep OLED black but give panels a separable depth */
    --void-black: #000000;
    --tactical-black: #050505;   /* sidebar/intel base */
    --panel-black: #0b0b0b;      /* cards/modals */
    --grid-gray: #111111;        /* subtle separators */
    --border-tactical: rgba(255, 255, 255, 0.08);

    /* Accent policy: one muted accent + red only for danger */
    --tactical-cyan: #7dd3fc;    /* muted cyan-blue accent */
    --signal-green: #34d399;     /* success */
    --alert-amber: #fbbf24;      /* warning */
    --warning-yellow: #fde68a;   /* softer yellow */
    --blood-red: #fb7185;        /* danger (muted) */
    --crimson: #fb7185;

    /* Text hierarchy */
    --ghost-white: rgba(255, 255, 255, 0.92);
    --stealth-gray: rgba(255, 255, 255, 0.66);

    /* Glows: keep minimal in System Black */
    --glow-red: 0 0 20px rgba(251, 113, 133, 0.18);
    --glow-cyan: 0 0 20px rgba(125, 211, 252, 0.16);

    --grid-line: rgba(255, 255, 255, 0.0);
    --scan-line: rgba(255, 255, 255, 0.0);

    --focus-ring: rgba(125, 211, 252, 0.30);
    --focus-ring-soft: rgba(125, 211, 252, 0.12);

    --sidebar-surface: linear-gradient(180deg, rgba(10, 10, 10, 0.98), rgba(5, 5, 5, 0.98));
    --sidebar-divider: rgba(255, 255, 255, 0.06);
    --sidebar-pill-bg: rgba(255, 255, 255, 0.04);
    --sidebar-pill-border: rgba(255, 255, 255, 0.10);
    --sidebar-btn-bg: rgba(255, 255, 255, 0.05);
    --sidebar-btn-bg-hover: rgba(255, 255, 255, 0.07);
    --sidebar-btn-border: rgba(255, 255, 255, 0.10);
    --sidebar-btn-border-hover: rgba(255, 255, 255, 0.14);
    --sidebar-title-color: rgba(255, 255, 255, 0.76);
    --sidebar-fg: rgba(255, 255, 255, 0.92);
    --rail-bg: rgba(0, 0, 0, 0.70);
    --rail-border: rgba(255, 255, 255, 0.10);

    --landing-border: rgba(255, 255, 255, 0.08);
    --landing-surface:
        radial-gradient(900px 420px at 40% 0%, rgba(125, 211, 252, 0.10), transparent 62%),
        radial-gradient(820px 520px at 80% 70%, rgba(251, 191, 36, 0.06), transparent 62%),
        linear-gradient(180deg, rgba(10, 10, 10, 0.86), rgba(5, 5, 5, 0.76));
    --landing-shadow: 0 34px 120px rgba(0, 0, 0, 0.72);
    --landing-title: rgba(255, 255, 255, 0.96);
    --landing-title-shadow: 0 24px 90px rgba(0, 0, 0, 0.82);

    background: var(--void-black);
    color: var(--ghost-white);
}

body.system .scan-line,
body.system .matrix-rain {
    display: none;
}

body.system::after,
body.system::before {
    display: none;
}

/* SYSTEM BLACK: surfaces + controls should avoid neon glows */
body.system .header,
body.system .sidebar,
body.system .intel-panel,
body.system .command-container,
body.system .modal,
body.system .command-wrapper,
body.system .op-item,
body.system .intel-section,
body.system .sidebar-panel,
body.system .resource-monitor,
body.system .team-collaboration-panel {
    background: var(--panel-black);
    box-shadow:
        0 18px 46px rgba(0, 0, 0, 0.68),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    border-color: var(--border-tactical);
}

body.system .sidebar,
body.system .intel-panel {
    background: var(--tactical-black);
}

body.system .header {
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: none;
}

body.system .logo-text,
body.system .briefing-title,
body.system .profile-section-title {
    color: var(--ghost-white);
    font-family: var(--font-ui);
    font-weight: 700;
    text-shadow: none;
    letter-spacing: -0.01em;
    text-transform: none;
}

body.system .logo-sub,
body.system .tactical-info,
body.system .status-indicator,
body.system .connections-indicator,
body.system .operation-timer,
body.system .mission-clock,
body.system .threat-level,
body.system .op-title,
body.system .op-count,
body.system .intel-label,
body.system .dropdown-header,
body.system .resource-header,
body.system .resource-subtext,
body.system .stat-label {
    font-family: var(--font-ui);
    color: var(--stealth-gray);
    letter-spacing: 0.02em;
    text-transform: none;
}

body.system .op-item .op-preview,
body.system .profile-role,
body.system .resource-value,
body.system .stat-value,
body.system .intel-item,
body.system .loot-value {
    font-family: var(--font-ui);
    color: rgba(255, 255, 255, 0.86);
}

body.system .logo-text {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

body.system .logo-text::after {
    display: none;
}

body.system .logo-sub,
body.system .mission-id,
body.system .op-title,
body.system .op-count,
body.system .account-name,
body.system .account-sub,
body.system .hub-title,
body.system .hub-row-title,
body.system .hub-row-sub,
body.system .briefing-code,
body.system .briefing-subtitle,
body.system .engagement-title,
body.system .engagement-desc,
body.system .modal-header h2,
body.system .modal-intro,
body.system .profile-edit-field label,
body.system .profile-edit-hint,
body.system .command-prefix,
body.system .status-indicator span,
body.system .connections-indicator span,
body.system .operation-timer,
body.system .threat-level,
body.system .mission-clock,
body.system .resource-header,
body.system .resource-subtext,
body.system .dropdown-header,
body.system .account-menu-item,
body.system .account-menu-header-name,
body.system .account-menu-header-sub,
body.system .new-op-btn,
body.system .ops-tool-btn,
body.system .tactical-btn,
body.system .clock-control,
body.system .quick-action {
    font-family: var(--font-ui);
    letter-spacing: 0;
    text-transform: none;
}

body.system .briefing-title {
    font-size: clamp(42px, 5vw, 64px);
    font-weight: 700;
    letter-spacing: -0.04em;
}

body.system .briefing-title::after {
    display: none;
}

body.system .briefing-subtitle {
    color: rgba(255, 255, 255, 0.74);
    font-size: 20px;
    line-height: 1.6;
    max-width: 820px;
    margin-inline: auto;
}

body.system .briefing-classification {
    border-width: 1px;
    letter-spacing: 2px;
}

body.system .engagement-card {
    background: rgba(255, 255, 255, 0.035);
    border-color: rgba(255, 255, 255, 0.10);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
}

body.system .engagement-card::before {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.22), transparent);
    opacity: 0.18;
}

body.system .engagement-card:hover {
    background: rgba(255, 255, 255, 0.055);
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.62);
}

body.system .engagement-title {
    font-weight: 700;
    font-size: 20px;
    color: rgba(255, 255, 255, 0.94);
}

body.system .engagement-desc {
    color: rgba(255, 255, 255, 0.62);
    line-height: 1.65;
}

body.system .command-prefix {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.76);
    border-radius: 10px;
}

body.system .command-wrapper {
    border-left-width: 1px;
    border-left-color: rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 6px;
}

body.system .command-wrapper:focus-within {
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.10), 0 14px 34px rgba(0, 0, 0, 0.35);
}

body.system .tactical-btn,
body.system .clock-control,
body.system .quick-action,
body.system .ops-tool-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.88);
    box-shadow: none;
}

body.system .tactical-btn:hover,
body.system .clock-control:hover,
body.system .quick-action:hover,
body.system .ops-tool-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: none;
}

body.system .op-search-input,
body.system .command-field,
body.system .notes-area,
body.system .vuln-search-input,
body.system .hub-row-right input[type='text'],
body.system .hub-row-right input[type='password'],
body.system .hub-row-right input[type='number'],
body.system .hub-row-right select,
body.system .setting-item input[type="text"],
body.system .setting-item input[type="number"],
body.system .setting-item select,
body.system .setting-item textarea {
    font-family: var(--font-ui);
    font-size: 15px;
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.92);
}

body.system .op-search-input::placeholder,
body.system .command-field::placeholder,
body.system .notes-area::placeholder,
body.system .vuln-search-input::placeholder,
body.system .hub-row-right input::placeholder,
body.system .setting-item input::placeholder,
body.system .setting-item textarea::placeholder {
    color: rgba(255, 255, 255, 0.48);
}

body.system .modal-btn {
    font-family: var(--font-ui);
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    background: rgba(255, 255, 255, 0.92);
    color: rgba(0, 0, 0, 0.94);
    box-shadow: none;
}

body.system .modal-btn:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: none;
}

body.system .modal-btn-secondary {
    font-family: var(--font-ui);
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.86);
}

body.system .modal-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.10);
    box-shadow: none;
}

/* SYSTEM BLACK: improve log/chat readability (higher contrast than tactical theme). */
body.system .log-header {
    color: rgba(255, 255, 255, 0.64);
}

body.system .log-timestamp {
    color: rgba(255, 255, 255, 0.72);
}

body.system .log-bubble {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.94);
}

body.system .log-entry.agent .log-bubble {
    border-left-color: rgba(125, 211, 252, 0.85);
    border-color: rgba(125, 211, 252, 0.18);
}

body.system .log-entry.operator .log-bubble {
    border-right-color: rgba(251, 113, 133, 0.85);
    border-color: rgba(251, 113, 133, 0.16);
}

body.system .sidebar-footer {
    background: #000000;
    border-top-color: rgba(255, 255, 255, 0.08);
}

body.system .account-footer {
    background: #000000;
    border-color: rgba(255, 255, 255, 0.10);
}

body.system .account-footer:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
}

body.system .account-menu {
    background: #000000;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 18px 46px rgba(0, 0, 0, 0.55);
}

/* SYSTEM BLACK: account menu should be monochrome (no cyan hover). */
body.system .account-menu-panels,
body.system .account-menu-panel {
    will-change: transform;
}

body.system .account-menu-header-avatar {
    font-family: var(--font-ui);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.90);
}

body.system .account-menu-header-name {
    letter-spacing: 0;
    font-weight: 700;
}

body.system .account-menu-item {
    color: rgba(255, 255, 255, 0.86);
    letter-spacing: 0;
}

body.system .account-menu-item i,
body.system .account-menu-next {
    color: rgba(255, 255, 255, 0.62);
}

body.system .account-menu-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.94);
}

body.system .account-menu-item:hover i,
body.system .account-menu-item:hover .account-menu-next {
    color: rgba(255, 255, 255, 0.92);
    opacity: 1;
}

body.system .account-menu-divider {
    background: rgba(255, 255, 255, 0.10);
}

body.system .account-menu-item-danger:hover {
    background: rgba(255, 42, 42, 0.10);
    border-color: rgba(255, 42, 42, 0.22);
}

body.system .account-menu-item-danger:hover i {
    color: rgba(255, 200, 200, 0.95);
}

/* SYSTEM BLACK: modals + settings hub readability */
body.system .modal-overlay {
    background: rgba(0, 0, 0, 0.60);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* Let the browser render native form controls (select dropdowns, etc.) appropriately per theme. */
body.system,
body:not(.matrix):not(.system) {
    color-scheme: dark;
}

body.matrix {
    color-scheme: light;
}

/* Fallback styling for select dropdown options (some browsers ignore these). */
body.system select option,
body.system .hub-row-right select option,
body.system .setting-item select option {
    background: rgba(7, 9, 13, 0.98);
    color: rgba(229, 231, 235, 0.95);
}

body.matrix select option,
body.matrix .hub-row-right select option,
body.matrix .setting-item select option {
    background: rgba(255, 255, 255, 0.98);
    color: rgba(15, 23, 42, 0.90);
}

/* SPECIALIZED (default/dark): match system blur treatment */
body:not(.matrix):not(.system) .modal-overlay {
    background: rgba(0, 0, 0, 0.60);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* PROFESSIONAL WHITE (matrix): use a lighter veil + blur */
body.matrix .modal-overlay {
    background: rgba(245, 248, 255, 0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

body.matrix .mission-briefing::before {
    background:
        radial-gradient(820px 520px at 50% 52%, rgba(29, 78, 216, 0.08), transparent 64%),
        radial-gradient(680px 480px at 64% 56%, rgba(217, 119, 6, 0.05), transparent 68%),
        radial-gradient(1200px 760px at 50% 50%, rgba(15, 23, 42, 0.22), transparent 70%);
    opacity: 0.75;
}

/* Professional White: ensure landing card text/buttons have enough contrast */
body.matrix .landing-brand,
body.matrix .landing-badge {
    color: rgba(15, 23, 42, 0.66);
}

body.matrix .landing-btn,
body.matrix .landing-workflow {
    color: rgba(15, 23, 42, 0.86);
    border-color: rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 18px 56px rgba(15, 23, 42, 0.08);
}

body.matrix .landing-btn:hover,
body.matrix .landing-workflow:hover {
    border-color: rgba(29, 78, 216, 0.22);
    background: rgba(29, 78, 216, 0.06);
}

body.system .modal {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015)),
        #000000;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 30px 80px rgba(0, 0, 0, 0.78);
}

body.system .modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.system .modal-close {
    color: rgba(255, 255, 255, 0.72);
    border-color: rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.04);
}

body.system .modal-close:hover {
    color: rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
}

body.system .hub-nav {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012)),
        #000000;
    border-right-color: rgba(255, 255, 255, 0.08);
}

body.system .hub-nav-item {
    color: rgba(255, 255, 255, 0.72);
    border-color: transparent;
}

body.system .hub-nav-item i {
    color: rgba(255, 255, 255, 0.54);
}

body.system .hub-nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.88);
}

body.system .hub-nav-item:hover i {
    color: rgba(255, 255, 255, 0.82);
}

body.system .hub-nav-item.is-active {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.94);
}

body.system .hub-nav-item.is-active i {
    color: rgba(255, 255, 255, 0.90);
}

body.system .hub-main {
    background: transparent;
}

body.system .hub-row {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

/* Dark theme polish: slightly softer typography + borders on major surfaces */
body:not(.matrix):not(.system) .sidebar,
body:not(.matrix):not(.system) .main-content,
body:not(.matrix):not(.system) .intel-panel {
    border-color: rgba(255,255,255,0.08);
}

body:not(.matrix):not(.system) {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Specialized theme: keep the background clean (no grid/scanlines). */
body:not(.matrix):not(.system)::before,
body:not(.matrix):not(.system)::after {
    display: none;
}

/* Specialized theme: reduce "boxy/texture" patterns inside the right intelligence panel. */
body:not(.matrix):not(.system) .intel-header {
    background: rgba(255, 107, 0, 0.055);
}

body:not(.matrix):not(.system) .intel-section {
    background: rgba(10, 12, 18, 0.88);
    border-color: rgba(255,255,255,0.06);
    box-shadow: none;
}

body:not(.matrix):not(.system) .intel-section-priority {
    background: rgba(10, 12, 18, 0.90);
}

body:not(.matrix):not(.system) .intel-section-support {
    background: rgba(10, 12, 18, 0.88);
}

body:not(.matrix):not(.system) .target-profile {
    background: rgba(10, 12, 18, 0.92);
    box-shadow: none;
}

body:not(.matrix):not(.system) .loot-box {
    background: rgba(10, 12, 18, 0.92);
    box-shadow: none;
}

/* Specialized theme: apply the clean, flat-surface treatment across the UI (no noisy gradients/textures). */
body:not(.matrix):not(.system) .sidebar,
body:not(.matrix):not(.system) .main-content,
body:not(.matrix):not(.system) .intel-panel,
body:not(.matrix):not(.system) .command-container,
body:not(.matrix):not(.system) .command-wrapper,
body:not(.matrix):not(.system) .modal,
body:not(.matrix):not(.system) .sidebar-panel,
body:not(.matrix):not(.system) .resource-monitor,
body:not(.matrix):not(.system) .team-collaboration-panel {
    background: rgba(10, 12, 18, 0.92) !important;
    box-shadow: none;
}

body:not(.matrix):not(.system) .header {
    background: rgba(10, 12, 18, 0.96) !important;
}

body:not(.matrix):not(.system) .op-search-input,
body:not(.matrix):not(.system) input,
body:not(.matrix):not(.system) textarea,
body:not(.matrix):not(.system) select {
    background: rgba(255,255,255,0.03);
    box-shadow: none;
}

body:not(.matrix):not(.system) select {
    color: var(--ghost-white);
    border-color: rgba(255,255,255,0.10);
}

body:not(.matrix):not(.system) select option {
    background: rgba(10, 12, 18, 0.98);
    color: rgba(229, 231, 235, 0.95);
}

body:not(.matrix):not(.system) .ops-tool-btn,
body:not(.matrix):not(.system) .new-op-btn,
body:not(.matrix):not(.system) .footer-btn,
body:not(.matrix):not(.system) .modal-btn,
body:not(.matrix):not(.system) .modal-btn-secondary {
    background: rgba(255,255,255,0.04);
    box-shadow: none;
}

body:not(.matrix):not(.system) .ops-tool-btn:hover,
body:not(.matrix):not(.system) .new-op-btn:hover,
body:not(.matrix):not(.system) .footer-btn:hover,
body:not(.matrix):not(.system) .modal-btn:hover,
body:not(.matrix):not(.system) .modal-btn-secondary:hover {
    background: rgba(255,255,255,0.06);
    box-shadow: none;
}

body:not(.matrix):not(.system) .account-menu,
body:not(.matrix):not(.system) .notifications-dropdown {
    background: rgba(10, 12, 18, 0.98);
    box-shadow: 0 18px 46px rgba(0,0,0,0.55);
}

body:not(.matrix):not(.system) .target-profile,
body:not(.matrix):not(.system) .loot-box,
body:not(.matrix):not(.system) .intel-item {
    box-shadow: none;
    background: rgba(10, 12, 18, 0.92);
}

body:not(.matrix):not(.system) .op-item,
body:not(.matrix):not(.system) .resource-item,
body:not(.matrix):not(.system) .stat,
body:not(.matrix):not(.system) .hub-row,
body:not(.matrix):not(.system) .modal-card {
    background: rgba(10, 12, 18, 0.92);
    box-shadow: none;
}

body:not(.matrix):not(.system) .modal-system {
    box-shadow: 0 0 44px rgba(255, 26, 26, 0.14), inset 0 0 0 1px rgba(255,255,255,0.02);
}

/* Anti-copy: disable selecting console UI text (inputs/textarea remain selectable). */
body.no-copy {
    -webkit-user-select: none;
    user-select: none;
}

body.no-copy input,
body.no-copy textarea,
body.no-copy [contenteditable="true"] {
    -webkit-user-select: text;
    user-select: text;
}

body.matrix {
    /* PROFESSIONAL THEME (replaces old matrix) */
    --font-ui: 'Manrope', sans-serif;
    --void-black: #f6f7fb;
    --tactical-black: #eff2f7;
    --panel-black: #ffffff;
    --grid-gray: #e6eaf0;
    --border-tactical: rgba(15, 23, 42, 0.12);
    --blood-red: #dc2626;
    --crimson: #be123c;
    --alert-amber: #d97706;
    --warning-yellow: #a16207;
    --tactical-cyan: #1d4ed8;
    --signal-green: #16a34a;
    --ghost-white: #0f172a;
    --stealth-gray: rgba(15, 23, 42, 0.66);
    --grid-line: rgba(15, 23, 42, 0.02);
    --scan-line: rgba(15, 23, 42, 0.03);
    --focus-ring: rgba(29, 78, 216, 0.22);
    --focus-ring-soft: rgba(29, 78, 216, 0.10);
    /* Keep the page background neutral/cool; avoid warm “pink” wash in light mode. */
    background:
        radial-gradient(1200px 720px at 20% -10%, rgba(37, 99, 235, 0.06), transparent 58%),
        radial-gradient(1000px 760px at 110% 10%, rgba(15, 23, 42, 0.020), transparent 62%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.015), transparent 26%),
        var(--void-black);
    color: var(--ghost-white);

    --sidebar-surface: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(241,245,249,0.96));
    --sidebar-divider: rgba(15, 23, 42, 0.10);
    --sidebar-pill-bg: rgba(255, 255, 255, 0.86);
    --sidebar-pill-border: rgba(15, 23, 42, 0.12);
    --sidebar-btn-bg: rgba(255, 255, 255, 0.92);
    --sidebar-btn-bg-hover: rgba(255, 255, 255, 0.98);
    --sidebar-btn-border: rgba(15, 23, 42, 0.12);
    --sidebar-btn-border-hover: rgba(15, 23, 42, 0.16);
    --sidebar-title-color: rgba(15, 23, 42, 0.72);
    --sidebar-fg: rgba(15, 23, 42, 0.86);
    --rail-bg: rgba(255, 255, 255, 0.92);
    --rail-border: rgba(15, 23, 42, 0.12);

    --landing-border: rgba(15, 23, 42, 0.10);
    --landing-surface:
        radial-gradient(900px 420px at 40% 0%, rgba(29, 78, 216, 0.08), transparent 62%),
        radial-gradient(820px 520px at 80% 70%, rgba(217, 119, 6, 0.06), transparent 62%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(241, 245, 249, 0.92));
    --landing-shadow: 0 34px 120px rgba(15, 23, 42, 0.14);
    --landing-title: rgba(15, 23, 42, 0.92);
    --landing-title-shadow: 0 18px 70px rgba(15, 23, 42, 0.18);
}

body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

body.interface-paused .sidebar,
body.interface-paused .main-content,
body.interface-paused .intel-panel,
body.interface-paused .logo-section,
body.interface-paused .tactical-info,
body.interface-paused .header-actions,
body.interface-paused .sidebar-footer,
body.interface-paused .sidebar-content,
body.interface-paused .intel-content {
    opacity: 0.42;
    filter: grayscale(0.25);
    pointer-events: none;
}

body.interface-paused .mission-clock {
    position: relative;
    z-index: 10;
    opacity: 1;
    filter: none;
    pointer-events: auto;
}

body.interface-paused .mission-clock::after {
    content: 'SYSTEM PAUSED';
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    padding: 6px 10px;
    background: rgba(255, 26, 26, 0.14);
    border: 1px solid rgba(255, 26, 26, 0.45);
    border-radius: 6px;
    color: var(--blood-red);
    font-size: 10px;
    letter-spacing: 2px;
    white-space: nowrap;
}

body.interface-paused .scan-line,
body.interface-paused .matrix-rain,
body.interface-paused .status-dot,
body.interface-paused .connections-dot,
body.interface-paused .tactical-btn.tactical-alert,
body.interface-paused .processing-dot,
body.interface-paused .meter-fill,
body.interface-paused .resource-fill,
body.interface-paused .network-map-sweep,
body.interface-paused .network-status-dot,
body.interface-paused .network-map .node,
body.interface-paused .network-map line,
body.interface-paused .network-map circle {
    animation-play-state: paused !important;
}

body.interface-paused button:not(#pause-overlay-resume),
body.interface-paused input,
body.interface-paused textarea,
body.interface-paused select {
    cursor: not-allowed;
}

.pause-overlay {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background:
        radial-gradient(circle at 50% 30%, rgba(0, 116, 255, 0.18), transparent 24%),
        linear-gradient(180deg, rgba(1, 6, 14, 0.88), rgba(2, 6, 12, 0.96));
    backdrop-filter: blur(16px);
}

.pause-overlay.hidden {
    display: none;
}

.pause-overlay-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.06) 1px, transparent 1px);
    background-size: 52px 52px;
    opacity: 0.38;
    pointer-events: none;
}

.pause-overlay-card {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    padding: 34px 28px 30px;
    border-radius: 24px;
    border: 1px solid rgba(0, 212, 255, 0.22);
    background:
        linear-gradient(180deg, rgba(4, 10, 22, 0.94), rgba(4, 12, 24, 0.82)),
        rgba(0, 0, 0, 0.56);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 24px 80px rgba(0, 0, 0, 0.46),
        0 0 40px rgba(0, 116, 255, 0.12);
    text-align: center;
}

.pause-overlay-card::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 23px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    pointer-events: none;
}

.pause-logo-shell {
    width: 124px;
    height: 124px;
    margin: 0 auto 18px;
    padding: 6px;
    border-radius: 28px;
    background:
        linear-gradient(145deg, rgba(2, 10, 20, 0.98), rgba(8, 20, 38, 0.9)),
        radial-gradient(circle at 50% 12%, rgba(0, 212, 255, 0.22), transparent 64%);
    border: 1px solid rgba(0, 212, 255, 0.24);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 0 28px rgba(0, 110, 255, 0.22);
}

.pause-logo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 22px;
    filter: saturate(1.08) contrast(1.08);
}

.pause-overlay-title {
    color: #f1f8ff;
    font-family: var(--font-tactical);
    font-size: clamp(36px, 6vw, 54px);
    font-weight: 700;
    letter-spacing: 8px;
    text-transform: uppercase;
    text-shadow:
        0 0 18px rgba(0, 122, 255, 0.26),
        0 0 34px rgba(255, 255, 255, 0.08);
}

.pause-overlay-subtitle {
    margin-top: 8px;
    color: rgba(191, 226, 255, 0.8);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.pause-overlay-progress {
    position: relative;
    height: 12px;
    margin: 26px auto 16px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.14);
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.35);
}

.pause-overlay-progress-fill {
    width: 46%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(0, 120, 255, 0.8), rgba(0, 212, 255, 1), rgba(255, 255, 255, 0.92));
    box-shadow:
        0 0 18px rgba(0, 140, 255, 0.36),
        0 0 30px rgba(0, 212, 255, 0.22);
    animation: pauseOverlayLoad 2.4s ease-in-out infinite;
}

.pause-overlay-status {
    color: var(--tactical-cyan);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 2px;
}

.pause-overlay-btn {
    margin-top: 22px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border: 1px solid rgba(0, 212, 255, 0.32);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0, 92, 160, 0.3), rgba(0, 32, 70, 0.58));
    color: #eef8ff;
    font-family: var(--font-tactical);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    box-shadow:
        inset 0 0 14px rgba(0, 120, 255, 0.08),
        0 0 18px rgba(0, 140, 255, 0.12);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.pause-overlay-btn i {
    font-size: 14px;
    line-height: 1;
}

.pause-overlay-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 212, 255, 0.55);
    box-shadow:
        inset 0 0 14px rgba(0, 120, 255, 0.12),
        0 0 24px rgba(0, 140, 255, 0.18);
}

@keyframes pauseOverlayLoad {
    0% {
        transform: translateX(-62%);
    }
    50% {
        transform: translateX(64%);
    }
    100% {
        transform: translateX(-62%);
    }
}

body.reduced-motion .pause-overlay-progress-fill,
body.interface-paused.reduced-motion .pause-overlay-progress-fill {
    animation: none;
    width: 72%;
}

body.reduced-motion .network-map-sweep {
    animation: none;
    opacity: 0.16;
    transform: none;
}

/* TACTICAL BACKGROUND GRID */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

/* SCANLINE OVERLAY */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.15) 2px,
        rgba(0, 0, 0, 0.15) 4px
    );
    pointer-events: none;
    z-index: 9999;
    opacity: 0.3;
}

body.matrix .header,
body.matrix .sidebar,
body.matrix .intel-panel,
body.matrix .command-container,
body.matrix .modal,
body.matrix .command-wrapper,
body.matrix .op-item,
body.matrix .intel-section,
body.matrix .sidebar-panel,
body.matrix .resource-monitor,
body.matrix .team-collaboration-panel {
    background:
        linear-gradient(180deg, #ffffff, #f8fafc);
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.06), 0 14px 34px rgba(15, 23, 42, 0.10);
}

body.matrix .header {
    border-bottom: 1px solid rgba(15, 23, 42, 0.10);
}

body.matrix .header::before {
    display: none;
}

body.matrix .matrix-rain {
    display: none;
}

body.matrix .scan-line {
    display: none;
}

body.matrix::after {
    display: none;
}

body.matrix::before {
    /* Disable the global grid overlay for a crisp, GPT-like light UI. */
    display: none;
}

body.matrix .logo-text,
body.matrix .briefing-title {
    color: rgba(15, 23, 42, 0.92);
    text-shadow: none;
    font-family: var(--font-ui);
}

body.matrix .logo-sub,
body.matrix .tactical-info,
body.matrix .status-indicator,
body.matrix .connections-indicator,
body.matrix .operation-timer,
body.matrix .mission-clock,
body.matrix .threat-level,
body.matrix .op-title,
body.matrix .op-count,
body.matrix .intel-label,
body.matrix .dropdown-header,
body.matrix .resource-header,
body.matrix .resource-subtext,
body.matrix .stat-label {
    color: rgba(15, 23, 42, 0.70);
    font-family: var(--font-ui);
}

body.matrix .op-item .op-preview,
body.matrix .profile-role,
body.matrix .resource-value,
body.matrix .stat-value,
body.matrix .intel-item,
body.matrix .loot-value {
    color: rgba(15, 23, 42, 0.82);
    font-family: var(--font-ui);
}

/* PROFESSIONAL THEME: engagement / briefing blocks */
body.matrix .briefing-code {
    color: rgba(15, 23, 42, 0.55);
    font-family: var(--font-mono);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

body.matrix .briefing-title {
    color: rgba(15, 23, 42, 0.92);
    text-shadow: none;
    font-family: var(--font-ui);
    text-transform: none;
    letter-spacing: -0.04em;
    font-size: clamp(46px, 5vw, 66px);
    line-height: 1.05;
}

body.matrix .briefing-title::after {
    background: linear-gradient(90deg, transparent, rgba(29, 78, 216, 0.6), transparent);
}

body.matrix .briefing-subtitle {
    color: rgba(15, 23, 42, 0.66);
    font-family: var(--font-ui);
    font-size: 16px;
    letter-spacing: 0;
    max-width: 660px;
}

body.matrix .briefing-classification {
    border-width: 1px;
    font-family: var(--font-ui);
    letter-spacing: 0.12em;
}

body.matrix .engagement-card {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.98), rgba(241,245,249,0.98));
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.05), 0 10px 22px rgba(15, 23, 42, 0.08);
    border-radius: 16px;
}

body.matrix .engagement-card::before {
    display: none;
}

body.matrix .engagement-title {
    color: rgba(15, 23, 42, 0.88);
    font-family: var(--font-ui);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 700;
    font-size: 16px;
}

body.matrix .engagement-desc {
    color: rgba(15, 23, 42, 0.64);
    font-family: var(--font-ui);
    letter-spacing: 0;
    font-size: 12.5px;
    line-height: 1.6;
}

body.matrix .engagement-icon {
    color: rgba(29, 78, 216, 0.88);
}

body.matrix .engagement-card:hover {
    background:
        linear-gradient(180deg, rgba(255,255,255,1), rgba(241,245,249,1));
    border-color: rgba(29, 78, 216, 0.22);
    box-shadow: 0 0 0 1px rgba(29, 78, 216, 0.10), 0 18px 38px rgba(15, 23, 42, 0.12);
}

body.matrix .top-secret-stamp {
    border-color: rgba(15, 23, 42, 0.18);
    color: rgba(15, 23, 42, 0.62);
    opacity: 0.65;
}

body.matrix .op-item[data-status='compromised'] {
    border-left-color: rgba(182, 35, 24, 0.55);
}

body.matrix .op-item[data-status='pending'] {
    border-left-color: rgba(178, 93, 0, 0.45);
}

body.matrix .op-item:hover {
    background: rgba(29, 78, 216, 0.06);
    border-color: rgba(29, 78, 216, 0.22);
    box-shadow: 0 0 0 1px rgba(29, 78, 216, 0.08), 0 12px 26px rgba(15, 23, 42, 0.10);
}

body.matrix .op-item.active {
    background: rgba(29, 78, 216, 0.10);
    border-color: rgba(29, 78, 216, 0.28);
    box-shadow: 0 0 0 1px rgba(29, 78, 216, 0.10), 0 12px 26px rgba(15, 23, 42, 0.10);
}

body.matrix .op-item::before {
    background: rgba(29, 78, 216, 0.95);
}

body.matrix .tactical-btn,
body.matrix .clock-control,
body.matrix .quick-action,
body.matrix .ops-tool-btn {
    border-color: rgba(15, 23, 42, 0.12);
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(238,242,246,0.98));
    color: rgba(15, 23, 42, 0.82);
}

body.matrix .tactical-btn:hover,
body.matrix .clock-control:hover,
body.matrix .quick-action:hover,
body.matrix .ops-tool-btn:hover {
    border-color: rgba(29, 78, 216, 0.32);
    color: rgba(29, 78, 216, 0.95);
    box-shadow: 0 0 0 1px rgba(29, 78, 216, 0.12), 0 10px 24px rgba(15, 23, 42, 0.10);
}

body.matrix .ops-tool-btn-danger {
    border-color: rgba(185, 28, 28, 0.20);
    color: rgba(185, 28, 28, 0.86);
}

body.matrix .ops-tool-btn-danger:hover {
    border-color: rgba(185, 28, 28, 0.28);
    color: rgba(185, 28, 28, 0.92);
    box-shadow: 0 0 0 1px rgba(185, 28, 28, 0.08), 0 14px 30px rgba(15, 23, 42, 0.12);
}

body.matrix .op-search-input,
body.matrix .command-field,
body.matrix .notes-area,
body.matrix .vuln-search-input,
body.matrix .hub-row-right input[type='text'],
body.matrix .hub-row-right input[type='password'],
body.matrix .hub-row-right input[type='number'],
body.matrix .hub-row-right select,
body.matrix .setting-item input[type="text"],
body.matrix .setting-item input[type="number"],
body.matrix .setting-item select,
body.matrix .setting-item textarea {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.98), rgba(238,242,246,0.98));
    border-color: rgba(15, 23, 42, 0.14);
    color: rgba(15, 23, 42, 0.92);
    font-family: var(--font-ui);
}

/* PROFESSIONAL WHITE: command input should feel like a clean assistant prompt. */
body.matrix .command-wrapper {
    border-left-width: 1px;
    border-left-color: rgba(15, 23, 42, 0.12);
    border-radius: 14px;
    padding: 6px;
}

body.matrix .command-wrapper:focus-within {
    border-color: rgba(29, 78, 216, 0.28);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.10), 0 14px 34px rgba(15, 23, 42, 0.10);
}

body.matrix .command-prefix {
    background: rgba(29, 78, 216, 0.08);
    color: rgba(29, 78, 216, 0.95);
    font-family: var(--font-ui);
    letter-spacing: 0;
    border-radius: 10px;
}

body.matrix .command-prefix:hover {
    background: rgba(29, 78, 216, 0.10);
}

body.matrix .command-prefix::after {
    display: none;
}

body.matrix .assist-attachment-chip {
    border-color: rgba(15, 23, 42, 0.12);
    background: rgba(15, 23, 42, 0.03);
    color: rgba(15, 23, 42, 0.82);
    font-family: var(--font-ui);
}

body.matrix .assist-attachment-chip button {
    border-color: rgba(15, 23, 42, 0.14);
    background: rgba(255, 255, 255, 0.70);
    color: rgba(15, 23, 42, 0.70);
}

body.matrix .assist-attachment-chip button:hover {
    border-color: rgba(185, 28, 28, 0.18);
    color: rgba(185, 28, 28, 0.90);
    background: rgba(185, 28, 28, 0.08);
}

body.matrix .op-search-input::placeholder,
body.matrix .command-field::placeholder,
body.matrix .notes-area::placeholder,
body.matrix .vuln-search-input::placeholder,
body.matrix .hub-row-right input::placeholder,
body.matrix .setting-item input::placeholder,
body.matrix .setting-item textarea::placeholder {
    color: rgba(15, 23, 42, 0.45);
}

/* PROFESSIONAL THEME: sidebar + account menu should not inherit dark gradients */
body.matrix .sidebar-header {
    background:
        radial-gradient(800px 220px at 20% 0%, rgba(29, 78, 216, 0.08), transparent 70%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.02), rgba(255,255,255,0));
    border-bottom-color: rgba(15, 23, 42, 0.10);
}

body.matrix .mission-id {
    color: rgba(15, 23, 42, 0.86);
    font-family: var(--font-ui);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body.matrix .new-op-btn {
    background: linear-gradient(180deg, #ffffff, #f1f5f9);
    border-color: rgba(15, 23, 42, 0.14);
    color: rgba(15, 23, 42, 0.80);
    font-family: var(--font-ui);
    letter-spacing: 0.06em;
    text-shadow: none;
}

body.matrix .new-op-btn::before {
    background: linear-gradient(90deg, transparent, rgba(29, 78, 216, 0.22), transparent);
}

body.matrix .new-op-btn:hover {
    background: linear-gradient(180deg, #ffffff, #eaf0f7);
    border-color: rgba(29, 78, 216, 0.28);
    box-shadow: 0 0 0 1px rgba(29, 78, 216, 0.12), 0 16px 34px rgba(15, 23, 42, 0.12);
    text-shadow: none;
}

body.matrix .op-count {
    color: rgba(29, 78, 216, 0.92);
    border-color: rgba(29, 78, 216, 0.30);
    background: rgba(29, 78, 216, 0.06);
}

body.matrix .sidebar-footer {
    background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(241,245,249,0.92));
    border-top-color: rgba(15, 23, 42, 0.10);
}

body.matrix .account-footer {
    background: linear-gradient(180deg, #ffffff, #f1f5f9);
    border-color: rgba(15, 23, 42, 0.12);
    color: rgba(15, 23, 42, 0.82);
}

body.matrix .account-footer:hover {
    border-color: rgba(29, 78, 216, 0.28);
    background: linear-gradient(180deg, #ffffff, #eaf0f7);
}

body.matrix .account-avatar {
    background: rgba(29, 78, 216, 0.10);
    border-color: rgba(29, 78, 216, 0.22);
    color: rgba(29, 78, 216, 0.92);
}

body.matrix .account-sub {
    color: rgba(15, 23, 42, 0.56);
    font-family: var(--font-ui);
    letter-spacing: 0.10em;
}

body.matrix .account-name {
    font-family: var(--font-ui);
    letter-spacing: 0;
}

body.matrix .account-menu {
    border-color: rgba(15, 23, 42, 0.12);
    background:
        linear-gradient(180deg, #ffffff, #f1f5f9);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.05), 0 18px 46px rgba(15, 23, 42, 0.14);
    font-family: var(--font-ui);
}

body.matrix .account-menu-item {
    color: rgba(15, 23, 42, 0.84);
}

body.matrix .account-menu-item i {
    color: rgba(15, 23, 42, 0.62);
}

body.matrix .account-menu-item:hover {
    background: rgba(29, 78, 216, 0.06);
    border-color: rgba(29, 78, 216, 0.18);
    color: rgba(15, 23, 42, 0.92);
}

body.matrix .account-menu-divider {
    background: rgba(15, 23, 42, 0.10);
}

body.matrix .account-menu-item-danger:hover {
    background: rgba(185, 28, 28, 0.07);
    border-color: rgba(185, 28, 28, 0.20);
}

body.matrix .account-menu-next {
    color: rgba(15, 23, 42, 0.54);
}

body.matrix .account-menu-item:hover .account-menu-next {
    color: rgba(29, 78, 216, 0.92);
}

body.matrix .account-menu-header-avatar {
    background: rgba(29, 78, 216, 0.10);
    border-color: rgba(15, 23, 42, 0.12);
    color: rgba(29, 78, 216, 0.92);
}

body.matrix .account-menu-header-name {
    color: rgba(15, 23, 42, 0.92);
}

/* PROFESSIONAL THEME: settings hub (left nav + right panel) */
body.matrix .hub-nav {
    background:
        radial-gradient(900px 380px at 20% 0%, rgba(29, 78, 216, 0.08), transparent 60%),
        linear-gradient(180deg, #ffffff, #f1f5f9);
    border-right-color: rgba(15, 23, 42, 0.10);
}

body.matrix .hub-nav-items {
    gap: 8px;
}

body.matrix .hub-close {
    border-color: rgba(15, 23, 42, 0.12);
    background: linear-gradient(180deg, #ffffff, #f1f5f9);
    color: rgba(15, 23, 42, 0.72);
}

body.matrix .hub-close:hover {
    border-color: rgba(29, 78, 216, 0.22);
    background: linear-gradient(180deg, #ffffff, #eaf0f7);
}

body.matrix .hub-nav-item {
    color: rgba(15, 23, 42, 0.78);
    border-color: rgba(15, 23, 42, 0.06);
}

body.matrix .hub-nav-item i {
    color: rgba(15, 23, 42, 0.60);
}

body.matrix .hub-nav-item:hover {
    background: rgba(29, 78, 216, 0.05);
    border-color: rgba(29, 78, 216, 0.16);
    color: rgba(15, 23, 42, 0.90);
}

body.matrix .hub-nav-item.is-active {
    background: linear-gradient(180deg, rgba(29, 78, 216, 0.14), rgba(29, 78, 216, 0.08));
    border-color: rgba(29, 78, 216, 0.24);
    color: rgba(15, 23, 42, 0.94);
    box-shadow: 0 0 0 1px rgba(29, 78, 216, 0.06);
}

body.matrix .hub-nav-item.is-active i {
    color: rgba(29, 78, 216, 0.92);
}

body.matrix .hub-nav-item,
body.matrix .hub-nav-item.is-active {
    font-weight: 650;
}

body.matrix .hub-main {
    background:
        radial-gradient(1200px 620px at 80% 0%, rgba(29, 78, 216, 0.06), transparent 60%),
        linear-gradient(180deg, #ffffff, #f8fafc);
}

body.matrix .hub-header {
    border-bottom-color: rgba(15, 23, 42, 0.10);
}

body.matrix .hub-title {
    color: rgba(15, 23, 42, 0.92);
    font-family: var(--font-ui);
    letter-spacing: -0.01em;
    font-weight: 700;
}

body.matrix .hub-row {
    border-bottom-color: rgba(15, 23, 42, 0.10);
}

body.matrix .hub-row-title {
    color: rgba(15, 23, 42, 0.88);
    font-family: var(--font-ui);
    letter-spacing: 0;
}

body.matrix .hub-row-sub {
    color: rgba(15, 23, 42, 0.62);
    font-family: var(--font-ui);
    letter-spacing: 0;
}

body.matrix .hub-empty {
    color: rgba(15, 23, 42, 0.62);
}

body.matrix .hub-empty-title {
    color: rgba(15, 23, 42, 0.90);
}

body.matrix .hub-empty-sub {
    color: rgba(15, 23, 42, 0.62);
}

/* Ensure selects/inputs inside settings hub look consistent (incl. Data controls). */
body.matrix #settings-modal .hub-row-right input[type='text'],
body.matrix #settings-modal .hub-row-right input[type='password'],
body.matrix #settings-modal .hub-row-right input[type='number'],
body.matrix #settings-modal .hub-row-right select {
    padding: 10px 12px;
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff, #eef2f6);
    border: 1px solid rgba(15, 23, 42, 0.14);
    color: rgba(15, 23, 42, 0.92);
    font-family: var(--font-ui);
    letter-spacing: 0;
}

body.matrix #settings-modal .hub-row-right input[type='text']:hover,
body.matrix #settings-modal .hub-row-right input[type='password']:hover,
body.matrix #settings-modal .hub-row-right input[type='number']:hover,
body.matrix #settings-modal .hub-row-right select:hover {
    border-color: rgba(29, 78, 216, 0.20);
}

body.matrix #settings-modal .hub-row-right input[type='text']:focus,
body.matrix #settings-modal .hub-row-right input[type='password']:focus,
body.matrix #settings-modal .hub-row-right input[type='number']:focus,
body.matrix #settings-modal .hub-row-right select:focus {
    outline: none;
    border-color: rgba(29, 78, 216, 0.34);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.10);
}

body.matrix #settings-modal .hub-row-right select {
    appearance: none;
    -webkit-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(15, 23, 42, 0.65) 50%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.65) 50%, transparent 50%),
        linear-gradient(180deg, #ffffff, #eef2f6);
    background-position:
        calc(100% - 18px) calc(50% - 2px),
        calc(100% - 12px) calc(50% - 2px),
        0 0;
    background-size:
        6px 6px,
        6px 6px,
        100% 100%;
    background-repeat: no-repeat;
    padding-right: 34px;
}

body.matrix #settings-modal .hub-row-right input::placeholder {
    color: rgba(15, 23, 42, 0.50);
}

/* Hub toggles (switch) */
body.matrix .hub-switch-track {
    background: rgba(15, 23, 42, 0.06);
    border-color: rgba(15, 23, 42, 0.14);
}

body.matrix .hub-switch-track::after {
    background: rgba(15, 23, 42, 0.60);
}

body.matrix .hub-switch input:checked + .hub-switch-track {
    background: rgba(29, 78, 216, 0.18);
    border-color: rgba(29, 78, 216, 0.28);
}

body.matrix .hub-switch input:checked + .hub-switch-track::after {
    background: rgba(29, 78, 216, 0.92);
}

/* Account card inside settings (Account tab) */
body.matrix .hub-account-card {
    border-color: rgba(15, 23, 42, 0.12);
    background: linear-gradient(180deg, #ffffff, #f1f5f9);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.05), 0 16px 36px rgba(15, 23, 42, 0.10);
}

body.matrix .hub-account-name {
    color: rgba(15, 23, 42, 0.90);
}

body.matrix .hub-account-sub {
    color: rgba(15, 23, 42, 0.58);
}

body.matrix .hub-mini-btn {
    border-color: rgba(15, 23, 42, 0.12);
    background: linear-gradient(180deg, #ffffff, #eef2f6);
    color: rgba(15, 23, 42, 0.78);
}

body.matrix .hub-mini-btn:hover {
    border-color: rgba(29, 78, 216, 0.20);
    box-shadow: 0 0 0 1px rgba(29, 78, 216, 0.06), 0 12px 26px rgba(15, 23, 42, 0.10);
    color: rgba(15, 23, 42, 0.90);
}

body.matrix .hub-actions .modal-btn {
    box-shadow: none;
}

body.matrix .hub-list {
    background: rgba(255, 255, 255, 0.90);
    border-color: rgba(15, 23, 42, 0.10);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.05), 0 16px 36px rgba(15, 23, 42, 0.10);
}

body.matrix .hub-list-item {
    border-top-color: rgba(15, 23, 42, 0.08);
}

body.matrix .hub-list-divider {
    background: rgba(15, 23, 42, 0.10);
}

body.matrix .hub-pill {
    color: rgba(15, 23, 42, 0.65);
    border-color: rgba(15, 23, 42, 0.16);
    background: rgba(241, 245, 249, 0.96);
}

body.matrix .hub-action-btn {
    color: rgba(15, 23, 42, 0.86);
    border-color: rgba(15, 23, 42, 0.16);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.08);
}

body.matrix .hub-action-btn:hover {
    border-color: rgba(29, 78, 216, 0.30);
    background: rgba(255, 255, 255, 0.98);
}

body.matrix .hub-action-btn-danger {
    border-color: rgba(185, 28, 28, 0.30);
    color: rgb(185, 28, 28);
    background: rgba(185, 28, 28, 0.05);
}

body.matrix .hub-action-btn-danger:hover {
    border-color: rgba(185, 28, 28, 0.42);
    background: rgba(185, 28, 28, 0.07);
}

/* PROFESSIONAL THEME: make operator profile modal match hub surfaces */
body.matrix #profile-modal .modal-hero-profile {
    border-color: rgba(15, 23, 42, 0.12);
    background: linear-gradient(180deg, #ffffff, #f1f5f9);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.05), 0 16px 40px rgba(15, 23, 42, 0.10);
}

body.matrix #profile-modal .modal-card,
body.matrix #profile-modal .profile-section.modal-card {
    border-color: rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.04), 0 14px 34px rgba(15, 23, 42, 0.08);
}

body.matrix #profile-modal .profile-section-title,
body.matrix #profile-modal .modal-hero-label {
    color: rgba(15, 23, 42, 0.62);
}

body.matrix #profile-modal .modal-hero-title {
    color: rgba(15, 23, 42, 0.92);
}

body.matrix #profile-modal .modal-hero-copy {
    color: rgba(15, 23, 42, 0.78);
}

body.matrix #profile-modal .modal-hero-badge {
    border-color: rgba(29, 78, 216, 0.22);
    background: rgba(29, 78, 216, 0.08);
    color: rgba(29, 78, 216, 0.92);
}

body.matrix #profile-modal .setting-item input[type=\"text\"],
body.matrix #profile-modal .setting-item input[type=\"number\"],
body.matrix #profile-modal .setting-item select,
body.matrix #profile-modal .setting-item textarea {
    border-color: rgba(15, 23, 42, 0.14);
    background: rgba(241, 245, 249, 0.92);
    color: rgba(15, 23, 42, 0.88);
}

body.matrix #profile-modal .setting-item input[type=\"text\"]:focus,
body.matrix #profile-modal .setting-item input[type=\"number\"]:focus,
body.matrix #profile-modal .setting-item select:focus,
body.matrix #profile-modal .setting-item textarea:focus {
    border-color: rgba(29, 78, 216, 0.30);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.10);
}

@media (max-width: 980px) {
    body.matrix #profile-modal .modal-grid-profile {
        grid-template-columns: 1fr;
    }

    body.matrix #profile-modal .modal-actions-row-profile {
        flex-wrap: wrap;
        justify-content: stretch;
    }

    body.matrix #profile-modal .modal-actions-row-profile .modal-btn {
        flex: 1 1 240px;
        min-width: 200px;
    }
}

/* New Profile Editor (ChatGPT-like) */
.profile-edit-shell {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: start;
}

.profile-edit-avatar {
    position: relative;
    display: grid;
    place-items: center;
    padding-top: 6px;
    padding-bottom: 2px;
}

.profile-edit-avatar-circle {
    position: relative;
    width: 132px;
    height: 132px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-family: var(--font-tactical);
    font-weight: 800;
    font-size: 42px;
    letter-spacing: 0.08em;
    background: rgba(255, 184, 0, 0.90);
    color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}

.profile-edit-avatar-circle.has-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: transparent;
}

.profile-edit-avatar-circle.has-image::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.profile-edit-avatar-btn {
    position: absolute;
    right: 22px;
    bottom: 18px;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(10, 12, 18, 0.92);
    color: rgba(229, 231, 235, 0.86);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.profile-edit-avatar-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 212, 255, 0.26);
    background: rgba(10, 12, 18, 0.98);
}

.profile-edit-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.profile-edit-field label {
    display: block;
    font-size: 12px;
    color: rgba(156, 163, 175, 0.78);
    margin-bottom: 8px;
    letter-spacing: 0.6px;
}

.profile-edit-field input {
    width: 100%;
    padding: 11px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(0, 0, 0, 0.12);
    color: rgba(229, 231, 235, 0.92);
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.profile-edit-field input:focus {
    border-color: rgba(0, 212, 255, 0.26);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.07);
}

.profile-phone-row {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 10px;
    align-items: center;
    position: relative;
}

.profile-phone-country-btn {
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(0, 0, 0, 0.12);
    color: rgba(229, 231, 235, 0.90);
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease, transform 160ms ease;
}

.profile-phone-row input {
    height: 44px;
}

.profile-phone-country-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 212, 255, 0.20);
    background: rgba(0, 0, 0, 0.16);
}

.profile-phone-country-btn:active {
    transform: translateY(0);
}

.profile-phone-flag {
    font-size: 16px;
    line-height: 1;
}

.profile-phone-dial {
    font-weight: 800;
    letter-spacing: 0.6px;
    font-size: 12px;
}

.profile-phone-chevron {
    opacity: 0.75;
    font-size: 12px;
}

.profile-phone-menu {
    position: fixed;
    /* anchored by JS using the button rect */
    min-width: 240px;
    max-width: min(320px, calc(100vw - 36px));
    max-height: 280px;
    overflow: auto;
    padding: 8px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.10);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)),
        rgba(10, 12, 18, 0.98);
    box-shadow: 0 18px 50px rgba(0,0,0,0.55);
    z-index: 9100;
}

.profile-phone-menu.hidden {
    display: none;
}

.profile-phone-item {
    width: 100%;
    display: grid;
    grid-template-columns: 22px 1fr 64px;
    gap: 10px;
    align-items: center;
    padding: 10px 10px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(229, 231, 235, 0.90);
    cursor: pointer;
    text-align: left;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.profile-phone-item:hover {
    background: rgba(0, 212, 255, 0.06);
    border-color: rgba(0, 212, 255, 0.18);
}

.profile-phone-item.is-active {
    background: rgba(255, 26, 26, 0.06);
    border-color: rgba(255, 26, 26, 0.18);
}

.profile-phone-item-flag {
    font-size: 16px;
    line-height: 1;
}

.profile-phone-item-name {
    font-size: 12px;
    letter-spacing: 0.4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-phone-item-dial {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-align: right;
    color: rgba(156, 163, 175, 0.92);
}

.profile-edit-field input.is-invalid,
.profile-phone-row input.is-invalid {
    border-color: rgba(255, 26, 26, 0.50) !important;
    box-shadow: 0 0 0 3px rgba(255, 26, 26, 0.10) !important;
}

.profile-edit-error {
    min-height: 14px;
    margin-top: 6px;
    font-size: 11px;
    letter-spacing: 0.25px;
    line-height: 1.2;
    color: rgba(255, 90, 90, 0.92);
    text-transform: none;
}

.profile-edit-error:empty {
    margin-top: 0;
}

.profile-edit-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.profile-edit-hint {
    font-size: 12px;
    color: rgba(156, 163, 175, 0.72);
    line-height: 1.5;
    margin-top: 4px;
}

.profile-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 8px;
    margin-top: 6px;
}

/* Profile modal should feel like a focused card (not a giant canvas). */
#profile-modal .modal-body {
    max-width: 560px;
    margin: 0 auto;
    padding-top: 14px;
}

/* Profile modal layout: avatar centered on top, then stacked fields like the reference. */
#profile-modal .profile-edit-avatar {
    justify-self: center;
}

#profile-modal .profile-edit-avatar-btn {
    right: 20px;
    bottom: 16px;
}

#profile-modal .profile-edit-actions {
    justify-content: space-between;
}

#profile-modal .profile-edit-actions .modal-btn {
    flex: 1 1 0;
}

#profile-modal .modal-header h2 {
    letter-spacing: 0.6px;
}

/* Make the actions look less “cartoonish” (no oversized full-width bars). */
#profile-modal .profile-edit-actions .modal-btn {
    min-width: 140px;
    padding: 10px 14px;
    border-radius: 999px;
    text-transform: none;
    letter-spacing: 0.3px;
}

@media (max-width: 900px) {
    .profile-edit-avatar {
        padding-top: 0;
    }

    .profile-edit-avatar-circle {
        width: 124px;
        height: 124px;
        font-size: 40px;
    }
}

@media (max-width: 520px) {
    .profile-edit-split {
        grid-template-columns: 1fr;
    }

    .profile-edit-actions {
        flex-direction: column;
    }

    .profile-edit-actions .modal-btn {
        width: 100%;
    }

    .profile-phone-row {
        grid-template-columns: 104px 1fr;
    }
}

body.matrix .profile-edit-avatar-circle {
    background: rgba(245, 158, 11, 0.96);
    border-color: rgba(15, 23, 42, 0.10);
    box-shadow: 0 18px 44px rgba(2, 6, 23, 0.10);
}

body.matrix .profile-edit-avatar-btn {
    border-color: rgba(15, 23, 42, 0.14);
    background: rgba(255,255,255,0.92);
    color: rgba(15, 23, 42, 0.72);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.08);
}

body.matrix .profile-edit-avatar-btn:hover {
    border-color: rgba(29, 78, 216, 0.26);
}

body.matrix .profile-edit-field label {
    color: rgba(15, 23, 42, 0.62);
}

body.matrix .profile-edit-field input {
    border-color: rgba(15, 23, 42, 0.12);
    background: rgba(241, 245, 249, 0.92);
    color: rgba(15, 23, 42, 0.86);
}

body.matrix .profile-edit-field input:focus {
    border-color: rgba(29, 78, 216, 0.30);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.10);
}

body.matrix .profile-phone-country-btn {
    border-color: rgba(15, 23, 42, 0.12);
    background: rgba(241, 245, 249, 0.92);
    color: rgba(15, 23, 42, 0.72);
}

body.matrix .profile-phone-country-btn:hover {
    border-color: rgba(29, 78, 216, 0.24);
    background: rgba(241, 245, 249, 0.98);
}

body.matrix .profile-phone-menu {
    border-color: rgba(15, 23, 42, 0.12);
    background: linear-gradient(180deg, #ffffff, #f1f5f9);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.05), 0 18px 48px rgba(15, 23, 42, 0.14);
}

body.matrix .profile-phone-item {
    color: rgba(15, 23, 42, 0.86);
}

body.matrix .profile-phone-item:hover {
    background: rgba(29, 78, 216, 0.06);
    border-color: rgba(29, 78, 216, 0.18);
}

body.matrix .profile-phone-item-dial {
    color: rgba(15, 23, 42, 0.58);
}

body.matrix .profile-edit-hint {
    color: rgba(15, 23, 42, 0.56);
}

body.matrix .hub-account-avatar {
    background: rgba(29, 78, 216, 0.10);
    border-color: rgba(29, 78, 216, 0.22);
    color: rgba(29, 78, 216, 0.92);
    box-shadow: 0 0 0 1px rgba(29, 78, 216, 0.06);
}

body.matrix .hub-account-actions {
    gap: 10px;
}

body.matrix .hub-key-row .hub-icon-btn {
    border-color: rgba(15, 23, 42, 0.14);
    background: linear-gradient(180deg, #ffffff, #eef2f6);
    color: rgba(15, 23, 42, 0.70);
}

body.matrix .hub-key-row .hub-icon-btn:hover {
    border-color: rgba(29, 78, 216, 0.22);
    color: rgba(29, 78, 216, 0.92);
    box-shadow: 0 0 0 1px rgba(29, 78, 216, 0.06), 0 12px 26px rgba(15, 23, 42, 0.10);
}

/* PROFESSIONAL THEME: main operation tabs should not be dark */
body.matrix .operation-tabs {
    background: linear-gradient(180deg, #ffffff, #f1f5f9);
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.05), 0 14px 34px rgba(15, 23, 42, 0.10);
}

body.matrix .op-tab {
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(15, 23, 42, 0.10);
    color: rgba(15, 23, 42, 0.70);
    font-family: var(--font-ui);
    letter-spacing: 0;
}

body.matrix .op-tab:hover {
    background: rgba(29, 78, 216, 0.06);
    border-color: rgba(29, 78, 216, 0.18);
    color: rgba(15, 23, 42, 0.86);
}

body.matrix .op-tab.active {
    background: linear-gradient(180deg, rgba(29, 78, 216, 0.14), rgba(29, 78, 216, 0.08));
    border-color: rgba(29, 78, 216, 0.30);
    color: rgba(29, 78, 216, 0.95);
    box-shadow: inset 0 0 0 1px rgba(29, 78, 216, 0.08), 0 10px 22px rgba(15, 23, 42, 0.12);
}

/* PROFESSIONAL WHITE: modal headers should be neutral (no red wash). */
body.matrix .modal-header {
    background: linear-gradient(180deg, #ffffff, #f1f5f9);
    border-bottom-color: rgba(15, 23, 42, 0.10);
}

body.matrix .modal-header h2 {
    font-family: var(--font-ui);
    color: rgba(15, 23, 42, 0.92);
    letter-spacing: 0;
}

body.matrix .modal-close {
    color: rgba(15, 23, 42, 0.62);
}

body.matrix .modal-close:hover {
    color: rgba(15, 23, 42, 0.92);
}

body.matrix .timeline-time {
    color: rgba(29, 78, 216, 0.92);
}

body.matrix .timeline-content {
    color: rgba(15, 23, 42, 0.86);
}

body.matrix .history-item {
    background: linear-gradient(180deg, #ffffff, #f1f5f9);
    border-color: rgba(15, 23, 42, 0.10);
}

body.matrix .history-item:hover {
    border-color: rgba(29, 78, 216, 0.20);
    box-shadow: 0 0 0 1px rgba(29, 78, 216, 0.06), 0 16px 38px rgba(15, 23, 42, 0.12);
}

body.matrix .history-cmd {
    color: rgba(15, 23, 42, 0.86);
}

body.matrix .history-result {
    color: rgba(15, 23, 42, 0.62);
}

/* PROFESSIONAL THEME: Active Ops status + badge contrast */
body.matrix .op-status.pending {
    background: rgba(180, 83, 9, 0.95);
    box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.16);
}

body.matrix .op-status.active {
    background: rgba(4, 120, 87, 0.95);
    box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.16);
}

body.matrix .op-status.compromised {
    background: rgba(185, 28, 28, 0.95);
    box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.14);
}

body.matrix .op-badge {
    border-color: rgba(15, 23, 42, 0.12);
    background: rgba(15, 23, 42, 0.03);
    color: rgba(15, 23, 42, 0.66);
}

body.matrix .op-item[data-status='pending'] .op-badge {
    border-color: rgba(180, 83, 9, 0.26);
    background: rgba(180, 83, 9, 0.10);
    color: rgba(120, 53, 15, 0.92);
}

body.matrix .op-item[data-status='active'] .op-badge {
    border-color: rgba(4, 120, 87, 0.24);
    background: rgba(4, 120, 87, 0.09);
    color: rgba(4, 120, 87, 0.92);
}

body.matrix .op-item[data-status='compromised'] .op-badge {
    border-color: rgba(185, 28, 28, 0.24);
    background: rgba(185, 28, 28, 0.09);
    color: rgba(185, 28, 28, 0.92);
}

/* PROFESSIONAL THEME: Console starter card (the large grey/black box in center) */
body.matrix .console-starter {
    border-color: rgba(15, 23, 42, 0.12);
    background:
        radial-gradient(900px 420px at 20% 0%, rgba(29, 78, 216, 0.07), transparent 60%),
        linear-gradient(180deg, #ffffff, #f1f5f9);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.05), 0 18px 42px rgba(15, 23, 42, 0.10);
}

body.matrix .console-starter-label {
    color: rgba(15, 23, 42, 0.60);
}

body.matrix .console-starter-title {
    color: rgba(15, 23, 42, 0.92);
    text-shadow: none;
}

body.matrix .console-starter-badge {
    border-color: rgba(180, 83, 9, 0.28);
    background: rgba(180, 83, 9, 0.10);
    color: rgba(120, 53, 15, 0.92);
}

body.matrix .console-starter-meta-item {
    border-color: rgba(15, 23, 42, 0.10);
    background: rgba(15, 23, 42, 0.03);
    color: rgba(15, 23, 42, 0.62);
}

/* PROFESSIONAL THEME: modal cards (operator profile, etc.) */
body.matrix .modal-card {
    background:
        linear-gradient(180deg, #ffffff, #f1f5f9);
    border-top-color: rgba(15, 23, 42, 0.10);
    border-right-color: rgba(15, 23, 42, 0.10);
    border-bottom-color: rgba(15, 23, 42, 0.10);
    border-left-color: rgba(29, 78, 216, 0.55);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.05), 0 18px 42px rgba(15, 23, 42, 0.10);
}

body.matrix .profile-name {
    color: rgba(15, 23, 42, 0.92);
}

body.matrix .profile-id,
body.matrix .profile-status {
    color: rgba(15, 23, 42, 0.62);
}

body.matrix .profile-role {
    color: rgba(29, 78, 216, 0.92);
}

body.matrix .profile-badge {
    border-color: rgba(29, 78, 216, 0.22);
    background: rgba(29, 78, 216, 0.08);
    color: rgba(29, 78, 216, 0.92);
}

body.matrix .profile-section-title {
    color: rgba(15, 23, 42, 0.80);
}

body.matrix .profile-dossier-card,
body.matrix .modal-card-profile-edit {
    background:
        radial-gradient(900px 360px at 20% 0%, rgba(29, 78, 216, 0.06), transparent 60%),
        linear-gradient(180deg, #ffffff, #f1f5f9);
}

body.matrix .setting-item label,
body.matrix .modal-card-profile-edit .setting-item label {
    color: rgba(15, 23, 42, 0.70);
}

body.matrix .modal-card-profile-edit .profile-section-title {
    color: rgba(15, 23, 42, 0.86);
}

body.matrix .modal-card-profile-edit .setting-item input[type=\"text\"],
body.matrix .modal-card-profile-edit .setting-item input[type=\"number\"],
body.matrix .modal-card-profile-edit .setting-item select,
body.matrix .modal-card-profile-edit .setting-item textarea {
    background: linear-gradient(180deg, #ffffff, #eef2f6);
    border-color: rgba(15, 23, 42, 0.14);
    color: rgba(15, 23, 42, 0.92);
}

body.matrix .modal-card-profile-edit .setting-item input[type=\"text\"]:hover,
body.matrix .modal-card-profile-edit .setting-item input[type=\"number\"]:hover,
body.matrix .modal-card-profile-edit .setting-item select:hover,
body.matrix .modal-card-profile-edit .setting-item textarea:hover {
    border-color: rgba(29, 78, 216, 0.20);
}

body.matrix .modal-card-profile-edit .setting-item input[type=\"text\"]:focus,
body.matrix .modal-card-profile-edit .setting-item input[type=\"number\"]:focus,
body.matrix .modal-card-profile-edit .setting-item select:focus,
body.matrix .modal-card-profile-edit .setting-item textarea:focus {
    border-color: rgba(29, 78, 216, 0.34);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.10);
}

body.matrix .log-bubble {
    background:
        linear-gradient(180deg, rgba(248,250,252,1), rgba(241,245,249,1));
    border-color: rgba(15, 23, 42, 0.14);
    color: rgba(15, 23, 42, 0.96);
    font-size: 14px;
    line-height: 1.75;
}

body.matrix .log-header {
    color: rgba(15, 23, 42, 0.66);
}

body.matrix .log-entry.agent .log-bubble {
    border-left-color: rgba(11, 134, 255, 0.7);
}

body.matrix .log-entry.operator .log-bubble {
    border-right-color: rgba(182, 35, 24, 0.7);
}

body.matrix .log-entry.agent .log-avatar {
    background: rgba(11, 134, 255, 0.08);
    border-color: rgba(11, 134, 255, 0.3);
    color: rgba(11, 134, 255, 0.95);
    box-shadow: 0 0 10px rgba(11, 134, 255, 0.12);
}

body.matrix .log-entry.operator .log-avatar {
    background: rgba(182, 35, 24, 0.06);
    border-color: rgba(182, 35, 24, 0.28);
    color: rgba(182, 35, 24, 0.92);
}

body.matrix .terminal-output {
    background:
        radial-gradient(900px 420px at 16% 0%, rgba(29, 78, 216, 0.08), transparent 58%),
        linear-gradient(180deg, #ffffff, #f1f5f9);
    border-color: rgba(15, 23, 42, 0.12);
    border-left-color: rgba(29, 78, 216, 0.70);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.04), 0 16px 36px rgba(15, 23, 42, 0.10);
}

body.matrix .terminal-header {
    background: rgba(29, 78, 216, 0.06);
    border-bottom-color: rgba(15, 23, 42, 0.10);
}

body.matrix .terminal-title {
    color: rgba(29, 78, 216, 0.92);
}

body.matrix .terminal-title::before {
    color: rgba(180, 83, 9, 0.92);
}

body.matrix .terminal-body pre {
    color: rgba(15, 23, 42, 0.88);
}

body.matrix .cmd-prompt {
    color: rgba(29, 78, 216, 0.92);
}

body.matrix .cmd-output {
    color: rgba(15, 23, 42, 0.84);
}

body.matrix .cmd-warning {
    color: rgba(180, 83, 9, 0.95);
}

/* CRT FLICKER ANIMATION */
@keyframes flicker {
    0%, 100% { opacity: 0.97; }
    50% { opacity: 1; }
}

/* ALERT PULSE */
@keyframes alertPulse {
    0%, 100% { 
        box-shadow: 0 0 5px var(--blood-red), inset 0 0 5px rgba(255, 26, 26, 0.2);
        border-color: var(--blood-red);
    }
    50% { 
        box-shadow: 0 0 20px var(--blood-red), inset 0 0 10px rgba(255, 26, 26, 0.4);
        border-color: #ff4444;
    }
}

@keyframes scanMove {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes pulseDot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes typeCursor {
    0%, 100% { border-right-color: var(--blood-red); }
    50% { border-right-color: transparent; }
}

/* MOVING SCAN LINE */
.scan-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--tactical-cyan), transparent);
    box-shadow: 0 0 10px var(--tactical-cyan);
    animation: scanMove 8s linear infinite;
    z-index: 9998;
    opacity: 0.5;
}

/* APP CONTAINER */
.app-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr var(--operation-panel);
    grid-template-rows: var(--header-height) 1fr;
    height: var(--app-vh);
    position: relative;
    z-index: 1;
    gap: 1px;
    background: var(--border-tactical);
}

body.right-panel-collapsed .app-container {
    grid-template-columns: var(--sidebar-width) 1fr 0px;
}

body.left-panel-collapsed .app-container {
    grid-template-columns: 0px 1fr var(--operation-panel);
}

body.left-panel-collapsed.right-panel-collapsed .app-container {
    grid-template-columns: 0px 1fr 0px;
}

@media (min-width: 1600px) and (min-height: 850px) {
    .app-container {
        width: calc(100vw / var(--desktop-ui-scale));
        height: calc(100vh / var(--desktop-ui-scale));
        transform: scale(var(--desktop-ui-scale));
        transform-origin: top left;
    }
}

/* HEADER - TACTICAL BAR */
.header {
    grid-column: 1 / -1;
    background: var(--tactical-black);
    border-bottom: 2px solid var(--blood-red);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-height);
    padding: 0 14px;
    position: relative;
    /* Allow pill-tooltips to render outside the header without being clipped. */
    overflow: visible;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--blood-red), transparent);
    opacity: 0.5;
}

.mobile-sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 10px 28px rgba(0,0,0,0.45);
    color: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    cursor: pointer;
    flex: 0 0 auto;
}

.mobile-sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

.mobile-sidebar-toggle:focus-visible {
    outline: 2px solid rgba(0, 255, 65, 0.55);
    outline-offset: 2px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    padding: 3px;
    border-radius: 12px;
    background:
        linear-gradient(145deg, rgba(3, 8, 18, 0.98), rgba(7, 18, 34, 0.92)),
        radial-gradient(circle at 50% 0%, rgba(0, 212, 255, 0.16), transparent 62%);
    border: 1px solid rgba(0, 212, 255, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 0 20px rgba(0, 110, 255, 0.18),
        0 0 30px rgba(0, 0, 0, 0.35);
    position: relative;
    overflow: hidden;
}

.logo-icon::after {
    content: '⚡';
    color: white;
    font-weight: bold;
    filter: drop-shadow(0 0 4px rgba(255,255,255,0.8));
}

.logo-text {
    font-family: var(--font-tactical);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--blood-red);
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(255, 26, 26, 0.5);
}

.logo-icon::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    pointer-events: none;
    z-index: 2;
}

.logo-icon::after {
    content: '';
    position: absolute;
    inset: -12px;
    background:
        radial-gradient(circle at 50% 50%, rgba(0, 180, 255, 0.2), transparent 48%),
        conic-gradient(from 180deg, transparent, rgba(0, 212, 255, 0.22), transparent 70%);
    opacity: 0.75;
    animation: spin 9s linear infinite;
    pointer-events: none;
}

.logo-image {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 9px;
    filter: saturate(1.08) contrast(1.12) brightness(0.96);
}

.logo-text::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    margin-top: 4px;
    background: linear-gradient(90deg, rgba(0, 212, 255, 0.95), rgba(255, 255, 255, 0.12));
    border-radius: 999px;
    box-shadow: 0 0 12px rgba(0, 140, 255, 0.2);
}

.logo-sub {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--alert-amber);
    letter-spacing: 2px;
    margin-left: 8px;
    padding: 2px 8px;
    border: 1px solid var(--alert-amber);
    background: rgba(255, 107, 0, 0.1);
}

body.reduced-motion .logo-icon::after,
body.interface-paused .logo-icon::after {
    animation: none;
}

.tactical-info {
    display: flex;
    align-items: center;
    gap: 18px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.16em;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--signal-green);
    font-weight: 700;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--signal-green);
    border-radius: 50%;
    box-shadow: var(--glow-green);
    animation: pulseDot 2s ease-in-out infinite;
}

.operation-timer {
    color: var(--alert-amber);
    font-weight: 600;
    white-space: nowrap;
}

.threat-level {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 26, 26, 0.1);
    border: 1px solid var(--blood-red);
    color: var(--blood-red);
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.3s;
}

.connections-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--tactical-cyan);
    font-weight: 700;
}

.connections-dot {
    width: 8px;
    height: 8px;
    background: var(--tactical-cyan);
    border-radius: 50%;
    box-shadow: var(--glow-cyan);
    animation: pulseDot 1.5s ease-in-out infinite;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 12px;
    border-left: 1px solid rgba(255,255,255,0.08);
    min-height: 36px;
    flex-wrap: nowrap;
}

/* When the left sidebar is open, keep the header clean: show only the temp-chat icon. */
body:not(.left-panel-collapsed) #profile-btn {
    display: none;
}

body:not(.left-panel-collapsed) .header-actions {
    border-left: none;
    padding-left: 0;
}

.header-actions > * {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
}

.tactical-btn {
    width: 34px;
    height: 34px;
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(0,0,0,0.24));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    color: var(--ghost-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
    position: relative;
    font-family: var(--font-mono);
    font-size: 14px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
    flex: 0 0 auto;
    align-self: center;
}

.tactical-btn i,
.clock-control i,
.footer-btn i {
    pointer-events: none;
}

.temp-chat-icon {
    width: 18px;
    height: 18px;
    display: block;
    fill: currentColor;
    transform: rotate(0deg);
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.tactical-btn-temp {
    color: rgba(229, 231, 235, 0.92);
}

.tactical-btn-temp.is-active {
    color: var(--tactical-cyan);
    border-color: rgba(0, 212, 255, 0.28);
    background: rgba(0, 212, 255, 0.06);
    box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.10), 0 0 22px rgba(0, 212, 255, 0.12);
}

.tactical-btn-temp.is-active .temp-chat-icon {
    transform: rotate(180deg);
}

.tactical-btn[disabled] {
    opacity: 1;
    cursor: default;
    pointer-events: none;
}

.tactical-btn[disabled]:hover {
    border-color: rgba(255,255,255,0.08);
    color: rgba(156, 163, 175, 0.9);
    background: rgba(255,255,255,0.02);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
    transform: none;
}

#temp-chat-btn,
#settings-btn,
#pause-mission {
    font-size: 16px;
}

#temp-chat-btn i,
#settings-btn i {
    font-size: 17px;
    line-height: 1;
}

#pause-mission i {
    font-size: 14px;
    line-height: 1;
}

.tactical-btn:hover {
    border-color: var(--blood-red);
    color: var(--blood-red);
    background: linear-gradient(180deg, rgba(255,26,26,0.14), rgba(255,26,26,0.05));
    box-shadow: 0 0 0 1px rgba(255,26,26,0.12), var(--glow-red);
    transform: translateY(-1px);
}

.tactical-btn.tactical-alert {
    animation: alertPulse 2s ease-in-out infinite;
}

.tactical-btn.tactical-alert::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    background: var(--blood-red);
    border-radius: 50%;
}

/* SIDEBAR - OPERATIONS LOG */
.sidebar {
    background: var(--sidebar-surface);
    border-right: 1px solid var(--sidebar-divider);
    display: flex;
    flex-direction: column;
    overflow: visible;
    transition: width 0.22s ease, max-width 0.22s ease, transform 0.22s ease, opacity 0.22s ease;
}

body.left-panel-collapsed .sidebar {
    width: 0 !important;
    max-width: 0 !important;
    pointer-events: none;
    overflow: hidden;
    border-right: 0;
    transform: none;
}

/* LEFT RAIL (Deepseek-like) */
.left-rail {
    position: fixed;
    top: calc(var(--header-height) + 10px);
    left: 10px;
    z-index: 60;
    display: none;
    flex-direction: row;
    gap: 8px;
    padding: 8px;
    border-radius: 18px;
    border: 1px solid var(--rail-border);
    background: var(--rail-bg);
    box-shadow: 0 18px 60px rgba(0,0,0,0.55);
    backdrop-filter: blur(12px);
    pointer-events: none;
}

body.left-panel-collapsed .left-rail {
    display: flex;
}

.left-rail-btn {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid var(--sidebar-btn-border);
    background: var(--sidebar-btn-bg);
    color: var(--sidebar-fg);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
    pointer-events: auto;
}

.left-rail-btn:hover {
    background: var(--sidebar-btn-bg-hover);
    border-color: var(--sidebar-btn-border-hover);
    transform: translateY(-1px);
}

/* Professional (matrix) polish for the floating rail + pill so it matches the white theme */
body.matrix .left-rail {
    box-shadow: 0 18px 60px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(14px);
}

body.matrix .left-rail-btn {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset, 0 10px 26px rgba(15, 23, 42, 0.08);
}

body.matrix .left-rail-btn:hover {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75) inset, 0 14px 34px rgba(15, 23, 42, 0.10);
}

.sidebar-header {
    padding: 16px 14px 16px;
    border-bottom: 1px solid var(--border-tactical);
    background: transparent;
}

.sidebar-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.sidebar-top-title {
    font-family: var(--font-tactical);
    font-size: 12px;
    font-weight: 700;
    color: var(--sidebar-title-color);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding-left: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-top-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border-radius: 16px;
    border: 1px solid var(--sidebar-pill-border);
    background: var(--sidebar-pill-bg);
}

body.matrix .sidebar-top-actions {
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.10);
}

.sidebar-toggle {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--sidebar-btn-border);
    background: var(--sidebar-btn-bg);
    color: var(--sidebar-fg);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.sidebar-toggle:hover {
    background: var(--sidebar-btn-bg-hover);
    border-color: var(--sidebar-btn-border-hover);
    transform: translateY(-1px);
}

.sidebar-quick {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--sidebar-btn-border);
    background: var(--sidebar-btn-bg);
    color: var(--sidebar-fg);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.sidebar-quick:hover {
    background: var(--sidebar-btn-bg-hover);
    border-color: var(--sidebar-btn-border-hover);
    transform: translateY(-1px);
}

/* mission-control kept for legacy markup but unused in current sidebar header */

.mission-label {
    font-size: 10px;
    color: var(--stealth-gray);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.mission-id {
    font-family: var(--font-tactical);
    font-size: 12px;
    font-weight: 700;
    color: rgba(229, 231, 235, 0.78);
    letter-spacing: 0.12em;
}

.new-op-btn {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 999px;
    color: rgba(229, 231, 235, 0.92);
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.new-op-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.14), transparent);
    transition: left 0.5s;
}

.new-op-btn:hover::before {
    left: 100%;
}

.new-op-btn:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
}

/* Deepseek-like collapsed sidebar */
body.sidebar-collapsed {
    --sidebar-width: 76px;
}

body.sidebar-collapsed .sidebar {
    width: 76px;
    max-width: 76px;
}

body.sidebar-collapsed .sidebar-header,
body.sidebar-collapsed .sidebar-footer {
    padding-left: 10px;
    padding-right: 10px;
}

body.sidebar-collapsed .mission-control,
body.sidebar-collapsed .sidebar-search-box,
body.sidebar-collapsed .sidebar-ops-tools,
body.sidebar-collapsed .new-op-btn span,
body.sidebar-collapsed .op-header,
body.sidebar-collapsed .op-list,
body.sidebar-collapsed .account-meta,
body.sidebar-collapsed .account-chevron {
    display: none !important;
}

body.sidebar-collapsed .new-op-btn {
    display: none;
}

body.sidebar-collapsed .sidebar-topbar {
    margin-bottom: 10px;
    justify-content: center;
}

body.sidebar-collapsed .sidebar-top-actions {
    padding: 6px;
    border-radius: 18px;
}

body.sidebar-collapsed .account-menu {
    left: 10px;
    right: auto;
    width: 280px;
}

body.sidebar-collapsed .account-footer {
    grid-template-columns: 36px 1fr;
    justify-content: center;
    gap: 0;
}

.sidebar-content {
    flex: 1;
    overflow: hidden;
    padding: 14px 0 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto auto;
    min-height: 0;
    gap: 0;
}

.op-section {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.sidebar-panel {
    padding: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.op-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-tactical);
}

.op-title {
    font-family: var(--font-tactical);
    font-size: 11px;
    font-weight: 600;
    color: var(--stealth-gray);
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.op-count {
    font-size: 10px;
    color: var(--alert-amber);
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border: 1px solid var(--alert-amber);
    background: rgba(255,107,0,0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.op-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    overflow-y: scroll;
    padding-right: 6px;
    padding-bottom: 4px;
    scrollbar-gutter: stable both-edges;
    overscroll-behavior: contain;
}

.op-list::-webkit-scrollbar {
    width: 8px;
}

.op-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 999px;
}

.op-list::-webkit-scrollbar-thumb {
    background: rgba(255, 107, 0, 0.6);
    border-radius: 999px;
}

.op-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 107, 0, 0.82);
}

.op-item {
    padding: 10px 12px;
    min-height: 62px;
    background: rgba(17, 17, 20, 0.88);
    border: 1px solid var(--border-tactical);
    border-left: 3px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, color 0.18s ease;
    position: relative;
    overflow: hidden;
}

.op-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--blood-red);
    opacity: 0;
    transition: opacity 0.2s;
}

.op-item:hover {
    background: rgba(255,26,26,0.05);
    border-color: rgba(255,26,26,0.3);
    transform: translateX(4px);
}

.op-item.active {
    background: rgba(255,26,26,0.1);
    border-color: var(--blood-red);
    border-left-color: var(--blood-red);
}

.op-item.active::before {
    opacity: 1;
}

.op-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
}

.op-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--ghost-white);
    display: flex;
    align-items: center;
    gap: 8px;
}

.op-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.op-status.active { background: var(--signal-green); box-shadow: var(--glow-green); }
.op-status.pending { background: var(--alert-amber); animation: pulseDot 2s infinite; }
.op-status.compromised { background: var(--blood-red); box-shadow: var(--glow-red); }

.op-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 10px;
    color: var(--stealth-gray);
}

.op-target {
    color: var(--tactical-cyan);
    font-family: var(--font-mono);
}

.op-time {
    color: var(--stealth-gray);
}

.tactical-assets {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.asset-tag {
    padding: 10px 14px;
    background: rgba(4,16,22,0.9);
    border: 1px solid rgba(0,212,255,0.22);
    color: var(--tactical-cyan);
    font-size: 11px;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, color 0.18s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    letter-spacing: 0.8px;
    min-height: 38px;
}

.asset-tag::before {
    content: '▸';
    color: var(--alert-amber);
}

.asset-tag:hover {
    background: rgba(0,212,255,0.1);
    border-color: var(--tactical-cyan);
    transform: translateX(4px);
}

.asset-tag.active {
    background: linear-gradient(180deg, rgba(0,212,255,0.12), rgba(0,212,255,0.04));
    box-shadow: inset 0 0 0 1px rgba(0,212,255,0.08);
}

.team-collaboration-panel,
.resource-monitor {
    background: rgba(5, 5, 7, 0.7);
}

.team-header,
.resource-header {
    margin-bottom: 16px;
    color: var(--tactical-cyan);
    font-family: var(--font-tactical);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
}

.resource-subtext {
    margin: -8px 0 14px;
    color: rgba(171, 201, 214, 0.72);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.9px;
    text-transform: uppercase;
}

.operators-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.operator-item {
    position: relative;
    padding: 2px 0 2px 12px;
    color: var(--stealth-gray);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.8px;
}

.operator-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 2px;
    background: rgba(255,255,255,0.12);
}

.operator-item.active {
    color: var(--signal-green);
    text-shadow: 0 0 10px rgba(0,255,65,0.18);
}

.operator-item.active::before {
    background: var(--signal-green);
    box-shadow: 0 0 10px rgba(0,255,65,0.35);
}

.resource-item + .resource-item {
    margin-top: 14px;
}

.resource-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.resource-item label {
    color: var(--stealth-gray);
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.resource-bar {
    height: 8px;
    background: rgba(255,255,255,0.06);
    border-radius: 999px;
    overflow: hidden;
}

.resource-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--signal-green), var(--tactical-cyan));
}

.resource-value {
    color: var(--tactical-cyan);
    font-size: 11px;
    font-family: var(--font-mono);
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(7, 9, 13, 0.88);
    position: relative;
}

.account-footer {
    width: 100%;
    display: grid;
    grid-template-columns: 36px 1fr 18px;
    align-items: center;
    gap: 12px;
    padding: 10px 10px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    color: rgba(229, 231, 235, 0.92);
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.account-footer:hover {
    border-color: rgba(0, 212, 255, 0.22);
    background: rgba(0, 212, 255, 0.05);
    transform: translateY(-1px);
}

.account-avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-tactical);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    background: rgba(255, 140, 0, 0.18);
    border: 1px solid rgba(255, 140, 0, 0.35);
    color: rgba(255, 225, 192, 0.95);
}

.account-avatar.has-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: transparent;
}

.account-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.account-name {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-sub {
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(156, 163, 175, 0.75);
}

.account-sub:empty {
    display: none;
}

.account-chevron {
    opacity: 0.8;
}

.account-menu {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: calc(100% + 10px);
    padding: 10px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)),
        rgba(10, 12, 18, 0.98);
    box-shadow: 0 14px 40px rgba(0,0,0,0.55);
    transform-origin: bottom center;
    animation: panelFadeInSoft 0.18s ease;
    z-index: 50;
}

/* When the left sidebar is hidden, anchor the account menu to the header user button. */
body.left-panel-collapsed .account-menu {
    position: fixed;
    transform-origin: top right;
    pointer-events: auto;
}

.account-menu-panels {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    overflow: hidden;
    min-height: 0;
}

.account-menu-panel {
    display: grid;
    grid-auto-rows: min-content;
    gap: 2px;
    transition: transform 180ms ease;
}

.account-menu-panels[data-account-panel='help'] .account-menu-panel[data-account-panel='main'] {
    transform: translateX(-110%);
}

.account-menu-panel[data-account-panel='help'] {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    transform: translateX(110%);
}

.account-menu-panels[data-account-panel='help'] .account-menu-panel[data-account-panel='help'] {
    transform: translateX(0);
}

.account-menu.hidden {
    display: none;
}

.account-menu-item {
    width: 100%;
    display: grid;
    grid-template-columns: 18px 1fr;
    align-items: center;
    gap: 10px;
    padding: 11px 10px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(229, 231, 235, 0.88);
    cursor: pointer;
    text-align: left;
    font-size: 12px;
    letter-spacing: 0.4px;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.account-menu-item-next {
    grid-template-columns: 18px 1fr 18px;
}

.account-menu-next {
    justify-self: end;
    opacity: 0.7;
    color: rgba(156, 163, 175, 0.9);
}

.account-menu-item:hover .account-menu-next {
    color: var(--tactical-cyan);
    opacity: 1;
}

.account-menu-item-back {
    font-weight: 800;
    letter-spacing: 0.8px;
}

.account-menu-item i {
    color: rgba(156, 163, 175, 0.9);
}

.account-menu-item:hover {
    background: rgba(0, 212, 255, 0.06);
    border-color: rgba(0, 212, 255, 0.18);
    color: rgba(229, 231, 235, 0.96);
}

.account-menu-item:hover i {
    color: var(--tactical-cyan);
}

.account-menu-divider {
    height: 1px;
    margin: 6px 8px;
    background: rgba(255,255,255,0.08);
}

.account-menu-note {
    margin: 6px 8px 2px;
    padding: 10px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.12);
    color: rgba(156, 163, 175, 0.78);
    font-size: 11px;
    line-height: 1.5;
}

body.matrix .account-menu-note {
    border-color: rgba(15, 23, 42, 0.10);
    background: rgba(241, 245, 249, 0.92);
    color: rgba(15, 23, 42, 0.62);
}


.account-menu-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 8px;
    border-radius: 14px;
}

.account-menu-header-avatar {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-family: var(--font-tactical);
    font-weight: 800;
    letter-spacing: 0.06em;
    background: rgba(255, 184, 0, 0.16);
    border: 1px solid rgba(255,255,255,0.10);
    color: rgba(229,231,235,0.92);
    flex: 0 0 auto;
}

.account-menu-header-avatar.has-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: transparent;
}

.account-menu-header-name {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.6px;
    color: rgba(229, 231, 235, 0.94);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-menu-item-danger:hover {
    background: rgba(255, 26, 26, 0.08);
    border-color: rgba(255, 26, 26, 0.22);
}

.account-menu-item-danger:hover i {
    color: rgba(255, 180, 180, 0.95);
}

.tactical-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.stat-box {
    padding: 10px;
    background: var(--tactical-black);
    border: 1px solid var(--border-tactical);
    text-align: center;
}

.stat-value {
    font-family: var(--font-tactical);
    font-size: 20px;
    font-weight: 700;
    color: var(--blood-red);
}

.stat-label {
    font-size: 9px;
    color: var(--stealth-gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

.footer-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(180deg, rgba(0,212,255,0.08), rgba(0,212,255,0.02));
    border: 1px solid rgba(0,212,255,0.22);
    border-radius: var(--radius-md);
    color: var(--stealth-gray);
    font-family: var(--font-mono);
    font-size: 11px;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, color 0.18s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#tactical-config-btn span:first-child {
    font-size: 0;
    width: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#tactical-config-btn span:first-child::before {
    content: "\f5db";
    font-family: "bootstrap-icons";
    font-size: 14px;
}

.footer-btn:hover {
    border-color: var(--tactical-cyan);
    color: var(--tactical-cyan);
    background: rgba(0,212,255,0.10);
    box-shadow: 0 0 18px rgba(0,212,255,0.15);
    transform: translateY(-1px);
}

/* MAIN CONTENT - OPERATION THEATER */
.main-content {
    display: flex;
    flex-direction: column;
    background: var(--void-black);
    position: relative;
    overflow: hidden;
}

.main-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--blood-red), transparent);
    opacity: 0.3;
}

/* TACTICAL OVERLAY CORNERS */
.tactical-corners {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    pointer-events: none;
    z-index: 10;
}

.corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--blood-red);
    opacity: 0.5;
}

.corner.tl { top: 0; left: 0; border-right: none; border-bottom: none; }
.corner.tr { top: 0; right: 0; border-left: none; border-bottom: none; }
.corner.bl { bottom: 0; left: 0; border-right: none; border-top: none; }
.corner.br { bottom: 0; right: 0; border-left: none; border-top: none; }

/* When the right intelligence panel is collapsed, hide the top-right HUD corner so it doesn't "float" by itself. */
body.right-panel-collapsed .corner.tr {
    opacity: 0;
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 28px 42px;
    position: relative;
}

/* WELCOME SCREEN - MISSION BRIEFING */
.mission-briefing {
    display: grid;
    place-items: center;
    min-height: 100%;
    text-align: center;
    padding: 24px 28px 28px;
    animation: slideIn 0.6s ease-out;
    position: relative;
}

.mission-briefing::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(680px 380px at 50% 55%, rgba(0, 212, 255, 0.10), transparent 62%),
        radial-gradient(560px 360px at 62% 62%, rgba(255, 140, 0, 0.06), transparent 64%),
        radial-gradient(1000px 650px at 50% 50%, rgba(0, 0, 0, 0.70), transparent 68%);
    opacity: 0.85;
    transition: opacity 0.22s ease;
}

.mission-briefing:hover::before {
    opacity: 1;
}

.landing {
    width: min(920px, 100%);
    position: relative;
    z-index: 1;
    transform: translateY(-42px);
}

.landing-card {
    border-radius: 24px;
    border: 1px solid var(--landing-border);
    background: var(--landing-surface);
    box-shadow: var(--landing-shadow);
    padding: 26px 24px 22px;
    text-align: left;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(16px);
    transform: translateY(10px);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.landing-card::after {
    content: '';
    position: absolute;
    left: 10%;
    right: 10%;
    bottom: -18px;
    height: 26px;
    pointer-events: none;
    background: radial-gradient(closest-side, rgba(0, 212, 255, 0.14), transparent 65%);
    opacity: 0.55;
    filter: blur(10px);
    transition: opacity 0.22s ease;
}

.landing-card:hover,
.landing-card:focus-within {
    transform: translateY(0);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 38px 140px rgba(0, 0, 0, 0.66);
}

.landing-card:hover::after,
.landing-card:focus-within::after {
    opacity: 0.9;
}

.landing-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 24px;
    pointer-events: none;
    background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.07) 18%, transparent 36%);
    transform: translateX(-80%);
    opacity: 0;
}

.landing-card:hover::before {
    opacity: 1;
    animation: landing-sheen 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes landing-sheen {
    from { transform: translateX(-80%); }
    to { transform: translateX(80%); }
}

.landing-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.landing-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: rgba(156, 163, 175, 0.82);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.landing-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(0, 212, 255, 0.9);
    box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.12);
}

.landing-badge {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.02);
    color: rgba(229, 231, 235, 0.92);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.landing-title {
    margin: 0;
    font-family: var(--font-tactical);
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 54px;
    color: var(--landing-title);
    line-height: 1.05;
    text-shadow: var(--landing-title-shadow);
}

.landing-sub {
    margin: 10px 0 0;
    color: rgba(156, 163, 175, 0.86);
    font-size: 14px;
    line-height: 1.6;
    max-width: 62ch;
}

.landing-actions {
    margin-top: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.landing-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.92);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.landing-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 212, 255, 0.22);
    background: rgba(0, 212, 255, 0.06);
    box-shadow: 0 18px 56px rgba(0, 0, 0, 0.50);
}

.landing-btn:focus-visible {
    outline: 2px solid rgba(0, 212, 255, 0.22);
    outline-offset: 2px;
}

.landing-btn-primary {
    border-color: rgba(255, 193, 34, 0.32);
    background: linear-gradient(90deg, rgba(255, 194, 51, 0.22), rgba(255, 122, 24, 0.12));
}

.landing-workflows {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

@media (max-width: 720px) {
    .landing-workflows {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-height: 760px) {
    .landing {
        transform: translateY(-18px);
    }
}

.landing-workflow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 12px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    color: rgba(229, 231, 235, 0.92);
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
    position: relative;
    overflow: hidden;
}

.landing-workflow i {
    color: rgba(0, 212, 255, 0.92);
}

.landing-workflow::after {
    content: '';
    position: absolute;
    inset: -1px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.10) 45%, transparent 70%);
    transform: translateX(-120%);
    opacity: 0;
    transition: opacity 0.18s ease;
    will-change: transform, opacity;
}

@keyframes landingWorkflowSweep {
    0% {
        transform: translateX(-120%);
        opacity: 0;
    }
    15% {
        opacity: 0.95;
    }
    55% {
        opacity: 1;
    }
    100% {
        transform: translateX(120%);
        opacity: 0;
    }
}

.landing-workflow[data-engagement="recon"] i { color: var(--tactical-cyan); }
.landing-workflow[data-engagement="persistence"] i { color: var(--alert-amber); }
.landing-workflow[data-engagement="lateral"] i { color: rgba(255, 26, 26, 0.92); }
.landing-workflow[data-engagement="exfil"] i { color: var(--signal-green); }

.landing-workflow:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 212, 255, 0.20);
    background: rgba(0, 212, 255, 0.05);
}

.landing-workflow:hover::after {
    opacity: 1;
    animation: landingWorkflowSweep 1.1s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

.briefing-classification {
    position: absolute;
    top: 18px;
    right: 18px;
    padding: 7px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 26, 26, 0.55);
    background: linear-gradient(180deg, rgba(255, 26, 26, 0.12), rgba(255, 26, 26, 0.04));
    color: rgba(255, 84, 84, 0.92);
    font-family: var(--font-tactical);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    transform: translateY(-8px) rotate(4deg);
    opacity: 0;
    filter: blur(2px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.22s ease, filter 0.22s ease;
    z-index: 2;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.mission-briefing:hover .briefing-classification,
.mission-briefing:focus-within .briefing-classification {
    opacity: 0.86;
    transform: translateY(0) rotate(4deg);
    filter: blur(0);
}

@media (hover: none) {
    .briefing-classification {
        opacity: 0.82;
        transform: translateY(0) rotate(4deg);
        filter: none;
    }
}

/* MESSAGES - OPERATION LOG */
.operation-log {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding-bottom: 40px;
}

.log-output {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 320px;
    padding: 18px 20px 6px;
}

.log-entry {
    display: flex;
    gap: 16px;
    animation: slideIn 0.4s ease-out;
    position: relative;
}

.log-entry.operator {
    flex-direction: row-reverse;
}

.log-avatar {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    border: 1px solid;
    position: relative;
}

.log-entry.operator .log-avatar {
    background: var(--panel-black);
    border-color: var(--blood-red);
    color: var(--blood-red);
}

.log-entry.agent .log-avatar {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--tactical-cyan);
    color: var(--tactical-cyan);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

.log-content {
    max-width: 80%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.log-header {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: var(--stealth-gray);
    letter-spacing: 1px;
}

.log-timestamp {
    font-family: var(--font-mono);
    color: var(--alert-amber);
}

.log-role {
    text-transform: uppercase;
    font-weight: 600;
}

.log-entry.operator .log-role { color: var(--blood-red); }
.log-entry.agent .log-role { color: var(--tactical-cyan); }

.log-bubble {
    padding: 16px 20px;
    background: rgba(17, 17, 20, 0.9);
    border: 1px solid var(--border-tactical);
    position: relative;
    font-size: 13px;
    line-height: 1.7;
    color: var(--ghost-white);
}

.log-entry.operator .log-bubble {
    border-color: rgba(255, 26, 26, 0.3);
    border-right-width: 3px;
    border-right-color: var(--blood-red);
}

.log-entry.agent .log-bubble {
    border-color: rgba(0, 212, 255, 0.3);
    border-left-width: 3px;
    border-left-color: var(--tactical-cyan);
}

/* TERMINAL CODE BLOCKS */
.terminal-output {
    background: #080808;
    border: 1px solid var(--border-tactical);
    border-left: 3px solid var(--signal-green);
    margin: 12px 0;
    overflow: hidden;
    font-family: var(--font-mono);
}

.terminal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(0, 255, 65, 0.05);
    border-bottom: 1px solid var(--border-tactical);
}

.terminal-title {
    font-size: 10px;
    color: var(--signal-green);
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.terminal-title::before {
    content: '>';
    color: var(--alert-amber);
}

.terminal-actions {
    display: flex;
    gap: 8px;
}

.terminal-btn {
    padding: 4px 8px;
    background: transparent;
    border: 1px solid var(--border-tactical);
    color: var(--stealth-gray);
    font-size: 10px;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.terminal-btn:hover {
    border-color: var(--signal-green);
    color: var(--signal-green);
}

.terminal-body {
    padding: 16px;
    overflow-x: auto;
}

.terminal-body pre {
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
    color: #f0f0f0;
}

.cmd-prompt {
    color: var(--signal-green);
    user-select: none;
}

.cmd-output {
    color: var(--ghost-white);
}

.cmd-error {
    color: var(--blood-red);
}

.cmd-warning {
    color: var(--alert-amber);
}

/* TYPING INDICATOR */
.processing-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-left: 3px solid var(--tactical-cyan);
}

.processing-dots {
    display: flex;
    gap: 4px;
}

.processing-dot {
    width: 6px;
    height: 6px;
    background: var(--tactical-cyan);
    border-radius: 50%;
    animation: pulseDot 1.4s ease-in-out infinite;
}

.processing-dot:nth-child(2) { animation-delay: 0.2s; }
.processing-dot:nth-child(3) { animation-delay: 0.4s; }

.processing-text {
    font-size: 12px;
    color: var(--tactical-cyan);
    font-family: var(--font-mono);
    letter-spacing: 1px;
}

/* COMMAND INPUT */
.command-container {
    --cmd-surface: var(--panel-black);
    --cmd-border: var(--border-tactical);
    --cmd-accent: var(--blood-red);
    --cmd-prefix-bg: rgba(255, 26, 26, 0.10);
    --cmd-prefix-bg-hover: rgba(255, 26, 26, 0.14);
    --cmd-prefix-fg: var(--blood-red);
    --cmd-field-bg: rgba(255, 255, 255, 0.02);
    --cmd-field-placeholder: var(--stealth-gray);
    --cmd-voice-bg: rgba(0, 212, 255, 0.08);
    --cmd-voice-bg-hover: rgba(0, 212, 255, 0.18);
    --cmd-voice-fg: var(--tactical-cyan);
    --cmd-exec-bg: var(--blood-red);
    --cmd-exec-bg-hover: #ff4444;

    padding: 18px 42px;
    background: linear-gradient(180deg, transparent 0%, var(--void-black) 30%);
    position: relative;
    border-top: 1px solid var(--border-tactical);
}

.assist-attachments {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.assist-attachments.hidden {
    display: none;
}

.assist-attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(0, 212, 255, 0.18);
    background: rgba(0, 212, 255, 0.06);
    color: rgba(229, 231, 235, 0.9);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.4px;
}

.assist-attachment-chip button {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.03);
    color: rgba(229,231,235,0.82);
    cursor: pointer;
}

.assist-attachment-chip button:hover {
    border-color: rgba(255,26,26,0.35);
    color: rgba(255, 210, 210, 0.95);
    background: rgba(255,26,26,0.08);
}

.command-wrapper {
    background: var(--cmd-surface);
    border: 1px solid var(--cmd-border);
    border-left: 3px solid var(--cmd-accent);
    border-radius: 14px;
    padding: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    position: relative;
}

.command-wrapper:focus-within {
    border-color: var(--cmd-accent);
    box-shadow: var(--glow-red), inset 0 0 20px rgba(255, 26, 26, 0.05);
}

.command-prefix {
    height: 40px;
    padding: 0 14px;
    background: var(--cmd-prefix-bg);
    color: var(--cmd-prefix-fg);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.8px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    cursor: pointer;
    border: none;
    appearance: none;
    border-radius: 10px;
}

.command-prefix:hover {
    background: var(--cmd-prefix-bg-hover);
}

.command-prefix:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.14);
}

.assist-mode-pill {
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(0, 212, 255, 0.22);
    background: rgba(0, 212, 255, 0.08);
    color: var(--tactical-cyan);
    font-size: 10px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.assist-mode-pill.hidden {
    display: none;
}

.command-prefix::after {
    content: '';
    width: 8px;
    height: 2px;
    background: var(--blood-red);
    animation: blink 1s step-end infinite;
}

.command-field {
    flex: 1;
    background: var(--cmd-field-bg);
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--ghost-white);
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.6;
    resize: none;
    outline: none;
    min-height: 24px;
    max-height: 150px;
    padding: 9px 12px;
}

.command-field::placeholder {
    color: var(--cmd-field-placeholder);
}

.assist-menu {
    position: absolute;
    left: 48px;
    bottom: 76px;
    width: min(320px, calc(100vw - 80px));
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.10);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)),
        rgba(8, 10, 14, 0.98);
    box-shadow: 0 18px 46px rgba(0,0,0,0.55);
    padding: 8px;
    z-index: 60;
    transform-origin: bottom left;
    animation: panelFadeInSoft 0.16s ease;
}

.assist-menu.hidden {
    display: none;
}

.assist-menu-item {
    width: 100%;
    display: grid;
    grid-template-columns: 18px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 10px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(229,231,235,0.90);
    cursor: pointer;
    text-align: left;
    font-size: 12px;
    letter-spacing: 0.4px;
}

.assist-menu-item i {
    color: rgba(156, 163, 175, 0.92);
}

.assist-menu-item:hover {
    background: rgba(0, 212, 255, 0.06);
    border-color: rgba(0, 212, 255, 0.18);
}

.assist-menu-item.is-checked {
    background: rgba(0, 212, 255, 0.10);
    border-color: rgba(0, 212, 255, 0.22);
}

.assist-menu-item.is-checked i {
    color: var(--tactical-cyan);
}

.assist-menu-item-more {
    grid-template-columns: 18px 1fr 18px;
}

.assist-menu-chevron {
    opacity: 0.75;
}

/* PROFESSIONAL THEME for assist menu */
body.matrix .assist-menu {
    border-color: rgba(15, 23, 42, 0.12);
    background: linear-gradient(180deg, #ffffff, #f1f5f9);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.05), 0 18px 46px rgba(15, 23, 42, 0.14);
}

body.matrix .assist-menu-item {
    color: rgba(15, 23, 42, 0.86);
}

body.matrix .assist-menu-item i {
    color: rgba(15, 23, 42, 0.62);
}

body.matrix .assist-menu-item:hover {
    background: rgba(29, 78, 216, 0.06);
    border-color: rgba(29, 78, 216, 0.18);
}

body.matrix .assist-menu-item.is-checked {
    background: rgba(29, 78, 216, 0.10);
    border-color: rgba(29, 78, 216, 0.22);
}

body.matrix .assist-attachment-chip {
    border-color: rgba(15, 23, 42, 0.12);
    background: rgba(15, 23, 42, 0.03);
    color: rgba(15, 23, 42, 0.82);
}

body.matrix .assist-attachment-chip button {
    border-color: rgba(15, 23, 42, 0.12);
    background: rgba(15, 23, 42, 0.03);
    color: rgba(15, 23, 42, 0.70);
}

body.matrix .assist-attachment-chip button:hover {
    border-color: rgba(185, 28, 28, 0.22);
    background: rgba(185, 28, 28, 0.07);
    color: rgba(185, 28, 28, 0.92);
}

body.matrix .has-tip::after {
    border-color: rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.96);
    color: rgba(15, 23, 42, 0.82);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.06), 0 18px 46px rgba(15, 23, 42, 0.14);
}

body.matrix .has-tip::before {
    background: rgba(255, 255, 255, 0.96);
    border-right-color: rgba(15, 23, 42, 0.12);
    border-bottom-color: rgba(15, 23, 42, 0.12);
}

.command-voice {
    width: 40px;
    height: 40px;
    background: var(--cmd-voice-bg);
    border: 1px solid var(--cmd-border);
    color: var(--cmd-voice-fg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.command-voice:hover {
    background: var(--cmd-voice-bg-hover);
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.25);
    transform: scale(1.05);
}

.command-voice.listening {
    color: var(--signal-green);
    border-color: rgba(0, 255, 65, 0.45);
    box-shadow: 0 0 18px rgba(0, 255, 65, 0.28);
    animation: alertPulse 1.2s ease-in-out infinite;
}

.command-voice.processing {
    color: var(--alert-amber);
    border-color: rgba(255, 140, 0, 0.5);
    box-shadow: 0 0 18px rgba(255, 140, 0, 0.28);
}

.command-voice.speaking {
    color: var(--blood-red);
    border-color: rgba(255, 26, 26, 0.5);
    box-shadow: 0 0 18px rgba(255, 26, 26, 0.28);
}

.command-voice:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.command-execute {
    width: 40px;
    height: 40px;
    background: var(--cmd-exec-bg);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, transform 0.18s ease;
    clip-path: polygon(30% 0%, 100% 50%, 30% 100%, 0% 50%);
}

.command-execute:hover {
    background: var(--cmd-exec-bg-hover);
    box-shadow: var(--glow-red);
    transform: scale(1.05);
}

/* Hover tooltips (replaces the static command hint row) */
.has-tip {
    position: relative;
}

.has-tip::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    top: calc(100% + 10px);
    transform: translateX(-50%) translateY(-6px);
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(10, 12, 18, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: rgba(229, 231, 235, 0.94);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
    max-width: min(280px, calc(100vw - 24px));
    text-overflow: ellipsis;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.16s ease, transform 0.16s ease;
    z-index: 70;
    box-shadow: 0 18px 46px rgba(0,0,0,0.55);
}

.has-tip::before {
    content: none;
}

.has-tip:hover::after,
.has-tip:focus-visible::after,
.has-tip:hover::before,
.has-tip:focus-visible::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Opt-in: render tooltip above (used for voice button to avoid overlapping the input row). */
.has-tip.tip-top::after {
    top: auto;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(6px);
}

.has-tip.tip-top:hover::after,
.has-tip.tip-top:focus-visible::after {
    transform: translateX(-50%) translateY(0);
}

/* Bottom tooltips that avoid overlapping neighboring header buttons */
.has-tip.tip-bottom-left::after {
    left: 0;
    transform: translateX(0) translateY(-6px);
}

.has-tip.tip-bottom-left:hover::after,
.has-tip.tip-bottom-left:focus-visible::after {
    transform: translateX(0) translateY(0);
}

.has-tip.tip-bottom-right::after {
    left: auto;
    right: 0;
    transform: translateX(0) translateY(-6px);
}

.has-tip.tip-bottom-right:hover::after,
.has-tip.tip-bottom-right:focus-visible::after {
    transform: translateX(0) translateY(0);
}

@media (max-width: 640px) {
    .has-tip.tip-bottom-left::after,
    .has-tip.tip-bottom-right::after {
        left: 50%;
        right: auto;
        transform: translateX(-50%) translateY(-6px);
    }

    .has-tip.tip-bottom-left:hover::after,
    .has-tip.tip-bottom-right:hover::after,
    .has-tip.tip-bottom-left:focus-visible::after,
    .has-tip.tip-bottom-right:focus-visible::after {
        transform: translateX(-50%) translateY(0);
    }
}

/* ============== MOBILE LAYOUT (phone) ============== */
@media (max-width: 640px) {
    body.is-mobile .app-container {
        grid-template-columns: 0px 1fr 0px;
        height: var(--app-vh);
        min-height: var(--app-vh);
    }

    body.is-mobile .intel-panel {
        display: none !important;
    }

    body.is-mobile .main-content {
        grid-column: 1 / -1;
    }

    body.is-mobile .header {
        padding: 0 10px;
    }

    body.is-mobile .mobile-sidebar-toggle {
        display: inline-flex;
    }

    body.is-mobile .logo-icon {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    body.is-mobile .logo-text {
        font-size: 16px;
        letter-spacing: 2px;
    }

    body.is-mobile .logo-sub {
        display: none;
    }

    /* Hide the desktop left rail on phones; use header toggle + swipe instead. */
    body.is-mobile .left-rail {
        display: none !important;
    }

    body.is-mobile.drawer-open {
        overflow: hidden;
        touch-action: pan-y;
    }

    body.is-mobile .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 100vw;
        max-width: 100vw;
        z-index: 10060;
        transform: translateX(-105%);
        transition: transform 220ms ease;
        box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
    }

    body.is-mobile:not(.left-panel-collapsed) .sidebar {
        transform: translateX(0);
    }

    body.is-mobile .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 10055;
        background: rgba(0, 0, 0, 0.58);
        opacity: 0;
        pointer-events: none;
        transition: opacity 180ms ease;
        -webkit-tap-highlight-color: transparent;
    }

    body.is-mobile:not(.left-panel-collapsed) .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    body.is-mobile .command-bar {
        padding-left: 10px;
        padding-right: 10px;
    }

    body.is-mobile .command-wrapper {
        border-left-width: 1px;
        border-radius: 999px;
        padding: 6px;
        gap: 10px;
    }

    body.is-mobile .chat-container {
        padding: 16px 14px calc(16px + 84px + env(safe-area-inset-bottom, 0px));
    }

    body.is-mobile .mission-briefing {
        padding: 16px 14px 18px;
    }

    body.is-mobile .landing {
        width: 100%;
        transform: none;
    }

    body.is-mobile .landing-card {
        padding: 18px 16px 16px;
        border-radius: 20px;
    }

    body.is-mobile .landing-title {
        font-size: clamp(34px, 10vw, 46px);
    }

    body.is-mobile .landing-actions {
        gap: 8px;
    }

    body.is-mobile .landing-btn {
        width: 100%;
        justify-content: center;
    }

    /* On phones: keep the UI clean (no intel panel + no toggle button). */
    body.is-mobile .right-panel-toggle {
        display: none !important;
    }

    /* ChatGPT-like composer on phones */
    body.is-mobile .command-container {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10004;
        padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
        background:
            linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.55) 28%, rgba(0, 0, 0, 0.88) 100%);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    body.is-mobile .command-wrapper {
        border-left: 1px solid rgba(255, 255, 255, 0.10);
        box-shadow: 0 10px 34px rgba(0, 0, 0, 0.55);
    }

    body.is-mobile .command-prefix {
        width: 44px;
        height: 44px;
        padding: 0;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.10);
        color: rgba(229, 231, 235, 0.92);
        flex: 0 0 auto;
        justify-content: center;
    }

    body.is-mobile .command-prefix::after {
        display: none;
    }

    body.is-mobile #command-prefix-label,
    body.is-mobile .assist-mode-pill {
        display: none !important;
    }

    body.is-mobile .command-prefix::before {
        content: "+";
        font-family: var(--font-ui);
        font-size: 22px;
        line-height: 1;
        margin-top: -1px;
    }

    body.is-mobile .command-field {
        background: rgba(255, 255, 255, 0.04);
        border-color: rgba(255, 255, 255, 0.08);
        border-radius: 999px;
        padding: 11px 14px;
        font-size: 13px;
        min-height: 42px;
    }

    body.is-mobile .command-voice,
    body.is-mobile .command-execute {
        width: 44px;
        height: 44px;
        border-radius: 999px;
        clip-path: none;
        transform: none;
    }

    body.is-mobile .command-execute {
        background: rgba(255, 255, 255, 0.92);
        color: rgba(0, 0, 0, 0.92);
    }

    body.is-mobile .command-execute:hover {
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.10), 0 18px 40px rgba(0, 0, 0, 0.45);
    }

    body.is-mobile .command-voice {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(255, 255, 255, 0.10);
        color: rgba(229, 231, 235, 0.92);
    }

    body.is-mobile .assist-menu {
        left: 12px;
        right: 12px;
        width: auto;
        bottom: calc(74px + env(safe-area-inset-bottom, 0px));
        transform-origin: bottom left;
    }
}

/* Touch devices: avoid sticky hover tooltips that can look messy on iOS/Android. */
@media (hover: none) {
    .has-tip::before,
    .has-tip::after {
        display: none !important;
    }
}

#voice-assist-status {
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

/* RIGHT PANEL - INTELLIGENCE */
.intel-panel {
    background: var(--tactical-black);
    border-left: 1px solid var(--border-tactical);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: inset 1px 0 0 rgba(255,255,255,0.02);
    transition: opacity 140ms ease, transform 160ms ease;
}

body.right-panel-collapsed .intel-panel {
    border-left: 0;
    opacity: 0;
    transform: translateX(12px);
    pointer-events: none;
}

.right-panel-toggle {
    --rp-toggle-accent: var(--alert-amber);
    --rp-toggle-border: rgba(255, 107, 0, 0.28);
    --rp-toggle-border-hover: rgba(255, 107, 0, 0.46);
    --rp-toggle-bg-top: rgba(255, 107, 0, 0.12);
    --rp-toggle-bg-bottom: rgba(0, 0, 0, 0.55);
    --rp-toggle-glow: rgba(255, 107, 0, 0.12);
    --rp-toggle-glow-hover: rgba(255, 107, 0, 0.16);
    --rp-toggle-text: rgba(255, 255, 255, 0.88);
    position: fixed;
    top: calc(var(--header-height) + 10px);
    right: 10px;
    width: 34px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--rp-toggle-border);
    background:
        linear-gradient(180deg, var(--rp-toggle-bg-top), var(--rp-toggle-bg-bottom)),
        rgba(8, 10, 14, 0.6);
    color: var(--rp-toggle-text);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.55),
        0 6px 18px rgba(0, 0, 0, 0.35),
        0 0 16px var(--rp-toggle-glow);
    z-index: 10005;
    cursor: pointer;
    transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

body:not(.matrix):not(.system) .right-panel-toggle {
    --rp-toggle-accent: var(--tactical-cyan);
    --rp-toggle-border: rgba(0, 212, 255, 0.26);
    --rp-toggle-border-hover: rgba(0, 212, 255, 0.44);
    --rp-toggle-bg-top: rgba(0, 212, 255, 0.10);
    --rp-toggle-bg-bottom: rgba(0, 0, 0, 0.55);
    --rp-toggle-glow: rgba(0, 212, 255, 0.12);
    --rp-toggle-glow-hover: rgba(0, 212, 255, 0.18);
}

body.matrix .right-panel-toggle {
    --rp-toggle-accent: rgba(15, 23, 42, 0.78);
    --rp-toggle-border: rgba(15, 23, 42, 0.16);
    --rp-toggle-border-hover: rgba(15, 23, 42, 0.26);
    --rp-toggle-bg-top: rgba(255, 255, 255, 0.92);
    --rp-toggle-bg-bottom: rgba(241, 245, 249, 0.92);
    --rp-toggle-glow: rgba(15, 23, 42, 0.08);
    --rp-toggle-glow-hover: rgba(15, 23, 42, 0.12);
    --rp-toggle-text: rgba(15, 23, 42, 0.82);
}

.right-panel-toggle:hover {
    transform: translateY(-1px);
    border-color: var(--rp-toggle-border-hover);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.55),
        0 10px 20px rgba(0, 0, 0, 0.35),
        0 0 22px var(--rp-toggle-glow-hover);
}

.right-panel-toggle:active {
    transform: translateY(0);
}

.right-panel-toggle:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 2px rgba(0, 212, 255, 0.35),
        0 0 0 1px rgba(0, 0, 0, 0.55),
        0 10px 22px rgba(0, 0, 0, 0.35);
}

.intel-header {
    padding: 14px 14px 13px;
    border-bottom: 1px solid var(--border-tactical);
    background: linear-gradient(90deg, rgba(255,107,0,0.04), rgba(255,107,0,0.1));
}

.intel-title {
    font-family: var(--font-tactical);
    font-size: 12px;
    font-weight: 700;
    color: var(--alert-amber);
    text-transform: uppercase;
    letter-spacing: 2.4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.intel-title::before {
    content: '◉';
    animation: pulseDot 2s infinite;
}

.intel-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px 12px 18px;
}

.intel-section {
    margin-bottom: 10px;
    padding: 12px 12px 13px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.015), rgba(255,255,255,0)),
        rgba(8, 10, 14, 0.8);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.015);
}

.intel-section:last-child {
    margin-bottom: 0;
}

.intel-section-priority {
    background:
        linear-gradient(180deg, rgba(255, 26, 26, 0.06), rgba(255,255,255,0)),
        rgba(8, 10, 14, 0.84);
    border-color: rgba(255, 26, 26, 0.14);
}

.intel-section-visual {
    padding-bottom: 10px;
}

.intel-section-support {
    background:
        linear-gradient(180deg, rgba(0, 212, 255, 0.035), rgba(255,255,255,0)),
        rgba(8, 10, 14, 0.82);
}

.intel-label {
    font-size: 9px;
    color: var(--stealth-gray);
    text-transform: uppercase;
    letter-spacing: 1.8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.intel-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-tactical);
    margin-left: 8px;
}

.target-profile {
    padding: 13px 13px 12px;
    background:
        radial-gradient(circle at 18% 18%, rgba(255, 107, 0, 0.08), transparent 24%),
        linear-gradient(180deg, rgba(255, 26, 26, 0.07), rgba(255, 26, 26, 0.02));
    border: 1px solid rgba(255, 26, 26, 0.18);
    border-radius: 10px;
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.015);
}

.target-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.target-indicator {
    width: 10px;
    height: 10px;
    background: var(--blood-red);
    border-radius: 50%;
    box-shadow: var(--glow-red);
    animation: pulseDot 2s infinite;
}

.target-name {
    font-family: var(--font-tactical);
    font-size: 15px;
    font-weight: 700;
    color: var(--blood-red);
    letter-spacing: 0.8px;
    line-height: 1.1;
    margin-bottom: 4px;
}

.target-meta {
    font-size: 10px;
    color: var(--stealth-gray);
    font-family: var(--font-mono);
    letter-spacing: 0.4px;
    line-height: 1.6;
}

.vuln-meter {
    margin-top: 10px;
}

.meter-label {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: var(--stealth-gray);
    margin-bottom: 5px;
    text-transform: uppercase;
}

.meter-bar {
    height: 7px;
    background: var(--grid-gray);
    position: relative;
    overflow: hidden;
    border-radius: 999px;
}

.meter-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--alert-amber), var(--blood-red));
    width: 73%;
    position: relative;
    animation: pulseMeter 2s ease-in-out infinite;
    border-radius: 999px;
}

@keyframes pulseMeter {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.intel-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.intel-item {
    padding: 9px 10px;
    background: rgba(12, 14, 20, 0.92);
    border: 1px solid rgba(255,255,255,0.05);
    border-left: 3px solid var(--tactical-cyan);
    border-radius: var(--radius-sm);
    font-size: 10px;
    color: var(--ghost-white);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.intel-item::before {
    content: '▸';
    color: var(--alert-amber);
    font-size: 10px;
}

.intel-item:hover {
    background: rgba(0, 212, 255, 0.05);
    border-color: rgba(0, 212, 255, 0.3);
    transform: translateX(2px);
}

.intel-item.critical {
    border-left-color: var(--blood-red);
    background: rgba(255, 26, 26, 0.05);
}

.intel-item.warning {
    border-left-color: var(--alert-amber);
}

.loot-box {
    padding: 12px;
    background:
        radial-gradient(circle at 82% 18%, rgba(0, 255, 65, 0.07), transparent 22%),
        linear-gradient(180deg, rgba(0, 255, 65, 0.06), rgba(0, 255, 65, 0.02));
    border: 1px solid rgba(0, 255, 65, 0.18);
    border-left: 3px solid var(--signal-green);
    border-radius: 10px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.015);
}

.loot-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--signal-green);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.loot-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 255, 65, 0.1);
    font-size: 10px;
    gap: 16px;
}

.loot-item:last-child {
    border-bottom: none;
}

.loot-type {
    color: var(--stealth-gray);
}

.loot-value {
    color: var(--signal-green);
    font-family: var(--font-mono);
}

/* RESPONSIVE */
@media (max-width: 1400px) {
    .app-container {
        grid-template-columns: var(--sidebar-width) 1fr;
    }
    .intel-panel {
        display: none;
    }
}

@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 10040;
        transform: translateX(-105%);
        transition: transform 220ms ease;
    }
    body:not(.left-panel-collapsed) .sidebar {
        transform: translateX(0);
    }
    .chat-container, .command-container {
        padding-left: 20px;
        padding-right: 20px;
    }
    .engagement-grid {
        grid-template-columns: 1fr;
    }
}

.log-bubble.typing::after {
    content: '|';
    animation: blink 1s infinite;
    color: var(--blood-red);
    font-weight: bold;
}

/* Enhanced animations */
@keyframes matrixRain {
    0% { transform: translateY(-100vh); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(100vh); opacity: 0; }
}

.matrix-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.03;
}

.matrix-rain::before {
    content: '0101001001010010010100100101001001010010';
    position: absolute;
    top: -100px;
    left: 10%;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--tactical-cyan);
    animation: matrixRain 15s linear infinite;
    letter-spacing: 2px;
}

.matrix-rain::after {
    content: '011010000110000101100011011010110110010101110010';
    position: absolute;
    top: -100px;
    left: 60%;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--signal-green);
    animation: matrixRain 20s linear infinite;
    animation-delay: 5s;
    letter-spacing: 1px;
}

/* SCROLLBAR */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--tactical-black);
}
::-webkit-scrollbar-thumb {
    background: var(--border-tactical);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--blood-red);
}

.network-map {
    position: relative;
    overflow: hidden;
    --impact-accent: rgba(0, 212, 255, 1);
    --impact-warn: rgba(255, 140, 0, 1);
    --impact-danger: rgba(255, 26, 26, 1);
    --impact-text: rgba(217, 228, 242, 1);
    --impact-muted: rgba(214, 224, 255, 0.66);
    --impact-border: rgba(0, 212, 255, 0.14);
    --impact-surface: rgba(7, 10, 18, 0.98);
    --impact-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 28%);
    --impact-panel-bg:
        linear-gradient(180deg, rgba(5, 10, 18, 0.88), rgba(3, 6, 12, 0.92)),
        linear-gradient(90deg, rgba(0, 212, 255, 0.04), transparent 55%);
    --impact-chip-bg: rgba(8, 12, 20, 0.56);
    --impact-chip-label: rgba(217, 228, 242, 0.88);
    --impact-panel-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    border: 1px solid color-mix(in srgb, var(--impact-border) 70%, transparent);
    border-radius: 14px;
    background:
        radial-gradient(circle at 18% 12%, rgba(0, 212, 255, 0.08), transparent 36%),
        radial-gradient(circle at 82% 78%, rgba(255, 26, 26, 0.12), transparent 30%),
        linear-gradient(180deg, var(--impact-surface), rgba(2, 4, 10, 1));
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.4);
}

body.system .network-map {
    --impact-accent: rgba(251, 191, 36, 1);
    --impact-warn: rgba(125, 211, 252, 1);
    --impact-danger: rgba(255, 26, 26, 1);
    --impact-text: rgba(255, 255, 255, 0.92);
    --impact-muted: rgba(255, 255, 255, 0.66);
    --impact-border: rgba(251, 191, 36, 0.16);
    --impact-surface: rgba(9, 9, 9, 0.96);
    --impact-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 30%);
    --impact-panel-bg:
        linear-gradient(180deg, rgba(12, 12, 12, 0.94), rgba(0, 0, 0, 0.96)),
        linear-gradient(90deg, rgba(251, 191, 36, 0.08), transparent 58%);
    --impact-chip-bg: rgba(255, 255, 255, 0.03);
    --impact-chip-label: rgba(255, 255, 255, 0.92);
    --impact-panel-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.04),
        0 0 24px rgba(0, 0, 0, 0.24);
}

body.matrix .network-map {
    --impact-accent: rgba(29, 78, 216, 0.95);
    --impact-warn: rgba(217, 119, 6, 0.95);
    --impact-danger: rgba(220, 38, 38, 0.95);
    --impact-text: rgba(15, 23, 42, 0.92);
    --impact-muted: rgba(15, 23, 42, 0.62);
    --impact-border: rgba(15, 23, 42, 0.12);
    --impact-surface: rgba(255, 255, 255, 0.92);
    --impact-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.5), transparent 36%);
    --impact-panel-bg:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.94)),
        linear-gradient(90deg, rgba(29, 78, 216, 0.08), transparent 58%);
    --impact-chip-bg: rgba(255, 255, 255, 0.78);
    --impact-chip-label: rgba(15, 23, 42, 0.88);
    --impact-panel-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.68),
        0 10px 24px rgba(15, 23, 42, 0.08);
    background:
        radial-gradient(circle at 18% 12%, rgba(29, 78, 216, 0.10), transparent 40%),
        radial-gradient(circle at 82% 78%, rgba(220, 38, 38, 0.10), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(241, 245, 249, 0.92));
    box-shadow:
        inset 0 0 24px rgba(15, 23, 42, 0.08),
        0 0 0 1px rgba(15, 23, 42, 0.04);
}

.network-map.is-hovering {
    border-color: color-mix(in srgb, var(--impact-accent) 28%, transparent);
    box-shadow:
        inset 0 0 30px rgba(0, 0, 0, 0.42),
        0 0 0 1px color-mix(in srgb, var(--impact-accent) 8%, transparent);
}

.network-map::before,
.network-map::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.network-map::before {
    background:
        var(--impact-sheen),
        radial-gradient(circle at 50% 24%, rgba(0, 212, 255, 0.06), transparent 42%),
        radial-gradient(circle at 16% 62%, rgba(255, 26, 26, 0.05), transparent 28%);
    mix-blend-mode: screen;
}

.network-map::after {
    border: 1px solid rgba(255, 255, 255, 0.025);
    box-shadow: inset 0 -18px 32px rgba(0, 0, 0, 0.28);
}

.network-map-shell {
    position: relative;
    --topology-canvas-height: 214px;
    padding: 10px 10px 12px;
}

.network-topology-canvas {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    height: var(--topology-canvas-height);
    border: 1px solid color-mix(in srgb, var(--impact-accent) 10%, transparent);
    border-radius: 12px;
    background:
        radial-gradient(circle at 20% 18%, color-mix(in srgb, var(--impact-text) 7%, transparent), transparent 18%),
        radial-gradient(circle at 78% 26%, color-mix(in srgb, var(--impact-warn) 12%, transparent), transparent 22%),
        radial-gradient(circle at 50% 18%, color-mix(in srgb, var(--impact-accent) 10%, transparent), transparent 38%),
        linear-gradient(180deg, color-mix(in srgb, var(--impact-surface) 92%, rgba(2, 4, 10, 1) 8%), color-mix(in srgb, var(--impact-surface) 84%, rgba(2, 4, 10, 1) 16%));
    box-shadow:
        inset 0 0 24px rgba(0, 0, 0, 0.34),
        inset 0 0 52px color-mix(in srgb, var(--impact-accent) 4%, transparent);
}

.network-map-grid,
.network-map-sweep {
    position: absolute;
    top: 12px;
    left: 10px;
    right: 10px;
    height: var(--topology-canvas-height);
    border-radius: 8px;
    pointer-events: none;
}

.network-map-grid {
    z-index: 0;
    opacity: 0.16;
    background:
        linear-gradient(color-mix(in srgb, var(--impact-accent) 9%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--impact-accent) 9%, transparent) 1px, transparent 1px),
        linear-gradient(180deg, color-mix(in srgb, var(--impact-text) 4%, transparent), transparent 16%);
    background-size: 24px 24px, 24px 24px, 100% 100%;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.95), transparent 98%);
}

.network-map-sweep {
    z-index: 1;
    background: linear-gradient(115deg, transparent 40%, color-mix(in srgb, var(--impact-accent) 10%, transparent) 50%, transparent 60%);
    transform: translateX(-120%);
    animation: topologySweep 11s linear infinite;
    mix-blend-mode: screen;
}

.network-map-overlay {
    position: absolute;
    top: 12px;
    left: 10px;
    right: 10px;
    height: var(--topology-canvas-height);
    z-index: 3;
    pointer-events: none;
}

.network-map-overlay::before,
.network-map-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 6px;
}

.network-map-overlay::before {
    background:
        radial-gradient(circle at 24% 20%, rgba(0, 212, 255, 0.08), transparent 20%),
        radial-gradient(circle at 74% 72%, rgba(255, 107, 0, 0.08), transparent 24%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent 26%, rgba(0, 0, 0, 0.06) 100%);
    mix-blend-mode: screen;
}

.network-map-overlay::after {
    border: 1px solid rgba(255, 255, 255, 0.02);
    box-shadow: inset 0 0 40px color-mix(in srgb, var(--impact-accent) 3%, transparent);
}

.network-map-tooltip {
    position: absolute;
    z-index: 4;
    min-width: 116px;
    max-width: 160px;
    padding: 7px 8px;
    border: 1px solid color-mix(in srgb, var(--impact-accent) 22%, transparent);
    border-radius: 8px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--impact-surface) 96%, rgba(2, 4, 10, 1) 4%), color-mix(in srgb, var(--impact-surface) 88%, rgba(2, 4, 10, 1) 12%)),
        linear-gradient(90deg, color-mix(in srgb, var(--impact-accent) 10%, transparent), transparent 70%);
    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.36),
        0 0 18px color-mix(in srgb, var(--impact-accent) 10%, transparent);
    pointer-events: none;
    transform: translate(10px, -50%);
}

.network-map-tooltip.hidden {
    display: none;
}

.network-tooltip-name {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--impact-text);
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.network-tooltip-meta {
    margin-top: 3px;
    font-size: 9px;
    letter-spacing: 0.8px;
    color: var(--impact-muted);
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.network-map-hud,
.network-zone-strip,
.network-map-status,
.network-map-meta {
    display: none;
}

.network-map-hud {
    position: relative;
    z-index: 3;
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.network-readout-card {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--impact-accent) 10%, transparent);
    border-radius: var(--radius-md);
    background: var(--impact-panel-bg);
    box-shadow: var(--impact-panel-shadow);
}

.network-readout-card::before {
    content: '';
    display: block;
    width: 28px;
    height: 2px;
    margin-bottom: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--impact-accent), color-mix(in srgb, var(--impact-text) 42%, transparent));
    box-shadow: none;
}

.network-hud-label {
    font-family: var(--font-ui);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.14em;
    line-height: 1.1;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--impact-muted) 72%, var(--impact-text) 28%);
}

.network-hud-value {
    font-family: var(--font-ui);
    margin-top: 2px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: var(--impact-text);
    line-height: 1;
    text-wrap: pretty;
}

.network-hud-detail,
.network-hud-meta {
    font-family: var(--font-ui);
    margin-top: 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: var(--impact-muted);
    line-height: 1.35;
    text-wrap: pretty;
}

.network-hud-meta {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: color-mix(in srgb, var(--impact-muted) 76%, transparent);
}

.network-zone-strip {
    position: relative;
    z-index: 3;
    display: grid;
    gap: 8px;
}

.network-zone-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--impact-accent) 10%, transparent);
    background: var(--impact-chip-bg);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--impact-text) 84%, transparent);
}

.network-zone-chip-label {
    color: var(--impact-chip-label);
    flex: 1 1 auto;
    min-width: 0;
    font-family: var(--font-ui);
    font-weight: 700;
}

.network-zone-chip-value {
    color: color-mix(in srgb, var(--impact-text) 62%, transparent);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 800;
    min-width: 18px;
    text-align: right;
}

.network-zone-swatch {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    flex: 0 0 auto;
}

.network-zone-chip[data-tone="secure"] {
    border-color: rgba(0, 212, 255, 0.12);
}

.network-zone-chip[data-tone="secure"] .network-zone-swatch {
    background: var(--tactical-cyan);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.34);
}

.network-zone-chip[data-tone="warning"] {
    border-color: rgba(255, 107, 0, 0.14);
}

.network-zone-chip[data-tone="warning"] .network-zone-swatch {
    background: var(--alert-amber);
    box-shadow: 0 0 12px rgba(255, 107, 0, 0.34);
}

.network-zone-chip[data-tone="compromised"] {
    border-color: rgba(255, 26, 26, 0.14);
}

.network-zone-chip[data-tone="compromised"] .network-zone-swatch {
    background: var(--blood-red);
    box-shadow: 0 0 12px rgba(255, 26, 26, 0.34);
}

.network-zone-chip[data-tone="transit"] {
    border-color: rgba(0, 255, 65, 0.2);
}

.network-zone-chip[data-tone="transit"] .network-zone-swatch {
    background: var(--signal-green);
    box-shadow: 0 0 12px rgba(0, 255, 65, 0.34);
}

@keyframes topologySweep {
    0% { transform: translateX(-120%); opacity: 0; }
    10% { opacity: 0.35; }
    55% { opacity: 0.18; }
    100% { transform: translateX(120%); opacity: 0; }
}

@media (max-width: 1024px) {
    .network-map-shell {
        --topology-canvas-height: 220px;
    }
}

/* ====== NEW ANIMATIONS ====== */

@keyframes slideInPanel {
    from { 
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeInAlert {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spinLoader {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

@keyframes typingCursor {
    0%, 100% { border-right-color: var(--blood-red); }
    50% { border-right-color: transparent; }
}

@keyframes skeletonShimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ====== MODAL STYLES ====== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    animation: fadeInAlert 0.3s;
}

.modal-overlay.is-open {
    display: flex;
}

.modal-overlay.hidden {
    display: none;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--panel-black);
    border: 2px solid var(--blood-red);
    border-radius: var(--radius-md);
    box-shadow: var(--elev-2);
    min-width: 400px;
    width: min(520px, calc(100vw - 32px));
    max-height: 90vh;
    overflow-y: auto;
    animation: slideInPanel 0.3s;
    z-index: 9001;
}

#settings-modal,
#alerts-modal,
#beacons-modal,
#profile-modal {
    width: min(920px, calc(100vw - 40px));
    max-height: min(90vh, 960px);
}

/* Profile editor should be a compact card like the reference UI. */
#profile-modal {
    width: min(560px, calc(100vw - 28px));
    max-height: min(84vh, 680px);
    overflow: hidden;
}

#settings-modal {
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

/* Keep profile modal edges tight (no reserved scrollbar gutter). */
#profile-modal {
    scrollbar-gutter: auto;
}

/* Profile modal polish */
#profile-modal .modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

#profile-modal .modal-body {
    padding-top: 18px;
    overflow-y: auto;
    max-height: calc(min(84vh, 680px) - 64px);
    padding-right: 12px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

#profile-modal .modal-body::-webkit-scrollbar {
    width: 10px;
}

#profile-modal .modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 999px;
}

#profile-modal .modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    border: 2px solid rgba(0, 0, 0, 0.22);
}

body.matrix #profile-modal .modal-body::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.06);
}

body.matrix #profile-modal .modal-body::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.18);
    border-color: rgba(255, 255, 255, 0.65);
}

.profile-edit-field label {
    letter-spacing: 1px;
    text-transform: uppercase;
    font-family: var(--font-mono);
    font-size: 11px;
    color: rgba(156, 163, 175, 0.82);
}

.profile-edit-field input:focus,
.profile-edit-field input:focus-visible {
    border-color: rgba(0, 212, 255, 0.22);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.06);
    outline: none;
}

body.system .profile-edit-field label {
    color: rgba(255, 255, 255, 0.60);
}

body.matrix .profile-edit-field label {
    color: rgba(15, 23, 42, 0.62);
}

.modal-hub#settings-modal {
    width: min(1040px, calc(100vw - 40px));
    height: min(720px, calc(100vh - 80px));
    max-height: none;
    padding: 0;
    overflow: hidden;
}

.hub-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    height: 100%;
}

.hub-nav {
    position: relative;
    padding: 16px 12px 12px;
    background:
        radial-gradient(900px 380px at 30% 0%, rgba(0,212,255,0.06), transparent 60%),
        rgba(7, 9, 13, 0.95);
    border-right: 1px solid rgba(255,255,255,0.06);
}

.hub-close {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.02);
    color: rgba(229,231,235,0.92);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease;
}

.hub-close:hover {
    background: rgba(0,212,255,0.06);
    border-color: rgba(0,212,255,0.18);
}

.hub-nav-items {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hub-nav-item {
    width: 100%;
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 10px;
    align-items: center;
    padding: 10px 10px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(229,231,235,0.86);
    cursor: pointer;
    text-align: left;
    font-size: 12px;
    letter-spacing: 0.4px;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.hub-nav-item i {
    color: rgba(156, 163, 175, 0.92);
}

.hub-nav-item:hover {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.06);
    color: rgba(229,231,235,0.94);
}

.hub-nav-item.is-active {
    background: rgba(0,212,255,0.08);
    border-color: rgba(0,212,255,0.18);
    color: rgba(229,231,235,0.96);
}

.hub-nav-item.is-active i {
    color: var(--tactical-cyan);
}

.hub-main {
    background:
        radial-gradient(1200px 600px at 80% 10%, rgba(255,26,26,0.06), transparent 58%),
        rgba(12, 14, 18, 0.96);
    padding: 18px 18px 14px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.hub-header {
    padding: 6px 6px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.hub-title {
    margin: 0;
    font-family: var(--font-tactical);
    font-size: 20px;
    letter-spacing: 1px;
    color: rgba(229,231,235,0.95);
}

.hub-panels {
    padding: 14px 6px 0;
    overflow: auto;
}

.hub-panel {
    display: none;
}

.hub-panel.is-active {
    display: block;
}

.hub-row {
    display: grid;
    grid-template-columns: 1fr 240px;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.hub-row:hover {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 14px;
    padding-left: 12px;
    padding-right: 12px;
    margin-left: -12px;
    margin-right: -12px;
}

.hub-row:focus-within {
    background: rgba(0, 212, 255, 0.05);
    border-radius: 14px;
    padding-left: 12px;
    padding-right: 12px;
    margin-left: -12px;
    margin-right: -12px;
}

.hub-row-left {
    min-width: 0;
}

.hub-row-title {
    font-size: 13px;
    font-weight: 700;
    color: rgba(229,231,235,0.94);
    letter-spacing: 0.4px;
}

.hub-row-sub {
    margin-top: 6px;
    font-size: 11px;
    color: rgba(156, 163, 175, 0.76);
    line-height: 1.5;
}

.hub-row-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.hub-row-right input[type='text'],
.hub-row-right input[type='password'],
.hub-row-right input[type='number'],
.hub-row-right select {
    width: 240px;
    max-width: 100%;
}

.hub-row-right select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(229,231,235,0.70) 50%),
        linear-gradient(135deg, rgba(229,231,235,0.70) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) calc(50% - 2px),
        calc(100% - 13px) calc(50% - 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 34px;
}

body.matrix .hub-row-right select {
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(15,23,42,0.50) 50%),
        linear-gradient(135deg, rgba(15,23,42,0.50) 50%, transparent 50%);
}

.hub-row-right-wide input[type='text'] {
    width: 100%;
    max-width: 520px;
}

.hub-row-right-inline {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.hub-list {
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(0, 0, 0, 0.10);
    border-radius: 14px;
    overflow: hidden;
}

.hub-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.hub-list-item:first-child {
    border-top: 0;
}

.hub-list-divider {
    height: 1px;
    background: rgba(255,255,255,0.12);
}

.hub-pill {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(156, 163, 175, 0.82);
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    background: rgba(0,0,0,0.12);
}

.hub-action-btn {
    appearance: none;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(0,0,0,0.22);
    color: var(--ghost-white);
    padding: 10px 14px;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.hub-action-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 212, 255, 0.35);
    background: rgba(0,0,0,0.28);
}

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

.hub-action-btn-danger {
    border-color: rgba(255, 26, 26, 0.45);
    color: var(--blood-red);
    background: rgba(255, 26, 26, 0.07);
}

.hub-action-btn-danger:hover {
    border-color: rgba(255, 26, 26, 0.65);
    background: rgba(255, 26, 26, 0.10);
}

/* Responsive: Settings hub rows and Data controls list */
@media (max-width: 860px) {
    .hub-row {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 14px 0;
    }

    .hub-row-right {
        justify-content: flex-start;
        width: 100%;
    }

    .hub-row-right input[type='text'],
    .hub-row-right input[type='password'],
    .hub-row-right input[type='number'],
    .hub-row-right select {
        width: 100%;
    }

    .hub-row-right-wide input[type='text'] {
        max-width: 100%;
    }

    .hub-actions {
        justify-content: stretch;
        flex-wrap: wrap;
    }

    .hub-actions .modal-btn {
        flex: 1 1 240px;
        min-width: 200px;
    }

    .hub-list-item {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px 14px;
    }

    .hub-row-right-inline {
        justify-content: space-between;
    }

    .hub-action-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 520px) {
    .hub-actions .modal-btn {
        flex: 1 1 100%;
        min-width: 0;
    }
}

/* Help/Report UI blocks */
.support-hero {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 14px 12px;
    border-radius: 16px;
    border: 1px solid var(--border-tactical);
    background:
        radial-gradient(circle at 14% 18%, rgba(0, 212, 255, 0.08), transparent 42%),
        linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.00)),
        rgba(0, 0, 0, 0.10);
}

.support-hero-badge {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 212, 255, 0.22);
    background: rgba(0, 0, 0, 0.22);
    color: rgba(230, 247, 255, 0.92);
    box-shadow: 0 0 18px rgba(0, 212, 255, 0.10);
}

.support-hero-badge i {
    font-size: 18px;
    line-height: 1;
}

.support-hero-title {
    font-family: var(--font-tactical);
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(229, 231, 235, 0.94);
}

.support-hero-sub {
    margin-top: 6px;
    color: rgba(156, 163, 175, 0.82);
    font-size: 12px;
    line-height: 1.5;
}

.support-hero-meta {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.support-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.14);
    color: rgba(229, 231, 235, 0.86);
    font-size: 11px;
    letter-spacing: 0.6px;
}

.support-pill i {
    opacity: 0.85;
}

.help-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.help-grid-hero {
    margin-top: 12px;
}

.help-card {
    border: 1px solid var(--border-tactical);
    background: rgba(0, 0, 0, 0.12);
    border-radius: 14px;
    padding: 14px;
}

.help-card-icon {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.help-card-icon-dot {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 212, 255, 0.18);
    background: rgba(0, 0, 0, 0.18);
    color: rgba(230, 247, 255, 0.92);
    box-shadow: 0 0 14px rgba(0, 212, 255, 0.08);
}

.help-card-title {
    font-family: var(--font-tactical);
    font-weight: 800;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: rgba(229, 231, 235, 0.92);
}

.help-card-sub {
    margin-top: 8px;
    color: rgba(156, 163, 175, 0.78);
    font-size: 12px;
    line-height: 1.5;
}

.release-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.release-timeline {
    position: relative;
    padding-left: 10px;
}

.release-timeline::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 6px;
    bottom: 6px;
    width: 1px;
    background: rgba(255,255,255,0.10);
}

.release-item {
    border: 1px solid var(--border-tactical);
    background: rgba(0, 0, 0, 0.12);
    border-radius: 14px;
    padding: 14px;
}

.release-item-dot {
    position: relative;
}

.release-item-dot::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 18px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.9);
    box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.12);
}

.release-title {
    font-weight: 800;
    color: rgba(229, 231, 235, 0.92);
    letter-spacing: 0.6px;
}

.release-sub {
    margin-top: 6px;
    color: rgba(156, 163, 175, 0.78);
    font-size: 12px;
    line-height: 1.5;
}

.terms-box {
    border: 1px solid var(--border-tactical);
    background: rgba(0, 0, 0, 0.12);
    border-radius: 14px;
    padding: 14px;
    margin-top: 12px;
    display: grid;
    gap: 10px;
}

.terms-box-structured .terms-item strong {
    color: rgba(229, 231, 235, 0.94);
}

.support-split {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.support-panel {
    border: 1px solid var(--border-tactical);
    background: rgba(0, 0, 0, 0.10);
    border-radius: 14px;
    padding: 14px;
}

.support-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-tactical);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: rgba(229, 231, 235, 0.90);
}

.support-panel-title i {
    opacity: 0.85;
}

.support-list {
    margin-top: 10px;
    display: grid;
    gap: 10px;
}

.support-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: rgba(156, 163, 175, 0.88);
    font-size: 12px;
}

.support-kbd {
    min-width: 74px;
    text-align: center;
    padding: 4px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.18);
    color: rgba(229, 231, 235, 0.92);
    font-family: var(--font-mono);
    letter-spacing: 0.6px;
}

.support-note {
    margin-top: 10px;
    color: rgba(156, 163, 175, 0.82);
    font-size: 12px;
    line-height: 1.6;
}

.platform-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.platform-card {
    border: 1px solid var(--border-tactical);
    background: rgba(0, 0, 0, 0.12);
    border-radius: 16px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.platform-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.platform-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    border: 1px solid rgba(0, 212, 255, 0.18);
    background: rgba(0, 0, 0, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(230, 247, 255, 0.92);
}

.platform-icon i {
    font-size: 18px;
    line-height: 1;
}

.platform-name {
    font-weight: 900;
    color: rgba(229, 231, 235, 0.92);
    letter-spacing: 0.5px;
}

.platform-sub {
    margin-top: 2px;
    color: rgba(156, 163, 175, 0.78);
    font-size: 12px;
}

.platform-btn {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.20);
    color: rgba(229, 231, 235, 0.78);
    font-family: var(--font-tactical);
    letter-spacing: 0.10em;
    text-transform: uppercase;
    cursor: not-allowed;
}

.bug-form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.bug-form-field {
    display: grid;
    gap: 6px;
    color: rgba(156, 163, 175, 0.82);
    font-size: 12px;
}

.bug-form-field span {
    letter-spacing: 1.2px;
    text-transform: uppercase;
    font-family: var(--font-mono);
    font-size: 11px;
}

.bug-form-field select {
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--border-tactical);
    background: rgba(0, 0, 0, 0.10);
    padding: 10px 12px;
    color: rgba(229, 231, 235, 0.92);
    outline: none;
}

.bug-form-field select:focus {
    border-color: rgba(0, 212, 255, 0.22);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.06);
}

.terms-item {
    color: rgba(229, 231, 235, 0.86);
    font-size: 12px;
    line-height: 1.6;
}

.bug-form textarea {
    width: 100%;
    min-height: 210px;
    border-radius: 14px;
    border: 1px solid var(--border-tactical);
    background: rgba(0, 0, 0, 0.10);
    padding: 14px;
    color: rgba(229, 231, 235, 0.92);
    outline: none;
    resize: vertical;
}

.bug-form textarea:focus {
    border-color: rgba(0, 212, 255, 0.22);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.06);
}

.bug-form-footer {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.bug-count {
    color: rgba(156, 163, 175, 0.78);
    font-size: 12px;
}

@media (max-width: 760px) {
    .help-grid {
        grid-template-columns: 1fr;
    }

    .support-split {
        grid-template-columns: 1fr;
    }

    .platform-grid {
        grid-template-columns: 1fr;
    }

    .bug-form-row {
        grid-template-columns: 1fr;
    }

    .bug-form-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .bug-form-footer .modal-btn {
        width: 100%;
    }
}

body.matrix .help-card,
body.matrix .release-item,
body.matrix .terms-box,
body.matrix .platform-card,
body.matrix .support-hero,
body.matrix .support-panel,
body.matrix .bug-form textarea,
body.matrix .bug-form-field select {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.06);
}

body.matrix .help-card-title,
body.matrix .support-hero-title,
body.matrix .support-panel-title,
body.matrix .release-title {
    color: rgba(15, 23, 42, 0.90);
}

body.matrix .help-card-sub,
body.matrix .support-hero-sub,
body.matrix .support-note,
body.matrix .support-list-item,
body.matrix .platform-sub,
body.matrix .release-sub,
body.matrix .terms-item,
body.matrix .bug-count {
    color: rgba(15, 23, 42, 0.62);
}

body.matrix .bug-form textarea {
    color: rgba(15, 23, 42, 0.86);
    background: rgba(241, 245, 249, 0.92);
}

body.matrix .bug-form textarea::placeholder {
    color: rgba(15, 23, 42, 0.42);
}

body.matrix .bug-form-field select {
    color: rgba(15, 23, 42, 0.86);
    background: rgba(241, 245, 249, 0.92);
}

body.matrix .bug-form-field span {
    color: rgba(15, 23, 42, 0.60);
}

body.matrix .platform-name,
body.matrix .terms-box-structured .terms-item strong {
    color: rgba(15, 23, 42, 0.90);
}

body.matrix .support-pill {
    background: rgba(241, 245, 249, 0.92);
    border-color: rgba(15, 23, 42, 0.10);
    color: rgba(15, 23, 42, 0.70);
}

body.matrix .support-kbd {
    background: rgba(241, 245, 249, 0.92);
    border-color: rgba(15, 23, 42, 0.12);
    color: rgba(15, 23, 42, 0.78);
}

body.matrix .release-item-dot::before {
    background: rgba(59, 130, 246, 0.92);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.16);
}

.hub-empty {
    padding: 22px 0;
    color: rgba(156,163,175,0.78);
}

.hub-empty-title {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: rgba(229,231,235,0.92);
}

.hub-empty-sub {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.5;
}

.hub-actions {
    padding: 18px 0 8px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.hub-switch {
    position: relative;
    width: 44px;
    height: 26px;
    display: inline-flex;
    align-items: center;
}

.hub-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.hub-switch-track {
    width: 44px;
    height: 26px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.10);
    position: relative;
    transition: background 0.16s ease, border-color 0.16s ease;
}

.hub-switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: rgba(229,231,235,0.92);
    transition: transform 0.16s ease, background 0.16s ease;
}

.hub-switch input:checked + .hub-switch-track {
    background: rgba(0,212,255,0.20);
    border-color: rgba(0,212,255,0.26);
}

.hub-switch input:checked + .hub-switch-track::after {
    transform: translateX(18px);
    background: rgba(0,212,255,0.95);
}

.hub-account-card {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 14px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    margin-bottom: 10px;
}

.hub-account-avatar {
    width: 54px;
    height: 54px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-tactical);
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 1px;
    background: rgba(255, 140, 0, 0.18);
    border: 1px solid rgba(255, 140, 0, 0.35);
    color: rgba(255, 225, 192, 0.95);
}

.hub-account-name {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: rgba(229,231,235,0.95);
}

.hub-account-sub {
    margin-top: 4px;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(156,163,175,0.78);
}

.hub-account-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 10px;
}

.hub-mini-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.02);
    color: rgba(229,231,235,0.88);
    cursor: pointer;
    font-size: 12px;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.hub-mini-btn:hover {
    background: rgba(0,212,255,0.06);
    border-color: rgba(0,212,255,0.18);
}

.hub-key-row {
    display: grid;
    grid-template-columns: 1fr 42px;
    gap: 10px;
    align-items: center;
    width: 100%;
    max-width: 520px;
}

.hub-icon-btn {
    width: 42px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.02);
    color: rgba(156,163,175,0.9);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.hub-icon-btn:hover {
    background: rgba(0,212,255,0.06);
    border-color: rgba(0,212,255,0.18);
    color: var(--tactical-cyan);
}

@media (max-width: 768px) {
    .modal-hub#settings-modal {
        width: calc(100vw - 18px);
        height: calc(100vh - 18px);
    }

    .hub-shell {
        grid-template-columns: 1fr;
    }

    .hub-nav {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }

    .hub-row {
        grid-template-columns: 1fr;
    }

    .hub-row-right {
        justify-content: flex-start;
    }
}


.modal-system {
    border-color: rgba(255, 26, 26, 0.4);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0)),
        rgba(8, 10, 14, 0.97);
    box-shadow: 0 0 44px rgba(255, 26, 26, 0.14), inset 0 0 0 1px rgba(255,255,255,0.02);
    overflow: hidden;
}

.modal.is-open {
    display: block;
}

.modal.hidden {
    display: none;
}

body.modal-open {
    overflow: hidden;
}

body.modal-open .scan-line {
    opacity: 0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 18px 16px;
    border-bottom: 1px solid var(--border-tactical);
    background: linear-gradient(90deg, rgba(255,26,26,0.06), transparent 70%);
}

.modal-header h2 {
    font-family: var(--font-tactical);
    font-size: 18px;
    color: var(--blood-red);
    margin: 0;
    letter-spacing: 2px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--ghost-white);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--blood-red);
}

.modal-body {
    padding: 18px;
}

.modal-intro {
    color: rgba(214, 224, 255, 0.7);
    font-size: 11px;
    line-height: 1.6;
    margin-bottom: 14px;
}

.modal-stack {
    display: grid;
    gap: 14px;
}

.modal-grid {
    align-items: start;
}

.modal-grid-settings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modal-grid-alerts,
.modal-grid-beacons {
    grid-template-columns: 280px minmax(0, 1fr);
}

.modal-grid-profile {
    grid-template-columns: 320px minmax(0, 1fr);
}

#profile-modal {
    width: min(560px, calc(100vw - 28px));
    max-height: min(84vh, 680px);
}

.modal-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    margin-bottom: 14px;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(255,26,26,0.08), rgba(0,212,255,0.04)),
        rgba(10, 13, 19, 0.9);
}

.modal-hero-copy {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-hero-label {
    color: var(--stealth-gray);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.modal-hero-title {
    color: var(--ghost-white);
    font-family: var(--font-tactical);
    font-size: 24px;
    letter-spacing: 1px;
}

.modal-hero-badge {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,26,26,0.22);
    background: rgba(255,26,26,0.08);
    color: var(--blood-red);
    font-size: 11px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    white-space: nowrap;
}

.modal-hero-badge-alert {
    border-color: rgba(255,184,0,0.24);
    background: rgba(255,184,0,0.08);
    color: var(--warning-yellow);
}

.modal-hero-badge-signal {
    border-color: rgba(0,255,65,0.24);
    background: rgba(0,255,65,0.08);
    color: var(--signal-green);
}

.modal-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.modal-actions-row-end {
    justify-content: flex-end;
    margin-top: 16px;
}

.modal-actions-row-profile {
    margin-top: 8px;
    justify-content: flex-start;
}

.modal-actions-row .modal-btn {
    margin-top: 0;
    flex: 1 1 180px;
}

.setting-item {
    margin-bottom: 16px;
}

.setting-item label {
    display: block;
    color: var(--tactical-cyan);
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 0.8px;
}

.setting-item input[type="text"],
.setting-item input[type="number"],
.setting-item select {
    width: 100%;
    padding: 10px 12px;
    background: rgba(4, 8, 14, 0.94);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--ghost-white);
    font-family: var(--font-mono);
    border-radius: 6px;
}

.setting-item input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.setting-toggle {
    margin-bottom: 0;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    background: rgba(255,255,255,0.015);
}

.setting-toggle label {
    margin-bottom: 0;
    color: var(--ghost-white);
}

.setting-toggle input[type="checkbox"] {
    transform: translateY(1px);
}

.profile-section {
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255, 26, 26, 0.05);
    border-left: 3px solid var(--blood-red);
}

.modal-card {
    margin-bottom: 0;
    padding: 16px;
    border-left-width: 2px;
    border-left-color: rgba(255, 26, 26, 0.8);
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.015), rgba(255,255,255,0)),
        rgba(13, 16, 22, 0.82);
    border-top: 1px solid rgba(255,255,255,0.04);
    border-right: 1px solid rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

.profile-hero {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.profile-identity {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-name {
    font-size: 18px;
    color: var(--blood-red);
    font-weight: 700;
}

.profile-id,
.profile-status {
    font-size: 12px;
    color: var(--stealth-gray);
    margin-top: 4px;
}

.profile-role {
    font-size: 12px;
    color: var(--tactical-cyan);
    margin-top: 4px;
}

.profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.profile-badge {
    padding: 6px 10px;
    border: 1px solid rgba(0, 212, 255, 0.25);
    background: rgba(0, 212, 255, 0.08);
    border-radius: 999px;
    color: var(--tactical-cyan);
    font-size: 10px;
    letter-spacing: 1px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.profile-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-section-title {
    color: var(--blood-red);
    font-family: var(--font-tactical);
    font-size: 12px;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.profile-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.setting-item-full {
    width: 100%;
}

.profile-notes-input {
    min-height: 100px;
}

.stat {
    padding: 10px 8px;
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid var(--tactical-cyan);
    text-align: center;
    border-radius: 8px;
}

.stat-label {
    font-size: 11px;
    color: var(--stealth-gray);
    text-transform: uppercase;
}

.stat-value {
    font-size: 16px;
    color: var(--tactical-cyan);
    font-weight: 700;
    margin-top: 4px;
}

.modal-btn {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 12px;
    background: var(--blood-red);
    border: none;
    color: white;
    cursor: pointer;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
    letter-spacing: 1px;
}

.modal-btn:hover {
    background: #ff4444;
    box-shadow: 0 0 15px rgba(255, 26, 26, 0.5);
}

.modal-btn-secondary {
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--ghost-white);
}

.modal-btn-secondary:hover {
    background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.04));
    box-shadow: 0 0 18px rgba(0, 212, 255, 0.12);
}

.modal-btn-amber {
    background: var(--alert-amber);
    color: var(--void-black);
}

.modal-btn-amber:hover {
    background: #ff8f26;
    box-shadow: 0 0 15px rgba(255, 107, 0, 0.45);
}

/* Profile actions already tag Cancel as `.modal-btn-secondary` and Save as `.modal-btn`.
   The old `:first-of-type` override made Cancel look like the primary action. */

#alerts-modal .modal-btn,
#beacons-modal .modal-btn {
    background: var(--alert-amber);
    color: var(--void-black);
}

#alerts-modal .modal-btn:hover,
#beacons-modal .modal-btn:hover {
    background: #ff8f26;
    box-shadow: 0 0 15px rgba(255, 107, 0, 0.45);
}

.alerts-modal-list,
.beacons-modal-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 320px;
    overflow-y: auto;
}

.alerts-modal-list .alert-item,
.beacons-modal-list .beacon-item {
    border-radius: 8px;
}

.beacon-item {
    padding: 14px;
    border: 1px solid rgba(0, 212, 255, 0.16);
    border-left: 3px solid var(--tactical-cyan);
    background:
        linear-gradient(180deg, rgba(0, 212, 255, 0.08), rgba(0, 212, 255, 0.03)),
        rgba(5, 11, 16, 0.86);
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

.beacon-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.beacon-id {
    color: var(--tactical-cyan);
    font-weight: 700;
}

.beacon-state {
    color: var(--signal-green);
    font-size: 10px;
    letter-spacing: 1px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(0,255,65,0.25);
    background: rgba(0,255,65,0.08);
}

.beacon-meta {
    color: var(--stealth-gray);
    font-size: 11px;
    margin-top: 2px;
}

.profile-dossier-card {
    background:
        linear-gradient(180deg, rgba(0, 212, 255, 0.06), rgba(255, 26, 26, 0.03)),
        rgba(8, 10, 14, 0.8);
}

.modal-card-profile-edit {
    grid-column: 1 / -1;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.018), rgba(255,255,255,0)),
        rgba(12, 15, 22, 0.9);
    overflow: hidden;
}

.modal-card-profile-edit .profile-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: rgba(255, 26, 26, 0.95);
    margin-bottom: 14px;
}

.modal-card-profile-edit .profile-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 14px 18px;
}

.modal-card-profile-edit .setting-item label {
    color: rgba(156, 163, 175, 0.9);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.modal-card-profile-edit .setting-item input[type="text"],
.modal-card-profile-edit .setting-item input[type="number"],
.modal-card-profile-edit .setting-item select,
.modal-card-profile-edit .setting-item textarea {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0)),
        rgba(4, 8, 14, 0.96);
    border-color: rgba(255,255,255,0.08);
    border-radius: 10px;
    min-height: 52px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.modal-card-profile-edit .setting-item input[type="text"]:hover,
.modal-card-profile-edit .setting-item input[type="number"]:hover,
.modal-card-profile-edit .setting-item select:hover,
.modal-card-profile-edit .setting-item textarea:hover {
    border-color: rgba(0, 212, 255, 0.18);
}

.modal-card-profile-edit .setting-item input[type="text"]:focus,
.modal-card-profile-edit .setting-item input[type="number"]:focus,
.modal-card-profile-edit .setting-item select:focus,
.modal-card-profile-edit .setting-item textarea:focus {
    outline: none;
    border-color: rgba(0, 212, 255, 0.32);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.10);
}

.modal-card-profile-edit .setting-item textarea {
    min-height: 156px;
    resize: vertical;
}

.modal-card-profile-edit .setting-item {
    margin-bottom: 0;
}

.modal-card-profile-edit .setting-item-full {
    margin-top: 6px;
    padding-top: 2px;
}

@media (max-width: 768px) {
    .modal-card-profile-edit .profile-form-grid {
        grid-template-columns: 1fr;
    }

    #profile-modal .modal-actions-row-profile {
        justify-content: stretch;
    }

    #profile-modal .modal-actions-row-profile .modal-btn {
        width: 100%;
        justify-content: center;
    }
}

#profile-modal .modal-actions-row-profile {
    justify-content: flex-end;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

#profile-modal .modal-actions-row-profile .modal-btn {
    width: auto;
    flex: 0 0 auto;
    margin-top: 0;
    padding: 12px 18px;
    border-radius: 12px;
    letter-spacing: 1.4px;
}

#profile-modal .modal-actions-row-profile .modal-btn.modal-btn-amber {
    border: 1px solid rgba(255, 140, 0, 0.28);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12);
}

.modal-card-profile-readiness,
.modal-card-profile-dossier {
    height: 100%;
}

.modal-hero-profile {
    margin-bottom: 18px;
    align-items: center;
}

.modal-hero-profile .profile-name {
    font-size: 42px;
    letter-spacing: 0.5px;
}

.modal-hero-profile .profile-role {
    font-size: 13px;
}

.profile-hero-main {
    display: flex;
    align-items: center;
    gap: 18px;
}

.profile-hero-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 14px;
}

.profile-crest {
    position: relative;
    width: 96px;
    height: 96px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.profile-crest-ring,
.profile-crest-core {
    position: absolute;
    border-radius: 50%;
}

.profile-crest-ring {
    inset: 0;
    border: 1px solid rgba(0, 212, 255, 0.24);
    box-shadow: inset 0 0 28px rgba(0, 212, 255, 0.08), 0 0 20px rgba(0, 212, 255, 0.12);
}

.profile-crest-core {
    inset: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 30% 30%, rgba(0,212,255,0.22), transparent 48%),
        linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0)),
        rgba(6, 13, 20, 0.94);
    border: 1px solid rgba(0, 212, 255, 0.18);
    color: var(--tactical-cyan);
    font-family: var(--font-tactical);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    text-align: center;
    padding: 0 10px;
}

.profile-hero-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    min-width: 260px;
}

.profile-hero-meta-item {
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 10px;
    background: rgba(255,255,255,0.025);
    text-align: left;
}

.profile-hero-meta-label {
    display: block;
    color: var(--stealth-gray);
    font-size: 10px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.profile-hero-meta-value {
    color: var(--ghost-white);
    font-weight: 700;
    letter-spacing: 0.8px;
}

.profile-dossier-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.profile-dossier-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    background: rgba(255,255,255,0.02);
}

.profile-dossier-label {
    color: var(--stealth-gray);
    font-size: 10px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.profile-dossier-value {
    color: var(--ghost-white);
    font-weight: 600;
    letter-spacing: 0.6px;
}

.profile-dossier-notes {
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, 0.16);
    background: rgba(0, 212, 255, 0.05);
    color: var(--ghost-white);
    line-height: 1.7;
}

.modal-card-copy {
    color: var(--stealth-gray);
    line-height: 1.7;
    margin-bottom: 16px;
}

body.matrix .modal-hero {
    background:
        linear-gradient(135deg, rgba(29, 78, 216, 0.12), rgba(220, 38, 38, 0.035)),
        rgba(255, 255, 255, 0.92);
    border-color: rgba(15, 23, 42, 0.10);
}

body.matrix .modal-hero-badge {
    border-color: rgba(29, 78, 216, 0.22);
    background: rgba(29, 78, 216, 0.08);
    color: rgba(29, 78, 216, 0.95);
}

body.matrix .modal-btn {
    background: linear-gradient(180deg, rgba(29, 78, 216, 0.22), rgba(29, 78, 216, 0.10));
    color: rgba(15, 23, 42, 0.96);
    font-family: var(--font-ui);
}

body.matrix .modal-btn:hover {
    background: linear-gradient(180deg, rgba(29, 78, 216, 0.30), rgba(29, 78, 216, 0.14));
    box-shadow: 0 0 18px rgba(29, 78, 216, 0.20);
}

body.matrix .modal-btn-secondary {
    background: linear-gradient(180deg, rgba(15,23,42,0.06), rgba(15,23,42,0.02));
    border-color: rgba(15,23,42,0.12);
    color: rgba(15, 23, 42, 0.92);
    font-family: var(--font-ui);
}

body.matrix .modal-btn-secondary:hover {
    box-shadow: 0 0 18px rgba(15,23,42,0.10);
}

body.matrix .notifications-dropdown {
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.05), 0 18px 46px rgba(15, 23, 42, 0.14);
}

body.matrix .dropdown-header {
    background: rgba(37, 99, 235, 0.08);
    color: rgba(15, 23, 42, 0.86);
    border-bottom-color: rgba(15, 23, 42, 0.10);
}

body.matrix .alert-item {
    color: rgba(15, 23, 42, 0.84);
}

body.matrix .alert-item.critical {
    background: rgba(220, 38, 38, 0.06);
    border-left-color: rgba(220, 38, 38, 0.55);
}

body.matrix .alert-item.warning {
    background: rgba(217, 119, 6, 0.07);
    border-left-color: rgba(217, 119, 6, 0.50);
}

body.matrix .alert-item.info {
    background: rgba(37, 99, 235, 0.06);
    border-left-color: rgba(37, 99, 235, 0.50);
}

body.matrix .alert-item-empty,
body.matrix .beacon-item-empty {
    background: rgba(15, 23, 42, 0.03);
}

/* ====== DROPDOWN STYLES ====== */

.notifications-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--panel-black);
    border: 1px solid var(--blood-red);
    border-radius: var(--radius-md);
    min-width: 300px;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 8px;
    box-shadow: var(--elev-1);
    z-index: 1000;
    animation: slideDown 0.3s;
}

.notifications-dropdown.hidden {
    display: none;
}

.dropdown-header {
    padding: 12px;
    background: rgba(255, 26, 26, 0.1);
    border-bottom: 1px solid var(--border-tactical);
    color: var(--blood-red);
    font-weight: 600;
    font-size: 12px;
}

.alerts-container {
    max-height: 250px;
    overflow-y: auto;
}

.alert-item {
    padding: 12px;
    border-bottom: 1px solid var(--border-tactical);
    color: var(--ghost-white);
    font-size: 12px;
    animation: fadeInAlert 0.3s;
}

.alert-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.alert-item-time {
    color: var(--stealth-gray);
    font-size: 10px;
    white-space: nowrap;
}

.alert-item:last-child {
    border-bottom: none;
}

.alert-item.critical {
    background: rgba(255, 26, 26, 0.1);
    border-left: 3px solid var(--blood-red);
}

.alert-item.warning {
    background: rgba(255, 107, 0, 0.1);
    border-left: 3px solid var(--alert-amber);
}

.alert-item.info {
    background: rgba(0, 212, 255, 0.08);
    border-left: 3px solid var(--tactical-cyan);
}

.alert-item-empty,
.beacon-item-empty {
    color: var(--stealth-gray);
    border-left-color: var(--border-tactical);
    background: rgba(255, 255, 255, 0.02);
}

/* ====== TOAST NOTIFICATION STYLES ====== */

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
}

.toast {
    background: var(--panel-black);
    border: 2px solid var(--tactical-cyan);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 10px;
    color: var(--ghost-white);
    font-size: 14px;
    min-width: 250px;
    box-shadow: var(--elev-1);
    animation: slideInPanel 0.3s;
}

.toast.error {
    border-color: var(--blood-red);
    box-shadow: 0 0 20px rgba(255, 26, 26, 0.3);
}

.toast.success {
    border-color: var(--signal-green);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
}

/* ====== PROGRESS BAR & BADGES ====== */

.progress-bar {
    height: 8px;
    background: var(--border-tactical);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--tactical-cyan), var(--signal-green));
    animation: slideInPanel 0.5s;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    background: var(--blood-red);
    color: white;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

.badge.amber {
    background: var(--alert-amber);
}

.badge.green {
    background: var(--signal-green);
}

/* ====== CARD HOVER EFFECTS ====== */

.card-hover {
    transition: all 0.3s ease;
    border: 1px solid var(--border-tactical);
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 212, 255, 0.2);
    border-color: var(--tactical-cyan);
}

/* ====== SKELETON LOADING ====== */

.skeleton {
    background: linear-gradient(90deg, var(--border-tactical) 0%, var(--grid-gray) 50%, var(--border-tactical) 100%);
    background-size: 1000px 100%;
    animation: skeletonShimmer 2s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* ====== TOOLTIP STYLES ====== */

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    background-color: var(--blood-red);
    color: white;
    text-align: center;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* ====== RESPONSIVE DESIGN ====== */

@media (max-width: 1400px) {
    .intel-panel {
        width: 260px;
    }
    
    .sidebar {
        width: 280px;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        position: absolute;
        left: 0;
        top: var(--header-height);
        height: calc(100vh - var(--header-height));
        width: 100%;
        transform: translateX(-100%);
        transition: transform 0.3s;
        z-index: 999;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .intel-panel {
        display: none;
    }
    
    .app-container {
        grid-template-columns: 1fr;
    }
    
    .header {
        flex-wrap: wrap;
    }
    
    .hamburger-menu {
        display: block;
    }
}

/* Hamburger Menu for Mobile */
.hamburger-menu {
    display: none;
    background: none;
    border: none;
    color: var(--ghost-white);
    font-size: 24px;
    cursor: pointer;
    margin-left: 16px;
}

/* Touch-friendly button sizes */
@media (max-width: 768px) {
    button {
        min-height: 44px;
        min-width: 44px;
    }
    
    .command-field {
        font-size: 16px;
    }
    
    .modal {
        min-width: 90%;
        max-width: 90%;
    }

    .profile-hero,
    .profile-form-grid {
        grid-template-columns: 1fr;
        display: grid;
    }

    .profile-badges {
        justify-content: flex-start;
    }
}

/* ====== ACCESSIBILITY ====== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: more) {
    body {
        opacity: 1;
    }
    
    .border-tactical {
        border-width: 2px;
    }
    
    * {
        text-decoration-thickness: 2px;
    }
}

/* Focus Ring Indicators */
button:focus,
input:focus,
select:focus,
textarea:focus,
a:focus {
    outline: 2px solid var(--tactical-cyan);
    outline-offset: 2px;
}

/* Screen Reader Helper */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ====== ENHANCED HEADER STYLES ====== */

.mission-clock {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    border-right: 1px solid var(--border-tactical);
}

.mission-clock span {
    color: var(--tactical-cyan);
    font-weight: 600;
    font-family: var(--font-mono);
}

.clock-control {
    width: 30px;
    height: 30px;
    background: rgba(0,212,255,0.06);
    border: 1px solid rgba(0,212,255,0.16);
    border-radius: 8px;
    color: var(--signal-green);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.clock-control:hover {
    color: var(--blood-red);
    border-color: rgba(255,26,26,0.4);
    background: rgba(255,26,26,0.08);
    transform: translateY(-1px);
}

.notification-wrapper,
.beacons-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    min-width: 36px;
    flex: 0 0 auto;
}

#profile-btn {
    width: auto;
    min-width: 72px;
    padding: 0 14px;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-card-profile-edit::before,
.modal-card-profile-edit::after {
    display: none;
}

.modal-card-profile-edit .profile-notes-input {
    width: 100%;
}

.modal-actions-row-profile {
    margin-top: 14px;
    justify-content: flex-start;
    gap: 12px;
}

.modal-actions-row-profile .modal-btn {
    flex: 1 1 220px;
}

body.interface-paused .header-actions .tactical-btn,
body.interface-paused .header-actions .notification-wrapper,
body.interface-paused .header-actions .beacons-wrapper {
    opacity: 0.45;
    filter: grayscale(0.2);
}

body.interface-paused .header-actions .tactical-btn:hover {
    transform: none;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

/* ====== SIDEBAR ENHANCEMENTS ====== */

.sidebar-search-box {
    padding: 8px;
    margin-bottom: 12px;
}

.op-search-input {
    width: 100%;
    padding: 8px;
    background: var(--tactical-black);
    border: 1px solid var(--border-tactical);
    color: var(--ghost-white);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 12px;
}

/* OPS TOOLBAR (import / export / clear) */
.sidebar-ops-tools {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    margin: 8px 0 12px;
}

.ops-tool-btn {
    min-height: 38px;
    padding: 8px 8px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)),
        rgba(7, 10, 14, 0.74);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(216, 247, 255, 0.88);
    border-radius: 12px;
    cursor: pointer;
    font-size: 10px;
    font-family: var(--font-mono);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, color 0.18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    min-width: 0;
}

.ops-tool-btn i {
    font-size: 14px;
    color: rgba(0, 212, 255, 0.92);
}

.ops-tool-btn:hover {
    background:
        linear-gradient(180deg, rgba(0, 212, 255, 0.10), rgba(0, 212, 255, 0.04)),
        rgba(7, 10, 14, 0.70);
    border-color: rgba(0, 212, 255, 0.22);
    color: rgba(229, 247, 255, 0.98);
    box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.10), 0 12px 26px rgba(0, 0, 0, 0.35);
    transform: translateY(-1px);
}

.ops-tool-btn-danger {
    border-color: rgba(255, 26, 26, 0.22);
    color: rgba(255, 214, 214, 0.88);
}

.ops-tool-btn-danger i {
    color: rgba(255, 26, 26, 0.92);
}

.ops-tool-btn-danger:hover {
    background:
        linear-gradient(180deg, rgba(255, 26, 26, 0.10), rgba(255, 26, 26, 0.04)),
        rgba(7, 10, 14, 0.70);
    border-color: rgba(255, 26, 26, 0.38);
    box-shadow: 0 0 0 1px rgba(255, 26, 26, 0.10), 0 12px 26px rgba(0, 0, 0, 0.35);
    color: rgba(255, 234, 234, 0.98);
}

.collapsible-section .collapsible-header {
    cursor: pointer;
}

.collapsible-section.collapsed > div:not(.collapsible-header) {
    display: none;
}

.team-collaboration-panel,
.resource-monitor {
    border-top: 1px solid var(--border-tactical);
    padding: 12px;
    margin: 8px 0;
    font-size: 12px;
}

.team-header,
.resource-header {
    color: var(--tactical-cyan);
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.operator-item {
    padding: 6px;
    color: var(--ghost-white);
    border-left: 2px solid var(--border-tactical);
    margin: 4px 0;
    padding-left: 8px;
}

.operator-item.active {
    border-left-color: var(--signal-green);
    color: var(--signal-green);
}

.resource-item {
    margin-bottom: 8px;
}

.resource-item label {
    display: block;
    color: var(--stealth-gray);
    font-size: 11px;
    margin-bottom: 4px;
}

.resource-bar {
    height: 6px;
    background: var(--grid-gray);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.resource-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--signal-green), var(--tactical-cyan));
    border-radius: 3px;
    transition: width 0.9s ease;
}

.resource-value {
    font-size: 10px;
    color: var(--tactical-cyan);
    float: right;
}

/* ====== MAIN CONTENT ENHANCEMENTS ====== */

.quick-commands-bar {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border-tactical);
    flex-wrap: wrap;
    overflow-x: auto;
}

.quick-cmd {
    padding: 8px 12px;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--tactical-cyan);
    color: var(--tactical-cyan);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 11px;
    white-space: nowrap;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, transform 0.18s ease;
    flex-shrink: 0;
}

.quick-cmd:hover {
    background: var(--tactical-cyan);
    color: var(--void-black);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

.operation-tabs {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.015), rgba(255,255,255,0)),
        rgba(7, 10, 14, 0.92);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
}

.op-tab {
    padding: 10px 16px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--stealth-gray);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 11px;
    border-radius: 8px;
    transition: all 0.3s;
    letter-spacing: 1px;
}

.op-tab.active {
    background: linear-gradient(180deg, rgba(0, 212, 255, 0.16), rgba(0, 212, 255, 0.06));
    color: var(--tactical-cyan);
    border-color: var(--tactical-cyan);
    box-shadow: inset 0 0 0 1px rgba(0,212,255,0.08), 0 0 20px rgba(0,212,255,0.08);
}

.op-tab:hover {
    background: rgba(0, 212, 255, 0.08);
}

.tab-content {
    display: block;
}

.tab-content.hidden {
    display: none;
}

.operation-timeline {
    padding: 16px;
    font-size: 12px;
}

.timeline-item {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    padding-left: 12px;
    border-left: 2px solid var(--border-tactical);
}

.timeline-item.active {
    border-left-color: var(--tactical-cyan);
}

.timeline-time {
    color: var(--tactical-cyan);
    min-width: 60px;
}

.timeline-content {
    color: var(--ghost-white);
}

.upload-zone {
    border: 2px dashed var(--border-tactical);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(0, 212, 255, 0.05);
}

.upload-zone:hover {
    border-color: var(--tactical-cyan);
    background: rgba(0, 212, 255, 0.1);
}

.upload-zone.dragover {
    background: rgba(0, 212, 255, 0.2);
    border-color: var(--tactical-cyan);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.upload-zone--readonly {
    cursor: default;
}

.upload-zone--readonly:hover {
    border-color: var(--border-tactical);
    background: rgba(0, 212, 255, 0.05);
}

.upload-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.upload-text {
    color: var(--stealth-gray);
    font-size: 12px;
}

.upload-meta {
    margin-top: 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--stealth-gray);
}

.hidden-file-input {
    display: none;
}

.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    padding: 16px;
}

.screenshot-item {
    background: var(--grid-gray);
    border: 1px solid var(--border-tactical);
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.screenshot-item:hover {
    border-color: var(--tactical-cyan);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
    transform: scale(1.05);
}

.command-history {
    padding: 16px;
    font-size: 12px;
}

.history-item {
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-left: 2px solid var(--border-tactical);
    margin-bottom: 8px;
    color: var(--ghost-white);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s;
}

.history-item:hover {
    border-left-color: var(--tactical-cyan);
    background: rgba(0, 212, 255, 0.05);
}

.history-cmd {
    color: var(--tactical-cyan);
    font-weight: 600;
}

.history-result {
    color: var(--stealth-gray);
    font-size: 11px;
    margin-top: 4px;
}

.console-starter {
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(255,26,26,0.04), rgba(0,212,255,0.03)),
        rgba(7, 10, 14, 0.9);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.015);
}

.console-starter-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.console-starter-label {
    color: var(--stealth-gray);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.console-starter-title {
    color: var(--ghost-white);
    font-family: var(--font-tactical);
    font-size: 18px;
    letter-spacing: 1.2px;
}

.console-starter-badge {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,26,26,0.28);
    background: rgba(255,26,26,0.08);
    color: var(--blood-red);
    font-size: 10px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    white-space: nowrap;
}

.console-starter-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.console-starter-meta-item {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    color: var(--stealth-gray);
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.console-starter-copy {
    color: var(--stealth-gray);
    font-size: 12px;
    line-height: 1.6;
    margin-bottom: 12px;
}

/* ====== RIGHT PANEL ENHANCEMENTS ====== */

.logs-stream {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-tactical);
    border-radius: var(--radius-md);
    padding: 8px;
    font-size: 11px;
    color: var(--tactical-cyan);
}

.log-entry {
    padding: 4px;
    margin: 2px 0;
    font-family: var(--font-mono);
    border-bottom: 1px solid rgba(0, 212, 255, 0.1);
}

.log-entry:last-child {
    border-bottom: none;
}

.notes-area {
    width: 100%;
    min-height: 100px;
    background: var(--tactical-black);
    border: 1px solid var(--border-tactical);
    color: var(--ghost-white);
    border-radius: var(--radius-md);
    padding: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    resize: vertical;
}

.bookmarks-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bookmark-item {
    padding: 8px;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--border-tactical);
    border-radius: var(--radius-md);
    color: var(--tactical-cyan);
    cursor: pointer;
    font-size: 12px;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.bookmark-item:hover {
    background: var(--tactical-cyan);
    color: var(--void-black);
}

.vuln-search-input {
    width: 100%;
    padding: 8px;
    background: var(--tactical-black);
    border: 1px solid var(--border-tactical);
    color: var(--ghost-white);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 12px;
    margin-bottom: 8px;
}

.vuln-results {
    max-height: 200px;
    overflow-y: auto;
    font-size: 11px;
}

.vuln-result-item {
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-left: 2px solid var(--blood-red);
    margin-bottom: 4px;
    color: var(--ghost-white);
    border-radius: 2px;
    cursor: pointer;
}

.vuln-result-item:hover {
    background: rgba(0, 212, 255, 0.1);
    border-left-color: var(--tactical-cyan);
}

.vuln-result-help {
    border-left-color: var(--alert-amber);
    color: var(--stealth-gray);
}

.vuln-result-loading {
    border-left-color: var(--tactical-cyan);
    color: var(--tactical-cyan);
}

.vuln-result-live {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
}

.vuln-result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.vuln-cve-id {
    color: var(--blood-red);
    font-weight: 700;
}

.vuln-score {
    color: var(--tactical-cyan);
    font-size: 10px;
    letter-spacing: 1px;
}

.vuln-result-meta {
    color: var(--stealth-gray);
    font-size: 10px;
}

.vuln-result-summary {
    color: var(--ghost-white);
    line-height: 1.5;
}

.vuln-result-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 8px 10px;
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.28);
    border-radius: var(--radius-sm);
    color: var(--tactical-cyan);
    text-decoration: none;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.vuln-result-link:hover {
    background: rgba(0, 212, 255, 0.14);
    border-color: var(--tactical-cyan);
}

@keyframes liveUpdatePulse {
    0% {
        box-shadow: 0 0 0 rgba(0, 212, 255, 0);
        transform: translateY(0);
    }
    35% {
        box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.16), 0 0 22px rgba(0, 212, 255, 0.12);
    }
    100% {
        box-shadow: 0 0 0 rgba(0, 212, 255, 0);
        transform: translateY(0);
    }
}

@keyframes liveUpdateRise {
    0% {
        opacity: 0.82;
        transform: translateY(4px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes panelFadeInSoft {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.live-update-pulse {
    animation: liveUpdatePulse 0.52s ease;
}

.live-update-rise {
    animation: liveUpdateRise 0.34s ease;
}

.tab-content:not(.hidden),
.intel-section,
.sidebar-panel {
    animation: panelFadeInSoft 0.24s ease;
}

.app-container {
    grid-template-columns: minmax(272px, var(--sidebar-width)) 1fr minmax(250px, var(--operation-panel));
}

.sidebar,
.main-content,
.intel-panel {
    min-width: 0;
}

.op-list {
    gap: 10px;
}

.op-item {
    padding: 13px 14px;
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.015), rgba(255,255,255,0)),
        rgba(10, 12, 18, 0.94);
    border-color: rgba(255,255,255,0.06);
    min-height: 86px;
    position: relative;
}

.op-item[data-status='pending'] {
    border-left-color: rgba(255, 140, 0, 0.52);
}

.op-item[data-status='compromised'] {
    border-left-color: rgba(255, 26, 26, 0.7);
}

.op-item.active {
    box-shadow: inset 0 0 0 1px rgba(255, 26, 26, 0.08), 0 10px 24px rgba(0, 0, 0, 0.25);
}

.op-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.op-topline-end {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.op-menu-btn {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: rgba(156, 163, 175, 0.9);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.op-menu-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(0,212,255,0.26);
    background: rgba(0,212,255,0.08);
    color: var(--tactical-cyan);
}

.op-item-menu.hidden {
    display: none;
}

.op-item-menu {
    position: absolute;
    top: 42px;
    right: 12px;
    width: 170px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(10, 12, 18, 0.96);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.60);
    padding: 6px;
    display: grid;
    gap: 4px;
    z-index: 5;
}

.op-item-menu-item {
    width: 100%;
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 10px;
    align-items: center;
    padding: 9px 10px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(229, 231, 235, 0.92);
    cursor: pointer;
    text-align: left;
    font-size: 12px;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.op-item-menu-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255,255,255,0.08);
    transform: translateY(-1px);
}

.op-item-menu-item i {
    color: rgba(156, 163, 175, 0.92);
}

.op-item-menu-item-danger:hover {
    background: rgba(255, 26, 26, 0.10);
    border-color: rgba(255, 26, 26, 0.25);
}

.op-item-menu-item-danger i {
    color: rgba(255, 155, 155, 0.92);
}

.op-name-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.op-name {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.op-badge {
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: var(--stealth-gray);
    font-size: 9px;
    letter-spacing: 1.2px;
    flex: 0 0 auto;
}

.op-preview {
    color: var(--tactical-cyan);
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.5;
    min-height: 34px;
    margin-bottom: 10px;
    opacity: 0.94;
}

.op-meta {
    justify-content: space-between;
    gap: 8px;
}

.op-time,
.op-engagement {
    font-size: 10px;
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.op-item.active .op-badge {
    border-color: rgba(255,26,26,0.4);
    background: rgba(255,26,26,0.12);
    color: #ffd1d1;
}

.op-item.active .op-preview {
    color: #5de6ff;
}

.op-empty {
    padding: 18px 16px;
    border: 1px dashed rgba(255,255,255,0.12);
    border-radius: 12px;
    background: rgba(255,255,255,0.02);
    color: var(--stealth-gray);
    font-size: 12px;
    line-height: 1.7;
    text-align: center;
}

.team-collaboration-panel,
.resource-monitor {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.015), rgba(255,255,255,0)),
        rgba(7, 9, 13, 0.82);
    border-top-color: rgba(255,255,255,0.05);
}

.operators-list {
    gap: 10px;
}

.operator-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-radius: 6px;
    background: rgba(255,255,255,0.01);
}

.operator-name-text {
    white-space: nowrap;
}

.operator-meta {
    color: rgba(163, 167, 178, 0.66);
    font-size: 10px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.operator-item[data-status='linked'] .operator-meta {
    color: rgba(0, 212, 255, 0.72);
}

.operator-item[data-status='standby'] .operator-meta {
    color: rgba(255, 140, 0, 0.72);
}

.resource-item {
    margin-bottom: 0;
}

.resource-row {
    margin-bottom: 7px;
}

.resource-item label,
.resource-value {
    letter-spacing: 0.9px;
}

.resource-bar {
    height: 7px;
    background: rgba(255,255,255,0.05);
}

.resource-fill {
    transition: width 0.7s ease, box-shadow 0.3s ease;
}

.intel-section {
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.intel-section:hover {
    border-color: rgba(255,255,255,0.08);
    transform: translateY(-1px);
}

.network-map {
    box-shadow:
        inset 0 0 38px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(0, 212, 255, 0.04),
        0 0 24px rgba(0, 212, 255, 0.05);
}

.network-map-shell {
    --topology-canvas-height: 268px;
}

.network-topology-canvas {
    border-color: rgba(0, 212, 255, 0.1);
    box-shadow:
        inset 0 0 28px rgba(0, 0, 0, 0.44),
        inset 0 0 90px rgba(0, 212, 255, 0.04),
        inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

@media (max-width: 1440px) {
    .app-container {
        grid-template-columns: minmax(270px, 300px) 1fr minmax(300px, 340px);
    }

    .chat-container,
    .command-container {
        padding-left: 36px;
        padding-right: 36px;
    }
}

@media (max-width: 1180px) {
    .network-map-shell {
        --topology-canvas-height: 232px;
    }

    .intel-content {
        padding: 14px 14px 20px;
    }

    .sidebar-header,
    .sidebar-panel,
    .intel-header,
    .intel-section {
        padding-left: 14px;
        padding-right: 14px;
    }

    .chat-container {
        padding: 30px 34px;
    }

    .command-container {
        padding: 18px 34px 20px;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: min(320px, 84vw);
    }

    .network-map-shell {
        --topology-canvas-height: 220px;
    }

}

@media (max-width: 768px) {
    .chat-container,
    .command-container {
        padding-left: 18px;
        padding-right: 18px;
    }

    .network-map-shell {
        --topology-canvas-height: 206px;
    }

    .op-meta,
    .operator-item,
    .resource-row {
        flex-wrap: wrap;
    }
}

.hidden {
    display: none !important;
}

@media (max-width: 1180px) {
    body {
        overflow: auto;
    }

    .app-container {
        height: auto;
        min-height: 100vh;
        grid-template-rows: auto 1fr;
    }

    .header {
        height: auto;
        min-height: var(--header-height);
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 12px 16px;
        align-items: center;
    }

    .logo-section,
    .tactical-info,
    .mission-clock,
    .header-actions {
        min-width: 0;
        flex-wrap: wrap;
    }

    .tactical-info {
        gap: 10px 16px;
    }

    .mission-clock {
        padding: 0 12px;
    }

    .header-actions {
        margin-left: 0;
    }

    .main-content {
        min-height: 0;
    }
}

@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        height: auto;
    }

    .sidebar,
    .main-content,
    .intel-panel {
        grid-column: 1;
        width: 100%;
        min-width: 0;
        min-height: 0;
        position: relative;
        top: auto;
        left: auto;
        height: auto;
        transform: none !important;
    }

    .sidebar {
        grid-row: 2;
        display: flex;
        z-index: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-tactical);
    }

    .main-content {
        grid-row: 3;
        overflow: visible;
        min-height: 60vh;
    }

    .intel-panel {
        grid-row: 4;
        display: flex;
        border-left: none;
        border-top: 1px solid var(--border-tactical);
    }

    .sidebar-content,
    .intel-content,
    .chat-container {
        overflow: visible;
    }

    .sidebar-content {
        display: block;
        padding-top: 12px;
    }

    .op-list {
        height: auto;
        max-height: 320px;
    }

    .tactical-corners {
        display: none;
    }

    .chat-container {
        padding: 28px 24px;
    }

    .command-container {
        padding: 18px 24px 24px;
    }

    .mission-briefing {
        min-height: auto;
        padding: 44px 20px 28px;
    }

    .briefing-classification {
        top: 14px;
        right: 14px;
        font-size: 11px;
    }

    .briefing-header {
        margin-bottom: 32px;
    }

    .briefing-title {
        font-size: clamp(34px, 7vw, 48px);
        letter-spacing: 4px;
    }

    .briefing-code {
        letter-spacing: 2px;
    }

    .briefing-subtitle {
        font-size: 14px;
        max-width: 100%;
    }

    .engagement-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 16px;
    }

    .operation-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 10px;
    }

    .op-tab {
        white-space: nowrap;
        flex: 0 0 auto;
    }

    .command-wrapper {
        flex-wrap: wrap;
        align-items: stretch;
        gap: 10px;
        padding: 10px;
    }

    .command-prefix {
        width: 100%;
        justify-content: space-between;
        height: auto;
        min-height: 44px;
        padding: 10px 12px;
    }

    .command-field {
        width: 100%;
        min-height: 56px;
        padding: 10px 12px;
    }

    .command-voice,
    .command-execute {
        flex: 0 0 48px;
        margin-right: 0;
    }

    .notifications-dropdown {
        right: 0;
        left: auto;
        width: min(320px, calc(100vw - 24px));
    }
}

@media (max-width: 640px) {
    .header {
        align-items: stretch;
    }

    .logo-section,
    .tactical-info,
    .mission-clock,
    .header-actions {
        width: 100%;
    }

    .logo-section {
        gap: 10px;
    }

    .logo-icon {
        width: 36px;
        height: 36px;
    }

    .logo-text {
        font-size: 18px;
        letter-spacing: 2px;
    }

    .logo-sub {
        margin-left: 0;
    }

    .tactical-info {
        justify-content: flex-start;
        font-size: 10px;
        gap: 8px;
    }

    .mission-clock {
        justify-content: flex-start;
        border-right: none;
        padding: 0;
    }

    .header-actions {
        justify-content: flex-start;
        padding-left: 0;
        padding-top: 0;
        border-left: none;
        border-top: none;
    }

    .sidebar-header,
    .sidebar-panel,
    .intel-header,
    .intel-section,
    .modal-header,
    .modal-body {
        padding-left: 12px;
        padding-right: 12px;
    }

    .chat-container,
    .command-container {
        padding-left: 14px;
        padding-right: 14px;
    }

    .briefing-title {
        font-size: clamp(28px, 9vw, 38px);
        letter-spacing: 3px;
    }

    .briefing-title::after {
        width: 120px;
    }

    .engagement-grid {
        grid-template-columns: 1fr;
    }

    .engagement-card {
        padding: 18px;
    }

    .op-meta,
    .target-header,
    .vuln-result-head,
    .meter-label,
    .loot-item {
        flex-wrap: wrap;
    }

    .modal {
        min-width: 0;
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }

    .modal-header h2 {
        font-size: 16px;
    }

    .network-map-shell {
        --topology-canvas-height: 180px;
    }

    .profile-dossier-grid {
        grid-template-columns: 1fr;
    }

    .modal-hero {
        flex-direction: column;
    }

    .modal-actions-row {
        flex-direction: column;
    }

    .profile-hero-main,
    .profile-hero-side {
        width: 100%;
    }

    .profile-hero-main {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-hero-side,
    .profile-badges {
        align-items: flex-start;
        justify-content: flex-start;
    }

    .profile-hero-meta {
        min-width: 0;
        width: 100%;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .modal-grid-settings,
    .modal-grid-alerts,
    .modal-grid-beacons,
    .modal-grid-profile {
        grid-template-columns: 1fr;
    }
}

/* ====== NOCTIS BRAND POLISH ====== */

@keyframes noctisHaloSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes noctisHeaderSweep {
    0% {
        transform: translateX(-18%);
        opacity: 0.18;
    }
    50% {
        opacity: 0.34;
    }
    100% {
        transform: translateX(18%);
        opacity: 0.18;
    }
}

.header {
    background:
        linear-gradient(90deg, rgba(2, 8, 18, 0.98), rgba(5, 14, 30, 0.96) 45%, rgba(3, 10, 22, 0.98)),
        var(--tactical-black);
    border-bottom: 1px solid rgba(0, 212, 255, 0.24);
    box-shadow:
        inset 0 -1px 0 rgba(255, 255, 255, 0.04),
        0 10px 30px rgba(0, 0, 0, 0.28);
}

.header::before {
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.85), rgba(255, 255, 255, 0.3), transparent);
    opacity: 0.75;
}

.header::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, transparent 0%, rgba(0, 212, 255, 0.08) 24%, transparent 52%),
        radial-gradient(circle at 14% 50%, rgba(0, 122, 255, 0.12), transparent 28%);
    pointer-events: none;
    animation: noctisHeaderSweep 8s ease-in-out infinite alternate;
}

.logo-section {
    position: relative;
    z-index: 1;
}

.logo-icon {
    width: 46px;
    height: 46px;
    padding: 3px;
    border-radius: 14px;
    background:
        linear-gradient(145deg, rgba(2, 8, 18, 0.98), rgba(8, 22, 40, 0.94)),
        radial-gradient(circle at 50% 12%, rgba(0, 212, 255, 0.2), transparent 64%);
    border: 1px solid rgba(0, 212, 255, 0.24);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 0 18px rgba(0, 110, 255, 0.22),
        0 0 34px rgba(0, 0, 0, 0.42);
}

.logo-icon::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    pointer-events: none;
    z-index: 2;
}

.logo-icon::after {
    content: '';
    position: absolute;
    inset: -15px;
    background:
        radial-gradient(circle at 50% 50%, rgba(0, 180, 255, 0.18), transparent 48%),
        conic-gradient(from 180deg, transparent, rgba(0, 212, 255, 0.18), transparent 72%);
    opacity: 0.72;
    animation: noctisHaloSpin 12s linear infinite;
    pointer-events: none;
}

.logo-image {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    filter: saturate(1.08) contrast(1.12) brightness(0.97);
}

.logo-text {
    color: #eef7ff;
    letter-spacing: 3.4px;
    text-shadow:
        0 0 10px rgba(0, 130, 255, 0.2),
        0 0 26px rgba(255, 255, 255, 0.08);
}

.logo-text::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    margin-top: 3px;
    background: linear-gradient(90deg, rgba(0, 212, 255, 0.95), rgba(255, 255, 255, 0.18));
    border-radius: 999px;
    box-shadow: 0 0 12px rgba(0, 140, 255, 0.2);
}

.logo-sub {
    color: var(--tactical-cyan);
    border: 1px solid rgba(0, 212, 255, 0.34);
    background: linear-gradient(135deg, rgba(0, 72, 124, 0.18), rgba(0, 24, 46, 0.28));
    box-shadow:
        inset 0 0 14px rgba(0, 120, 255, 0.08),
        0 0 10px rgba(0, 110, 255, 0.08);
}

body.reduced-motion .header::after,
body.reduced-motion .logo-icon::after,
body.interface-paused .header::after,
body.interface-paused .logo-icon::after {
    animation: none;
}

@media (max-width: 640px) {
    .logo-icon {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .logo-text {
        letter-spacing: 2.2px;
    }

    .logo-sub {
        padding: 2px 6px;
        font-size: 8px;
    }
}
