/* Vexon Prime trader website. Served from the site itself (the CSP allows no inline or external
 * styles).
 *
 * The admin site's stylesheet with the Vexon gold accent in place of violet, plus the trader
 * pages' own rules at the end. Colours live only in the tokens below; the light theme overrides
 * the tokens and nothing else.
 */

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter-latin.woff2") format("woff2");
}

@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-weight: 100 800;
    font-display: swap;
    src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2");
}

:root {
    /* Surfaces */
    --bg:             #020617;
    --bg-elevated:    #0b1120;
    --bg-elevated-2:  #111a2e;
    --surface:        rgba(255, 255, 255, 0.03);
    --surface-hover:  rgba(255, 255, 255, 0.06);
    --surface-sunken: rgba(0, 0, 0, 0.20);
    --border:         rgba(255, 255, 255, 0.10);
    --border-strong:  rgba(255, 255, 255, 0.16);
    --grid-line:      rgba(255, 255, 255, 0.03);
    --nav-bg:         rgba(2, 6, 23, 0.72);
    --orb-1:          rgba(214, 170, 92, 0.14);
    --orb-2:          rgba(56, 189, 248, 0.10);

    /* Text */
    --text:        #e2e8f0;
    --text-strong: #ffffff;
    --muted:       #94a3b8;
    --muted-dim:   #64748b;

    /* Vexon gold accent (the admin site is violet, so the two are never mixed up) */
    --accent:          #d6aa5c;
    --accent-soft:     #e5c27f;
    --accent-text:     #f3d9a0;
    --accent-tint:     rgba(214, 170, 92, 0.12);
    --accent-border:   rgba(214, 170, 92, 0.30);
    --accent-glow:     rgba(214, 170, 92, 0.25);
    --accent-contrast: #140e05;
    --mark-text:       #0b1120;

    /* Semantic */
    --success:      #34d399;
    --success-tint: rgba(52, 211, 153, 0.14);
    --danger:       #f87171;
    --danger-tint:  rgba(248, 113, 113, 0.14);
    --warning:      #fbbf24;
    --warning-tint: rgba(251, 191, 36, 0.14);
    --info:         #38bdf8;

    --radius:    16px;
    --radius-sm: 10px;
    --shadow:    0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 40px -12px rgba(0, 0, 0, 0.55);
    --font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "JetBrains Mono", "SF Mono", "Fira Code", "Cascadia Code", Consolas, monospace;

    color-scheme: dark;
}

html[data-theme="light"] {
    --bg:             #f8fafc;
    --bg-elevated:    #ffffff;
    --bg-elevated-2:  #f1f5f9;
    --surface:        rgba(255, 255, 255, 0.85);
    --surface-hover:  rgba(15, 23, 42, 0.05);
    --surface-sunken: rgba(15, 23, 42, 0.04);
    --border:         rgba(15, 23, 42, 0.10);
    --border-strong:  rgba(15, 23, 42, 0.16);
    --grid-line:      rgba(15, 23, 42, 0.04);
    --nav-bg:         rgba(255, 255, 255, 0.75);
    --orb-1:          rgba(214, 170, 92, 0.10);
    --orb-2:          rgba(56, 189, 248, 0.055);

    --text:        #0f172a;
    --text-strong: #0f172a;
    --muted:       #475569;
    --muted-dim:   #64748b;

    --accent:        #a97a31;
    --accent-soft:   #b98a3e;
    --accent-text:   #8a6424;
    --accent-tint:   rgba(169, 122, 49, 0.10);
    --accent-border: rgba(169, 122, 49, 0.28);
    --accent-glow:   rgba(169, 122, 49, 0.20);

    --success:      #059669;
    --success-tint: rgba(5, 150, 105, 0.12);
    --danger:       #dc2626;
    --danger-tint:  rgba(220, 38, 38, 0.10);
    --warning:      #b45309;
    --warning-tint: rgba(180, 83, 9, 0.12);
    --info:         #0284c7;

    --shadow:    0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, 0.18);

    color-scheme: light;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.5 var(--font-stack);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-text); }
a:hover { color: var(--accent-soft); }

/* Ambient backdrop: two blurred accent orbs and a faint grid, fixed behind everything. */
.app-ambient {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}
.app-ambient::before,
.app-ambient::after {
    content: "";
    position: absolute;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    filter: blur(120px);
}
.app-ambient::before { top: -180px; left: -160px; background: var(--orb-1); }
.app-ambient::after { top: 30%; right: -180px; background: var(--orb-2); }
.app-ambient-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
    background-size: 44px 44px;
}

