/* ========================================
   EVENT TRADER - Prediction Market UI
   ======================================== */

/* Mobile-web 2026-09-22: the body font is JetBrains Mono and its fallback, Courier New, has the
   same glyph width but a SHORTER line box (JetBrains Mono: ascender 1020 / descender 300 per
   1000 em). Every line of text therefore grew when the font arrived and the whole page moved
   (/events/universe: the chip cloud 224 -> 271 px, RUM CLS 0.17). This face gives the fallback
   the web font's vertical metrics, so the swap changes nothing below the swapped line. It only
   ever renders BEFORE the web font; the fonts themselves are untouched. Measured: 271 = 271 px
   at 1280/1920, 796 = 796 at 360, 334 = 334 at 768, fonts blocked vs loaded. */
@font-face {
    font-family: 'JetBrains Mono Fallback';
    src: local('Courier New'), local('Liberation Mono'), local('Cousine'), local('Menlo');
    ascent-override: 102%;
    descent-override: 30%;
    line-gap-override: 0%;
}

:root {
    /* Color System — Blue/Cyan Glass-Morphism Theme */
    --bg-primary: #0a0e17;
    --bg-secondary: #0d1520;
    --bg-tertiary: #111a28;

    /* STANDARDIZED PANEL STYLING - DO NOT CHANGE (prevents color drift across templates) */
    --panel-bg: rgba(17, 24, 39, 0.6);
    --panel-bg-hover: rgba(17, 24, 39, 0.8);
    --panel-border: rgba(0, 150, 255, 0.15);
    --panel-border-hover: rgba(0, 150, 255, 0.3);
    --panel-radius: 6px;
    --bg-panel: rgba(17, 24, 39, 0.6);

    /* Blue/Cyan Accent Colors */
    --accent-cyan: #00cfff;
    --accent-glow: rgba(0, 150, 255, 0.5);
    --accent-lime: #00cfff;
    --accent-pink: #ff4444;
    --accent-blue: #00cfff;
    --accent-gold: #00cfff;
    --accent-vibrant-blue: #00aaff;
    --accent-orange: #ff4444;
    --accent-secondary: #7B8794;

    /* The #3b82f6 blue, by MEANING (owner decision 2026-10-05, TASK 105 item 3):
       four tokens, not one, so a later change to the action blue cannot silently
       move the status blue. Same value in dark; they diverge in light below.
       action = buttons/links/active states · status = badges/chips/labels ·
       data = chart series/progress values · decoration = borders/fills/glows. */
    --blue-action: #3b82f6;
    --blue-status: #3b82f6;
    --blue-data: #3b82f6;
    --blue-decoration: #3b82f6;

    --text-primary: #FFFFFF;
    --text-secondary: #7B8794;
    --text-dim: #7B8794;
    --text-heading: #FFFFFF;
    --border-color: rgba(0, 150, 255, 0.3);
    --border-glow: rgba(0, 150, 255, 0.5);

    /* Input fields */
    --input-bg: rgba(0, 50, 100, 0.3);
    --input-border: rgba(0, 150, 255, 0.35);
    --input-focus-border: rgba(0, 180, 255, 0.6);
    --input-focus-glow: 0 0 15px rgba(0, 150, 255, 0.3);
    --input-focus-bg: rgba(0, 60, 120, 0.4);

    /* Solid card backgrounds */
    --card-bg-solid: #0a0e17;

    /* Financial colors */
    --positive-color: #00ff88;
    --negative-color: #ff4444;

    /* Auth pages */
    --auth-container-bg: linear-gradient(180deg, #0a0e17 0%, #0d1520 50%, #111a28 100%);
    --auth-card-bg: linear-gradient(135deg, rgba(0, 50, 100, 0.5) 0%, rgba(0, 80, 150, 0.4) 100%);
    --auth-card-border: rgba(0, 150, 255, 0.5);
    --auth-card-shadow: 0 0 40px rgba(0, 100, 255, 0.3), 0 0 80px rgba(0, 150, 255, 0.15), inset 0 0 30px rgba(0, 150, 255, 0.1);
    --auth-btn-bg: rgba(0, 100, 255, 0.35);
    --auth-btn-border: rgba(0, 150, 255, 0.5);
    --auth-btn-color: #00cfff;
    --auth-btn-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);

    /* Google button */
    --google-btn-bg: #131314;
    --google-btn-color: #e3e3e3;
    --google-btn-border: rgba(142, 145, 143, 0.4);

    /* Dividers */
    --divider-color: rgba(255, 255, 255, 0.1);

    /* Scrolled header */
    --scrolled-header-bg: rgba(10, 14, 23, 0.85);

    /* Typography */
    --font-mono: 'JetBrains Mono', 'JetBrains Mono Fallback', 'Courier New', monospace;
    --font-display: 'Archivo Black', sans-serif;
    --font-body: 'Inter', 'Outfit', sans-serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Glass-Morphism Effects */
    --glow-cyan: 0 0 12px rgba(0, 207, 255, 0.2);
    --glow-lime: 0 0 12px rgba(0, 255, 136, 0.2);
    --glow-gold: 0 0 12px rgba(0, 207, 255, 0.2);
    --glow-danger: 0 0 12px rgba(255, 68, 68, 0.2);
    --shadow-deep: 0 8px 32px rgba(0, 0, 0, 0.5);
    --glass-blur: blur(15px);
    --glass-border: 1px solid rgba(0, 150, 255, 0.5);
    --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.04);

    /* Glass-Morphism Components */
    --glass-bg: rgba(17, 24, 39, 0.6);
    --glass-shadow: 0 0 40px rgba(0, 100, 255, 0.3);
    --btn-glass-bg: rgba(0, 150, 255, 0.08);
    --btn-glass-border: 1px solid rgba(0, 150, 255, 0.15);
    --input-glass-bg: rgba(0, 50, 100, 0.3);

    /* Holographic Glass Buttons */
    --btn-holo-bg: linear-gradient(145deg, rgba(0, 50, 100, 0.4) 0%, rgba(0, 80, 150, 0.3) 50%, rgba(0, 50, 100, 0.4) 100%);
    --btn-holo-bg-hover: linear-gradient(145deg, rgba(0, 60, 120, 0.5) 0%, rgba(0, 100, 180, 0.4) 50%, rgba(0, 60, 120, 0.5) 100%);
    --btn-holo-border: 1px solid rgba(0, 150, 255, 0.2);
    --btn-holo-border-hover: 1px solid rgba(0, 150, 255, 0.4);
    --btn-holo-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(0, 150, 255, 0.05);
    --btn-holo-shadow-hover: 0 4px 24px rgba(0, 50, 150, 0.4), inset 0 1px 1px rgba(0, 150, 255, 0.08);

    /* Native-Feel Easing Curves */
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out-quart: cubic-bezier(0.76, 0, 0.24, 1);
    --ease-native: cubic-bezier(0.25, 0.46, 0.45, 0.94);

    /* Duration Scale */
    --duration-instant: 100ms;
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 350ms;
    --duration-sheet: 400ms;

    /* Z-Index Scale */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-header: 300;
    --z-overlay: 400;
    --z-modal-backdrop: 500;
    --z-modal: 600;
    --z-chat: 700;
    --z-toast: 800;
    --z-tooltip: 900;
    --z-max: 999;
}

/* View Transitions — smooth cross-fade between pages */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: var(--duration-normal, 250ms) var(--ease-out-expo, ease) both vt-fade-out; }
::view-transition-new(root) { animation: var(--duration-normal, 250ms) var(--ease-out-expo, ease) both vt-fade-in; }
@keyframes vt-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes vt-fade-in  { from { opacity: 0; } to { opacity: 1; } }
.chat-header { view-transition-name: main-header; }
::view-transition-old(main-header), ::view-transition-new(main-header) { animation: none; }

/* ========================================
   LIGHT THEME OVERRIDES
   ======================================== */

