:root {
    --green: #16a34a;
    --green-dark: #15803d;
    --green-light: #22c55e;
    --green-soft: #ecfdf5;
    --black: #0b0f0d;
    --black-soft: #161b18;
    --white: #ffffff;
    --gray-50: #f6f8f7;
    --gray-100: #eef1ef;
    --gray-200: #dfe4e1;
    --gray-400: #9aa5a0;
    --gray-600: #5b6661;
    --gray-900: #1f2925;
    --red: #dc2626;
    --amber: #d97706;
    --blue: #2563eb;
    --radius: 12px;
    --shadow: 0 8px 24px rgba(11, 15, 13, .08);
    --shadow-lg: 0 20px 50px rgba(11, 15, 13, .14);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    font-size: 15px;
    line-height: 1.55;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-x: hidden;
}

a { color: var(--green-dark); text-decoration: none; }
a:hover { color: var(--green); }

h1, h2, h3, h4 { margin: 0 0 .6rem; line-height: 1.25; font-weight: 700; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 .8rem; }

/* ---------------- Layout ---------------- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 480px; }

.app-shell { display: flex; min-height: 100vh; }

.impersonation-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 9px 16px;
    background: var(--amber, #d97706);
    color: var(--white);
    font-size: .88rem;
    text-align: center;
}
.impersonation-bar strong { color: var(--white); }
.impersonation-bar form { margin: 0; }

.sidebar {
    width: 250px;
    flex: 0 0 250px;
    background: var(--black);
    color: #cfd6d2;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar .brand {
    display: flex; align-items: center; gap: 10px;
    color: var(--white); font-weight: 800; font-size: 1.15rem;
    padding: 6px 10px 18px; letter-spacing: .3px;
}
.sidebar .brand span.logo {
    width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
    background: var(--green); color: var(--white); font-weight: 800;
}
.sidebar .nav-label {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .12em;
    color: #6d7a74; padding: 14px 10px 6px;
}
.sidebar a.nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 11px; border-radius: 9px; color: #cfd6d2; font-size: .92rem;
}
.sidebar a.nav-link:hover { background: var(--black-soft); color: var(--white); }
.sidebar a.nav-link.active { background: var(--green); color: var(--white); font-weight: 600; }
.sidebar .spacer { flex: 1 1 auto; }

.main-area { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 14px 24px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    position: sticky; top: 0; z-index: 20;
}
.topbar .page-title { font-size: 1.15rem; font-weight: 700; margin: 0; }
.topbar .topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar .topbar-left .page-title { margin: 0; }
.topbar .topbar-right { display: flex; align-items: center; gap: 12px; }

.nav-toggle {
    display: none; flex: 0 0 auto;
    flex-direction: column; justify-content: center; gap: 5px;
    width: 40px; height: 40px; padding: 9px;
    border: 1px solid var(--gray-200); border-radius: 10px;
    background: var(--white); cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; width: 100%; background: var(--gray-900); border-radius: 2px; }
.nav-overlay { display: none; }
body.nav-open { overflow: hidden; }
.drawer-user { display: none; }

.page { padding: 24px; flex: 1 1 auto; }

/* ---------------- Cards ---------------- */
.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card + .card { margin-top: 18px; }
.card-header {
    padding: 16px 18px; border-bottom: 1px solid var(--gray-100);
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.card-header h2, .card-header h3 { margin: 0; font-size: 1.02rem; }
.card-body { padding: 18px; }
.card-footer { padding: 14px 18px; border-top: 1px solid var(--gray-100); }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

/* ---------------- Stat cards ---------------- */
.stat {
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: 4px;
}
.stat .stat-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--gray-600); }
.stat .stat-value { font-size: 1.6rem; font-weight: 800; }
.stat .stat-hint { font-size: .8rem; color: var(--gray-400); }
.stat.accent { background: linear-gradient(135deg, var(--black) 0%, #16321f 100%); color: var(--white); border-color: transparent; }
.stat.accent .stat-label, .stat.accent .stat-hint { color: #a7b3ad; }
.stat.green { background: var(--green); color: var(--white); border-color: transparent; }
.stat.green .stat-label, .stat.green .stat-hint { color: rgba(255,255,255,.8); }

/* ---------------- Buttons ---------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 16px; border-radius: 9px; border: 1px solid transparent;
    font-size: .92rem; font-weight: 600; cursor: pointer;
    background: var(--green); color: var(--white); transition: .15s ease;
}
.btn:hover { background: var(--green-dark); color: var(--white); }
.btn-black { background: var(--black); }
.btn-black:hover { background: var(--black-soft); }
.btn-outline { background: transparent; border-color: var(--gray-200); color: var(--gray-900); }
.btn-outline:hover { background: var(--gray-100); color: var(--gray-900); }
.btn-white { background: var(--white); color: var(--black); }
.btn-white:hover { background: var(--green-soft); color: var(--black); }
.btn-ghost-light { background: rgba(255,255,255,.08); color: var(--white); border-color: rgba(255,255,255,.2); }
.btn-ghost-light:hover { background: rgba(255,255,255,.16); color: var(--white); }
.btn-danger { background: var(--red); }
.btn-danger:hover { filter: brightness(.92); color: var(--white); }
.btn-sm { padding: 6px 11px; font-size: .82rem; border-radius: 7px; }
.btn-block { width: 100%; }
.btn-copied, .btn-copied:hover { background: var(--green); color: var(--white); }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }

.btn-group { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------------- Forms ---------------- */
label { display: block; font-size: .84rem; font-weight: 600; margin-bottom: 5px; color: var(--gray-900); }
.input, select, textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--gray-200);
    border-radius: 9px; background: var(--white); font-size: .92rem; font-family: inherit; color: var(--gray-900);
}
.input:focus, select:focus, textarea:focus { outline: 2px solid rgba(22,163,74,.25); border-color: var(--green); }
textarea { min-height: 90px; resize: vertical; }
.form-group { margin-bottom: 14px; }
.form-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.form-check { display: flex; align-items: center; gap: 8px; }
.form-check input { width: 16px; height: 16px; }
.form-check label { margin: 0; font-weight: 500; }
.help { font-size: .78rem; color: var(--gray-600); margin-top: 4px; }
.inline-form { display: inline; }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.table th {
    text-align: left; padding: 11px 14px; background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200); font-size: .76rem;
    text-transform: uppercase; letter-spacing: .07em; color: var(--gray-600); white-space: nowrap;
}
table.table td { padding: 12px 14px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
table.table tbody tr:hover { background: var(--green-soft); }
table.table .right, th.right { text-align: right; }
.empty { padding: 32px 16px; text-align: center; color: var(--gray-400); }

/* ---------------- Badges ---------------- */
.badge {
    display: inline-block; padding: 3px 9px; border-radius: 999px;
    font-size: .74rem; font-weight: 700; letter-spacing: .03em;
}
.badge-success { background: rgba(22,163,74,.12); color: var(--green-dark); }
.badge-warning { background: rgba(217,119,6,.13); color: var(--amber); }
.badge-danger { background: rgba(220,38,38,.12); color: var(--red); }
.badge-info { background: rgba(37,99,235,.12); color: var(--blue); }
.badge-dark { background: var(--black); color: var(--white); }

/* ---------------- Alerts ---------------- */
.alert {
    padding: 12px 15px; border-radius: 10px; margin-bottom: 18px;
    border: 1px solid transparent; font-size: .9rem;
}
.alert-success { background: var(--green-soft); border-color: rgba(22,163,74,.3); color: var(--green-dark); }
.alert-error { background: #fef2f2; border-color: rgba(220,38,38,.25); color: var(--red); }
.alert-info { background: var(--gray-100); border-color: var(--gray-200); color: var(--gray-900); }

/* ---------------- Progress ---------------- */
.progress { height: 8px; background: var(--gray-100); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--green); border-radius: 999px; }

/* ---------------- Public site ---------------- */
.public-body { background: var(--white); }
.site-header {
    background: var(--black); color: var(--white);
    padding: 16px 0; position: sticky; top: 0; z-index: 30;
}
.site-header .inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.site-nav { display: flex; gap: 22px; align-items: center; }
.site-nav a { color: #c7d0cb; font-size: .93rem; font-weight: 500; }
.site-nav a:hover { color: var(--green-light); }
.brand-light { display: flex; align-items: center; gap: 10px; color: var(--white); font-weight: 800; font-size: 1.2rem; }
.brand-light span.logo {
    width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
    background: var(--green); color: var(--white);
}

/* Public site: hamburger toggle (hidden on desktop) */
.site-nav-toggle {
    display: none; flex: 0 0 auto;
    flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 11px;
    border: 1px solid rgba(255,255,255,.2); border-radius: 10px;
    background: rgba(255,255,255,.06); cursor: pointer;
}
.site-nav-toggle span { display: block; height: 2px; width: 100%; background: var(--white); border-radius: 2px; transition: .2s ease; }
.site-nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.site-nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.site-nav-overlay { display: none; }

.hero {
    background:
        radial-gradient(900px 420px at 85% -10%, rgba(34,197,94,.25), transparent 60%),
        linear-gradient(160deg, var(--black) 0%, #0d1a12 100%);
    color: var(--white);
    padding: 80px 0 90px;
}
.hero h1 { font-size: 2.9rem; letter-spacing: -.02em; max-width: 15ch; }
.hero h1 span { color: var(--green-light); }
.hero p.lead { font-size: 1.05rem; color: #b6c1bb; max-width: 60ch; }
.hero .hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

.ticker { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 40px; }
.ticker .tick {
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
    border-radius: 10px; padding: 12px 16px; min-width: 150px;
}
.ticker .tick b { display: block; font-size: 1.25rem; color: var(--green-light); }
.ticker .tick span { font-size: .78rem; color: #97a39d; text-transform: uppercase; letter-spacing: .08em; }

.section { padding: 64px 0; }
.section.alt { background: var(--gray-50); }
.section.dark { background: var(--black); color: var(--white); }
.section-head { max-width: 62ch; margin-bottom: 34px; }
.section-head h2 { font-size: 2rem; }
.section-head p { color: var(--gray-600); }
.section.dark .section-head p { color: #a7b3ad; }

.feature { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.feature .icon {
    width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center;
    background: var(--green-soft); color: var(--green-dark); font-weight: 800; margin-bottom: 12px;
}
.feature h3 { font-size: 1.05rem; }
.feature p { color: var(--gray-600); font-size: .92rem; margin: 0; }

.price-card {
    background: var(--white); border: 2px solid var(--gray-200); border-radius: 16px;
    padding: 24px; display: flex; flex-direction: column; gap: 10px; position: relative;
}
.price-card.featured { border-color: var(--green); box-shadow: var(--shadow-lg); }
.price-card .tag {
    position: absolute; top: -12px; right: 18px; background: var(--green); color: var(--white);
    font-size: .7rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; letter-spacing: .06em;
}
.price-card .amount { font-size: 2.2rem; font-weight: 800; }
.price-card ul { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 8px; font-size: .92rem; }
.price-card ul li::before { content: "\2713"; color: var(--green); font-weight: 800; margin-right: 8px; }

.cta-band { background: var(--green); color: var(--white); padding: 54px 0; text-align: center; }
.cta-band h2 { font-size: 1.9rem; }
.cta-band p { color: rgba(255,255,255,.9); }

.site-footer { background: var(--black); color: #93a09a; padding: 40px 0; font-size: .88rem; }
.site-footer .cols { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-footer .cols > div { flex: 1 1 220px; }
.site-footer a { color: #c7d0cb; }
.site-footer a:hover { color: var(--green-light); }

/* ---------------- Auth ---------------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: linear-gradient(160deg, var(--black) 0%, #0d1a12 100%); color: var(--white); padding: 48px; display: flex; flex-direction: column; justify-content: center; }
.auth-side h2 { font-size: 1.9rem; }
.auth-side p { color: #a7b3ad; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; background: var(--gray-50); }
.auth-card { width: 100%; max-width: 430px; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-lg); }
.auth-card h1 { font-size: 1.5rem; }
.auth-card .sub { color: var(--gray-600); font-size: .9rem; margin-bottom: 18px; }
.otp-input { letter-spacing: .5em; text-align: center; font-size: 1.3rem; font-weight: 700; }
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* ---------------- Misc ---------------- */
.muted { color: var(--gray-600); }
.small { font-size: .82rem; }
.strong { font-weight: 700; }
.text-green { color: var(--green-dark); }
.text-red { color: var(--red); }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; } .between { justify-content: space-between; } .center { align-items: center; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.pill-list { display: flex; gap: 8px; flex-wrap: wrap; }
.code-box {
    background: var(--black); color: var(--green-light); padding: 16px; border-radius: 10px;
    font-size: 1.4rem; font-weight: 800; letter-spacing: .18em; text-align: center;
}
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--gray-200); margin-bottom: 18px; }
.tabs a { padding: 10px 14px; border-bottom: 2px solid transparent; font-weight: 600; font-size: .9rem; color: var(--gray-600); }
.tabs a.active { color: var(--green-dark); border-bottom-color: var(--green); }
.pagination { display: flex; gap: 6px; list-style: none; padding: 0; margin: 18px 0 0; flex-wrap: wrap; }
.pagination li span, .pagination li a {
    display: block; padding: 7px 12px; border: 1px solid var(--gray-200); border-radius: 8px;
    background: var(--white); font-size: .85rem;
}
.pagination li.active span { background: var(--green); border-color: var(--green); color: var(--white); font-weight: 700; }
.rank-card { border-left: 4px solid var(--gray-200); }
.rank-card.held { border-left-color: var(--green); }
.rank-level { font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--gray-600); }
.badge-light { background: var(--gray-100); color: var(--gray-600); }
.badge-green { background: var(--green); color: var(--white); }
table.table-sm td, table.table-sm th { padding: 7px 10px; font-size: .82rem; }
.wallet-tile { display: flex; flex-direction: column; gap: 2px; }
.wallet-tile .label { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--gray-600); }
.wallet-tile .value { font-size: 1.3rem; font-weight: 800; }
.member-row { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; background: var(--green-soft);
    color: var(--green-dark); display: grid; place-items: center; font-weight: 800; font-size: .82rem;
}
@media (max-width: 1024px) {
    .app-shell { flex-direction: column; }
    .nav-toggle { display: inline-flex; }
    .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0;
        width: 82%; max-width: 300px; height: 100%;
        flex-direction: column; align-items: stretch; gap: 6px;
        padding: 18px 16px;
        overflow-y: auto; overflow-x: hidden;
        transform: translateX(-100%);
        transition: transform .25s ease;
        z-index: 60;
        -webkit-overflow-scrolling: touch;
    }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .sidebar .nav-label { display: block; }
    .sidebar .spacer { flex: 1 1 auto; }
    .sidebar .brand { padding: 0 0 16px; font-size: 1.1rem; }
    .sidebar a.nav-link { padding: 10px 12px; }
    .topbar-user { display: none; }
    .drawer-user {
        display: flex; align-items: center; gap: 10px;
        padding: 0 4px 14px; margin-bottom: 6px;
        border-bottom: 1px solid rgba(255, 255, 255, .12);
    }
    .drawer-user .avatar { background: var(--green); color: var(--white); flex: 0 0 auto; }
    .drawer-user-info { min-width: 0; flex: 1 1 auto; }
    .drawer-user-info .strong { color: var(--white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .drawer-user-info .small { color: #a7b3ad; }
    .drawer-user .badge-success { margin-left: auto; flex: 0 0 auto; }
    .nav-overlay.show { display: block; position: fixed; inset: 0; background: rgba(11, 15, 13, .5); z-index: 55; }
    .topbar { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 16px; }
    .topbar .topbar-left { width: 100%; }
}

@media (max-width: 900px) {
    .site-nav-toggle { display: inline-flex; }
    .site-header .inner { position: relative; }
    .site-nav {
        position: absolute; top: 100%; left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 0;
        background: var(--black);
        border-top: 1px solid rgba(255,255,255,.1);
        padding: 8px 20px 16px;
        display: none;
        box-shadow: var(--shadow-lg);
    }
    .site-nav.open { display: flex; }
    .site-nav a {
        display: flex; align-items: center; min-height: 48px;
        padding: 12px 4px; font-size: 1rem;
        border-bottom: 1px solid rgba(255,255,255,.07);
    }
    .site-nav a:last-child { border-bottom: 0; }
    .site-nav a.btn { margin-top: 12px; justify-content: center; border-bottom: 0; }
    .site-nav-overlay.show { display: block; position: fixed; inset: 0; background: rgba(11,15,13,.5); z-index: 25; }
}

@media (max-width: 640px) {
    body { font-size: 14px; }
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.05rem; }
    .page { padding: 16px; }
    .grid { gap: 14px; }
    .card-header { padding: 13px 14px; }
    .card-body { padding: 14px; }
    .card-footer { padding: 12px 14px; }
    .card + .card { margin-top: 14px; }
    .stat { padding: 15px; }
    .stat .stat-value { font-size: 1.35rem; }
    .topbar .page-title { font-size: 1.05rem; }
    .topbar .topbar-right { width: 100%; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
    .topbar .member-row { min-width: 0; }
    .topbar .member-row > div { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
    table.table th, table.table td { padding: 10px; }
    .code-box { font-size: 1rem; letter-spacing: .06em; overflow-wrap: anywhere; word-break: break-word; }
    .modal { padding: 18px; }

    /* Public site */
    .section { padding: 40px 0; }
    .section-head { margin-bottom: 24px; }
    .site-header { padding: 12px 0; }
    .brand-light { font-size: 1.05rem; }
    .site-footer { padding: 32px 0; }
    .site-footer .cols { flex-direction: column; gap: 18px; }

    /* Auth */
    .auth-card { padding: 22px; }
}

/* Touch targets + form zoom prevention on phones */
@media (max-width: 640px) {
    .btn { min-height: 44px; }
    .btn-sm { min-height: 38px; }
    .nav-link { min-height: 44px; }
    /* 16px prevents iOS Safari auto-zoom on focus */
    .input, select, textarea { font-size: 16px; }
    .pagination li span, .pagination li a { min-height: 44px; display: inline-flex; align-items: center; }
    .form-check input { width: 20px; height: 20px; }
}

@media (max-width: 420px) {
    .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .stat .stat-value { font-size: 1.2rem; overflow-wrap: anywhere; }
    .stat .stat-label { font-size: .7rem; }
    .stat .stat-hint { font-size: .72rem; }
    .sidebar a.nav-link { font-size: .82rem; padding: 7px 10px; }
}

/* ---------------- Live trading feed ---------------- */
.live-dot {
    width: 9px; height: 9px; border-radius: 50%; background: var(--green-light);
    display: inline-block; vertical-align: middle; margin-right: 8px;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: livePulse 1.8s infinite;
}
.live-dot-sm { width: 7px; height: 7px; margin-right: 6px; }
@keyframes livePulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); }
    70% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
.section.dark .stat { background: #131815; border-color: #232b26; color: var(--white); }
.section.dark .stat .stat-label { color: #a7b3ad; }
.section.dark .stat .stat-hint { color: #6d7a74; }
.section.dark .stat.green { background: var(--green); border-color: transparent; }
.section.dark .card { border-color: #232b26; }
.section.dark .table thead th { background: #1a211c; color: #cfd6d2; border-color: #2f3831; }
.section.dark .table td { color: #ffffff; border-color: #2f3831; background: #131815; }
.section.dark .muted { color: #b9c2bd; }
.section.dark .small { color: #ffffff; }
#live-feed-body tr { transition: background .4s ease; }

/* ---------------- Modal ---------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 15, 13, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}
.modal-overlay[hidden] { display: none; }
.modal {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    padding: 22px;
    animation: modalPop .18s ease;
}
@keyframes modalPop {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to { opacity: 1; transform: none; }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.modal-header h3 { margin: 0; font-size: 1.15rem; }
.modal-x {
    border: 0;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0 4px;
}
.modal-x:hover { color: var(--gray-900); }
.modal-body { margin-top: 4px; }
body.modal-open { overflow: hidden; }
.otp-input {
    letter-spacing: 8px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 600;
}
/* ---------------- LiveTrades: market data ---------------- */
.mono { font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace; font-variant-numeric: tabular-nums; }
.narrow { max-width: 780px; }
.right { text-align: right; }
table .right, th.right { text-align: right; }

.card-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; flex-wrap: wrap; padding: 16px 18px; border-bottom: 1px solid var(--gray-100);
}
.card-head h2 { margin: 0; font-size: 1.05rem; }
.card.flush { overflow-x: auto; }

.breadcrumb { display: flex; gap: 8px; align-items: center; font-size: .85rem; margin: 0 0 14px; }
.breadcrumb a { color: var(--gray-600); }
.breadcrumb a:hover { color: var(--green); }

/* Venue feed status */
.venue-status { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin: 0 0 18px; }
.venue-dot { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--gray-600); }
.venue-dot i { width: 8px; height: 8px; border-radius: 50%; background: var(--gray-400); display: inline-block; }
.venue-dot.up i { background: var(--green-light); box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
.venue-dot.down i { background: var(--red); box-shadow: 0 0 0 3px rgba(220,38,38,.16); }
.alert-warn { background: #fffbeb; border-color: rgba(217,119,6,.3); color: #92400e; }

/* Markets list */
.mkt-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.mkt-table th {
    text-align: left; padding: 11px 16px; background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200); font-size: .74rem;
    text-transform: uppercase; letter-spacing: .07em; color: var(--gray-600); white-space: nowrap;
}
.mkt-table td { padding: 12px 16px; border-bottom: 1px solid var(--gray-100); white-space: nowrap; }
.mkt-table tbody tr { cursor: pointer; }
.mkt-table tbody tr:hover { background: var(--green-soft); }
.mkt-table .pair { display: inline-flex; gap: 2px; color: var(--gray-900); }

/* Market detail */
.market-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.market-title { margin: 0; font-size: 1.9rem; }
.market-price { display: flex; align-items: baseline; gap: 12px; }
.price-lg { font-size: 1.7rem; font-weight: 700; }
.change { font-size: 1rem; font-weight: 700; }

.grid-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 0 0 20px; }
.grid-stats .stat { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }

/* Interval selector */
.intervals { display: flex; gap: 6px; flex-wrap: wrap; }
.interval {
    padding: 5px 11px; border-radius: 8px; font-size: .8rem; font-weight: 600;
    color: var(--gray-600); background: var(--gray-100); border: 1px solid transparent;
}
.interval:hover { background: var(--gray-200); color: var(--gray-900); }
.interval.active { background: var(--black); color: var(--white); }

/* Chart */
.chart-wrap { position: relative; padding: 16px; }
.live-chart { width: 100%; height: 280px; display: block; }
.chart-axis { display: flex; justify-content: space-between; font-size: .78rem; padding: 0 4px; }
.chart-empty { padding: 60px 16px; }

/* Tape */
.tape-card { padding: 0; overflow: hidden; }
.tape-scroll { overflow-x: auto; }
.tape { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tape th {
    text-align: left; padding: 11px 14px; background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200); font-size: .72rem;
    text-transform: uppercase; letter-spacing: .07em; color: var(--gray-600); white-space: nowrap;
}
.tape td { padding: 10px 14px; border-bottom: 1px solid var(--gray-100); white-space: nowrap; }
.tape tbody tr:hover { background: var(--gray-50); }
.tape .tape-time { font-variant-numeric: tabular-nums; }
.tape-whale { background: rgba(217,119,6,.10); }
.tape-whale:hover { background: rgba(217,119,6,.16) !important; }
.tape-note { padding: 12px 16px; margin: 0; border-top: 1px solid var(--gray-100); }

.venue-tag {
    display: inline-block; padding: 2px 8px; border-radius: 6px;
    font-size: .72rem; font-weight: 600; text-transform: capitalize;
    background: var(--gray-100); color: var(--gray-600);
}
.side-pill {
    display: inline-block; min-width: 46px; text-align: center;
    padding: 2px 8px; border-radius: 6px; font-size: .74rem; font-weight: 700;
}
.side-buy { background: rgba(22,163,74,.13); color: var(--green-dark); }
.side-sell { background: rgba(220,38,38,.12); color: var(--red); }

@media (max-width: 900px) {
    .grid-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .hide-sm { display: none; }
    .mkt-table th, .mkt-table td { padding: 11px 12px; }
    .tape th, .tape td { padding: 9px 11px; font-size: .82rem; }
    .market-title { font-size: 1.5rem; }
    .price-lg { font-size: 1.4rem; }
    .live-chart { height: 200px; }
    .section-head h1 { font-size: 1.6rem; }
}

/* ---------------- Password visibility toggle ---------------- */
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 44px; }
.password-toggle {
    position: absolute; top: 1px; right: 1px; bottom: 1px; width: 42px;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: 0; border-radius: 0 9px 9px 0;
    color: var(--gray-600); cursor: pointer; padding: 0;
}
.password-toggle:hover { color: var(--gray-900); }
.password-toggle svg { width: 18px; height: 18px; }
.password-toggle .icon-eye-off { display: none; }
.password-toggle.is-visible .icon-eye { display: none; }
.password-toggle.is-visible .icon-eye-off { display: block; }

/* ---------------- Country flag select ---------------- */
.country-select { position: relative; }
.country-toggle {
    display: flex; align-items: center; gap: 9px; text-align: left; cursor: pointer;
    color: var(--gray-900);
}
.country-toggle .country-flag { font-size: 1.2rem; line-height: 1; flex: none; }
.country-toggle .country-flag img, img.country-flag { width: 22px; height: auto; display: block; border-radius: 2px; }
.country-toggle .country-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.country-toggle .country-label.placeholder { color: var(--gray-400); }
.country-toggle .caret { color: var(--gray-400); flex: none; transition: transform .15s ease; }
.country-select.open .country-toggle .caret { transform: rotate(180deg); }

.country-menu {
    position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; right: 0;
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    padding: 8px; display: none;
}
.country-select.open .country-menu { display: block; }
.country-search { margin-bottom: 6px; }
.country-options { max-height: 250px; overflow-y: auto; }
.country-option {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 8px 10px; border: 0; background: transparent; border-radius: 8px;
    font: inherit; color: var(--gray-900); cursor: pointer; text-align: left;
}
.country-option:hover, .country-option.active { background: var(--green-soft); }
.country-option .country-flag { font-size: 1.2rem; line-height: 1; flex: none; }
.country-option .country-name { flex: 1; }
.country-option .country-code { color: var(--gray-400); font-size: .78rem; letter-spacing: .05em; }
.country-options .no-match { padding: 10px; color: var(--gray-600); font-size: .85rem; }

@media (max-width: 640px) {
    .country-menu { position: fixed; left: 12px; right: 12px; top: auto; }
}