/* ── Top navigation ───────────────────────────────────────── */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 56px;
    padding: 8px 24px;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    text-decoration: none;
}

/* Gradient monogram tile: the one saturated thing in the chrome. */
.nav-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent-soft), var(--info));
    color: var(--mark-text);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: -0.3px;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.nav-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.nav-brand-name { font-size: 14px; font-weight: 700; letter-spacing: -0.2px; color: var(--text-strong); }
.nav-brand-sub { font-size: 11px; font-weight: 500; color: var(--muted-dim); }

.nav-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    flex: 1;
}

.nav-link {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s ease, background 0.15s ease;
}
.nav-link:hover { color: var(--text-strong); background: var(--surface-hover); }
.nav-link.active { color: var(--accent-text); background: var(--accent-tint); }

/* Sections: a button in the bar opens a panel of that section's pages. */
.nav-group { position: relative; }
.nav-group-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    background: none;
    font-family: inherit;
    line-height: inherit;
    cursor: pointer;
}
.nav-group-toggle:hover { border-color: transparent; transform: none; }
.nav-group-toggle:active { transform: none; }
.nav-group-toggle[aria-expanded="true"] { color: var(--text-strong); background: var(--surface-hover); }
.nav-group-toggle.active[aria-expanded="true"] { color: var(--accent-text); background: var(--accent-tint); }
.nav-caret {
    width: 6px;
    height: 6px;
    margin-top: -3px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    opacity: 0.7;
    transition: transform 0.15s ease;
}
.nav-group-toggle[aria-expanded="true"] .nav-caret { transform: translateY(3px) rotate(-135deg); }

.nav-sub {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 110;
    min-width: 260px;
    padding: 6px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}
.nav-group.open .nav-sub { display: grid; gap: 2px; }
/* Without JavaScript the panels open on hover and keyboard focus instead. */
html:not(.js) .nav-group:hover .nav-sub,
html:not(.js) .nav-group:focus-within .nav-sub { display: grid; gap: 2px; }

.nav-sub-link {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.15s ease;
}
.nav-sub-label { font-size: 13px; font-weight: 600; color: var(--text); }
.nav-sub-hint { font-size: 12px; color: var(--muted-dim); white-space: nowrap; }
.nav-sub-link:hover { background: var(--surface-hover); }
.nav-sub-link:hover .nav-sub-label { color: var(--text-strong); }
.nav-sub-link.active { background: var(--accent-tint); }
.nav-sub-link.active .nav-sub-label { color: var(--accent-text); }

.me {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-left: auto;
    font-size: 13px;
}
.me form { margin: 0; }
.me-name { color: var(--text); font-weight: 600; text-decoration: none; }
.me-name:hover { color: var(--accent-text); }

.btn-theme {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    background: var(--surface-hover);
    color: var(--muted);
    border: 1px solid var(--border);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}
.btn-theme:hover { background: var(--border); color: var(--text-strong); transform: none; }

/* Hamburger button: hidden on wide screens. */
.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-left: auto;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-hover);
    color: var(--text-strong);
    cursor: pointer;
}
.nav-toggle:hover { border-color: var(--accent-border); transform: none; }
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.2s ease, background 0.2s ease;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before,
.nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }


/* Small screens: the links and account controls fold into a menu behind the
   hamburger. Without JavaScript (no .js on <html>) the menu simply stays open. */
@media (max-width: 1024px) {
    .top-nav { flex-wrap: wrap; gap: 0 16px; padding: 8px 16px; }
    .js .nav-toggle { display: inline-flex; }
    .nav-menu {
        flex-basis: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px 0 8px;
    }
    .js .nav-menu { display: none; }
    .js .top-nav.open .nav-menu { display: flex; max-height: calc(100vh - 64px); overflow-y: auto; }
    .nav-links { flex-direction: column; align-items: stretch; gap: 2px; }
    .nav-link { padding: 10px 12px; font-size: 14px; }
    /* Sections become an accordion: the panel opens in place, indented. */
    .nav-group-toggle { width: 100%; justify-content: space-between; text-align: left; }
    .nav-sub {
        position: static;
        min-width: 0;
        margin: 2px 0 6px 12px;
        padding: 0 0 0 10px;
        background: none;
        border: 0;
        border-left: 1px solid var(--border);
        border-radius: 0;
        box-shadow: none;
    }
    .nav-sub-hint { white-space: normal; }
    .nav-menu .me {
        flex-wrap: wrap;
        margin-left: 0;
        padding: 12px 12px 4px;
        border-top: 1px solid var(--border);
    }
}