[data-theme="light"] {
    /* Backgrounds */
    --bg-primary: #f8f9fc;
    --bg-secondary: #f0f2f8;
    --bg-tertiary: #e8ecf4;

    /* Panels — blue-tinted borders */
    --panel-bg: rgba(255, 255, 255, 0.95);
    --panel-bg-hover: rgba(255, 255, 255, 1.0);
    --panel-border: rgba(0, 80, 160, 0.10);
    --panel-border-hover: rgba(0, 80, 160, 0.20);
    --bg-panel: rgba(255, 255, 255, 0.95);

    /* Accents — deeper for light bg contrast.
       2026-10-06 (TASK 105 item 2): #0369a1 measured 3.49:1 on the white header
       ground (Log In, links, the back link) — text a reader cannot see. #0369a1
       is 5.93:1 on white, 5.51:1 on the #f3f7fb panel and 5.01:1 on the darkest
       light canvas #e8ecf4, so every var(--accent-cyan) consumer clears 4.5:1.
       --accent-blue (#0080c7, 4.27:1) moved with it to #075985 (7.56:1). */
    --accent-cyan: #0369a1;
    --accent-blue: #075985;
    --accent-lime: #0369a1;
    --accent-glow: rgba(3, 105, 161, 0.15);
    --accent-pink: #dc2626;
    --accent-orange: #dc2626;
    --accent-gold: #0369a1;

    /* The four blues in light: text-bearing roles darken to clear 4.5:1 on white
       (action/status #1d4ed8 = 6.70:1, data #2563eb = 5.17:1); decoration is
       never text and keeps the brand value (3.68:1, above the 3:1 UI bar). */
    --blue-action: #1d4ed8;
    --blue-status: #1d4ed8;
    --blue-data: #2563eb;
    --blue-decoration: #3b82f6;

    /* Text hierarchy */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-dim: #64748b;
    --text-heading: #0f172a;
    --border-color: rgba(0, 50, 120, 0.10);
    --border-glow: rgba(0, 50, 120, 0.15);

    /* Input fields */
    --input-bg: #ffffff;
    --input-border: rgba(0, 80, 160, 0.20);
    --input-focus-border: rgba(0, 130, 210, 0.5);
    --input-focus-glow: 0 0 0 3px rgba(0, 130, 210, 0.12);
    --input-focus-bg: #ffffff;

    /* Solid card backgrounds */
    --card-bg-solid: #f8f9fc;

    /* Financial colors */
    --positive-color: #059669;
    --negative-color: #dc2626;

    /* Auth pages */
    --auth-container-bg: linear-gradient(180deg, #f8f9fc 0%, #f0f2f8 50%, #e8ecf4 100%);
    --auth-card-bg: #ffffff;
    --auth-card-border: rgba(0, 80, 160, 0.10);
    --auth-card-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --auth-btn-bg: #0369a1;        /* white text on it: 5.93:1 (was 3.49:1 on #0369a1) */
    --auth-btn-border: #0369a1;
    --auth-btn-color: #ffffff;
    --auth-btn-shadow: 0 2px 8px rgba(3, 105, 161, 0.15);

    /* Google button */
    --google-btn-bg: #ffffff;
    --google-btn-color: #1f1f1f;
    --google-btn-border: rgba(0, 0, 0, 0.12);

    /* Dividers */
    --divider-color: rgba(0, 0, 0, 0.06);

    /* Scrolled header */
    --scrolled-header-bg: rgba(255, 255, 255, 0.92);

    /* Subtle shadows replace glows */
    --glow-cyan: 0 1px 3px rgba(0, 0, 0, 0.06);
    --glow-lime: 0 1px 3px rgba(0, 0, 0, 0.06);
    --glow-gold: 0 1px 3px rgba(0, 0, 0, 0.04);
    --glow-danger: 0 1px 3px rgba(204, 34, 51, 0.08);
    --shadow-deep: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
    --glass-blur: blur(15px);
    --glass-border: 1px solid rgba(0, 50, 120, 0.10);
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    --btn-glass-bg: rgba(0, 130, 210, 0.06);
    --btn-glass-border: 1px solid rgba(0, 80, 160, 0.10);
    --input-glass-bg: rgba(255, 255, 255, 0.8);

    /* Holographic buttons */
    --btn-holo-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(240, 245, 255, 0.8) 50%, rgba(255, 255, 255, 0.9) 100%);
    --btn-holo-bg-hover: linear-gradient(145deg, rgba(240, 245, 255, 0.95) 0%, rgba(230, 240, 255, 0.9) 50%, rgba(240, 245, 255, 0.95) 100%);
    --btn-holo-border: 1px solid rgba(0, 80, 160, 0.10);
    --btn-holo-border-hover: 1px solid rgba(0, 80, 160, 0.20);
    --btn-holo-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --btn-holo-shadow-hover: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] body {
    background: linear-gradient(180deg, #f8f9fc 0%, #f0f2f8 50%, #e8ecf4 100%);
}

/* --- Light Theme: Terminal/Glass Buttons --- */
[data-theme="light"] .terminal-btn {
    background: rgba(0, 100, 180, 0.08);
    border: 1px solid rgba(0, 120, 200, 0.25);
    color: var(--accent-cyan);
    box-shadow: 0 1px 3px rgba(0, 80, 150, 0.08);
    text-shadow: none;
}
[data-theme="light"] .terminal-btn.primary {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 130, 210, 0.2);
}
[data-theme="light"] .terminal-btn:hover {
    background: rgba(0, 120, 200, 0.12);
    border-color: rgba(0, 120, 200, 0.4);
    color: var(--accent-cyan);
    box-shadow: 0 2px 8px rgba(0, 100, 180, 0.12);
}
[data-theme="light"] .terminal-btn.primary:hover {
    background: #007ab8;
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 130, 210, 0.25);
}

/* --- Light Theme: Glass Button System --- */
[data-theme="light"] .glass-btn {
    background: rgba(0, 100, 180, 0.06);
    border: 1px solid rgba(0, 100, 180, 0.15);
    color: var(--text-secondary);
    backdrop-filter: none;
}
[data-theme="light"] .glass-btn:hover {
    background: rgba(0, 130, 210, 0.10);
    border-color: rgba(0, 130, 210, 0.30);
    color: var(--accent-cyan);
    box-shadow: 0 2px 8px rgba(0, 100, 180, 0.08);
}
[data-theme="light"] .glass-btn.active {
    background: rgba(3, 105, 161, 0.12);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}
[data-theme="light"] .glass-btn-primary {
    background: rgba(0, 130, 210, 0.08);
    border-color: rgba(0, 130, 210, 0.25);
    color: var(--accent-cyan);
}
[data-theme="light"] .glass-btn-primary:hover {
    background: rgba(3, 105, 161, 0.14);
    border-color: rgba(3, 105, 161, 0.40);
    box-shadow: 0 2px 12px rgba(0, 130, 210, 0.12);
}

/* --- Light Theme: Modal --- */
[data-theme="light"] .modal-overlay {
    background: rgba(15, 23, 42, 0.3);
}
[data-theme="light"] .modal-content {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 80, 160, 0.10);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10), 0 8px 48px rgba(0, 50, 120, 0.08);
}
[data-theme="light"] .modal-close {
    background: rgba(0, 100, 180, 0.06);
    border-color: rgba(0, 100, 180, 0.15);
    color: var(--text-secondary);
}
[data-theme="light"] .modal-close:hover {
    background: rgba(0, 100, 180, 0.12);
    border-color: rgba(0, 100, 180, 0.3);
    color: var(--accent-cyan);
    box-shadow: none;
}

