/* CentFx — panel styles. Plain CSS, no build step. */

:root {
    --bg: #0d0e10;
    --surface: #141518;
    --raised: #1b1d21;
    --hover: #22252a;
    --line: #26292e;
    --line-soft: #1f2125;
    --text: #ecebe6;
    --muted: #8b8e95;
    --faint: #5d6067;
    --brand: #f5c518;
    --brand-ink: #1a1500;
    --brand-soft: rgba(245, 197, 24, .12);
    --up: #2ebd85;
    --up-soft: rgba(46, 189, 133, .12);
    --down: #ef4f5a;
    --down-soft: rgba(239, 79, 90, .12);
    --buy: #3b82f6;
    --info: #60a5fa;
    --radius: 10px;
    --radius-sm: 7px;
    --sidebar: 236px;
    --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
/* `hidden` must always win — otherwise a class with display:flex (like .sheet-back) stays on screen invisibly and eats every tap */
[hidden] { display: none !important; }
html { color-scheme: dark; } /* native controls + scrollbars render dark */

/* Thin dark scrollbars everywhere (watchlist, tables, modals) */
* { scrollbar-width: thin; scrollbar-color: #2c2f35 transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: #2c2f35; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #3d4148; }
::-webkit-scrollbar-button { display: none; height: 0; width: 0; }
body {
    background: var(--bg);
    color: var(--text);
    font: 14px/1.5 var(--font);
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.up { color: var(--up); }
.down { color: var(--down); }
.ico { flex: none; display: block; }
.hidden { display: none !important; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--brand); }
.logo-word { font-weight: 800; font-size: 21px; letter-spacing: -.02em; }
.logo img { display: block; width: auto; max-width: 100%; object-fit: contain; }

/* ---------- Buttons & form controls ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 38px; padding: 0 16px; border-radius: var(--radius-sm);
    border: 1px solid var(--line); background: var(--raised); color: var(--text);
    font: 600 13.5px var(--font); cursor: pointer; white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--hover); border-color: #34383e; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-brand:hover { background: #ffd43b; border-color: #ffd43b; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--raised); }
.btn-up { background: var(--up-soft); border-color: transparent; color: var(--up); }
.btn-up:hover { background: rgba(46, 189, 133, .2); }
.btn-down { background: var(--down-soft); border-color: transparent; color: var(--down); }
.btn-down:hover { background: rgba(239, 79, 90, .2); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label, .label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
    width: 100%; height: 42px; padding: 0 13px;
    background: var(--bg); color: var(--text);
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    font: 500 14px var(--font); outline: none;
    transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 90px; padding: 11px 13px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input-sm { height: 34px; font-size: 13px; padding: 0 10px; }
select.input {
    appearance: none; padding-right: 34px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b8e95' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}
.input-icon { position: relative; }
.input-icon .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.input-icon .input { padding-left: 40px; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; line-height: 1.45; color: var(--muted); cursor: pointer; }
.check input { accent-color: var(--brand); width: 16px; height: 16px; flex: none; margin: 1px 0 0; }
.error-text { color: var(--down); font-size: 12.5px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

/* ---------- Alerts ---------- */
.alert {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 18px;
    font-size: 13.5px; border: 1px solid;
}
.alert-ok { background: var(--up-soft); border-color: rgba(46, 189, 133, .25); color: #9fe3c6; }
.alert-err { background: var(--down-soft); border-color: rgba(239, 79, 90, .25); color: #f7b3b8; }
.alert ul { margin: 0; padding-left: 16px; }

/* ---------- Auth pages ---------- */
.auth {
    min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}
.auth-side {
    position: relative; overflow: hidden; padding: 56px;
    display: flex; flex-direction: column; justify-content: flex-start; gap: 30px;
    background: radial-gradient(120% 80% at 0% 0%, #17181c 0%, #0f1012 60%); border-right: 1px solid var(--line-soft);
}
.scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.auth-copy { position: relative; z-index: 1; max-width: 500px; }
.auth-side h1 { font-size: 42px; line-height: 1.1; letter-spacing: -.03em; margin-top: 18px; }
.auth-side h1 em { font-style: normal; color: var(--brand); }
.auth-side p.lead { color: var(--muted); max-width: 430px; margin-top: 16px; font-size: 15px; }
.live-pill {
    display: inline-flex; align-items: center; gap: 9px; padding: 6px 12px 6px 10px; border-radius: 99px;
    background: rgba(20, 21, 24, .8); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--muted);
}
.auth-points { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 28px; }
.auth-points div { font-size: 13px; color: var(--muted); }
.auth-points b { display: block; color: var(--text); font-size: 18px; font-family: var(--mono); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-brand { display: flex; justify-content: center; margin-bottom: 26px; }
.auth-heading { text-align: center; margin-bottom: 26px; }
.auth-heading h2 { font-size: 26px; margin-bottom: 6px; }
.auth-heading .sub { color: var(--muted); }
.auth-heading .staff-tag { margin-bottom: 12px; }
/* "New to CentFx? Create a free account →" row under the auth forms */
.auth-alt {
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 10px;
    margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line-soft);
    font-size: 13.5px; color: var(--muted); text-align: center;
}
.auth-alt a {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 99px;
    background: var(--brand-soft); color: var(--brand); font-weight: 700; white-space: nowrap;
    transition: background .15s, gap .15s;
}
.auth-alt a:hover { background: rgba(245, 197, 24, .2); gap: 9px; }
.auth-alt a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.auth-legal {
    display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 18px;
    font-size: 12px; color: var(--faint); text-align: center;
}
.auth-legal-center { position: relative; z-index: 2; margin: 0 16px 22px; }
.logo-lg { gap: 12px; }
.logo-lg .logo-word { font-size: 30px; }

/* Social sign-in */
.social { display: grid; gap: 10px; }
.social-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px; height: 46px; border-radius: var(--radius-sm);
    background: #fff; color: #1f1f1f; font: 600 14px var(--font); border: 1px solid #fff; transition: background .15s, transform .1s;
}
.social-btn:hover { background: #f1f1f1; }
.social-btn:active { transform: scale(.99); }
.social-btn .ico { color: #000; }
.or { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--faint); font-size: 12.5px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Ticker tape */
.ticker {
    position: relative; z-index: 1; overflow: hidden; margin: 0 -56px; padding: 12px 0;
    border-top: 1px solid var(--line-soft); background: rgba(13, 14, 16, .75); backdrop-filter: blur(6px);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker-track { display: flex; gap: 34px; width: max-content; animation: ticker 40s linear infinite; }
.ticker-item { font: 500 12.5px var(--mono); color: var(--muted); white-space: nowrap; }
.ticker-item b { color: var(--text); font-family: var(--font); font-weight: 700; margin-right: 6px; }
.ticker-item .up, .ticker-item .down { transition: color .3s; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* Staff login: centred glass card over the animated scene */
.auth-center { position: relative; min-height: 100vh; display: flex; flex-direction: column; overflow: hidden; background: #0c0d0f; }
.auth-vignette { position: absolute; inset: 0; background: radial-gradient(60% 55% at 50% 45%, rgba(12, 13, 15, .55), rgba(12, 13, 15, .92)); pointer-events: none; }
.glass-card {
    position: relative; z-index: 2; width: calc(100% - 32px); max-width: 430px; margin: auto; overflow: hidden;
    background: rgba(20, 21, 24, .78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, .08); border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
    animation: card-in .5s cubic-bezier(.2, .8, .2, 1);
}
.glass-card::before { content: ""; position: absolute; left: 20%; right: 20%; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--brand), transparent); }
.glass-head {
    display: flex; justify-content: center; padding: 30px 24px 24px; border-bottom: 1px solid rgba(255, 255, 255, .06);
    background: radial-gradient(70% 120% at 50% 0%, rgba(245, 197, 24, .1), transparent 70%);
}
.glass-body { padding: 26px 30px 30px; }
.auth-center .ticker { margin: 0; z-index: 2; }
@keyframes card-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }

/* Gift box submit button */
.gift-btn { height: 48px; gap: 12px; font-size: 14.5px; overflow: visible; position: relative; }
.gift { position: relative; width: 30px; height: 30px; display: inline-block; }
.gift-svg { width: 30px; height: 30px; overflow: visible; display: block; }
.gift-lid { transform-box: fill-box; transform-origin: 15% 100%; transition: transform .25s; }
.gift-box { transform-box: fill-box; transform-origin: 50% 100%; }
.gift-btn:not(.opening) .gift { animation: gift-wiggle 3.2s ease-in-out infinite; }
.gift-btn:hover .gift-lid { transform: translateY(-2px) rotate(-6deg); }
.gift-glow { position: absolute; left: 50%; top: 55%; width: 6px; height: 6px; border-radius: 50%; background: #fff; opacity: 0; transform: translate(-50%, -50%); }
.gift-bit {
    position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%;
    background: var(--c); opacity: 0; pointer-events: none;
}
.gift-btn.opening { pointer-events: none; }
.gift-btn.opening .gift-lid { animation: lid-pop .55s cubic-bezier(.3, 1.6, .5, 1) forwards; }
.gift-btn.opening .gift-box { animation: box-squash .45s ease-out; }
.gift-btn.opening .gift-glow { animation: glow .7s ease-out .12s forwards; }
.gift-btn.opening .gift-bit { animation: burst .75s cubic-bezier(.15, .7, .3, 1) calc(.14s + var(--d)) forwards; }
@keyframes gift-wiggle {
    0%, 82%, 100% { transform: rotate(0); }
    86% { transform: rotate(-9deg); } 90% { transform: rotate(8deg); } 94% { transform: rotate(-5deg); } 97% { transform: rotate(3deg); }
}
@keyframes lid-pop { 0% { transform: none; } 100% { transform: translate(-3px, -13px) rotate(-28deg); } }
@keyframes box-squash { 0% { transform: none; } 35% { transform: scale(1.12, .86); } 70% { transform: scale(.95, 1.06); } 100% { transform: none; } }
@keyframes glow { 0% { opacity: .9; box-shadow: 0 0 0 0 rgba(255, 255, 255, .9); } 100% { opacity: 0; box-shadow: 0 0 22px 18px rgba(255, 243, 196, 0); } }
@keyframes burst {
    0% { opacity: 1; transform: translate(0, 0) scale(.4) rotate(0); }
    70% { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.1) rotate(200deg); }
}
@media (prefers-reduced-motion: reduce) {
    .ticker-track, .gift-btn .gift { animation: none !important; }
}
.staff-tag {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px;
    background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 700; margin-bottom: 14px;
}

/* ---------- Panel shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 40;
    background: #101113; border-right: 1px solid var(--line-soft);
    display: flex; flex-direction: column; padding: 20px 14px;
}
.sidebar .logo { padding: 2px 8px 22px; }
/* Long menus (client: trading, research, learn, funds…) scroll between the fixed logo and footer.
   The side padding keeps the active item's notch (left: -14px) inside the scroll box. */
.sidebar .nav {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    margin: 0 -14px; padding: 0 14px 12px;
    scrollbar-width: thin; scrollbar-color: var(--line-soft) transparent;
}
.sidebar .nav::-webkit-scrollbar { width: 6px; }
.sidebar .nav::-webkit-scrollbar-thumb { background: var(--line-soft); border-radius: 99px; }
.sidebar .nav:hover::-webkit-scrollbar-thumb { background: var(--faint); }
.nav-title { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 16px 10px 8px; }
.nav a {
    display: flex; align-items: center; gap: 12px; padding: 9px 10px; margin-bottom: 2px;
    border-radius: var(--radius-sm); color: var(--muted); font-weight: 600; font-size: 13.5px;
    position: relative; transition: color .15s, background .15s;
}
.nav a:hover { color: var(--text); background: var(--raised); }
.nav a.active { color: var(--text); background: var(--raised); }
.nav a.active::before {
    content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand);
}
.nav a.active .ico { color: var(--brand); }
.nav .count { margin-left: auto; background: var(--brand); color: var(--brand-ink); font-size: 11px; font-weight: 800; padding: 0 7px; border-radius: 99px; line-height: 18px; }
.sidebar-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--faint); }

.main { flex: 1; margin-left: var(--sidebar); min-width: 0; display: flex; flex-direction: column; }
.topbar {
    height: 64px; display: flex; align-items: center; gap: 16px; padding: 0 28px;
    border-bottom: 1px solid var(--line-soft); background: rgba(13, 14, 16, .85);
    backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 30;
}
.topbar h1 { font-size: 17px; }
.topbar .spacer { flex: 1; }
/* Phones + tablets have no top header: the page title and its action buttons sit at the top of the content instead */
.mobile-head { display: none; align-items: center; justify-content: space-between; gap: 10px 12px; flex-wrap: wrap; margin-bottom: 18px; }
.mobile-head h1 { font-size: 21px; text-wrap: balance; }
.mobile-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mobile-actions:empty { display: none; }

/* ---------- Bottom navigation (phones + tablets, shown by the 1024px media query) ---------- */
:root { --bn-space: calc(104px + env(safe-area-inset-bottom, 0px)); } /* room left under the content for the bar */
.bottom-nav {
    display: none; position: fixed; z-index: 70; left: 0; right: 0; margin-inline: auto;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    width: min(520px, calc(100% - 28px));
    justify-content: space-between; align-items: center; gap: 6px; padding: 8px;
    border-radius: 24px;
    /* light glass — no solid colour, so the page shows through and the icons stay crisp */
    background: rgba(255, 255, 255, .07);
    -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, .13);
    box-shadow: 0 14px 36px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.bn-item {
    position: relative; flex: 1; max-width: 76px; height: 52px; display: grid; place-items: center;
    border: 0; border-radius: 17px; background: transparent; color: #f3f2ed; cursor: pointer;
    transition: background .18s, color .18s, transform .12s, box-shadow .18s;
    -webkit-tap-highlight-color: transparent;
}
.bn-item .ico { width: 25px; height: 25px; }
.bn-item:hover { background: rgba(255, 255, 255, .07); }
.bn-item:active { transform: scale(.93); }
.bn-item:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.bn-item.active, .bn-all.on {
    background: var(--brand); color: var(--brand-ink);
    box-shadow: 0 8px 20px rgba(245, 197, 24, .35);
}
.bn-item.active .ico { transform: translateY(-1px); }
.bn-all.here:not(.on) { color: var(--brand); box-shadow: inset 0 0 0 1.5px rgba(245, 197, 24, .7); }
.bn-dot {
    position: absolute; top: 10px; right: calc(50% - 17px); width: 9px; height: 9px; border-radius: 50%;
    background: var(--down); box-shadow: 0 0 0 2px rgba(20, 21, 24, .9);
}

/* "All menu" sheet */
.sheet-back {
    position: fixed; inset: 0; z-index: 120; display: flex; align-items: flex-end; justify-content: center;
    background: rgba(0, 0, 0, 0); transition: background .22s;
}
.sheet-back.open { background: rgba(0, 0, 0, .55); }
.sheet {
    width: min(640px, 100%); max-height: 84vh; overflow-y: auto; overscroll-behavior: contain;
    background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: 24px 24px 0 0;
    padding: 6px max(16px, env(safe-area-inset-right, 0px)) calc(26px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    transform: translateY(100%); transition: transform .24s cubic-bezier(.2, .8, .2, 1);
}
.sheet-back.open .sheet { transform: none; }
.sheet-grip { width: 42px; height: 4px; border-radius: 4px; background: var(--line); margin: 6px auto 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.sheet-close { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--raised); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.sheet-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 8px; }
.sheet-nav .nav-title { grid-column: 1 / -1; padding: 14px 2px 0; }
.sheet-nav a, .sheet-logout button {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    min-height: 84px; padding: 12px 4px; border-radius: 16px; text-align: center; line-height: 1.25;
    font: 600 11.5px var(--font); color: var(--muted); background: var(--raised); border: 1px solid var(--line-soft);
    transition: background .15s, color .15s, border-color .15s;
}
.sheet-nav a .ico, .sheet-logout .ico { width: 26px; height: 26px; color: var(--text); }
.sheet-nav a:hover, .sheet-logout button:hover { background: var(--hover); color: var(--text); }
.sheet-nav a.active { background: var(--brand-soft); border-color: rgba(245, 197, 24, .45); color: var(--brand); }
.sheet-nav a.active .ico { color: var(--brand); }
.sheet-nav .count { position: absolute; top: 7px; right: 7px; margin: 0; }
.sheet-logout { display: contents; }
.sheet-logout button { width: 100%; cursor: pointer; }
.sheet-logout button .ico { color: var(--down); }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-back, .bn-item { transition: none; } }
.profile { position: relative; }
.profile-btn {
    position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
    background: var(--brand-soft); color: var(--brand); border: 1px solid transparent; transition: border-color .15s;
}
.profile-btn:hover, .profile.open .profile-btn { border-color: var(--brand); }
.profile-tick {
    position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border-radius: 50%;
    background: var(--up) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 9px no-repeat;
    border: 2px solid var(--bg);
}
.profile-menu {
    position: absolute; right: 0; top: calc(100% + 10px); width: 250px; z-index: 60; padding: 6px;
    background: var(--raised); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
    opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity .15s, transform .15s;
}
.profile.open .profile-menu { opacity: 1; transform: none; pointer-events: auto; }
.profile-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; display: flex; flex-direction: column; align-items: flex-start; }
.profile-head b { font-size: 14px; }
.profile-head small { color: var(--faint); font-size: 12px; }
.profile-menu a, .profile-menu button {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 8px;
    color: var(--muted); font: 600 13px var(--font); background: none; border: 0; cursor: pointer; text-align: left;
}
.profile-menu a:hover, .profile-menu button:hover { background: var(--hover); color: var(--text); }
.tag-kyc-not_submitted { background: var(--raised); color: var(--muted); border: 1px solid var(--line); }
.tag-kyc-pending { background: rgba(245, 158, 11, .13); color: #f5a524; }
.tag-kyc-approved { background: var(--up-soft); color: var(--up); }
.tag-kyc-rejected { background: var(--down-soft); color: var(--down); }
.who { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
    background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 12.5px;
}
.who small { display: block; color: var(--faint); font-size: 11.5px; line-height: 1.2; }
.who b { font-size: 13px; line-height: 1.2; }
.content { padding: 26px 28px 40px; flex: 1; }

/* ---------- Cards, stats, tables ---------- */
.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.card-head h3 { font-size: 15px; }
.card-head .spacer { flex: 1; }
.card-body { padding: 20px; }
/* minmax(0, …) everywhere: a plain 1fr track can't shrink below its widest child, so one wide table would push the whole page sideways on phones */
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cols-even { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack > *, .cols > *, .cols-even > *, .content > * { min-width: 0; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px 18px; }
.stat .k { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.stat .k .ico { color: var(--faint); }
.stat .v { font-family: var(--mono); font-size: 22px; font-weight: 600; margin-top: 8px; letter-spacing: -.02em; }
.stat .s { font-size: 12px; color: var(--faint); margin-top: 2px; }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
    text-align: left; font-size: 11.5px; font-weight: 700; color: var(--faint);
    text-transform: uppercase; letter-spacing: .05em; padding: 11px 16px; border-bottom: 1px solid var(--line-soft); white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: rgba(255, 255, 255, .015); }
.table .r { text-align: right; }
.empty { padding: 40px 20px; text-align: center; color: var(--faint); }
.empty .ico { margin: 0 auto 10px; color: var(--line); }

.tag {
    display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 5px;
    font-size: 11.5px; font-weight: 700; text-transform: capitalize; background: var(--raised); color: var(--muted);
}
.tag-live { background: var(--brand-soft); color: var(--brand); }
.tag-demo { background: rgba(96, 165, 250, .12); color: var(--info); }
.tag-ok, .tag-approved, .tag-active, .tag-buy { background: var(--up-soft); color: var(--up); }
.tag-pending { background: rgba(245, 158, 11, .13); color: #f5a524; }
.tag-rejected, .tag-suspended, .tag-disabled, .tag-sell { background: var(--down-soft); color: var(--down); }
.tag-buy { background: rgba(59, 130, 246, .14); color: #7cb0ff; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-soft); margin-bottom: 20px; }
.tabs a {
    padding: 10px 14px; font-weight: 700; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a.on { color: var(--brand); border-color: var(--brand); }
.pill-tabs { display: inline-flex; padding: 3px; background: var(--bg); border: 1px solid var(--line-soft); border-radius: 8px; gap: 2px; }
.pill-tabs a, .pill-tabs button {
    padding: 5px 12px; border-radius: 6px; font: 700 12.5px var(--font); color: var(--muted); background: none; border: 0; cursor: pointer;
}
.pill-tabs .on { background: var(--raised); color: var(--text); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filters .input { width: auto; min-width: 160px; height: 36px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line-soft); font-size: 13px; flex-wrap: wrap; }
.pager-btns { display: inline-flex; align-items: center; gap: 10px; }

/* ---------- Account cards ---------- */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.acc {
    background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius);
    padding: 18px; display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden;
}
.acc::after {
    content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%;
    border: 18px solid rgba(245, 197, 24, .05);
}
.acc.is-demo::after { border-color: rgba(96, 165, 250, .06); }
.acc-top { display: flex; align-items: center; gap: 10px; }
.acc-top .login { font-family: var(--mono); font-weight: 600; font-size: 15px; }
.acc-top .nick { color: var(--faint); font-size: 12.5px; }
.acc-bal { font-family: var(--mono); font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.acc-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-size: 12px; color: var(--faint); }
.acc-meta b { display: block; color: var(--text); font-family: var(--mono); font-weight: 500; font-size: 13px; }
.acc-actions { display: flex; gap: 8px; }
.acc-actions .btn { flex: 1; }
.acc-new {
    border: 1.5px dashed var(--line); background: transparent; border-radius: var(--radius); min-height: 200px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); cursor: pointer; font: 600 14px var(--font);
}
.acc-new:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); display: none; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal-back.open { display: flex; }
.modal { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; max-height: 92vh; overflow-y: auto; }
.modal .card-head { padding: 18px 22px; }
.modal .card-body { padding: 22px; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.choice label { cursor: pointer; }
.choice input { display: none; }
.choice span {
    display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; font-weight: 700;
}
.choice span small { font-weight: 500; color: var(--faint); font-size: 12px; }
.choice input:checked + span { border-color: var(--brand); background: var(--brand-soft); }

/* ---------- Market mini list (dashboard) ---------- */
.mkt-row { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--line-soft); }
.mkt-row:last-child { border-bottom: 0; }
.sym-badge {
    width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none;
    background: var(--raised); color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .02em;
}
.sym-badge.metals { color: var(--brand); background: var(--brand-soft); }
.sym-badge.crypto { color: #c084fc; background: rgba(192, 132, 252, .1); }
.sym-badge.forex { color: var(--info); background: rgba(96, 165, 250, .1); }
.sym-badge.indices { color: var(--up); background: var(--up-soft); }
.sym-badge.energy { color: #fb923c; background: rgba(251, 146, 60, .1); }
.mkt-row .name { flex: 1; min-width: 0; }
.mkt-row .name b { display: block; font-size: 13.5px; }
.mkt-row .name small { color: var(--faint); font-size: 12px; }

/* <x-bar-chart> */
.bchart { position: relative; }
.bchart svg { display: block; width: 100%; height: auto; overflow: visible; }
.bchart .grid { stroke: #1f2226; stroke-width: 1; }
.bchart .zero { stroke: #3a3d43; stroke-width: 1; }
.bchart .axis { fill: var(--faint); font: 11px var(--mono); }
.bchart .hit { fill: transparent; cursor: default; }
.bchart .hit.on { fill: rgba(255, 255, 255, .035); }
.bchart-legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.bchart-legend span, .bchart-tip div { display: inline-flex; align-items: center; gap: 7px; }
.bchart-legend i, .bchart-tip i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.bchart-tip {
    position: absolute; pointer-events: none; z-index: 5; min-width: 170px; padding: 10px 12px;
    background: var(--raised); border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 10px 28px rgba(0, 0, 0, .45); font-size: 12.5px;
}
.bchart-tip b { display: block; margin-bottom: 6px; }
.bchart-tip div { display: flex; width: 100%; }
.bchart-tip span { color: var(--muted); flex: 1; }
.bchart-tip strong { font-family: var(--mono); font-weight: 500; }
.bchart-table { margin-top: 10px; font-size: 12.5px; color: var(--faint); }
.bchart-table summary { cursor: pointer; width: max-content; }
.bchart-table .table-wrap { max-height: 260px; overflow-y: auto; margin-top: 8px; }

.pnl-sum { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; font-size: 12.5px; }
.pnl-sum b { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }

/* bars (admin chart) */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 10px; }
.bars div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars i { display: block; width: 100%; border-radius: 4px 4px 1px 1px; background: var(--brand); opacity: .85; min-height: 2px; }
.bars span { font-size: 10px; color: var(--faint); }

.method-box { background: var(--bg); border: 1px dashed var(--line); border-radius: 8px; padding: 14px; white-space: pre-line; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; font-size: 13.5px; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }

/* ---------- Trading terminal ---------- */
body.is-terminal .content { padding: 0; display: flex; flex-direction: column; }
.term-bar {
    display: flex; align-items: center; gap: 22px; padding: 10px 18px; border-bottom: 1px solid var(--line-soft); background: var(--surface); flex-wrap: wrap;
}
.term-bar .acct-select { width: auto; min-width: 270px; height: 36px; }
.term-figs { display: flex; gap: 24px; flex-wrap: wrap; }
.term-figs div { font-size: 11px; color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.term-figs b { display: block; font-family: var(--mono); font-size: 14px; color: var(--text); text-transform: none; letter-spacing: 0; font-weight: 500; }
.term-clock { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--faint); display: flex; align-items: center; gap: 8px; }
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 3px var(--up-soft); }
.dot-live.off { background: var(--down); box-shadow: 0 0 0 3px var(--down-soft); }
/* Trading sessions (Sydney / Tokyo / London / New York) — open ones light up */
.sessions { display: flex; gap: 6px; flex-wrap: wrap; margin-right: 10px; }
.sess { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border: 1px solid var(--line-soft); border-radius: 999px; font-size: 11px; color: var(--faint); cursor: default; }
.sess i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); opacity: .5; }
.sess.on { color: var(--text); border-color: var(--up-soft); }
.sess.on i { background: var(--up); opacity: 1; }
.sess-note { font-size: 11px; color: var(--down); align-self: center; }
@media (max-width: 640px) { .sessions { display: none; } }

.term-root { display: flex; flex-direction: column; flex: 1; min-height: 0; background: var(--bg); }
.term {
    display: grid; grid-template-columns: 290px minmax(0, 1fr) 280px; grid-template-rows: minmax(0, 1fr) 230px;
    flex: 1; min-height: 0;
}
/* Desktop: the terminal fills the window exactly, so positions are always on screen */
@media (min-width: 1025px) {
    body.is-terminal .main { height: 100vh; }
    body.is-terminal .content { min-height: 0; overflow: hidden; }
}
.term-root:fullscreen { width: 100vw; height: 100vh; overflow: auto; }
.term-root.pseudo-full { position: fixed; inset: 0; z-index: 90; }
.term-root .when-full { display: none; }
.term-root:fullscreen .when-full, .term-root.pseudo-full .when-full { display: block; }
.term-root:fullscreen .when-normal, .term-root.pseudo-full .when-normal { display: none; }
.term.focus { grid-template-columns: minmax(0, 1fr) 280px; grid-template-rows: minmax(0, 1fr); }
.term.focus .watch, .term.focus .bottom { display: none; }
.chart-head .btn.on { color: var(--brand); background: var(--brand-soft); }
.term > section { border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); min-height: 0; display: flex; flex-direction: column; }
.term .watch { grid-row: 1 / 3; }
.term .ticket { border-right: 0; }
.term .bottom { grid-column: 2 / 4; border-right: 0; border-bottom: 0; }

.watch-head { padding: 12px; border-bottom: 1px solid var(--line-soft); display: grid; gap: 10px; }
.watch-cats { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.watch-cats button {
    border: 0; background: none; color: var(--faint); font: 700 12px var(--font); padding: 5px 9px; border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.watch-cats button.on { background: var(--raised); color: var(--text); }
.watch-list { overflow-y: auto; flex: 1; }
.wl-row {
    display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--line-soft);
    border-left: 2px solid transparent;
}
.wl-row:hover { background: var(--raised); }
.wl-row.sel { background: var(--raised); border-left-color: var(--brand); }
.wl-row .c { font-weight: 700; font-size: 13.5px; }
.wl-row .n { font-size: 11.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-row .p { font-family: var(--mono); font-size: 13.5px; text-align: right; transition: color .3s; }
.wl-row .ch { font-family: var(--mono); font-size: 11.5px; text-align: right; }
.flash-up { color: var(--up) !important; }
.flash-down { color: var(--down) !important; }

.chart-head { display: flex; align-items: center; gap: 14px; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.chart-head .sym { font-size: 16px; font-weight: 800; }
.chart-head .ohlc { font-family: var(--mono); font-size: 12px; color: var(--faint); display: flex; gap: 10px; }
.chart-head .ohlc b { color: var(--muted); font-weight: 500; }
.chart-head .spacer { flex: 1; }
.chart-box { flex: 1; position: relative; min-height: 0; }
.chart-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.ticket-inner { padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.ticket h4 { font-size: 15px; }
.ticket .spread { font-size: 12px; color: var(--faint); font-family: var(--mono); }
.side-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.side-btn {
    border: 1px solid; border-radius: 9px; padding: 10px 12px; cursor: pointer; text-align: left; font: 700 12px var(--font);
    display: flex; flex-direction: column; gap: 2px; transition: transform .08s, background .15s;
}
.side-btn:active { transform: scale(.98); }
.side-btn .px { font-family: var(--mono); font-size: 17px; font-weight: 600; }
.side-btn.sell { background: var(--down-soft); border-color: rgba(239, 79, 90, .35); color: var(--down); }
.side-btn.buy { background: rgba(59, 130, 246, .12); border-color: rgba(59, 130, 246, .38); color: #7cb0ff; }
.side-btn.sell:hover { background: rgba(239, 79, 90, .2); }
.side-btn.buy:hover { background: rgba(59, 130, 246, .2); }
.side-btn[disabled] { opacity: .5; pointer-events: none; }
.stepper { display: flex; }
.stepper button { width: 38px; border: 1px solid var(--line); background: var(--raised); color: var(--text); cursor: pointer; font: 700 16px var(--font); }
.stepper button:first-child { border-radius: 7px 0 0 7px; }
.stepper button:last-child { border-radius: 0 7px 7px 0; }
.stepper .input { border-radius: 0; text-align: center; border-left: 0; border-right: 0; font-family: var(--mono); }
.quick-lots { display: flex; gap: 6px; }
.quick-lots button { flex: 1; height: 26px; border: 1px solid var(--line-soft); background: none; color: var(--muted); border-radius: 6px; cursor: pointer; font: 600 11.5px var(--mono); }
.quick-lots button:hover { border-color: var(--brand); color: var(--brand); }
.ticket-info { font-size: 12px; color: var(--faint); display: grid; gap: 5px; padding-top: 4px; border-top: 1px dashed var(--line); }
.ticket-info div { display: flex; justify-content: space-between; }
.ticket-info b { color: var(--muted); font-family: var(--mono); font-weight: 500; }

.bottom-head { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--line-soft); }
.bottom-body { overflow: auto; flex: 1; }
.bottom-body .table td, .bottom-body .table th { padding: 8px 14px; font-size: 12.5px; }
.bottom-body .table td.num { font-family: var(--mono); }

/* Settings & APIs */
.api-row { display: flex; gap: 20px; align-items: flex-start; padding: 18px 20px; border-bottom: 1px solid var(--line-soft); }
.api-row:last-child { border-bottom: 0; }
.api-row.is-off .api-main { opacity: .6; }
.api-main { flex: 1; min-width: 0; }
.api-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.api-url { display: inline-block; margin-top: 6px; font: 12px var(--mono); color: var(--muted); background: var(--bg); padding: 3px 8px; border-radius: 5px; }
.api-kv { display: grid; grid-template-columns: 80px 1fr; gap: 4px 12px; margin: 10px 0 0; font-size: 12.5px; }
.api-kv dt { color: var(--faint); }
.api-kv dd { margin: 0; color: var(--muted); }
.api-test { font-size: 12.5px; margin-top: 8px; font-family: var(--mono); }
.api-test:empty { display: none; }
.api-actions { display: flex; align-items: center; gap: 12px; }
.switch {
    position: relative; width: 44px; height: 24px; border-radius: 99px; border: 1px solid var(--line); background: var(--raised);
    cursor: pointer; padding: 0; transition: background .2s, border-color .2s;
}
.switch span { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.switch.on { background: var(--brand); border-color: var(--brand); }
.switch.on span { transform: translateX(20px); background: var(--brand-ink); }
.switch:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (max-width: 560px) { .api-row { flex-direction: column; } .api-kv { grid-template-columns: 1fr; } }
.settings-tabs { overflow-x: auto; scrollbar-width: none; }
.settings-tabs a { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.tab-count { font: 600 11px var(--mono); padding: 1px 6px; border-radius: 99px; background: var(--raised); color: var(--faint); }
.tab-count.on { background: var(--up-soft); color: var(--up); }
.settings-intro { max-width: 820px; margin-bottom: 18px; font-size: 13.5px; }
.api-card.is-off .api-main { opacity: .75; }
.api-callback {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 20px 4px; padding: 10px 12px;
    background: var(--bg); border: 1px dashed var(--line); border-radius: 8px; font-size: 12.5px;
}
.api-callback code { font: 12px var(--mono); color: var(--brand); word-break: break-all; flex: 1; }
.api-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 16px; padding: 16px 20px 18px; border-top: 1px solid var(--line-soft); }
.api-fields .field { margin-bottom: 12px; }
.api-fields .field.wide { grid-column: 1 / -1; }
.api-save { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* Account-to-account transfer */
.xfer { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: end; }
.xfer .field { margin-bottom: 16px; min-width: 0; }
.xfer-swap { width: 42px; height: 42px; margin-bottom: 16px; border-radius: 50%; border: 1px solid var(--line); background: var(--raised); color: var(--brand); display: grid; place-items: center; cursor: pointer; }
.xfer-swap:hover { border-color: var(--brand); }
.amount-row { display: flex; gap: 8px; }
.amount-row .btn { height: 42px; }
.xfer-preview { display: grid; gap: 6px; margin-bottom: 18px; padding: 12px 14px; border-radius: 10px; background: var(--bg); border: 1px dashed var(--line); font-size: 13px; }
.xfer-preview:empty { display: none; }
.xfer-preview div { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.xfer-preview span { color: var(--faint); font-family: var(--mono); }
.xfer-preview.over { border-color: rgba(239, 79, 90, .5); }
.xfer-preview p { color: var(--down); font-size: 12.5px; }
@media (max-width: 560px) { .xfer { grid-template-columns: minmax(0, 1fr); } .xfer-swap { justify-self: center; margin: -6px 0 6px; transform: rotate(90deg); } }

/* Login banner popup */
.promo-back {
    position: fixed; inset: 0; z-index: 160; display: grid; place-items: center;
    padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    background: rgba(5, 6, 8, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    animation: promo-fade .25s ease-out; overflow-y: auto;
}
.promo {
    position: relative; width: min(640px, calc(100% - 20px)); margin-block: 18px;
    background: var(--surface); border: 1px solid rgba(245, 197, 24, .28); border-radius: 20px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .03);
    animation: promo-in .32s cubic-bezier(.2, .9, .25, 1.1);
}
.promo-img { display: block; line-height: 0; }
.promo-img img { width: 100%; height: auto; display: block; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 19px 19px 0 0; }
.promo-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; padding: 16px 18px 18px; }
.promo-actions .btn { height: 44px; padding: 0 20px; }
/* Sits on the popup's corner, outside the artwork, so it never covers part of an uploaded banner */
.promo-x {
    position: absolute; top: -14px; right: -14px; z-index: 1; width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
    display: grid; place-items: center; background: var(--raised); color: var(--text);
    border: 1px solid rgba(245, 197, 24, .4); box-shadow: 0 8px 20px rgba(0, 0, 0, .5);
}
.promo-x:hover { background: var(--hover); border-color: var(--brand); }
.promo-x:focus-visible, .promo-actions .btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.promo-back.closing { animation: promo-fade .2s ease-in reverse forwards; }
@keyframes promo-fade { from { opacity: 0; } }
@keyframes promo-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@media (prefers-reduced-motion: reduce) { .promo-back, .promo { animation: none; } }
.banner-card { overflow: hidden; }
.banner-card.is-live { border-color: rgba(46, 189, 133, .4); }
.banner-thumb { aspect-ratio: 16 / 9; background: var(--bg); line-height: 0; }
.banner-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Client access switches (admin) */
.access-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 16px; }
.access-group { margin: 0; padding: 12px; border: 1px solid var(--line-soft); border-radius: 12px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.access-group legend { padding: 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.access-row {
    position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer;
    background: var(--bg); border: 1px solid transparent; transition: border-color .15s, background .15s;
}
.access-row:hover { border-color: var(--line); }
.access-row > .ico { color: var(--faint); flex: none; }
.access-row.on > .ico { color: var(--brand); }
.access-text { flex: 1; min-width: 0; display: grid; }
.access-text b { font-size: 13.5px; }
.access-text small { font-size: 12px; color: var(--faint); }
.access-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle { position: relative; width: 40px; height: 22px; flex: none; border-radius: 99px; background: var(--raised); border: 1px solid var(--line); transition: background .18s, border-color .18s; }
.toggle i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .18s, background .18s; }
.access-row input:checked + .toggle { background: var(--brand); border-color: var(--brand); }
.access-row input:checked + .toggle i { transform: translateX(18px); background: var(--brand-ink); }
.access-row input:focus-visible + .toggle { outline: 2px solid var(--brand); outline-offset: 2px; }
.access-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }

/* KYC */
.kyc-banner {
    display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 16px 18px; margin-bottom: 20px;
    background: var(--brand-soft); border: 1px solid rgba(245, 197, 24, .25); border-radius: var(--radius); color: var(--brand);
}
.kyc-banner > div { flex: 1; min-width: 220px; }
.kyc-banner b { color: var(--text); }
.kyc-hero { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 22px; }
.kyc-hero-icon { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; }
.kyc-steps { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.kyc-steps li { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 99px; background: var(--bg); color: var(--faint); font-size: 12.5px; font-weight: 700; }
.kyc-steps span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--raised); font-size: 11px; }
.kyc-steps li.now { color: var(--brand); }
.kyc-steps li.now span { background: var(--brand); color: var(--brand-ink); }
.kyc-steps li.done { color: var(--up); }
.kyc-steps li.done span { background: var(--up); color: #062b1c; }
.kyc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.kyc-doc { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.kyc-doc-head { display: flex; gap: 12px; align-items: flex-start; }
.kyc-doc-head .ico { color: var(--brand); margin-top: 2px; }
.kyc-file { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg); border-radius: 8px; font-size: 13px; }
.kyc-file span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kyc-file:hover { color: var(--brand); }
.drop {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 12px; text-align: center; cursor: pointer;
    border: 1.5px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: 13px; font-weight: 600; transition: border-color .15s, color .15s;
}
.drop:hover, .drop:focus-within { border-color: var(--brand); color: var(--brand); }
.drop small { display: block; font-weight: 500; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.kyc-preview {
    display: grid; place-items: center; height: 190px; border-radius: 10px; overflow: hidden; background: var(--bg);
    border: 1px solid var(--line-soft); color: var(--muted); text-align: center; font-size: 13px;
}
.kyc-preview img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.kyc-preview:hover img { transform: scale(1.03); }
.kyc-preview.empty { color: var(--faint); border-style: dashed; }
.kyc-review { display: grid; gap: 8px; }
.inline-verify { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.inline-verify .input { flex: 1; min-width: 220px; }
.upload-for { border-top: 1px dashed var(--line); padding-top: 10px; font-size: 12.5px; color: var(--muted); }
.upload-for summary { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.upload-for summary:hover { color: var(--brand); }

/* Live selfie camera */
.cam-modal { max-width: 520px; }
.cam-stage { position: relative; aspect-ratio: 4 / 3; background: #000; border-radius: 12px; overflow: hidden; }
.cam-stage video, .cam-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-stage video { transform: scaleX(-1); } /* mirror like a real mirror; the saved photo is not mirrored */
.cam-guide { position: absolute; inset: 0; pointer-events: none; }
.cam-guide::before {
    content: ""; position: absolute; left: 14%; top: 10%; width: 38%; height: 70%; border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, .7); box-shadow: 0 0 0 999px rgba(0, 0, 0, .28);
}
.cam-guide::after {
    content: "ID"; position: absolute; right: 10%; top: 34%; width: 30%; height: 30%; border-radius: 8px;
    border: 2px dashed rgba(245, 197, 24, .85); color: rgba(245, 197, 24, .85); font: 700 13px var(--font);
    display: grid; place-items: center;
}
.cam-stage.shot .cam-guide { display: none; }
.cam-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.cam-flash.go { animation: cam-flash .35s ease-out; }
@keyframes cam-flash { from { opacity: .9; } to { opacity: 0; } }
.cam-count { position: absolute; inset: 0; display: grid; place-items: center; font: 800 72px var(--font); color: #fff; text-shadow: 0 4px 20px rgba(0, 0, 0, .6); pointer-events: none; }
.cam-msg { padding: 30px 20px; text-align: center; color: var(--muted); display: grid; gap: 10px; place-items: center; height: 100%; }
.cam-actions { display: flex; gap: 10px; margin-top: 14px; }
.cam-actions .btn { flex: 1; height: 42px; }
.selfie-preview { width: 100%; max-height: 180px; object-fit: cover; border-radius: 10px; display: block; }

/* News */
.news-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--faint); }
.news-cat-forex { background: rgba(96, 165, 250, .12); color: var(--info); }
.news-cat-crypto { background: rgba(192, 132, 252, .12); color: #c084fc; }
.news-cat-markets { background: var(--brand-soft); color: var(--brand); }
.news-lead { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); overflow: hidden; margin-bottom: 20px; transition: border-color .15s; }
.news-lead:hover, .news-card:hover { border-color: #3a3d43; }
.news-lead img { width: 100%; height: 100%; min-height: 240px; max-height: 340px; object-fit: cover; display: block; }
.news-lead-body { padding: 26px; display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.news-lead:not(:has(img)) { grid-template-columns: 1fr; }
.news-lead h2 { font-size: 22px; line-height: 1.3; }
.news-read { color: var(--brand); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.news-card { display: flex; flex-direction: column; overflow: hidden; transition: border-color .15s, transform .15s; }
.news-card:hover { transform: translateY(-2px); }
.news-thumb { aspect-ratio: 16 / 8; overflow: hidden; background: var(--raised); }
.news-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.news-card:hover .news-thumb img { transform: scale(1.04); }
.news-card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.news-card h3 { font-size: 15px; line-height: 1.35; }
.news-card p { font-size: 12.5px; }
.news-time { margin-top: auto; font-size: 12px; display: flex; align-items: center; gap: 6px; }
@media (max-width: 760px) { .news-lead { grid-template-columns: 1fr; } .news-lead img { max-height: 200px; min-height: 0; } }

/* Admin → Project details */
.brand-logos { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 22px; }
.brand-logo { display: flex; flex-direction: column; gap: 12px; }
.brand-preview { height: 110px; border-radius: 10px; border: 1px dashed var(--line-soft); display: flex; align-items: center; justify-content: center; padding: 16px;
    background: #0b0c0e repeating-conic-gradient(#15171a 0 25%, transparent 0 50%) 0 0 / 18px 18px; }
.brand-preview img { max-height: 100%; max-width: 100%; object-fit: contain; }
.brand-preview.mark img { height: 64px; }
.support-contact { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; padding: 14px 18px; margin-bottom: 18px; font-size: 13px; }
.support-contact a, .support-contact span { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); }
.support-contact a:hover { color: var(--brand); }
@media (max-width: 760px) { .brand-logos { grid-template-columns: 1fr; } }

/* Research & learning pages (provider iframe) */
.insight-frame { overflow: hidden; min-height: 520px; position: relative; background: #fff; }
.insight-frame iframe { display: block; width: 100%; min-height: 520px; border: 0; }
.insight-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 13px; background: var(--surface); }
.insight-frame:has(iframe) .insight-loading { display: none; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-soft); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Online payment options on the deposit page */
.gw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 16px; }
.gw-grid label { cursor: pointer; }
.gw-grid input { position: absolute; opacity: 0; pointer-events: none; }
.gw-grid span { display: flex; flex-direction: column; gap: 2px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; font-weight: 800; font-size: 15px; transition: border-color .15s, background .15s; }
.gw-grid span small { font-weight: 500; font-size: 12px; color: var(--faint); }
.gw-grid input:checked + span { border-color: var(--brand); background: var(--brand-soft); }
.gw-grid input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.gw-quote { font-size: 12.5px; color: var(--muted); margin: -6px 0 14px; }

/* Two-factor authentication */
.tfa-hero { display: flex; gap: 16px; align-items: center; }
.tfa-hero b { font-size: 15px; }
.tfa-badge { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; flex: none; background: var(--raised); color: var(--muted); }
.tfa-badge.on { background: var(--up-soft); color: var(--up); }
.tfa-box { display: grid; gap: 8px; padding: 16px; background: var(--bg); border: 1px solid var(--line-soft); border-radius: 10px; align-content: start; }
.tfa-box p { font-size: 12.5px; }
.tfa-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.tfa-steps li { display: flex; gap: 14px; }
.step-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--brand); color: var(--brand-ink); font-weight: 800; font-size: 13px; }
.tfa-qr-row { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.tfa-qr { background: #fff; padding: 10px; border-radius: 12px; line-height: 0; }
.tfa-qr svg { width: 180px; height: 180px; display: block; }
.tfa-key { display: inline-block; margin-top: 6px; padding: 8px 12px; border-radius: 8px; background: var(--bg); border: 1px dashed var(--line); font: 600 14px var(--mono); letter-spacing: .06em; color: var(--brand); word-break: break-all; }
.tfa-confirm { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.otp { display: flex; gap: 8px; justify-content: center; margin-bottom: 18px; }
.tfa-confirm .otp { margin: 0; }
.otp-box {
    width: 46px; height: 54px; text-align: center; font: 600 22px var(--mono); color: var(--text);
    background: var(--bg); border: 1px solid var(--line); border-radius: 10px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.otp-box:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.codes-card { border-color: rgba(245, 158, 11, .35); }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.codes code { padding: 8px 10px; background: var(--bg); border-radius: 7px; font: 600 13.5px var(--mono); text-align: center; letter-spacing: .04em; }
@media (max-width: 420px) { .otp-box { width: 40px; height: 48px; font-size: 19px; } .otp { gap: 6px; } }

/* Support tickets */
.support-empty { display: grid; place-items: center; text-align: center; gap: 10px; padding: 50px 20px; }
.support-empty .ico { color: var(--brand); }
.ticket-list { overflow: hidden; }
.ticket-row { display: flex; gap: 14px; align-items: center; padding: 15px 18px; border-bottom: 1px solid var(--line-soft); transition: background .15s; }
.ticket-row:hover { background: rgba(255, 255, 255, .02); }
.ticket-row.unread { background: rgba(245, 197, 24, .04); }
.ticket-row.unread b { color: var(--text); }
.ticket-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--raised); color: var(--muted); }
.ticket-icon.cat-deposit, .ticket-icon.cat-withdrawal { color: var(--up); background: var(--up-soft); }
.ticket-icon.cat-kyc { color: var(--brand); background: var(--brand-soft); }
.ticket-icon.cat-trading { color: var(--info); background: rgba(96, 165, 250, .12); }
.ticket-icon.cat-technical { color: #c084fc; background: rgba(192, 132, 252, .12); }
.ticket-main { flex: 1; min-width: 0; }
.ticket-top { display: flex; align-items: center; gap: 8px; }
.ticket-preview { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.dot-new { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); margin-left: 6px; vertical-align: middle; }
.row-unread td { background: rgba(245, 197, 24, .035); }
.tag-ticket-open { background: rgba(245, 158, 11, .13); color: #f5a524; }
.tag-ticket-answered { background: rgba(96, 165, 250, .12); color: var(--info); }
.tag-ticket-closed { background: var(--raised); color: var(--faint); }
.tag-prio-high { background: var(--down-soft); color: var(--down); }
.tag-prio-normal { background: var(--raised); color: var(--muted); }
.tag-prio-low { background: var(--raised); color: var(--faint); }
.ticket-page { display: grid; gap: 16px; min-width: 0; }
.ticket-head { display: flex; gap: 14px; align-items: center; padding: 18px 20px; flex-wrap: wrap; }
.ticket-head h2 { font-size: 18px; }
.ticket-admin { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .ticket-admin { grid-template-columns: 1fr; } }

/* Chat */
.chat { display: flex; flex-direction: column; height: min(68vh, 680px); min-height: 420px; }
.chat-log { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.chat-day { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 11.5px; font-weight: 700; margin: 6px 0; }
.chat-day::before, .chat-day::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.msg { display: flex; gap: 10px; align-items: flex-end; max-width: 78%; animation: msg-in .18s ease-out; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--raised); color: var(--muted); font-weight: 800; font-size: 12px; }
.msg.staff .msg-avatar { background: var(--brand-soft); color: var(--brand); }
.msg-bubble { padding: 10px 14px 8px; border-radius: 16px; background: var(--raised); border: 1px solid var(--line-soft); min-width: 90px; }
.msg.theirs .msg-bubble { border-bottom-left-radius: 5px; }
.msg.mine .msg-bubble { background: #2a2408; border-color: rgba(245, 197, 24, .25); border-bottom-right-radius: 5px; }
.msg-author { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 4px; color: var(--muted); }
.msg-text { font-size: 14px; line-height: 1.5; white-space: normal; word-wrap: break-word; overflow-wrap: anywhere; }
.msg-text a { color: var(--brand); text-decoration: underline; }
.msg-time { display: block; text-align: right; font: 11px var(--mono); color: var(--faint); margin-top: 4px; }
.msg-seen { font-style: normal; color: var(--up); }
.chat-img { display: block; margin-top: 6px; }
.chat-img img { max-width: 260px; max-height: 220px; border-radius: 10px; display: block; }
.chat-doc { display: inline-block; margin-top: 6px; padding: 7px 10px; border-radius: 8px; background: var(--bg); font-size: 13px; color: var(--brand); }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } }
.chat-compose { border-top: 1px solid var(--line-soft); padding: 12px 14px 10px; }
.chat-row { display: flex; gap: 10px; align-items: flex-end; }
.chat-row textarea {
    flex: 1; resize: none; min-height: 44px; max-height: 180px; padding: 11px 14px; border-radius: 12px;
    background: var(--bg); border: 1px solid var(--line); color: var(--text); font: 14px/1.45 var(--font); outline: none;
}
.chat-row textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.chat-attach { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--muted); cursor: pointer; flex: none; position: relative; }
.chat-attach:hover { background: var(--raised); color: var(--text); }
.chat-attach input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.chat-send { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; cursor: pointer; flex: none; transition: transform .1s, background .15s; }
.chat-send:hover { background: #ffd43b; }
.chat-send:active { transform: scale(.95); }
.chat-send[disabled] { opacity: .5; }
.chat-file { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 6px 6px 6px 10px; background: var(--bg); border-radius: 8px; font-size: 12.5px; color: var(--muted); width: max-content; max-width: 100%; }
.chat-hint { font-size: 11.5px; margin-top: 6px; }
@media (max-width: 640px) { .msg { max-width: 92%; } .chat { height: 72vh; } }

/* Live trades page */
.acc-strip { display: flex; gap: 10px; flex-wrap: wrap; }
.acc-strip:empty { display: none; }
.acc-chip {
    flex-wrap: wrap; max-width: 100%;
    display: inline-flex; align-items: center; gap: 10px; padding: 9px 14px; font-size: 12.5px;
    background: var(--surface); border: 1px solid var(--line-soft); border-radius: 9px; transition: border-color .15s;
}
.acc-chip:hover { border-color: var(--brand); }
.acc-chip b { font-weight: 500; }
td[data-cur] { transition: color .3s; }

/* Trade popup */
.tm-back { z-index: 150; }
.tmodal { max-width: 400px; padding: 22px; animation: tm-in .16s ease-out; }
@keyframes tm-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.tm-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.tm-head h3 { font-size: 17px; }
.tm-head p { font-size: 13px; margin-top: 2px; }
.tm-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.tm-icon.buy { background: rgba(59, 130, 246, .14); color: #7cb0ff; }
.tm-icon.sell, .tm-icon.err { background: var(--down-soft); color: var(--down); }
.tm-icon.ok { background: var(--up-soft); color: var(--up); }
.tm-icon.close { background: var(--brand-soft); color: var(--brand); }
.tm-rows { background: var(--bg); border: 1px solid var(--line-soft); border-radius: 9px; padding: 4px 14px; margin-bottom: 18px; }
.tm-rows:empty { display: none; }
.tm-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 13px; border-bottom: 1px dashed var(--line-soft); }
.tm-row:last-child { border-bottom: 0; }
.tm-row span { color: var(--faint); }
.tm-row b { font-family: var(--mono); font-weight: 500; }
.tm-row.big b { font-size: 16px; font-weight: 600; }
.tm-actions { display: flex; gap: 10px; }
.tm-actions .btn { flex: 1; height: 42px; }
.btn-buy { background: #2f6fe0; border-color: #2f6fe0; color: #fff; }
.btn-buy:hover { background: #3b82f6; border-color: #3b82f6; }
.btn-sell { background: #d93b46; border-color: #d93b46; color: #fff; }
.btn-sell:hover { background: var(--down); border-color: var(--down); }

.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast {
    min-width: 260px; max-width: 360px; padding: 12px 14px; border-radius: 9px; font-size: 13px; font-weight: 600;
    background: var(--raised); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
    animation: toast-in .2s ease-out;
}
.toast.ok { border-left: 3px solid var(--up); }
.toast.err { border-left: 3px solid var(--down); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
    .term { grid-template-columns: 250px minmax(0, 1fr) 260px; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
    /* Phones + tablets: no sidebar, no top menu — the floating bottom bar takes over */
    .sidebar, .topbar { display: none; }
    .main { margin-left: 0; }
    .mobile-head { display: flex; }
    body.is-terminal .mobile-head { display: none; }
    .content { padding-top: calc(18px + env(safe-area-inset-top, 0px)); }
    body.is-terminal .content { padding-top: env(safe-area-inset-top, 0px); }
    .bottom-nav { display: flex; }
    .content, body.is-terminal .content { padding-bottom: var(--bn-space); }
    .toasts { bottom: calc(var(--bn-space) - 10px); }
    .cols, .cols-even, .ticket-admin { grid-template-columns: minmax(0, 1fr); }
    .term { display: flex; flex-direction: column; height: auto; }
    .term .watch { max-height: 300px; }
    .term .chart { height: 420px; }
    .term > section { border-right: 0; }
}
@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; }
    .auth-side { display: none; }
    .glass-body { padding: 22px 20px 24px; }
    .content { padding: calc(18px + env(safe-area-inset-top, 0px)) 16px var(--bn-space); }
    .who .who-text { display: none; }
}
@media (max-width: 560px) {
    .card-head { flex-wrap: wrap; }
    .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat .v { font-size: 18px; }
    .grid-2 { grid-template-columns: 1fr; }
    .term-bar .acct-select { width: 100%; }
    .kv { grid-template-columns: 1fr; gap: 2px; }
    .kv dd { margin-bottom: 8px; }
}

/* ---------- Live prices (live-prices.js) ---------- */
@keyframes lp-up { from { background: rgba(46, 189, 133, .28); } to { background: transparent; } }
@keyframes lp-down { from { background: rgba(255, 138, 61, .3); } to { background: transparent; } }
.lp-flash-up { animation: lp-up .7s ease-out; border-radius: 4px; }
.lp-flash-down { animation: lp-down .7s ease-out; border-radius: 4px; }

/* ---------- Animate on scroll (aos-lite.js) ---------- */
.aos-on [data-aos] { opacity: 0; transition: opacity .55s ease, transform .55s cubic-bezier(.2, .7, .2, 1); will-change: opacity, transform; }
.aos-on [data-aos="fade-up"] { transform: translateY(18px); }
.aos-on [data-aos="fade-left"] { transform: translateX(18px); }
.aos-on [data-aos="zoom-in"] { transform: scale(.96); }
.aos-on [data-aos].aos-in { opacity: 1; transform: none; }

/* ---------- Market analysis ---------- */
.ma { display: flex; flex-direction: column; gap: 18px; }
/* Chat and side panel share one fixed-height row: the chat fills it, the side panel scrolls inside it — no empty gap under the chat */
.ma-top { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; height: min(780px, calc(100vh - 120px)); min-height: 600px; }
.ma-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; min-height: 0; overflow-y: auto; padding-right: 2px; }
.ma-side > .card { flex: none; }
.ma-av { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font: 700 13px var(--font); }

.ma-chat { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.ma-chat .card-head small { display: block; font-size: 12px; }
.ma-msgs { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.ma-empty { margin: auto 0; text-align: center; padding: 10px 0; }
.ma-empty h4 { font-size: 20px; margin-bottom: 6px; }
.ma-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; text-align: left; }
.ma-tiles button { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--raised); color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.ma-tiles button:hover { border-color: var(--brand); background: var(--hover); }
.ma-tiles .ico { grid-row: span 2; color: var(--brand); margin-top: 2px; }
.ma-tiles small { color: var(--faint); font-size: 12px; }

.ma-msg { display: flex; gap: 10px; align-items: flex-start; }
.ma-msg.me { justify-content: flex-end; }
.ma-bubble { max-width: 78%; padding: 10px 14px; border-radius: 14px 14px 4px 14px; background: var(--brand); color: var(--brand-ink); font-weight: 500; overflow-wrap: anywhere; }
.ma-body { min-width: 0; flex: 1; }
.ma-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; margin-bottom: 4px; }
.ma-meta .tag { height: 18px; font-size: 10.5px; }
.ma-copy { height: 24px; padding: 0 8px; font-size: 11.5px; margin-left: auto; }
.ma-text { background: var(--raised); border: 1px solid var(--line-soft); border-radius: 4px 14px 14px 14px; padding: 12px 14px; overflow-wrap: anywhere; }
.ma-text p + p, .ma-text p + .ma-blk, .ma-blk + .ma-blk { margin-top: 6px; }
.ma-text ul, .ma-text ol { margin: 4px 0; padding-left: 20px; }
.ma-text li + li { margin-top: 3px; }
@keyframes ma-blk { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ma-blk.in { animation: ma-blk .4s ease both; }
.ma-typing { display: flex; gap: 4px; padding: 14px 16px; background: var(--raised); border-radius: 4px 14px 14px 14px; }
.ma-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: ma-dot 1.1s infinite ease-in-out; }
.ma-typing i:nth-child(2) { animation-delay: .15s; }
.ma-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ma-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

.ma-chips { display: flex; gap: 6px; padding: 0 20px 10px; overflow-x: auto; }
.ma-chips button { flex: none; height: 28px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--muted); font: 600 12px var(--font); cursor: pointer; }
.ma-chips button:hover { color: var(--text); border-color: var(--brand); }
.ma-input { padding: 12px 20px 16px; border-top: 1px solid var(--line-soft); }
.ma-input textarea { width: 100%; resize: none; min-height: 44px; max-height: 160px; line-height: 1.45; padding-top: 11px; }
.ma-input-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-size: 12px; }

.ma-ideas { display: flex; flex-direction: column; }
.ma-idea { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; padding: 10px 20px; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ma-idea:hover { background: var(--hover); }
.ma-idea:last-child { border-bottom: 0; }
.ma-idea .ma-lv, .ma-idea small { grid-column: 2; }
.ma-lv { font-size: 12.5px; }
.ma-rules { margin: 0; padding: 14px 20px 16px 38px; display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: var(--muted); }
.ma-rules b { color: var(--text); }

/* Quick start */
.ma-hero { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 20px; align-items: center; padding: 22px 24px; border-radius: var(--radius);
    background: radial-gradient(120% 140% at 0% 0%, rgba(245, 197, 24, .12), transparent 55%), var(--surface); border: 1px solid var(--line-soft); }
.ma-hero h2 { font-size: 22px; letter-spacing: -.02em; }
.ma-hero-text p { margin-top: 6px; font-size: 13.5px; }
.ma-notice { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
    background: rgba(245, 158, 11, .1); border: 1px solid rgba(245, 158, 11, .3); color: #f5c87a; font-size: 12.5px; line-height: 1.45; }
.ma-notice .ico { color: #f59e0b; margin-top: 1px; }
.ma-notice b { color: #fbbf24; }
.ma-hero-mood { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; }
.ma-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ma-q { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px; min-height: 118px; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--raised); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: transform .15s, border-color .15s, background .15s; }
.ma-q:hover { transform: translateY(-2px); border-color: var(--brand); background: var(--hover); }
.ma-q:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ma-q b { font-size: 14.5px; margin-top: 6px; }
.ma-q small { color: var(--muted); font-size: 12px; }
.ma-q-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.ma-q.q-target { border-color: rgba(245, 197, 24, .5); background: linear-gradient(160deg, rgba(245, 197, 24, .16), var(--raised) 70%); }
.q-best .ma-q-ico { background: var(--up-soft); color: var(--up); }
.q-safe .ma-q-ico { background: rgba(96, 165, 250, .14); color: var(--info); }
.q-chat .ma-q-ico { background: rgba(255, 138, 61, .14); color: #ff8a3d; }
.ma-step { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); font: 800 13px var(--font); }
.ma-side .card-head small { display: block; font-size: 12px; }
@keyframes ma-glow { 0% { box-shadow: 0 0 0 0 rgba(245, 197, 24, .55); } 100% { box-shadow: 0 0 0 14px rgba(245, 197, 24, 0); } }
.ma-glow { animation: ma-glow 1s ease-out 2; }

/* Profit target form */
.ma-target-card { border-color: rgba(245, 197, 24, .35); }
.ma-target { display: flex; flex-direction: column; gap: 8px; }
.ma-target-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.ma-amount { display: flex; align-items: center; height: 52px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); padding: 0 14px; transition: border-color .15s; }
.ma-amount:focus-within { border-color: var(--brand); }
.ma-amount span { font: 600 22px var(--mono); color: var(--brand); margin-right: 6px; }
.ma-amount input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 22px; font-weight: 600; }
.ma-amount input::-webkit-outer-spin-button, .ma-amount input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ma-amount input[type=number] { -moz-appearance: textfield; }
.ma-amount-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 4px; }
.ma-amount-chips button { height: 32px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--raised); color: var(--muted); font: 600 12.5px var(--mono); cursor: pointer; }
.ma-amount-chips button:hover, .ma-amount-chips button.on { border-color: var(--brand); color: var(--brand); }
.ma-target .btn-block { margin-top: 6px; height: 42px; }

/* Rules row */
.ma-rules-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.ma-rule-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px 0; }
.ma-rule-head .ma-q-ico { width: 32px; height: 32px; }
.ma-rule-head b { font-size: 15px; }
.ma-rule-head small { flex-basis: 100%; padding-left: 42px; margin-top: -6px; font-size: 12px; }
.r-dont .ma-q-ico { background: var(--down-soft); color: var(--down); }
.r-profit .ma-q-ico { background: var(--up-soft); color: var(--up); }
.r-loss .ma-q-ico { background: rgba(96, 165, 250, .14); color: var(--info); }
.ma-verdict { margin-top: 16px; }
.ma-verdict-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; }
.ma-verdict-head b { font-size: 16px; }
.ma-meter { height: 8px; margin-top: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--down), #f59e0b 45%, var(--up)); position: relative; opacity: .9; }
.ma-meter i { position: absolute; top: -4px; width: 4px; height: 16px; border-radius: 2px; background: var(--text); transform: translateX(-2px); transition: left .6s ease; }
.ma-meter-scale { display: flex; justify-content: space-between; font-size: 11px; margin-top: 4px; }
.ma-verdict.up b { color: var(--up); }
.ma-verdict.brand b { color: var(--brand); }
.ma-verdict.warn b { color: #f59e0b; }
.ma-verdict.down b { color: var(--down); }
.ma-kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 14px 0 0; font-size: 13px; }
.ma-kv dt { color: var(--muted); }
.ma-kv dd { margin: 0; text-align: right; }
.ma-kv small { display: block; font-size: 11px; }
.ma-setup { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); display: flex; flex-direction: column; gap: 4px; }
.ma-steps { margin: 14px 0 0; padding-left: 20px; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 5px; }
.ma-talk { margin-top: 12px; color: var(--brand); padding-left: 0; }

.ma-day { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 18px 22px; }
.ma-clock { font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.ma-day-read { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ma-day-read > div { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ma-day-read small { font-size: 12.5px; }
.ma-day .sessions { display: flex; margin: 2px 0 0; }
.ma-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; align-self: center; }
.ma-dot.up { background: var(--up); box-shadow: 0 0 0 3px var(--up-soft); }
.ma-dot.down { background: var(--down); box-shadow: 0 0 0 3px var(--down-soft); }
.ma-dot.mid { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .14); }
.ma-counts { display: flex; gap: 22px; }
.ma-counts div { text-align: center; }
.ma-counts b { display: block; font: 600 28px var(--mono); line-height: 1.1; }
.ma-counts small { color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }

.ma-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.ma-chart-card { display: flex; flex-direction: column; min-width: 0; }
.ma-chart-card .card-head { flex-wrap: wrap; gap: 8px 10px; }
.ma-chart-card select { width: auto; max-width: 220px; }
.ma-tf { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 10px 16px 0; }
.ma-tf .pill-tabs { max-width: 100%; overflow-x: auto; }
.ma-tf small { font-size: 12px; }
.ma-canvas { height: 300px; padding: 6px 4px 0; }
.ma-canvas canvas { display: block; width: 100%; height: 100%; }
.tag-live-now { background: rgba(255, 138, 61, .16); color: #ff8a3d; }
.ma-player { display: flex; align-items: center; gap: 10px; padding: 10px 16px 14px; flex-wrap: wrap; }
.ma-player input[type=range] { flex: 1; min-width: 120px; accent-color: var(--brand); }
.ma-player #lv-play { width: 38px; padding: 0; }
.ma-legend { font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.ma-legend i { width: 14px; height: 2px; background: #60a5fa; display: inline-block; }
.ma-next-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 10px 16px; align-items: end; padding: 10px 16px 14px; }
.ma-next-sum small { display: block; font-size: 11.5px; }
.ma-next-sum b { font-size: 13.5px; font-weight: 600; }

.ma-chart-card.is-full { height: 100%; border: 0; }
.ma-chart-card.is-full .ma-canvas { flex: 1; height: auto; min-height: 300px; }
.ma-modal { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .72); display: flex; align-items: center; justify-content: center; padding: 24px; }
.ma-modal-box { position: relative; width: min(1400px, 100%); height: min(860px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
#ma-modal-slot { height: 100%; }
.ma-modal-x { position: absolute; top: 10px; right: 10px; z-index: 2; }
.ma-modal .ma-chart-card .card-head { padding-right: 56px; }

/* Four cards of one size: each shows up to 4 markets, the rest open in the "more" popup */
.ma-buckets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.ma-bucket { display: flex; flex-direction: column; border-top: 3px solid var(--line); min-height: 420px; }
.ma-bucket-list { flex: 1; }
.ma-bucket-foot { min-height: 46px; display: flex; align-items: center; justify-content: flex-end; padding: 6px 10px; border-top: 1px solid var(--line-soft); }
.ma-more { gap: 6px; color: var(--brand); }
.ma-list-box { width: min(560px, 100%); height: auto; max-height: min(80vh, 760px); display: flex; flex-direction: column; }
.ma-list-body { overflow-y: auto; padding-bottom: 6px; }
.ma-list-body .ma-mk:first-child { border-top: 0; }
.ma-bucket.b-better { border-top-color: var(--up); }
.ma-bucket.b-safe { border-top-color: var(--info); }
.ma-bucket.b-normal { border-top-color: var(--muted); }
.ma-bucket.b-risky { border-top-color: var(--down); }
.ma-bucket-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 16px 10px; }
.ma-bucket-head b { font-size: 15px; }
.ma-bucket-head small { flex-basis: 100%; font-size: 12px; }
.ma-mk { display: flex; flex-direction: column; gap: 3px; width: 100%; padding: 10px 16px; border: 0; border-top: 1px solid var(--line-soft); background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ma-mk:hover { background: var(--hover); }
.ma-mk-top { display: flex; align-items: baseline; gap: 8px; }
.ma-mk-top b { margin-right: auto; }
.ma-mk-top .mono { font-size: 12.5px; }
.ma-mk small.faint { font-size: 12px; line-height: 1.35; }
.ma-none { padding: 10px 16px 14px; font-size: 12.5px; }
.ma-foot { font-size: 12px; text-align: center; padding: 4px 0 8px; }

@media (max-width: 1280px) {
    .ma-buckets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ma-hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1100px) {
    .ma-top { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; }
    .ma-chat { height: 620px; }
    .ma-side { overflow: visible; }
    .ma-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ma-rules-row { grid-template-columns: minmax(0, 1fr); }
    /* Tablet / phone: the profit target comes before the chat so it's seen without scrolling */
    .ma-side { order: -1; }
    .ma-charts { grid-template-columns: minmax(0, 1fr); }
    .ma-day { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .ma-counts { justify-content: flex-start; }
}
@media (max-width: 640px) {
    .ma-chat { height: 540px; }
    .ma-hero { padding: 18px 16px; }
    .ma-hero h2 { font-size: 19px; }
    .ma-q { min-height: 104px; padding: 14px; }
    .ma-bucket { min-height: 0; }
    .ma-list-box { max-height: 100%; }
    .ma-tiles { grid-template-columns: minmax(0, 1fr); }
    .ma-buckets { grid-template-columns: minmax(0, 1fr); }
    .ma-next-sum { grid-template-columns: minmax(0, 1fr); }
    .ma-canvas { height: 240px; }
    .ma-bubble { max-width: 90%; }
    .ma-modal { padding: 0; }
    .ma-modal-box { border-radius: 0; height: 100%; }
    .ma-clock { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
    .ma-blk.in, .ma-typing i, .lp-flash-up, .lp-flash-down, .ma-glow { animation: none; }
    .ma-q { transition: none; }
    .ma-q:hover { transform: none; }
    .ma-meter i { transition: none; }
}