/* ── Page ─────────────────────────────────────────────────── */
main { width: 100%; max-width: 1200px; margin: 0 auto; padding: 32px 24px 48px; flex: 1; }
h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; color: var(--text-strong); margin: 0 0 20px; }
h2 { font-size: 18px; font-weight: 700; color: var(--text-strong); margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 700; color: var(--text-strong); margin: 0 0 8px; }
h2.spaced { margin-top: 28px; }
h3.spaced { margin-top: 20px; }

.site-footer {
    padding: 24px;
    border-top: 1px solid var(--border);
    color: var(--muted-dim);
    font-size: 13px;
    text-align: center;
}

@media (max-width: 600px) {
    main { padding: 24px 16px 40px; }
    h1 { font-size: 22px; }
}

.narrow { max-width: 420px; margin: 40px auto; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.mono, code, pre { font-family: var(--font-mono); }
.spaced-top { margin-top: 12px; }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border: 1px solid var(--accent-border);
    border-radius: 20px;
    background: var(--accent-tint);
    color: var(--accent-text);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Cards: translucent fill over the ambient backdrop. */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    margin: 16px 0;
}
.key-once { border-color: var(--accent-border); box-shadow: 0 0 0 3px var(--accent-tint); }

.notice, .error, .banner-test {
    padding: 10px 14px;
    border: 1px solid;
    border-radius: var(--radius-sm);
    font-weight: 500;
}
.notice { background: var(--success-tint); border-color: var(--success); color: var(--success); }
.error { background: var(--danger-tint); border-color: var(--danger); color: var(--danger); }
.banner-test { background: var(--warning-tint); border-color: var(--warning); color: var(--warning); font-weight: 600; }
.ok { color: var(--success); }
.bad { color: var(--danger); font-weight: 600; }
.warn { color: var(--warning); }
.badge.risk { border-color: var(--warning); background: var(--warning-tint); color: var(--warning); }

/* ── Forms ────────────────────────────────────────────────── */
form label { display: block; margin: 0 0 14px; font-size: 13px; font-weight: 600; color: var(--text-strong); }

input, select, textarea {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text-strong);
    font: 400 14px/1.4 var(--font-stack);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-tint);
}
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }

label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
label.check input { width: 18px; height: 18px; margin: 0; }

button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-hover);
    color: var(--text);
    font: 600 14px/1.4 var(--font-stack);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
button:hover, .button:hover { border-color: var(--border-strong); color: var(--text-strong); transform: translateY(-1px); }
button:active, .button:active { transform: translateY(0); }
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

button.primary, .button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-contrast);
    box-shadow: 0 4px 14px var(--accent-glow);
}
button.primary:hover, .button.primary:hover { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-contrast); }
button.danger { background: var(--danger-tint); border-color: var(--danger); color: var(--danger); }
button.danger:hover { color: var(--danger); }
button.link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent-text);
    font-weight: 600;
    box-shadow: none;
}
button.link:hover { color: var(--accent-soft); transform: none; }

.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 16px; }
.filters label { margin: 0; min-width: 150px; }
.filters label.check { min-width: 0; padding-bottom: 10px; }

form.inline { display: flex; gap: 6px; align-items: center; margin: 0; }
form.inline input { margin: 0; min-width: 160px; }
form.inline input[type=file] { min-width: 0; border: 0; padding: 0; background: none; box-shadow: none; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.actions form { margin: 0; }
.action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.action-grid.spaced { margin-top: 16px; }
.action-grid form,
.action-grid > div {
    margin: 0;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-sunken);
}
.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }

/* ── Tables ───────────────────────────────────────────────── */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 13px;
}
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.table-wrap > table { border: 0; }
th, td { padding: 9px 12px; text-align: left; vertical-align: top; }
thead th {
    background: var(--bg-elevated);
    color: var(--text-strong);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom: 1px solid var(--accent-border);
}
tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:last-child { border-bottom: 0; }
tbody tr:nth-child(even) { background: var(--surface-sunken); }
tbody tr:hover { background: var(--accent-tint); }
tbody th { color: var(--muted); font-weight: 600; }
tfoot th { color: var(--text-strong); border-top: 1px solid var(--accent-border); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
pre { margin: 6px 0 0; white-space: pre-wrap; word-break: break-all; font-size: 12px; }

dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
dt { color: var(--muted); font-size: 13px; }
dd { margin: 0; color: var(--text-strong); }

/* ── Dashboard tiles ──────────────────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; margin-bottom: 16px; }
.tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 18px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.tile .value { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.tile .label { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }
a.tile { color: var(--text); text-decoration: none; }
.wallet dd { overflow-wrap: anywhere; }
a.tile:hover { transform: translateY(-2px); border-color: var(--accent-border); box-shadow: var(--shadow-lg); }

/* ── Misc ─────────────────────────────────────────────────── */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 16px; }
.tabs a {
    padding: 6px 14px;
    border-radius: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.tabs a:hover { color: var(--text-strong); background: var(--surface-hover); }
.tabs a.active { color: var(--accent-text); background: var(--accent-tint); }

.qr { display: block; margin: 12px 0; background: #fff; padding: 8px; border-radius: 8px; }
.codes { display: grid; grid-template-columns: repeat(2, max-content); gap: 6px 32px; padding: 0; list-style: none; font-family: var(--font-mono); }
.pager { display: flex; gap: 16px; margin-top: 16px; }
.preview { border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 12px; }
.preview table { width: auto; }
.preview .confluences { margin: 8px 0 0; }
.preview .high-risk { color: var(--warning); font-weight: 600; margin: 8px 0; }
.signal-chart { display: block; width: 100%; max-width: 720px; height: auto; margin-top: 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.network { font-size: 22px; font-weight: 800; color: var(--text-strong); }
details summary { cursor: pointer; color: var(--accent-text); }

/* ── Sign-in pages: logo and form in a card centred on the page ── */
main.auth-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: none;
    min-height: 100vh;
    padding: 24px 16px;
}
.auth-card {
    width: 100%;
    max-width: 400px;
    overflow: hidden;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.auth-card > :not(.auth-logo) { margin-left: 28px; margin-right: 28px; }
.auth-card > :last-child { margin-bottom: 28px; }
.auth-card h1 { margin-top: 24px; font-size: 24px; text-align: center; }
.auth-card button.primary { width: 100%; margin-top: 4px; }
/* The logo is drawn on a near-black ground, so it sits on a matching band in both themes. */
.auth-logo { padding: 20px; background: #0a0805; text-align: center; border-bottom: 1px solid var(--accent-border); }
.auth-logo img { display: block; width: 220px; max-width: 100%; height: auto; margin: 0 auto; }

/* ── IP addresses: live feed ──────────────────────────────── */
.live-status { margin-left: 8px; font-size: 13px; font-weight: 600; }
.live-feed { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
.live-feed li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 6px 0; border-top: 1px solid var(--border); font-size: 13px; }
.live-feed li:first-child { border-top: 0; }
.live-time { color: var(--muted); }
.live-count { font-weight: 600; }
tr.flash td { animation: row-flash 1.6s ease-out; }
@keyframes row-flash { from { background: var(--accent-tint); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { tr.flash td { animation: none; } }

/* IP locations (IP addresses page, member detail, live feed). */
.geo { white-space: nowrap; }
.geo-cc { display: inline-block; min-width: 2.4em; margin-right: 6px; padding: 0 4px; border: 1px solid var(--border); border-radius: 4px; color: var(--muted); font-size: 11px; text-align: center; }
.geo-note { font-size: 13px; }

/* ── Visitor globe ─────────────────────────────────────────── */
main.wide-main { max-width: 1600px; }
:root {
    --globe-ocean-1: #16213d;
    --globe-ocean-2: #070b1a;
    --globe-land:    rgba(148, 163, 184, 0.22);
    --globe-land-edge: rgba(226, 232, 240, 0.28);
    --globe-border:  rgba(226, 232, 240, 0.10);
    --globe-grat:    rgba(255, 255, 255, 0.035);
    --globe-limb:    rgba(167, 139, 250, 0.55);
    --globe-public:  #38bdf8;
    --globe-member:  #a78bfa;
    --globe-blocked: #f87171;
    --globe-home:    #fbbf24;
    --globe-arc:     rgba(251, 191, 36, 0.9);
}
html[data-theme="light"] {
    --globe-ocean-1: #e2e8f0;
    --globe-ocean-2: #bfcbdc;
    --globe-land:    rgba(255, 255, 255, 0.92);
    --globe-land-edge: rgba(71, 85, 105, 0.45);
    --globe-border:  rgba(71, 85, 105, 0.18);
    --globe-grat:    rgba(15, 23, 42, 0.05);
    --globe-limb:    rgba(124, 58, 237, 0.35);
    --globe-public:  #0284c7;
    --globe-member:  #7c3aed;
    --globe-blocked: #dc2626;
    --globe-home:    #b45309;
    --globe-arc:     rgba(180, 83, 9, 0.9);
}
.globe-page { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.globe-stage { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.globe-stage h1 { margin: 0 0 4px; }
.globe-stage .globe-head p { margin: 0; }
.globe-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.globe-controls { display: flex; align-items: center; gap: 14px; }
.globe-period { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.globe-canvas-wrap { position: relative; aspect-ratio: 1 / 1; max-height: calc(100vh - 260px); min-height: 360px; margin: 0 auto; width: 100%; max-width: calc(100vh - 260px); }
#globe-canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; border-radius: var(--radius); }
#globe-canvas.dragging { cursor: grabbing; }
.globe-tip {
    position: absolute; pointer-events: none; z-index: 2; max-width: 260px;
    padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    background: var(--bg-elevated); box-shadow: var(--shadow-lg); font-size: 13px; line-height: 1.4;
}
.globe-tip strong { display: block; color: var(--text-strong); }
.globe-tip .muted { font-size: 12px; }
.globe-legend { position: absolute; left: 12px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); pointer-events: none; }
.globe-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.dot-public { background: var(--globe-public); box-shadow: 0 0 6px var(--globe-public); }
.dot-member { background: var(--globe-member); box-shadow: 0 0 6px var(--globe-member); }
.dot-blocked { background: var(--globe-blocked); box-shadow: 0 0 6px var(--globe-blocked); }
.dot-home { background: var(--globe-home); box-shadow: 0 0 6px var(--globe-home); }
.globe-empty { position: absolute; left: 0; right: 0; top: 46%; text-align: center; pointer-events: none; }
.globe-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 80px; }
.globe-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.globe-tiles .tile { padding: 12px 14px; }
.globe-tiles .tile .value { font-size: 22px; }
.globe-card { margin: 0; padding: 14px 16px; }
.globe-card h2 { margin: 0 0 8px; font-size: 15px; }
.globe-feed { max-height: 260px; }
.globe-feed li { gap: 4px 10px; }
.globe-feed .flag { font-size: 16px; line-height: 1; }
.globe-feed button.link { padding: 0; font: inherit; }
.globe-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.globe-bars li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 13px; }
.globe-bars .flag { font-size: 16px; text-align: center; }
.globe-bars .name { color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.globe-bars .bar { grid-column: 2 / 4; height: 4px; border-radius: 2px; background: var(--surface-hover); overflow: hidden; }
.globe-bars .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--info)); border-radius: 2px; }
.globe-bars .n { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.globe-bars button { all: unset; cursor: pointer; display: contents; }
.globe-bars li:hover .name { color: var(--accent-text); }
@media (max-width: 1100px) {
    .globe-page { grid-template-columns: 1fr; }
    .globe-side { position: static; }
    .globe-canvas-wrap { max-height: none; max-width: none; }
}

/* ── Trader website ───────────────────────────────────────── */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.page-head h1 { margin: 0; }
.signal-form { max-width: 760px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 16px; }
fieldset.direction { border: 0; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
fieldset.direction legend { font-size: 13px; font-weight: 600; color: var(--text-strong); margin-bottom: 6px; width: 100%; }
label.choice { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 9px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; }
label.choice input { margin: 0; width: auto; }
label.choice.buy:has(input:checked) { border-color: var(--success); background: var(--success-tint); color: var(--success); }
label.choice.sell:has(input:checked) { border-color: var(--danger); background: var(--danger-tint); color: var(--danger); }
.high-risk-check { padding: 10px 12px; border: 1px solid var(--warning); border-radius: var(--radius-sm); background: var(--warning-tint); font-weight: 500; }
.high-risk-check strong { color: var(--warning); }
.confirm-box { margin: 0 0 18px; padding: 14px 16px; border: 1px solid var(--warning); border-radius: var(--radius-sm); background: var(--warning-tint); }
.confirm-box h2 { color: var(--warning); margin-top: 0; }
.confirm-box .actions { margin: 10px 0 0; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 0 16px; align-items: start; }
.detail-grid .signal-chart { width: 100%; height: auto; border-radius: var(--radius-sm); }
ul.plain { margin: 0; padding-left: 18px; }
.close-form { margin-top: 12px; }