/* --- Light Theme: Footer --- */
[data-theme="light"] .site-footer {
    background: linear-gradient(to bottom, #e8ecf4, #dde3ef);
    border-top: 1px solid rgba(0, 80, 160, 0.10);
}
[data-theme="light"] .site-footer::before {
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
    opacity: 0.3;
}
[data-theme="light"] .social-icon {
    background: rgba(0, 100, 180, 0.06);
    border-color: rgba(0, 80, 160, 0.12);
    color: var(--text-secondary);
}
[data-theme="light"] .social-icon:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    background: rgba(3, 105, 161, 0.08);
    box-shadow: 0 2px 12px rgba(0, 130, 210, 0.12);
}
[data-theme="light"] .footer-bottom {
    border-top-color: rgba(0, 80, 160, 0.08);
}

/* --- Light Theme: Dropdown Menu --- */
[data-theme="light"] .nav-dropdown-menu {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 80, 160, 0.10);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 8px 48px rgba(0, 50, 120, 0.06);
}
[data-theme="light"] .dropdown-heading {
    color: var(--accent-cyan);
    border-bottom-color: rgba(3, 105, 161, 0.15);
}
[data-theme="light"] .dropdown-section a {
    color: var(--text-primary);
}
[data-theme="light"] .dropdown-section a:hover {
    color: var(--accent-cyan);
    background: rgba(3, 105, 161, 0.06);
}
[data-theme="light"] .dropdown-section a::before {
    color: var(--accent-cyan);
}

/* --- Light Theme: Financial Colors --- */
[data-theme="light"] .price-positive,
[data-theme="light"] .text-positive,
[data-theme="light"] .stat-positive,
[data-theme="light"] .change-positive {
    color: #059669 !important;
}
[data-theme="light"] .price-negative,
[data-theme="light"] .text-negative,
[data-theme="light"] .stat-negative,
[data-theme="light"] .change-negative {
    color: #dc2626 !important;
}

/* ========================================
   RESET & BASE
   ======================================== */

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

/* Suppress all outlines by default — restore only for keyboard-navigated interactive elements (WCAG 2.4.7) */
*, *:focus, *:active {
    outline: none !important;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid var(--accent-cyan, #00cfff) !important;
    outline-offset: 2px;
}
/* Reset Tailwind outline style */
* {
    --tw-outline-style: none;
}

/* Hide native number input spinners globally — industry standard for financial UIs
   (Uniswap, 1inch, Jupiter, Coinbase all hide these) */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Eliminate 300ms tap delay on ALL interactive elements — platform-wide.
   Modern browsers honor this on html; no per-element rules needed. */
html {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Global overflow fix - clip horizontal, allow vertical scroll (EVE-13716) */
html {
    overflow-x: clip;
    overflow-y: auto;
    overscroll-behavior-y: contain; /* Contain scroll chaining; preserve iOS rubber-band bounce */
    max-width: 100%;
    /* CentCom 15670: the root canvas must NEVER show white. iOS Safari does
       not honor body background-attachment:fixed — regions beyond the first
       painted viewport (long pages, pinch-zoom gutters, rubber-band bounce)
       fall through to the html canvas, which defaulted to white. Paint it
       the page background color so any fallthrough stays on-theme. */
    background-color: var(--bg-primary, #0a0e17);
}
[data-theme="light"] html {
    background-color: #f8f9fc;
}

body {
    font-family: var(--font-mono);
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: clip;
    overscroll-behavior-y: contain;
    position: relative;
    max-width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    padding-top: calc(90px + env(safe-area-inset-top, 0px));
}
@media (max-width: 768px) {
    body { padding-top: calc(90px + env(safe-area-inset-top, 0px)); }
}

/* CentCom 15670: iOS Safari renders background-attachment:fixed gradients
   only over the first viewport — everything below shows as a blank white
   panel on long pages. On touch-width screens let the gradient scroll with
   the page. (mobile-polish.css already does this, but not every page loads
   it — this is the universal fix at the source.) */
@media (max-width: 768px) {
    body {
        background-attachment: scroll;
    }
}

/* Override for pages that handle their own padding or don't use fixed header */
body.no-header-padding {
    padding-top: 0;
}

/* ========================================
   STANDARDIZED PANEL/CARD COMPONENT
   Use this class across all templates to prevent color drift
   ======================================== */

.panel,
.standard-panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: var(--panel-radius);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.panel:hover,
.standard-panel:hover {
    border-color: var(--panel-border-hover);
    background: var(--panel-bg-hover);
}

/* Tab styling - standardized across all pages */
.standard-tabs {
    display: flex;
    gap: 8px;
}

.standard-tab {
    background: transparent;
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.standard-tab:hover {
    border-color: var(--panel-border-hover);
    color: var(--text-primary);
}

.standard-tab.active {
    background: rgba(0, 207, 255, 0.15);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

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

.terminal-header {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid var(--bg-tertiary);
    padding: var(--spacing-md) var(--spacing-lg);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    box-shadow: none;
}

.header-grid {
    display: flex;
    gap: var(--spacing-md);
    max-width: 1600px;
    margin: 0 auto;
    align-items: center;
}

/* Header Navigation Menu (Left-aligned) */
.header-nav-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    margin-left: var(--spacing-md);
}

.header-nav-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    border-radius: 4px;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
}

.header-nav-item:hover {
    color: var(--text-primary);
    background: rgba(0, 207, 255, 0.1);
}

.header-nav-item.dropship {
    background: linear-gradient(135deg, rgba(0, 207, 255, 0.15) 0%, rgba(0, 150, 255, 0.15) 100%);
    border: 1px solid var(--panel-border-hover);
}

.header-nav-item.dropship:hover {
    background: linear-gradient(135deg, rgba(0, 207, 255, 0.25) 0%, rgba(0, 150, 255, 0.25) 100%);
    border-color: var(--accent-glow);
}

.nav-item-icon {
    font-size: 0.9rem;
}

.nav-item-text {
    text-transform: uppercase;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.terminal-logo {
    font-family: var(--font-display);
    font-size: 2rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.glitch {
    color: var(--accent-cyan);
    text-shadow: var(--glow-cyan);
    position: relative;
    animation: glitch 3s infinite;
}

@keyframes glitch {
    0%, 90%, 100% {
        transform: translate(0);
        opacity: 1;
    }
    91% {
        transform: translate(-2px, 2px);
        opacity: 0.8;
    }
    93% {
        transform: translate(2px, -2px);
        opacity: 0.9;
    }
    95% {
        transform: translate(-1px, 1px);
        opacity: 0.85;
    }
}

.futures {
    color: var(--accent-lime);
    font-size: 0.9em;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 100, 255, 0.15);
    border: 1px solid var(--accent-glow);
    border-radius: 4px;
}

.dot {
    width: 8px;
    height: 8px;
    background: var(--accent-cyan);
    border-radius: 50%;
    box-shadow: var(--glow-cyan);
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.status-text {
    font-size: 0.75rem;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: 0.2em;
}

.header-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    justify-items: end;
}

.stat-block {
    text-align: right;
}

.stat-label {
    font-size: 12px;
    color: var(--text-dim);
    letter-spacing: 0.15em;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-lime);
    text-shadow: var(--glow-lime);
    font-family: var(--font-mono);
}

/* Wallet Section */
.wallet-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.wallet-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--btn-holo-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--btn-holo-border);
    border-radius: 6px;
    color: #00cfff;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    box-shadow: var(--btn-holo-shadow);
    position: relative;
    overflow: hidden;
}

/* Holographic shimmer effect */
.wallet-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0, 200, 255, 0.1),
        transparent
    );
    transition: left 0.5s ease;
    pointer-events: none;
}

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

.wallet-btn:hover {
    transform: translateY(-2px);
    background: var(--btn-holo-bg-hover);
    border: var(--btn-holo-border-hover);
    box-shadow: var(--btn-holo-shadow-hover);
}

.wallet-icon {
    font-size: 1.2rem;
}

.wallet-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--accent-cyan);
    border-radius: 8px;
    box-shadow: var(--glow-cyan);
}

.wallet-address {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-cyan);
    letter-spacing: 0.05em;
}

.wallet-disconnect {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.wallet-disconnect:hover {
    color: var(--accent-pink);
}

.logout-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 68, 68, 0.15);
    border: 1px solid rgba(255, 68, 68, 0.5);
    border-radius: 8px;
    color: #ff4444;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.logout-btn:hover {
    background: rgba(255, 68, 68, 0.25);
    border-color: #ff4444;
}

/* ========================================
   MAIN CONTENT
   ======================================== */

.terminal-main {
    max-width: 100%;
    margin: var(--spacing-xl) 0;
    padding: 0 var(--spacing-lg);
}

/* ========================================
   NAVIGATION
   ======================================== */

.terminal-nav {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    position: relative;
    border-bottom: 1px solid var(--bg-tertiary);
}

.nav-tab {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: var(--spacing-sm) var(--spacing-md);
    min-height: 44px;  /* WCAG touch target minimum */
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    position: relative;
}

.nav-tab:hover {
    color: var(--accent-cyan);
}

.nav-tab.active {
    color: var(--accent-cyan);
}

.nav-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-cyan);
    box-shadow: var(--glow-cyan);
}

/* ========================================
   SECTIONS
   ======================================== */

.view-section {
    display: none;
    animation: fadeIn 0.5s ease;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    letter-spacing: 0.05em;
    color: var(--text-primary);
}

.bracket {
    color: var(--accent-cyan);
    font-weight: normal;
}

.filter-controls {
    display: flex;
    gap: var(--spacing-sm);
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--text-dim);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.filter-btn.active {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    color: var(--bg-primary);
}

/* ========================================
   MARKETS GRID
   ======================================== */

.markets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(400px, 100%), 1fr));
    gap: var(--spacing-lg);
}

.market-card {
    background: linear-gradient(135deg, rgba(0, 50, 100, 0.4) 0%, rgba(0, 80, 150, 0.3) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--panel-border-hover);
    border-radius: var(--panel-radius);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 100, 255, 0.1);
}

.market-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #00cfff;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.market-card:hover {
    border-color: rgba(0, 180, 255, 0.6);
    box-shadow: 0 0 30px var(--accent-glow), inset 0 0 20px var(--accent-glow);
    transform: translateY(-2px);
}

.market-card:hover::before {
    transform: scaleY(1);
}

.market-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: var(--spacing-sm);
}

.market-name {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.market-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: rgba(0, 207, 255, 0.1);
    border: 1px solid var(--accent-glow);
    color: #00cfff;
    letter-spacing: 0.15em;
    font-weight: 700;
    border-radius: 4px;
}

.market-status.pending {
    background: rgba(0, 207, 255, 0.1);
    border-color: #00cfff;
    color: #00cfff;
}

.market-status.completed {
    background: rgba(0, 207, 255, 0.1);
    border-color: rgba(0, 207, 255, 0.4);
    color: rgba(0, 207, 255, 0.72);
}

.market-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    line-height: 1.5;
}

.market-assets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: var(--spacing-md);
}

.asset-tag {
    padding: 0.35rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--text-dim);
    color: var(--accent-lime);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.market-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--bg-tertiary);
}

.stat-item {
    text-align: center;
}

.stat-item-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
}

.stat-item-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-lime);
}

/* Market Expiration Display */
.market-expiration {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin: 0.75rem 0;
    background: rgba(0, 212, 255, 0.05);
    border-left: 2px solid var(--accent-blue);
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.expiration-icon {
    width: 16px;
    height: 16px;
    stroke-width: 2.5;
}

.expiration-text {
    flex: 1;
}

/* Time urgency states */
.market-expiration.time-safe {
    background: rgba(0, 207, 255, 0.05);
    border-left-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.market-expiration.time-warning {
    background: rgba(0, 207, 255, 0.1);
    border-left-color: #00cfff;
    color: #00cfff;
}

.market-expiration.time-critical {
    background: rgba(255, 68, 68, 0.1);
    border-left-color: var(--accent-pink);
    color: var(--accent-pink);
    animation: pulse-glow 2s ease-in-out infinite;
}

.market-expiration.expired {
    background: rgba(74, 85, 104, 0.1);
    border-left-color: var(--text-dim);
    color: var(--text-dim);
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 5px rgba(255, 68, 68, 0.3);
    }
    50% {
        opacity: 0.85;
        box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
    }
}

@keyframes price-up {
    0% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(0, 207, 255, 0.2);
        transform: scale(1.05);
    }
    100% {
        background-color: transparent;
        transform: scale(1);
    }
}

@keyframes price-down {
    0% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(255, 68, 68, 0.2);
        transform: scale(1.05);
    }
    100% {
        background-color: transparent;
        transform: scale(1);
    }
}

/* ========================================
   FORMS
   ======================================== */

.terminal-form {
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    padding: var(--spacing-lg);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.span-2 {
    grid-column: span 2;
}

.form-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 0.15em;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.terminal-input,
.terminal-select {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    padding: 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--bg-tertiary);
    color: var(--text-primary);
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

/* 2026-09-21 (WS8 8.4, mobile-web audit section 4): .terminal-input (used by
   the shared login/signup modal, partials/auth_modal.html) was 0.95rem
   (15.2px) — below iOS Safari's 16px zoom-on-focus threshold. Today that's
   rescued only by an UNRELATED cross-file !important in mobile-responsive.css
   (`input[type="text"] { font-size: 16px !important; }`), so removing that
   block would silently reopen the zoom bug here. Setting it directly on the
   class itself, scoped to the same <=768px breakpoint that rule already
   uses, makes the fix load-bearing in its own file. Desktop (>768px) keeps
   the original 0.95rem — no visual change above the breakpoint. */
@media (max-width: 768px) {
    .terminal-input {
        font-size: 16px;
    }
}

.terminal-input:focus,
.terminal-select:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-glow);
}

textarea.terminal-input {
    resize: vertical;
    min-height: 80px;
}

/* ========================================
   BUTTONS
   ======================================== */

.terminal-btn {
    position: relative;
    padding: 1rem 2rem;
    /* Blue Glass Effect */
    background: rgba(0, 80, 150, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--panel-border-hover);
    color: #00cfff;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0, 100, 255, 0.15);
    border-radius: 8px;
}

.terminal-btn.primary {
    /* Primary Blue Glass */
    background: rgba(0, 100, 255, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #00cfff;
    border: 1px solid var(--accent-glow);
    box-shadow: 0 0 20px rgba(0, 100, 255, 0.2);
    text-shadow: 0 0 10px rgba(0, 207, 255, 0.5);
}

.terminal-btn:hover {
    background: rgba(0, 120, 255, 0.4);
    border-color: rgba(0, 180, 255, 0.6);
    color: #40dfff;
    box-shadow: 0 0 30px var(--accent-glow);
    transform: translateY(-2px);
}

.terminal-btn.primary:hover {
    background: rgba(0, 120, 255, 0.5);
    border-color: rgba(0, 180, 255, 0.7);
    color: #40dfff;
    box-shadow: 0 0 30px var(--accent-glow);
    transform: translateY(-2px);
}

.btn-text {
    position: relative;
    z-index: 2;
}

.btn-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* ========================================
   GLASS BUTTON SYSTEM
   Unified transparent glass button styles
   ======================================== */

/* Base glass button - neutral cyan */
.glass-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(0, 80, 120, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--panel-border-hover);
    border-radius: 8px;
    color: rgba(0,207,255,0.72);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.glass-btn:hover {
    background: rgba(0, 207, 255, 0.15);
    border-color: var(--panel-border-hover);
    color: var(--accent-cyan);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

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

.glass-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.glass-btn.active {
    background: rgba(0, 180, 255, 0.3);
    border-color: #00D4FF;
    color: #fff;
}

/* Primary glass button - stronger cyan */
.glass-btn-primary {
    background: rgba(0, 100, 150, 0.25);
    border-color: rgba(0, 180, 220, 0.4);
    color: #00D4FF;
}

.glass-btn-primary:hover {
    background: rgba(0, 150, 200, 0.35);
    border-color: rgba(0, 200, 255, 0.6);
    box-shadow: 0 4px 25px rgba(0, 180, 255, 0.3);
}

/* Success glass button - green */
.glass-btn-success {
    background: rgba(0, 255, 136, 0.15);
    border-color: rgba(0, 255, 136, 0.4);
    color: #00ff88;
}

.glass-btn-success:hover {
    background: rgba(0, 255, 136, 0.25);
    border-color: #00ff88;
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.3);
}

.glass-btn-success.active {
    background: rgba(0, 255, 136, 0.3);
    border-color: #00ff88;
    color: #fff;
}

/* Danger glass button - red */
.glass-btn-danger {
    background: rgba(255, 68, 68, 0.15);
    border-color: rgba(255, 68, 68, 0.4);
    color: #ff4444;
}

.glass-btn-danger:hover {
    background: rgba(255, 68, 68, 0.25);
    border-color: #ff4444;
    box-shadow: 0 4px 20px rgba(255, 68, 68, 0.3);
}

/* Warning glass button */
.glass-btn-warning {
    background: rgba(255, 68, 68, 0.15);
    border-color: rgba(255, 68, 68, 0.4);
    color: #00cfff;
}

.glass-btn-warning:hover {
    background: rgba(255, 68, 68, 0.25);
    border-color: #00cfff;
    box-shadow: 0 4px 20px rgba(255, 68, 68, 0.3);
}

/* Small glass button */
.glass-btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
    border-radius: 6px;
}

/* Large glass button */
.glass-btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
    border-radius: 10px;
}

/* Glass button with icon only */
.glass-btn-icon {
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
}

/* ========================================
   PRICES GRID
   ======================================== */

.prices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.price-card {
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    padding: var(--spacing-md);
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

.price-card:hover {
    border-color: var(--accent-cyan);
}

.price-asset {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-cyan);
    margin-bottom: 0.5rem;
}

.price-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-lime);
    text-shadow: var(--glow-lime);
}

.price-change {
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.price-change.up {
    color: var(--accent-lime);
}

.price-change.down {
    color: var(--accent-pink);
}

/* ========================================
   MODAL
   ======================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-modal);
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 23, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    padding: var(--spacing-xl);
    box-shadow: 0 0 40px rgba(0, 10, 30, 0.6);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background: rgba(0, 100, 255, 0.2);
    border: 1px solid var(--panel-border-hover);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00cfff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

.modal-close:hover {
    background: rgba(0, 120, 255, 0.4);
    border-color: rgba(0, 180, 255, 0.6);
    color: #40dfff;
    box-shadow: 0 0 15px var(--accent-glow);
}

/* ========================================
   LOADING
   ======================================== */

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--spacing-md);
}

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

/* Inline signup spinner for button */
.signup-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */

.toast-container {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--accent-cyan);
    padding: var(--spacing-md);
    min-width: 300px;
    box-shadow: var(--shadow-deep), var(--glow-cyan);
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success {
    border-color: var(--accent-lime);
}

.toast.error {
    border-color: var(--accent-pink);
}

/* ========================================
   QUICK BET BUTTONS
   ======================================== */

.quick-trade-btn {
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--text-dim);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

.quick-trade-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    background: rgba(0, 207, 255, 0.1);
}

.quick-trade-btn.active {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    color: var(--bg-primary);
    box-shadow: var(--glow-cyan);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .header-grid {
        grid-template-columns: 1fr;
    }

    .header-stats {
        justify-items: start;
    }

    /* Reduce logo size by 20% on mobile (2rem -> 1.6rem) */
    .terminal-logo {
        font-size: 1.6rem;
        white-space: nowrap;
    }

    .terminal-logo .futures {
        font-size: 0.9em;
    }

    /* Fix mobile horizontal scroll - wrap nav buttons */
    .wallet-section {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        max-width: 100%;
        overflow-x: clip;
    }

    .wallet-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
        min-height: 44px;  /* iOS touch target minimum */
    }

    .wallet-btn .wallet-text {
        display: none;  /* Hide text on small screens, show only icon */
    }

    .wallet-btn .wallet-icon {
        margin: 0;
    }

    .markets-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.span-2 {
        grid-column: span 1;
    }

    /* Ensure body doesn't overflow horizontally (EVE-13716: clip not hidden) */
    body {
        overflow-x: clip;
        max-width: 100%;
    }

    /* Fix terminal header on mobile */
    .terminal-header {
        padding: 0.5rem;
    }

    .terminal-header .header-grid {
        gap: 0.5rem;
    }
}

/* Even smaller screens - show 2 columns of buttons */
@media (max-width: 480px) {
    .wallet-section {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
        width: 100%;
    }

    .wallet-btn {
        justify-content: center;
        padding: 0.5rem;
        min-width: 44px;
        min-height: 44px;
    }

    #authSection {
        grid-column: span 4;
        justify-content: center;
    }
}

/* ========================================
   GLOBAL MOBILE OVERFLOW FIX
   Prevents horizontal scroll on ALL pages
   ======================================== */

@media (max-width: 768px) {
    /* Global overflow prevention (EVE-13716: clip not hidden — hidden blocks vertical scroll) */
    html {
        overflow-x: clip !important;
        overflow-y: auto !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    body {
        overflow-x: clip !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Ensure all main containers respect viewport */
    main,
    .container,
    .terminal-main,
    .content,
    .page-content,
    .wrapper,
    section,
    article {
        max-width: 100%;
        overflow-x: clip;
    }

    /* Fix any elements with fixed widths — exclude Google GSI iframes which need explicit height */
    img, video, embed, object {
        max-width: 100%;
        height: auto;
    }
    iframe:not([src*="accounts.google.com"]) {
        max-width: 100%;
        height: auto;
    }

    /* Fix pre/code blocks that may overflow */
    pre, code {
        max-width: 100%;
        overflow-x: auto;
        white-space: pre-wrap;
        word-wrap: break-word;
    }

    /* Fix tables. overflow-y stays HIDDEN on purpose: with overflow-x alone
       the y axis computes to auto, the block-level table becomes a scroll box
       on BOTH axes, and the 1px of vertical overflow every bordered table has
       latches a touch that starts on it — the page never scrolls (ET-33595,
       /crypto coin table, 24 of 24 swipes stuck). A hidden axis is not
       user-scrollable, so the vertical gesture goes to the page. */
    table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
    }

    /* Fix long text/links */
    a, p, span, div {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* CentCom 15670 BUG 3: the generic mobile table rules (table{display:
       block} here + td,th{white-space:nowrap;min-width:max-content} in
       mobile-responsive.css) made docs reference tables (.api-wrap — the
       API/SDK/MCP pages) render ~5x wider than the phone viewport with the
       scrollbar hidden — content simply looked cut off mid-word. Keep those
       tables as real tables and let cells wrap normally. */
    .api-wrap table {
        display: table;
        width: 100%;
        white-space: normal;
    }
    .api-wrap th,
    .api-wrap td {
        white-space: normal;
        min-width: 0;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    /* Fix grid containers that may overflow */
    .markets-grid,
    .prices-grid,
    .form-grid {
        max-width: 100%;
        overflow-x: clip;
    }

    /* Fix any absolute positioned elements */
    .toast-container {
        right: 0.5rem;
        max-width: calc(100vw - 1rem);
    }

    .toast {
        min-width: auto;
        max-width: 100%;
    }

    /* Ensure modal doesn't overflow */
    .modal-content {
        max-width: calc(100vw - 2rem);
        margin: 1rem;
    }

    /* Fix header on small screens */
    .terminal-header {
        max-width: 100%;
        overflow-x: clip;
    }

    /* Ensure touch targets meet iOS minimum (44x44px) */
    button,
    a.btn,
    .wallet-btn,
    .terminal-btn,
    .nav-tab,
    .filter-btn,
    [role="button"],
    input[type="submit"],
    input[type="button"] {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ========================================
   ORDER BOOK STYLES
   ======================================== */

.order-book {
    font-family: var(--font-mono);
    margin: 1rem 0;
}

.order-book-side {
    background: var(--bg-tertiary);
    border: 1px solid var(--bg-secondary);
    border-radius: 8px;
    padding: 1rem;
}

.order-book-table {
    margin-top: 0.5rem;
}

.order-book-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
    padding: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-dim);
    font-weight: 700;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--bg-secondary);
    margin-bottom: 0.25rem;
}

.order-book-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
    padding: 0.5rem;
    font-size: 0.85rem;
    transition: background 0.2s ease;
    border-radius: 4px;
}

.order-book-row:hover {
    background: rgba(0, 207, 255, 0.05);
}

.bid-row {
    border-left: 2px solid var(--accent-lime);
}

.ask-row {
    border-left: 2px solid var(--accent-pink);
}

.order-price {
    font-weight: 700;
    color: var(--text-primary);
}

.bid-price {
    color: var(--accent-lime);
}

.ask-price {
    color: var(--accent-pink);
}

.order-size {
    text-align: right;
    color: var(--text-secondary);
}

.order-count {
    text-align: right;
    color: var(--text-dim);
    font-size: 0.8rem;
}

/* ==========================================================================
   Corporate Footer Styles
   ========================================================================== */

.site-footer {
    background: linear-gradient(to bottom, #111722, #0a0e14);
    border-top: 1px solid var(--panel-border-hover);
    padding: 3rem 2rem 1.5rem;
    margin-top: 4rem;
    position: relative;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
    opacity: 0.6;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Footer Brand Section */
.footer-brand {
    padding-right: 2rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.footer-logo .logo-event {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--accent-cyan);
    letter-spacing: 2px;
}

.footer-logo .logo-trader {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text-primary);
    letter-spacing: 2px;
}

.footer-tagline {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--accent-lime);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.footer-description {
    font-family: 'Archivo Black', sans-serif;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 300px;
}

/* Footer Links Section */
.footer-links {
    padding-left: 1rem;
}

.footer-heading {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 1.25rem;
    position: relative;
}

.footer-heading::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--accent-cyan);
}

.footer-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-nav li {
    margin-bottom: 0.75rem;
}

.footer-nav .footer-link {
    font-family: 'Archivo Black', sans-serif;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
    display: inline-block;
}

.footer-nav .footer-link:hover {
    color: var(--accent-cyan);
    transform: translateX(4px);
}

/* Footer Social Section */
.footer-social {
    padding-left: 1rem;
}

.footer-social-icons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    max-width: 160px;
}

.social-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 50, 100, 0.4);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

.social-icon svg {
    transition: transform 0.3s ease;
}

.social-icon:hover {
    border-color: #00cfff;
    color: #00cfff;
    background: rgba(0, 207, 255, 0.1);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-3px);
}

.social-icon:hover svg {
    transform: scale(1.1);
}

/* Footer Bottom */
.footer-bottom {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.footer-copyright {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 0.5px;
}

/* Footer Responsive Styles */
@media (max-width: 900px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .footer-brand {
        grid-column: span 2;
        padding-right: 0;
        text-align: center;
    }

    .footer-description {
        max-width: none;
        margin: 0 auto;
    }

    .footer-links,
    .footer-social {
        padding-left: 0;
    }

    .footer-heading::after {
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (max-width: 600px) {
    .site-footer {
        padding: 2.5rem 1.5rem 1rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer-brand {
        grid-column: span 1;
    }

    .footer-logo {
        justify-content: center;
    }

    .footer-nav li {
        margin-bottom: 0.5rem;
    }

    .footer-social-icons {
        margin: 0 auto;
    }
}

/* ===== MARKET REACTIONS (Like/Dislike) ===== */
.market-reactions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bg-tertiary);
}

.reaction-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: transparent;
    border: 1px solid var(--bg-tertiary);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.reaction-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--text-primary);
    background: rgba(0, 212, 255, 0.05);
}

.reaction-btn .reaction-icon {
    width: 16px;
    height: 16px;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

/* Like button active state */
.reaction-btn.like-btn.active {
    border-color: var(--accent-pink);
    color: var(--accent-pink);
    background: rgba(255, 68, 68, 0.1);
}

.reaction-btn.like-btn.active .reaction-icon {
    fill: var(--accent-pink);
    stroke: var(--accent-pink);
}

.reaction-btn.like-btn:hover {
    border-color: var(--accent-pink);
    color: var(--accent-pink);
}

/* Dislike button active state */
.reaction-btn.dislike-btn.active {
    border-color: #ff4444;
    color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
}

.reaction-btn.dislike-btn.active .reaction-icon {
    fill: #ff4444;
    stroke: #ff4444;
}

.reaction-btn.dislike-btn:hover {
    border-color: #ff4444;
    color: #ff4444;
}

/* Share button */
.reaction-btn.share-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

/* Feedback button */
.reaction-btn.feedback-btn:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
}

.reaction-count {
    font-weight: 600;
    min-width: 1ch;
}

/* Animation for like/dislike */
@keyframes heartBeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.2); }
    50% { transform: scale(1); }
    75% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.reaction-btn.active .reaction-icon {
    animation: heartBeat 0.4s ease;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .market-reactions {
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .reaction-btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }

    .reaction-btn .reaction-icon {
        width: 14px;
        height: 14px;
    }

    .reaction-btn.share-btn span:last-child {
        display: none;
    }
}

/* ========================================
   LEFT SIDEBAR NAVIGATION (DESKTOP)
   ======================================== */

.left-sidebar {
    position: fixed;
    top: 80px; /* Below header */
    left: 0;
    width: 180px;
    height: calc(100vh - 80px);
    height: calc(100dvh - 80px);
    background: linear-gradient(180deg, rgba(0, 50, 100, 0.4) 0%, rgba(0, 40, 80, 0.3) 100%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-right: 1px solid var(--panel-border-hover);
    z-index: var(--z-dropdown);
    padding: 50px 0 1rem 0; /* 50px top spacing to prevent text cutoff */
    overflow-y: auto;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0 0.5rem;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    border-radius: 6px;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
}

.sidebar-nav-item:hover {
    color: var(--text-primary);
    background: rgba(0, 207, 255, 0.1);
}

.sidebar-nav-item.dropship {
    background: linear-gradient(135deg, rgba(0, 207, 255, 0.15) 0%, rgba(0, 150, 255, 0.15) 100%);
    border: 1px solid var(--panel-border-hover);
}

.sidebar-nav-item.dropship:hover {
    background: linear-gradient(135deg, rgba(0, 207, 255, 0.25) 0%, rgba(0, 150, 255, 0.25) 100%);
    border-color: var(--accent-glow);
}

.sidebar-nav-icon {
    font-size: 1rem;
    min-width: 1.25rem;
    text-align: center;
}

.sidebar-nav-text {
    text-transform: uppercase;
}

/* Adjust main content to account for sidebar - only when sidebar exists */
.has-sidebar .terminal-main {
    margin-left: 180px;
}

/* Hide sidebar on mobile (hamburger menu handles it) */
@media (max-width: 768px) {
    .left-sidebar {
        display: none;
    }

    .has-sidebar .terminal-main {
        margin-left: 0;
    }
}

/* ========================================
   MOBILE HAMBURGER MENU
   ======================================== */

/* Hamburger button - hidden by default, shown on mobile */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    z-index: var(--z-overlay);
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.mobile-menu-toggle:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 212, 255, 0.1);
}

.mobile-menu-toggle:focus {
    outline: none;
}

/* Hamburger icon lines */
.hamburger-icon {
    width: 20px;
    height: 14px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--accent-cyan);
    border-radius: 1px;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

/* Hamburger to X animation */
.mobile-menu-toggle.active .hamburger-icon span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* Mobile menu overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: var(--z-overlay);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
}

/* Mobile menu panel */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    z-index: var(--z-overlay);
    transition: right 0.3s ease;
    overflow-y: auto;
    padding: 20px;
    padding-top: 90px;
}

.mobile-menu.active {
    right: 0;
}

/* Mobile menu items */
.mobile-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-menu-nav a,
.mobile-menu-nav button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
    width: 100%;
    text-align: left;
}

.mobile-menu-nav a:hover,
.mobile-menu-nav button:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 212, 255, 0.1);
}

.mobile-menu-nav .menu-icon {
    font-size: 18px;
}

.mobile-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 0;
}

.mobile-menu-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 0;
}

/* Show hamburger on mobile */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
        order: 99; /* Put hamburger on the right */
        margin-left: auto; /* Push to far right */
    }

    .mobile-menu-overlay,
    .mobile-menu {
        display: block;
    }

    /* Adjust header for mobile menu */
    .terminal-header .header-grid {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* Hide header nav menu on mobile (it goes in hamburger menu) */
    .terminal-header .header-nav-menu {
        display: none !important;
    }

    /* Hide wallet section on mobile (it goes in hamburger menu) */
    .terminal-header .wallet-section {
        display: none !important;
    }

    /* Hide header stats on very small screens */
    .terminal-header .header-stats {
        display: none;
    }

    /* Keep logo visible on left */
    .terminal-header .logo-section {
        flex-shrink: 0;
        flex: 1;
        justify-content: flex-start;
        order: -1; /* Ensure logo is first/leftmost */
    }
}

/* Smaller mobile - even more compact */
@media (max-width: 480px) {
    .mobile-menu {
        width: 100%;
        right: -100%;
    }

    .mobile-menu.active {
        right: 0;
    }
}

/* ========================================
   IPHONE 14 / SMALL MOBILE FIXES (393px)
   Fixes for QA test failures on iOS devices
   ======================================== */

@media (max-width: 480px) {
    /* Fix login button visibility - ensure it's in mobile menu */
    .mobile-menu .wallet-section {
        display: flex !important;
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem;
    }

    .mobile-menu .wallet-btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    .mobile-menu #loginBtn {
        display: flex !important;
        width: 100%;
        padding: 0.75rem 1rem;
        background: var(--accent-lime);
        color: var(--bg-primary);
        font-weight: 700;
    }

    /* Fix terminal navigation tabs for small screens */
    .terminal-nav {
        flex-wrap: wrap;
        gap: 0.25rem;
        justify-content: center;
        padding: 0.5rem 0;
    }

    .nav-tab {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
        min-height: 44px;
        flex: 1 1 auto;
        text-align: center;
    }

    /* Ensure Markets and Create tabs are visible */
    .nav-tab[data-view="markets"],
    .nav-tab[data-view="create"],
    .nav-tab[data-view="prices"] {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    /* Fix contact page grid */
    .contact-options {
        grid-template-columns: 1fr !important;
    }

    /* Fix getting-started page */
    .guide-container {
        padding: 1rem !important;
        max-width: 100% !important;
    }

    .guide-hero {
        padding: 1.5rem !important;
    }

    .guide-hero h1 {
        font-size: 1.5rem !important;
    }

    /* Fix SDK docs code blocks */
    .sdk-docs pre,
    .sdk-docs code,
    pre[class*="language-"],
    code[class*="language-"] {
        max-width: calc(100vw - 2rem) !important;
        font-size: 0.75rem !important;
    }
}

/* Extra small screens (iPhone SE, etc) */
@media (max-width: 375px) {
    .nav-tab {
        font-size: 0.75rem;
        padding: 0.4rem 0.5rem;
        min-height: 44px;  /* WCAG touch target minimum */
        letter-spacing: 0.05em;
    }

    .terminal-nav {
        gap: 0.15rem;
    }

    .guide-container {
        padding: 0.5rem !important;
    }
}

/* ========================================
   MOBILE AUTH BUTTONS
   Fixes for login button visibility
   ======================================== */

.mobile-auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.mobile-auth-buttons .wallet-btn {
    width: 100%;
    justify-content: flex-start;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    text-align: left;
    min-height: 44px;
}

.mobile-login-btn {
    background: var(--accent-lime) !important;
    color: var(--bg-primary) !important;
    font-weight: 700;
}

.mobile-login-btn:hover {
    background: #00dfff !important;
}

.mobile-signup-btn {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--accent-cyan);
}

.mobile-signup-btn:hover {
    background: var(--accent-cyan) !important;
    color: var(--bg-primary) !important;
}

/* ========================================
   HORIZONTAL SCROLL FIX - ALL PAGES
   ======================================== */

@media (max-width: 480px) {
    /* SDK docs specific fixes */
    .sdk-container,
    .sdk-content,
    .sdk-docs {
        max-width: 100% !important;
        overflow-x: clip !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* Contact page grid fix */
    .contact-container,
    .contact-content {
        max-width: 100% !important;
        padding: 1rem !important;
    }

    .contact-options {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .contact-option {
        padding: 1rem !important;
    }

    /* Getting started fixes */
    .guide-container,
    .guide-content {
        max-width: 100% !important;
        padding: 0.75rem !important;
        overflow-x: clip !important;
    }

    .guide-hero {
        padding: 1rem !important;
    }

    .guide-hero h1 {
        font-size: 1.25rem !important;
    }

    /* Force all containers to respect viewport */
    .container,
    .wrapper,
    .content,
    .page-content,
    main {
        box-sizing: border-box !important;
        max-width: 100% !important;
        overflow-x: clip !important;
    }

    /* Fix grids that might overflow */
    .grid,
    [class*="grid-"] {
        max-width: 100% !important;
    }

    /* SDK docs specific mobile fixes */
    .sdk-hero {
        padding: 1rem !important;
    }

    .sdk-hero h1 {
        font-size: 1.5rem !important;
    }

    .sdk-section {
        padding: 1rem !important;
    }

    .sdk-section h2 {
        font-size: 1.2rem !important;
    }

    .sdk-section pre {
        max-width: 100% !important;
        overflow-x: auto !important;
        font-size: 0.75rem !important;
    }

    .sdk-section code {
        word-break: break-all !important;
    }

    /* Contact page fixes */
    .contact-container,
    .contact-content {
        max-width: 100% !important;
        padding: 0.5rem !important;
    }

    /* Swagger UI fixes */
    .swagger-ui,
    .swagger-container {
        max-width: 100% !important;
        overflow-x: clip !important;
    }

    .swagger-ui .wrapper {
        padding: 0 0.5rem !important;
    }

    .swagger-ui .opblock-summary {
        flex-wrap: wrap !important;
    }

    /* Global overflow control (EVE-13716: clip not hidden) */
    html {
        overflow-x: clip !important;
        overflow-y: auto !important;
        max-width: 100% !important;
    }
    body {
        overflow-x: clip !important;
        max-width: 100% !important;
    }

    /* Code blocks on all pages */
    pre, code {
        max-width: 100% !important;
        overflow-x: auto !important;
    }
}

/* ========================================
   BROWSER FALLBACKS - Liquid Glass
   For browsers without backdrop-filter support
   ======================================== */

@supports not (backdrop-filter: blur(10px)) {
    .terminal-btn {
        background: rgba(0, 50, 100, 0.95);
        border: 1px solid var(--panel-border-hover);
    }

    .terminal-btn.primary {
        background: linear-gradient(135deg, rgba(0, 207, 255, 0.8), rgba(0, 150, 200, 0.8));
    }

    .terminal-btn:hover {
        background: rgba(0, 207, 255, 0.15);
    }
}

/* ========================================
   HUB DROPDOWN MENU
   Compact navigation for leaderboards & dashboards
   ======================================== */

.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-trigger {
    cursor: pointer;
}

.nav-dropdown-trigger .dropdown-arrow {
    font-size: 0.75rem;
    margin-left: 0.25rem;
    transition: transform 0.2s ease;
}

.nav-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    min-width: min(420px, 95vw);
    background: rgba(10, 15, 25, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 207, 255, 0.3);
    border-radius: var(--panel-radius);
    padding: 1.5rem;
    z-index: var(--z-dropdown);
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    box-shadow:
        0 4px 30px rgba(0, 207, 255, 0.15),
        0 0 60px rgba(0, 207, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown-menu.active {
    display: grid;
}

.dropdown-section {
    min-width: 180px;
}

.dropdown-heading {
    color: #00cfff;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0, 207, 255, 0.25);
    padding-bottom: 0.5rem;
    font-weight: 700;
}

.dropdown-section a {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    margin: 0.25rem 0;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 6px;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.dropdown-section a:hover {
    color: #00cfff;
    background: rgba(0, 207, 255, 0.1);
    transform: translateX(4px);
}

.dropdown-section a::before {
    content: '›';
    margin-right: 0.5rem;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    color: #00cfff;
}

.dropdown-section a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-dropdown-menu {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        transform: none;
        min-width: 100%;
        width: 100%;
        border-radius: 20px 20px 0 0;
        grid-template-columns: 1fr;
        gap: 1.5rem;
        max-height: 70vh;
        overflow-y: auto;
        padding: 2rem 1.5rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
    }

    .nav-dropdown:hover .nav-dropdown-menu {
        display: none;
    }

    .nav-dropdown-menu.active {
        display: grid;
    }
}

/* Hide Web3 Connect Wallet buttons - use system wallet for logged-in users */
.connect-wallet-btn,
.wallet-connect-btn,
[data-action="connect-wallet"],
button[onclick*="connectWallet"],
.header-connect-btn,
.mobile-connect-wallet,
#connectWalletBtn,
#headerConnectWalletBtn,
#walletBtn,
#connectWallet,
.wallet-btn:not(.wallet-disconnect) {
    display: none !important;
}

/* ========================================
   REDUCED MOTION — Accessibility (WCAG 2.1 SC 2.3.3)
   Respects OS-level "reduce motion" setting.
   Kills decorative animations; preserves layout-critical transitions
   (opacity fades shortened to 0.1s so state changes remain visible).
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition-duration: 0.1s !important;
        scroll-behavior: auto !important;
    }

}

/* ========================================
   v2 DESIGN OVERRIDES
   v2 design — neutral borders, tighter radii
   ======================================== */

.market-card { border-color: var(--panel-border); border-radius: 6px; }
.market-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.4); }
.terminal-btn { border-radius: 6px; }
.glass-btn { border-color: var(--panel-border); border-radius: 6px; }
.glass-btn.active { border-color: var(--accent-cyan); }
.modal-content { border-color: var(--panel-border); border-radius: 6px; box-shadow: 0 4px 24px rgba(0,0,0,0.5); }
.modal-close { border-color: var(--panel-border); border-radius: 6px; }
.modal-close:hover { background: rgba(255,255,255,0.1); }
.site-footer { border-top-color: var(--panel-border); }
.social-icon { border-color: var(--panel-border); border-radius: 6px; }
.social-icon:hover { border-color: var(--accent-cyan); box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
.order-book-row:hover { background: rgba(255,255,255,0.03); }
.standard-tab.active { background: rgba(0, 207, 255, 0.1); }
.left-sidebar { border-right-color: var(--panel-border); }
.status-indicator { box-shadow: 0 0 8px rgba(0,207,255,0.2); }

/* ── Universal pill toggle ─────────────────────────────────────────── */
.et-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}
.et-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.et-toggle-slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 26px;
    transition: background 0.25s ease;
}
.et-toggle-slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.et-toggle input:checked + .et-toggle-slider {
    background: var(--accent-green, #00ff88);
}
.et-toggle input:checked + .et-toggle-slider::before {
    transform: translateX(22px);
}
.et-toggle input:disabled + .et-toggle-slider {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Hover/focus utilities (replace inline onmouseover/onmouseout/onfocus/onblur) ── */
.focus-border-cyan:focus { border-color: rgba(0, 207, 255, 0.5) !important; }
.hover-border-cyan:hover { border-color: rgba(0, 207, 255, 0.5) !important; }
.hover-border-green:hover { border-color: rgba(0, 255, 136, 0.6) !important; }
.hover-border-cyan-full:hover { border-color: #00cfff !important; }
.hover-border-green-full:hover { border-color: #00ff88 !important; }
.hover-lift:hover { transform: translateY(-2px); }
.hover-bg-cyan:hover { background: rgba(0, 207, 255, 0.1) !important; }
.hover-bg-green:hover { background: rgba(0, 255, 136, 0.1) !important; }
.hover-bg-blue:hover { background: rgba(59, 130, 246, 0.25) !important; }
.hover-bg-red:hover { background: rgba(255, 68, 68, 0.35) !important; }
.hover-color-cyan:hover { color: #00cfff !important; }
.hover-color-white:hover { color: #ffffff !important; }
.hover-opacity:hover { opacity: 0.85; }
.hover-opacity-full:hover { opacity: 1 !important; }
.hover-glow-cyan:hover { background: rgba(0, 120, 255, 0.4) !important; box-shadow: 0 0 15px rgba(0, 207, 255, 0.4); }
.hover-reveal:hover { opacity: 1 !important; }
[data-theme="light"] .hover-border-cyan:hover { border-color: rgba(0, 150, 200, 0.5) !important; }
[data-theme="light"] .hover-border-green:hover { border-color: rgba(0, 180, 100, 0.6) !important; }
[data-theme="light"] .hover-bg-cyan:hover { background: rgba(0, 150, 200, 0.1) !important; }
[data-theme="light"] .hover-bg-green:hover { background: rgba(0, 180, 100, 0.1) !important; }

/* ── Sticky table headers: ONE shared pattern (.sth) ─────────────────────────
   A table header only sticks inside its nearest scrolling ancestor. Put class `sth`
   on the wrapper around a table. Two states, switched by static/js/sticky-table.js
   (ResizeObserver; re-evaluated on resize and rotation):
   - table fits its wrapper: NO scroll box. The wrapper does not scroll, so th sticks
     to the PAGE, just under the fixed site header (top: var(--site-header-h)).
   - table is wider than its wrapper (.sth-x): the wrapper is the one scroll box in
     both axes, capped to the viewport, th sticks at top:0 of the box. The box is the
     only way to keep sideways scrolling AND a pinned header, so it exists only here.
   overscroll-behavior-y: auto (a fresh swipe at the box's end continues into the
   page; `contain` would trap the reader in a box that fills most of a phone screen),
   x = contain (a sideways swipe at the table's edge must not trigger browser back).
   --sth-offset = space above and below the capped box (header + margin).
   Pinned by tests/test_sticky_table_header_pattern.py. */
.sth { -webkit-overflow-scrolling: touch; }
.sth:not(.sth-x) { overflow: visible !important; max-height: none; }
.sth.sth-x {
    overflow: auto;
    overscroll-behavior: contain auto; /* shorthand is X then Y: x contain, y auto */
    max-height: calc(100vh - var(--sth-offset, 140px));
    max-height: calc(100dvh - var(--sth-offset, 140px));
}
.sth table {
    display: table;
    overflow: visible;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}
.sth thead th,
.sth th {
    position: sticky;
    top: var(--site-header-h, 0px) !important;
    z-index: 2;
}
.sth.sth-x th { top: 0 !important; }
.sth th:first-child { z-index: 3; }
