/* ==========================================================
   Wealth Forge Academy FX
   ========================================================== */

:root {
  --bg: #0e182b;
  --bg-2: #111d32;
  --surface: #19253b;
  --surface-2: #222f47;
  --border: rgba(155, 174, 207, 0.11);
  --border-strong: rgba(155, 174, 207, 0.23);
  --text: #f6f8fc;
  --text-dim: #a7b5ce;
  --text-faint: #7485a4;
  --gold: #2478eb;
  --gold-2: #62a8ff;
  --gold-deep: #1457c4;
  --up: #1fd48a;
  --down: #ff4d6a;
  --up-bg: rgba(31, 212, 138, 0.12);
  --down-bg: rgba(255, 77, 106, 0.12);
  --radius: 22px;
  --radius-sm: 11px;
  --shadow: 0 22px 60px -24px rgba(2, 8, 20, 0.7);
  --font: "Sora", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }

.container { width: min(1240px, 100% - 32px); margin-inline: auto; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-faint); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.up { color: var(--up) !important; }
.down { color: var(--down) !important; }
.gold-text {
  background: linear-gradient(100deg, var(--gold-2), var(--gold) 45%, var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 22px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 0.95rem; white-space: nowrap;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-lg { padding: 16px 28px; font-size: 1rem; }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-2), var(--gold) 50%, var(--gold-deep));
  color: #1a1204;
  box-shadow: 0 10px 30px -10px rgba(245, 184, 61, 0.6);
}
.btn-gold:hover { box-shadow: 0 14px 40px -10px rgba(245, 184, 61, 0.8); }
.btn-ghost { border-color: var(--border-strong); background: rgba(255,255,255,0.03); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-2); }
.tg-icon { width: 18px; height: 18px; fill: currentColor; flex: none; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(245, 184, 61, 0.08); border: 1px solid rgba(245, 184, 61, 0.25);
  color: var(--gold-2); font-size: 0.82rem; font-weight: 500;
}
.pill-sm { padding: 3px 10px; font-size: 0.72rem; }
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--up);
  box-shadow: 0 0 0 0 rgba(31, 212, 138, .7); animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(31, 212, 138, .6); }
  70% { box-shadow: 0 0 0 10px rgba(31, 212, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(31, 212, 138, 0); }
}
.chip {
  display: inline-block; padding: 3px 9px; border-radius: 6px;
  font-family: var(--mono); font-size: 0.78rem; font-weight: 600;
  background: var(--up-bg); color: var(--up);
}
.chip.neg { background: var(--down-bg); color: var(--down); }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 6px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;
}
.badge-buy { background: var(--up-bg); color: var(--up); }
.badge-sell { background: var(--down-bg); color: var(--down); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7, 9, 15, 0.72);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold-2), var(--gold) 50%, var(--gold-deep));
  box-shadow: 0 6px 20px -6px rgba(245, 184, 61, .6);
}
.brand-mark svg { width: 24px; height: 24px; fill: none; stroke: #111; stroke-width: 3.2; stroke-linecap: round; }
.brand-text { font-size: 1.05rem; letter-spacing: -0.01em; }
.brand-text em { font-style: normal; color: var(--gold); font-weight: 600; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links > a:not(.btn) { color: var(--text-dim); font-size: 0.92rem; font-weight: 500; transition: color .2s; }
.nav-links > a:not(.btn):hover { color: var(--text); }
.nav-toggle { display: none; background: none; border: 0; width: 40px; height: 40px; padding: 8px; }
.nav-toggle span { display: block; height: 2px; background: var(--text); margin: 5px 0; border-radius: 2px; transition: .3s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Ticker ---------- */
.ticker {
  overflow: hidden; border-bottom: 1px solid var(--border); background: var(--bg-2);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.ticker-track { display: flex; width: max-content; animation: ticker 45s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.tick-item { display: flex; align-items: center; gap: 10px; padding: 10px 26px; font-size: 0.85rem; white-space: nowrap; border-right: 1px solid var(--border); }
.tick-item .sym { font-weight: 600; }
.tick-item .px { font-family: var(--mono); color: var(--text-dim); }
.tick-item .chg { font-family: var(--mono); font-size: 0.78rem; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 90px 0 100px; overflow: hidden; }
.hero-glow {
  position: absolute; inset: -20% -10% auto auto; width: 900px; height: 900px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(245, 184, 61, 0.16), transparent 70%);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 70%);
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 60px; align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 5.4vw, 4.2rem); font-weight: 800; margin: 22px 0 22px; }
.lead { font-size: 1.1rem; color: var(--text-dim); max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero-stats { list-style: none; padding: 0; margin: 48px 0 0; display: flex; gap: 44px; flex-wrap: wrap; }
.hero-stats strong { display: block; font-size: 1.7rem; font-weight: 700; color: var(--text); }
.hero-stats span { color: var(--text-faint); font-size: 0.85rem; }

.hero-card { position: relative; display: grid; gap: 18px; }
.glass {
  background: linear-gradient(160deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
  border: 1px solid var(--border-strong); border-radius: 20px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
.hero-quote { padding: 22px 22px 10px; }
.hq-head { display: flex; justify-content: space-between; align-items: flex-start; }
.hq-sym { display: block; font-weight: 700; }
.hq-name { color: var(--text-faint); font-size: 0.8rem; }
.hq-price { font-size: 2.1rem; font-weight: 600; margin: 8px 0 4px; }
.hero-spark { width: 100%; height: 130px; display: block; }
.hero-signal { padding: 18px 22px; margin-left: 40px; transform: translateY(-6px); }
.hs-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.hs-pair { font-weight: 700; }
.hs-time { margin-left: auto; color: var(--text-faint); font-size: 0.78rem; }
.hs-levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hs-levels span { display: block; font-family: var(--font); font-size: 0.72rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .08em; }
.hs-levels strong { font-size: 0.95rem; font-weight: 600; }

/* ---------- Sections ---------- */
.section { padding: 100px 0; position: relative; }
.section-alt { background: linear-gradient(180deg, var(--bg-2), var(--bg)); border-block: 1px solid var(--border); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 52px; }
.eyebrow { display: inline-block; color: var(--gold); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 14px; }
.section-head h2 { font-size: clamp(1.9rem, 3.8vw, 2.8rem); font-weight: 700; margin-bottom: 14px; }
.section-head p { color: var(--text-dim); }

/* ---------- Terminal ---------- */
.terminal {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-areas: "chart trade" "positions watch" "depth depth";
  gap: 16px;
}
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.chart-panel { grid-area: chart; padding: 16px; display: flex; flex-direction: column; min-width: 0; }
.trade-panel { grid-area: trade; padding: 20px; }
.positions-panel { grid-area: positions; padding: 8px 16px 16px; min-width: 0; }
.watch-panel { grid-area: watch; padding: 16px; min-width: 0; }
.depth-panel { grid-area: depth; padding: 16px; min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 4px 20px; }
.depth-panel > .panel-title, .depth-panel > p, .depth-panel > .link-btn { grid-column: 1 / -1; }
@media (max-width: 760px) { .depth-panel { grid-template-columns: 1fr; } }
.hero-grid > *, .trade-panel { min-width: 0; }
.panel-title { font-size: 0.95rem; margin-bottom: 8px; }

.chart-toolbar { overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; }
.chart-toolbar::-webkit-scrollbar { display: none; }
.pair-tabs { display: flex; gap: 6px; width: max-content; }
.pair-tab {
  padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: transparent; font-size: 0.82rem; font-weight: 600; color: var(--text-dim);
  transition: .2s;
}
.pair-tab:hover { color: var(--text); border-color: var(--border-strong); }
.pair-tab.active { background: rgba(245, 184, 61, 0.12); border-color: rgba(245, 184, 61, 0.45); color: var(--gold-2); }

.chart-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; padding: 0 4px; }
.ch-sym { color: var(--text-dim); font-size: 0.85rem; font-weight: 600; }
.ch-price-row { display: flex; align-items: center; gap: 12px; }
.ch-price { font-size: 1.9rem; font-weight: 600; transition: color .3s; }
.ch-ohlc { font-size: 0.78rem; color: var(--text-faint); display: flex; gap: 14px; flex-wrap: wrap; }
.ch-ohlc b { color: var(--text-dim); font-weight: 500; }
.chart-wrap { position: relative; flex: 1; min-height: 420px; }
#chart { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }

.tp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.tp-head h3 { font-size: 1.05rem; }
.acct { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 22px; }
.acct div { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.acct span { display: block; font-size: 0.72rem; color: var(--text-faint); }
.acct strong { font-size: 0.95rem; font-weight: 600; }
.field-label { display: block; font-size: 0.78rem; color: var(--text-dim); margin-bottom: 8px; }
.stepper { display: flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.stepper button { width: 46px; background: transparent; border: 0; font-size: 1.2rem; color: var(--text-dim); transition: .2s; }
.stepper button:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.stepper input {
  flex: 1; min-width: 0; text-align: center; background: transparent; border: 0; color: var(--text);
  font-family: var(--mono); font-size: 1.05rem; padding: 12px 0; outline: none; -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.lot-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 20px; }
.lot-presets button {
  padding: 6px 0; font-family: var(--mono); font-size: 0.78rem; border-radius: 8px;
  border: 1px solid var(--border); background: transparent; color: var(--text-dim); transition: .2s;
}
.lot-presets button:hover { border-color: var(--gold); color: var(--gold-2); }

.trade-buttons { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.trade-btn {
  border: 0; border-radius: 12px; padding: 14px 10px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: transform .15s ease, filter .2s, box-shadow .2s;
}
.trade-btn span { font-size: 0.78rem; font-weight: 700; letter-spacing: .12em; opacity: .9; }
.trade-btn strong { font-size: 1.05rem; font-weight: 600; }
.trade-btn:hover { filter: brightness(1.1); }
.trade-btn:active { transform: scale(0.97); }
.trade-btn.sell { background: linear-gradient(160deg, #ff6a82, #d8314e); color: #fff; box-shadow: 0 10px 26px -12px rgba(255, 77, 106, .8); }
.trade-btn.buy { background: linear-gradient(160deg, #3ae3a0, #0fa86b); color: #04130c; box-shadow: 0 10px 26px -12px rgba(31, 212, 138, .8); }
.spread { font-size: 0.72rem; color: var(--text-faint); text-align: center; min-width: 30px; }
.tp-note { font-size: 0.76rem; color: var(--text-faint); margin-top: 16px; }
.link-btn { background: none; border: 0; padding: 0; margin-top: 10px; color: var(--gold); font-size: 0.8rem; text-decoration: underline; text-underline-offset: 3px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.tab { background: none; border: 0; padding: 12px 12px; font-size: 0.85rem; font-weight: 600; color: var(--text-faint); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--text); border-color: var(--gold); }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); font-size: 0.7rem; margin-left: 4px; }

.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.table th { text-align: left; font-weight: 500; color: var(--text-faint); font-size: 0.74rem; padding: 10px 8px; white-space: nowrap; }
.table td { padding: 10px 8px; border-top: 1px solid var(--border); white-space: nowrap; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.table td:first-child { font-family: var(--font); font-weight: 600; }
.table .empty td { text-align: center; color: var(--text-faint); font-family: var(--font); padding: 28px 8px; font-weight: 400; }
.close-btn { border: 1px solid var(--border-strong); background: transparent; border-radius: 6px; padding: 3px 10px; font-size: 0.74rem; color: var(--text-dim); font-family: var(--font); transition: .2s; }
.close-btn:hover { border-color: var(--down); color: var(--down); }
.watch tbody tr { cursor: pointer; transition: background .2s; }
.watch tbody tr:hover { background: rgba(255,255,255,0.03); }
.watch tbody tr.active { background: rgba(245, 184, 61, 0.07); }
.flash-up { animation: flashUp .6s ease; }
.flash-down { animation: flashDown .6s ease; }
@keyframes flashUp { 0% { color: var(--up); } 100% { color: inherit; } }
@keyframes flashDown { 0% { color: var(--down); } 100% { color: inherit; } }

/* ---------- Signals ---------- */
.signals-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 28px; }
.signal {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; transition: transform .25s ease, border-color .25s ease; overflow: hidden;
}
.signal:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.signal::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--up); }
.signal.sell::before { background: var(--down); }
.sig-top { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.sig-pair { font-weight: 700; font-size: 1.1rem; }
.sig-status { margin-left: auto; font-size: 0.72rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: rgba(245,184,61,.12); color: var(--gold-2); display: inline-flex; align-items: center; gap: 6px; }
.sig-status.tp { background: var(--up-bg); color: var(--up); }
.sig-status.sl { background: var(--down-bg); color: var(--down); }
.sig-status .live-dot { width: 6px; height: 6px; background: var(--gold); animation: none; }
.sig-time { color: var(--text-faint); font-size: 0.76rem; margin-bottom: 16px; }
.sig-levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.sig-levels div { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.sig-levels span { display: block; font-size: 0.68rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .08em; }
.sig-levels strong { font-family: var(--mono); font-size: 0.86rem; font-weight: 600; }
.sig-progress { height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--down-bg), rgba(255,255,255,0.05), var(--up-bg)); position: relative; margin-bottom: 10px; }
.sig-progress i { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); border: 2px solid var(--bg); transform: translate(-50%, -50%); transition: left .6s ease; box-shadow: 0 0 12px rgba(245,184,61,.6); }
.sig-foot { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; }
.sig-foot .mono { font-weight: 600; }
.sig-trade { background: none; border: 0; color: var(--gold); font-size: 0.8rem; font-weight: 600; padding: 0; }
.sig-trade:hover { color: var(--gold-2); }

/* ---------- Features ---------- */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 24px;
  transition: transform .25s, border-color .25s;
}
.feature:hover { transform: translateY(-4px); border-color: rgba(245,184,61,.35); }
.f-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: rgba(245,184,61,.1); border: 1px solid rgba(245,184,61,.25); margin-bottom: 20px; }
.f-icon svg { width: 24px; height: 24px; fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { font-size: 1.1rem; margin-bottom: 10px; }
.feature p { color: var(--text-dim); font-size: 0.92rem; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 56px; }
.step { position: relative; padding: 24px; border-radius: var(--radius); border: 1px dashed var(--border-strong); }
.step span { font-family: var(--mono); color: var(--gold); font-weight: 600; font-size: 0.85rem; }
.step h4 { font-size: 1.05rem; margin: 8px 0 6px; }
.step p { color: var(--text-dim); font-size: 0.9rem; }

/* ---------- Testimonials ---------- */
.testimonials { columns: 3 280px; column-gap: 18px; }
.t-card {
  break-inside: avoid; margin: 0 0 18px; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); cursor: zoom-in;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.t-card:hover { transform: translateY(-4px); border-color: rgba(245,184,61,.35); box-shadow: var(--shadow); }
.t-card img { width: 100%; height: auto; }
.t-card figcaption { padding: 12px 16px; font-size: 0.85rem; color: var(--text-dim); border-top: 1px solid var(--border); }
.t-card figcaption strong { color: var(--text); display: block; }
.t-placeholder {
  cursor: default; aspect-ratio: 4 / 5; display: grid; place-items: center; text-align: center; padding: 24px;
  background: repeating-linear-gradient(135deg, var(--surface), var(--surface) 12px, var(--surface-2) 12px, var(--surface-2) 24px);
  border-style: dashed; border-color: var(--border-strong);
}
.t-placeholder:hover { transform: none; box-shadow: none; }
.t-placeholder svg { width: 40px; height: 40px; stroke: var(--gold); fill: none; stroke-width: 1.5; margin: 0 auto 12px; }
.t-placeholder p { color: var(--text-dim); font-size: 0.85rem; }
.t-placeholder code { display: block; margin-top: 6px; font-family: var(--mono); font-size: 0.72rem; color: var(--gold-2); word-break: break-all; }

/* ---------- CTA ---------- */
.cta {
  position: relative; overflow: hidden; text-align: center; padding: 72px 24px; border-radius: 28px;
  background: linear-gradient(135deg, #1a1407, #0f1320 60%);
  border: 1px solid rgba(245,184,61,.3);
}
.cta-glow { position: absolute; left: 50%; top: -60%; width: 700px; height: 700px; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(245,184,61,.25), transparent); pointer-events: none; }
.cta h2 { position: relative; font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 14px; }
.cta p { position: relative; color: var(--text-dim); margin-bottom: 30px; }
.cta .btn { position: relative; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 48px 0 32px; background: var(--bg-2); }
.footer-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; margin-bottom: 28px; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { color: var(--text-dim); font-size: 0.9rem; }
.footer-links a:hover { color: var(--gold-2); }
.disclaimer { font-size: 0.78rem; color: var(--text-faint); max-width: 900px; line-height: 1.7; }
.disclaimer strong { color: var(--text-dim); }
.copy { margin-top: 20px; font-size: 0.8rem; color: var(--text-faint); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(3, 4, 8, 0.92); backdrop-filter: blur(6px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: min(900px, 100%); max-height: 82vh; border-radius: 12px; object-fit: contain; }
.lightbox p { color: var(--text-dim); font-size: 0.9rem; }
.lb-close { position: absolute; top: 16px; right: 20px; background: none; border: 0; font-size: 2.2rem; color: var(--text); line-height: 1; }

/* ---------- Accounts ---------- */
.nav-user { display: flex; align-items: center; gap: 10px; }
.nav-user[hidden], #navLogin[hidden] { display: none; }
.nav-avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(245,184,61,.15); border: 1px solid rgba(245,184,61,.4); color: var(--gold-2);
  font-size: 0.8rem; font-weight: 700;
}
.nav-name { font-size: 0.88rem; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user .link-btn { margin: 0; }

.trade-panel { position: relative; }
.tp-lock {
  position: absolute; inset: 0; z-index: 2; border-radius: inherit;
  display: grid; place-items: center; padding: 24px; text-align: center;
  background: rgba(17, 23, 38, 0.82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.tp-lock[hidden] { display: none; }
.tp-lock-inner { max-width: 260px; display: grid; justify-items: center; gap: 12px; }
.tp-lock .f-icon { margin: 0; }
.tp-lock h3 { font-size: 1.1rem; }
.tp-lock p { color: var(--text-dim); font-size: 0.86rem; }
.tp-lock .btn { width: 100%; }

.modal {
  position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 16px;
  background: rgba(3, 4, 8, 0.78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.modal.open { opacity: 1; pointer-events: auto; }
.modal-card {
  position: relative; width: min(420px, 100%); max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 20px;
  padding: 32px 28px 24px; box-shadow: var(--shadow);
  transform: translateY(12px); transition: transform .25s;
}
.modal.open .modal-card { transform: none; }
.modal-close { top: 10px; right: 14px; font-size: 1.8rem; color: var(--text-dim); }
.modal-card .brand-mark { margin-bottom: 18px; }
.modal-card h2 { font-size: 1.4rem; margin-bottom: 6px; }
.modal-sub { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 18px; }
.auth-tabs { margin-bottom: 18px; }
.auth-tabs .tab { flex: 1; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 0.78rem; color: var(--text-dim); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); outline: none;
  background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text); font: inherit; font-size: 0.95rem;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245,184,61,.15); }
.field[hidden] { display: none; }
.form-msg { min-height: 1.2em; font-size: 0.84rem; color: var(--down); margin-bottom: 10px; }
.form-msg.ok { color: var(--up); }
.auth-submit { width: 100%; }
.auth-submit[disabled], .trade-btn[disabled] { opacity: .6; cursor: wait; transform: none; }
.modal-foot { margin-top: 16px; font-size: 0.76rem; color: var(--text-faint); text-align: center; }

/* ---------- Screenshot-inspired account access ---------- */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
#authModal {
  background: rgba(17, 28, 48, .96);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
#authModal .auth-card {
  width: min(375px, calc(100% - 28px));
  padding: 27px 24px 24px;
  background: #0d1729;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .24);
  color: #f7f9fd;
  overflow: visible;
}
.auth-close {
  position: absolute; top: 5px; right: 8px; width: 30px; height: 30px; padding: 0;
  border: 0; background: transparent; color: #7f8da8; font-size: 1.35rem; line-height: 1;
  opacity: 0; transition: opacity .2s, color .2s;
}
.auth-card:hover .auth-close, .auth-close:focus-visible { opacity: 1; }
.auth-close:hover { color: #fff; }
.auth-brand-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.auth-logo { display: inline-flex; align-items: center; gap: 8px; font-size: 1.25rem; font-weight: 800; letter-spacing: -.07em; }
.auth-logo > span:last-child > span { color: #f5b83d; }
.auth-logo-mark {
  width: 26px; height: 26px; display: grid; place-items: center; border-radius: 5px;
  background: linear-gradient(135deg, var(--gold-2), var(--gold) 50%, var(--gold-deep));
}
.auth-logo-mark svg { width: 18px; height: 18px; fill: none; stroke: #101522; stroke-width: 2.7; stroke-linecap: round; }
.auth-tools { display: flex; align-items: center; gap: 17px; }
.support-icon { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.locale-badge { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; overflow: hidden; font-size: 22px; line-height: 1; }
#authModal .auth-card h2 { margin: 0 0 7px; font-size: 1.22rem; font-weight: 700; }
#authModal .auth-switch-copy { margin-bottom: 21px; color: #9ba8be; font-size: .85rem; }
.auth-context { margin: -10px 0 16px; color: #9ba8be; font-size: .78rem; line-height: 1.45; }
.auth-context[hidden] { display: none; }
.auth-mode-link, .forgot-link { padding: 0; border: 0; background: transparent; color: #2780f7; font: inherit; font-weight: 500; }
.auth-mode-link:hover, .forgot-link:hover { color: #65a6ff; text-decoration: underline; }
#authModal .field { margin-bottom: 12px; }
#authModal .field input {
  min-height: 48px; padding: 0 15px; border-radius: 11px; background: transparent;
  border: 1px solid #39455d; color: #fff; font-size: .88rem; box-shadow: none;
}
#authModal .field input::placeholder { color: #9aa7bd; opacity: 1; }
#authModal .field input:focus { border-color: #2f82f6; box-shadow: 0 0 0 3px rgba(47, 130, 246, .13); }
.password-control { position: relative; display: block !important; margin: 0 !important; }
.password-control input { padding-right: 49px !important; }
.password-toggle {
  position: absolute; top: 50%; right: 10px; transform: translateY(-50%); display: grid; place-items: center;
  width: 34px; height: 34px; padding: 0; border: 0; background: transparent; color: #8f9db5;
}
.password-toggle svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.forgot-link { display: block; margin: 1px 0 17px; font-size: .84rem; }
#authModal .form-msg { min-height: 0; margin: 0 0 10px; font-size: .78rem; }
#authModal .form-msg:empty { display: none; }
#authModal .auth-submit {
  width: 100%; min-height: 49px; padding: 0 18px; border: 0; border-radius: 11px;
  background: #2478eb; color: #fff; font-weight: 700; box-shadow: none;
  transition: background .2s, transform .2s, opacity .2s;
}
#authModal .auth-submit:hover { background: #3488f8; transform: translateY(-1px); }
.auth-divider { display: flex; align-items: center; gap: 13px; margin: 25px 0 14px; color: #9ba8be; font-size: .88rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: #465168; }
.auth-divider span { white-space: nowrap; }
.google-login {
  display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; min-height: 48px;
  padding: 0 18px; border: 0; border-radius: 10px; background: #354158; color: #fff; font-weight: 700;
  transition: background .2s, transform .2s;
}
.google-login:hover { background: #414e67; transform: translateY(-1px); }
.google-login svg { width: 20px; height: 20px; }
#authModal.signup-mode .forgot-link, #authModal.signup-mode [data-login-only] { display: none; }
#authModal.signup-mode .auth-card { max-height: calc(100vh - 32px); overflow-y: auto; }
#authModal.signup-mode .modal-foot { color: #7d8aa3; }
.signup-promo {
  display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px;
  margin: -2px 0 22px; padding: 14px; border-radius: 9px; color: #fff;
  background: radial-gradient(circle at 75% 30%, rgba(68,111,220,.55), transparent 38%), linear-gradient(135deg, #11192d, #091123);
}
.signup-promo[hidden] { display: none; }
.signup-promo span { font-size: .78rem; font-weight: 600; }
.signup-promo strong { grid-row: 1 / 3; grid-column: 2; font-size: 1.5rem; }
.signup-promo small { color: #afbdd4; font-size: .68rem; }
#authModal.signup-mode { background: rgba(237, 242, 248, .98); }
#authModal.signup-mode .auth-card { background: #fff; color: #101827; box-shadow: 0 24px 70px rgba(48, 67, 96, .16); }
#authModal.signup-mode .support-icon { stroke: #101827; }
#authModal.signup-mode .auth-switch-copy { color: #73829c; }
#authModal.signup-mode .field input { background: #fff; border-color: #d8e0ec; color: #101827; }
#authModal.signup-mode .field input::placeholder { color: #74839c; }
#authModal.signup-mode .auth-close { color: #6d7d97; }

@media (max-width: 480px) {
  #authModal { padding: 18px 14px; align-items: center; }
  #authModal .auth-card { width: 100%; padding: 26px 24px 24px; }
}

/* ---------- Trading screen (signed-in members) ---------- */
.view-btn, .demo-banner { display: none; }
body.signed-in:not(.trading-mode) .view-btn[data-view="trade"] { display: inline-flex; }
body.trading-mode .view-btn[data-view="home"] { display: inline-flex; }
body.trading-mode .nav-links > a:not(.btn),
body.trading-mode .nav-vip,
body.trading-mode main > section:not(#markets),
body.trading-mode #markets .section-head { display: none; }
body.trading-mode #markets { padding: 16px 0 24px; }
body.trading-mode #markets .container { width: min(1680px, 100% - 32px); }
body.trading-mode .demo-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
  font-size: 0.84rem; color: var(--text-dim);
}
body.trading-mode .terminal { grid-template-columns: minmax(0, 1fr) 360px; }
body.trading-mode .chart-wrap { min-height: max(440px, calc(100vh - 330px)); }

/* ---------- VIP payment modal ---------- */
.nav-vip { border-color: rgba(245,184,61,.45); color: var(--gold); }
.pay-card { padding: 0; width: min(440px, 100%); }
.pay-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 24px 24px 16px; border-bottom: 1px solid var(--border);
}
.pay-head .modal-sub { margin: 0; }
.pay-close {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  background: none; border: 0; color: var(--text-dim); cursor: pointer;
}
.pay-close:hover { background: var(--border); color: var(--text); }
.pay-close svg, .pay-arrow, .pay-icon svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pay-close svg { width: 18px; height: 18px; }
.pay-body { padding: 18px 20px 20px; display: grid; gap: 12px; }
.pay-price {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 0 4px 4px; font-size: 0.86rem; color: var(--text-dim);
}
.pay-price strong { color: var(--gold); font-size: 1.05rem; }
.pay-row {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; text-align: left;
  background: rgba(255,255,255,.02); border: 1px solid var(--border-strong); border-radius: 14px;
  color: var(--text); font: inherit; cursor: pointer; transition: border-color .2s, background .2s;
}
.pay-row:hover, .pay-row:focus-visible { border-color: rgba(245,184,61,.5); background: rgba(245,184,61,.05); outline: none; }
.pay-icon {
  flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px;
  background: rgba(245,184,61,.12); color: var(--gold);
}
.pay-icon svg { width: 22px; height: 22px; }
.pay-icon-usdt { background: #26a17b; color: #fff; }
.pay-text { flex: 1; display: grid; gap: 2px; min-width: 0; }
.pay-text strong { font-size: 0.98rem; }
.pay-text small { color: var(--text-dim); font-size: 0.82rem; }
.pay-arrow { flex: none; width: 20px; height: 20px; color: var(--text-faint); transition: transform .2s, color .2s; }
.pay-row:hover .pay-arrow { color: var(--gold); transform: translateX(3px); }
.pay-body .modal-foot { margin-top: 4px; }
.pay-label { font-size: 0.9rem; color: var(--text-dim); }
.pay-address {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: rgba(255,255,255,.03); border: 1px solid var(--border-strong); border-radius: 12px;
}
.pay-address code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 0.8rem; color: var(--text); overflow-wrap: anywhere; }
.pay-copy {
  flex: none; padding: 6px 12px; border-radius: 8px; cursor: pointer; font: inherit; font-size: 0.8rem; font-weight: 600;
  background: rgba(245,184,61,.12); border: 1px solid rgba(245,184,61,.4); color: var(--gold);
}
.pay-copy:hover { background: rgba(245,184,61,.2); }
.pay-warn { font-size: 0.78rem; color: var(--down); }

@media (max-width: 900px) {
  .nav-links #navLogin { margin-top: 16px; }
  .nav-user { padding: 14px 4px; border-bottom: 1px solid var(--border); }
}

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: grid; gap: 10px; }
.toast {
  background: var(--surface-2); border: 1px solid var(--border-strong); border-left: 3px solid var(--gold);
  padding: 12px 16px; border-radius: 10px; font-size: 0.85rem; box-shadow: var(--shadow); min-width: 240px;
  animation: toastIn .3s ease;
}
.toast.buy { border-left-color: var(--up); }
.toast.sell { border-left-color: var(--down); }
.toast.out { opacity: 0; transform: translateY(8px); transition: .3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .ticker-track { animation-duration: 120s; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .terminal { grid-template-columns: 1fr; grid-template-areas: "chart" "trade" "positions" "watch" "depth"; }
  .trade-panel { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
  .trade-panel .tp-head, .trade-panel .acct { grid-column: 1 / -1; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .signals-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .hero { padding: 60px 0 70px; }
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .hero-signal { margin-left: 0; }
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(7, 9, 15, 0.97); border-bottom: 1px solid var(--border); padding: 8px 16px 20px;
    transform: translateY(-120%); transition: transform .35s ease; z-index: -1;
  }
  .nav-links.open { transform: none; }
  .nav-links > a:not(.btn) { padding: 14px 4px; border-bottom: 1px solid var(--border); font-size: 1rem; }
  .nav-cta { margin-top: 16px; }
}
@media (max-width: 640px) {
  .section { padding: 72px 0; }
  .hero-stats { gap: 28px; }
  .hero-actions .btn { width: 100%; }
  .acct { grid-template-columns: 1fr 1fr; }
  .trade-panel { display: block; }
  .chart-wrap { min-height: 320px; }
  .ch-price { font-size: 1.5rem; }
  .signals-grid, .features, .steps { grid-template-columns: 1fr; }
  .brand-text { font-size: 0.95rem; }
  .toasts { left: 16px; right: 16px; }
}

#walletNav[hidden], #depositForm[hidden] { display: none; }
.wallet-balance { font-size: 2rem; color: var(--gold); margin: 16px 0; }
.deposit-history { padding-left: 20px; max-height: 200px; overflow-y: auto; font-size: .85rem; }
.deposit-history li { margin: 10px 0; }
#walletModal h3 { margin-top: 24px; }
#depositForm { margin: 18px 0; }

#kycNav[hidden], #kycForm[hidden], #walletKyc[hidden] { display: none; }
#walletKyc { margin-right: 8px; }
.kyc-status { margin: 0 0 12px; font-size: .9rem; }
.kyc-status.ok { color: var(--up); }
.kyc-status.bad { color: var(--down); }
#kycForm { margin-top: 18px; }
.kyc-types { border: 0; padding: 0; }
.kyc-types legend { font-size: 0.78rem; color: var(--text-dim); margin-bottom: 6px; }
.kyc-types label { display: inline-flex; align-items: center; gap: 6px; margin-right: 18px; font-size: .9rem; }
.kyc-consent { display: flex; gap: 8px; align-items: flex-start; font-size: .8rem; color: var(--text-dim); margin-bottom: 14px; }
.kyc-consent input { margin-top: 3px; }
.field input[type="file"] { padding: 9px 10px; font-size: .82rem; }
.nav-wallet-balance { margin-left: 6px; color: var(--gold-2); font-weight: 600; }

/* ==========================================================
   Member portal visual system
   ========================================================== */
body { background: var(--bg); }
.container { width: min(1180px, 100% - 40px); }
.nav {
  background: rgba(13, 23, 41, .94);
  border-bottom-color: rgba(164, 181, 211, .1);
  box-shadow: 0 8px 30px rgba(3, 9, 20, .14);
}
.nav-inner { height: 64px; }
.brand-mark { border-radius: 7px; background: linear-gradient(145deg, #fff 0 42%, #2478eb 43% 100%); }
.brand-mark svg { stroke: #0d1729; }
.brand-text em { color: #62a8ff; }
.nav-links { gap: 18px; }
.nav-links > a:not(.btn) { color: #a9b6cd; font-size: .84rem; }
.nav-avatar { background: #25344e; border: 1px solid #3b4c69; color: #fff; }
.nav-user .link-btn { color: #8da0be; text-decoration: none; }

.btn { border-radius: 10px; }
.btn-gold {
  color: #fff;
  background: linear-gradient(135deg, #3289fa, #1766da);
  box-shadow: 0 12px 28px -14px rgba(36, 120, 235, .85);
}
.btn-gold:hover { box-shadow: 0 14px 34px -14px rgba(36, 120, 235, .95); }
.btn-ghost { background: #17243a; border-color: #31415e; }
.btn-ghost:hover { border-color: #438ff4; color: #fff; }
.pill { color: #8ec0ff; background: rgba(36, 120, 235, .1); border-color: rgba(74, 147, 246, .3); }
.gold-text {
  background: linear-gradient(100deg, #8bc4ff, #3e91ff 48%, #596cff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.verify-strip {
  display: none; width: 100%; min-height: 56px; align-items: center; justify-content: center; gap: 10px;
  padding: 10px 18px; border: 0; background: #ffb41f; color: #091326; font-size: .84rem; font-weight: 600;
}
.verify-strip[hidden] { display: none !important; }
.verify-strip svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.verify-strip strong { padding: 8px 14px; border-radius: 999px; background: #071120; color: #fff; font-size: .75rem; }
body.signed-in .verify-strip:not([hidden]) { display: flex; }

.ticker { background: #121f34; border-bottom-color: var(--border); }
.tick-item { padding-block: 8px; }
.hero { padding: 84px 0 88px; }
.hero-glow { background: radial-gradient(closest-side, rgba(36, 120, 235, .22), transparent 70%); }
.hero::before { opacity: .5; }
.hero h1 { max-width: 760px; }
.glass {
  background: linear-gradient(155deg, rgba(39, 55, 87, .96), rgba(21, 33, 56, .96));
  border-color: rgba(134, 158, 198, .18); border-radius: 22px;
}
.hero-quote { overflow: hidden; }
.hero-quote::after {
  content: ""; position: absolute; width: 260px; height: 260px; right: -90px; top: -120px;
  border-radius: 50%; background: radial-gradient(circle, rgba(53, 107, 255, .35), transparent 66%); pointer-events: none;
}
.hero-signal { border-color: rgba(79, 133, 244, .24); }
.hero-stats li { padding: 15px 18px; border-radius: 14px; background: rgba(25, 37, 59, .72); border: 1px solid var(--border); }

.section { padding: 84px 0; }
.section-alt { background: #101c30; border-color: var(--border); }
.section-head { margin-bottom: 42px; }
.eyebrow { color: #64aaff; letter-spacing: .13em; }
.panel, .signal, .feature, .t-card {
  background: #19253b; border-color: rgba(144, 165, 201, .12); box-shadow: 0 16px 40px -30px rgba(0, 0, 0, .8);
}
.panel { overflow: hidden; }
.feature:hover, .t-card:hover, .signal:hover { border-color: rgba(67, 143, 244, .42); }
.f-icon { background: #273650; border-color: #354967; }
.f-icon svg { stroke: #75b3ff; }
.step { background: rgba(25, 37, 59, .55); border-style: solid; }
.step span, .sig-trade, .link-btn { color: #65a9ff; }
.pair-tab.active { background: #2778e5; border-color: #2778e5; color: #fff; }
.watch tbody tr.active { background: rgba(36, 120, 235, .12); }
.tab.active { border-color: #2f85f4; }
.cta {
  background: linear-gradient(135deg, #172843, #141f36 62%);
  border-color: rgba(77, 147, 242, .3);
}
.cta-glow { background: radial-gradient(closest-side, rgba(48, 126, 239, .28), transparent); }
.footer { background: #0b1526; }

.member-dashboard { display: none; }
body.dashboard-mode .member-dashboard {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(270px, .95fr);
  gap: 16px;
  max-width: 760px;
  margin: 0 auto 24px;
}
.member-account-card, .member-account-details, .member-quick-actions {
  border-radius: 24px; box-shadow: 0 20px 45px -30px rgba(0, 0, 0, .75);
}
.member-account-card {
  position: relative; isolation: isolate; overflow: hidden; min-height: 254px; padding: 18px;
  background:
    radial-gradient(circle at 90% 82%, rgba(37, 65, 255, .95), transparent 44%),
    radial-gradient(circle at 5% 55%, rgba(211, 0, 111, .86), transparent 48%),
    linear-gradient(145deg, #15104b, #080a67 58%, #0829dc);
}
.member-account-card::after {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .18;
  background-image: linear-gradient(120deg, transparent 0 40%, #fff 40.5% 41%, transparent 41.5% 100%);
}
.member-account-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.member-account-type { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; border-radius: 999px; background: rgba(255, 255, 255, .14); font-size: .78rem; font-weight: 600; }
.member-account-type .locale-badge { width: 20px; height: 20px; font-size: 18px; }
.member-live-dot { padding: 4px 9px; border: 1px solid rgba(255,255,255,.65); border-radius: 6px; font-size: .68rem; }
.member-card-label { display: block; margin-bottom: 3px; color: rgba(255, 255, 255, .72); font-size: .72rem; }
.member-card-balance { display: block; font-family: var(--font); font-size: 2.5rem; line-height: 1.1; letter-spacing: -.04em; }
.member-card-name { display: block; margin-top: 4px; color: rgba(255,255,255,.75); font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 26px; }
.member-card-actions button { min-height: 42px; border: 0; border-radius: 999px; background: #fff; color: #0d1729; font-weight: 700; font-size: .82rem; }
.member-card-actions button:hover { background: #eaf3ff; transform: translateY(-1px); }
.member-account-details { padding: 24px; background: #19253b; }
.member-account-details h3 { margin-bottom: 16px; font-size: 1rem; }
.member-account-details dl { margin: 0; display: grid; gap: 9px; }
.member-account-details dl div { display: flex; justify-content: space-between; gap: 20px; }
.member-account-details dt { color: #91a8cc; font-size: .78rem; }
.member-account-details dd { margin: 0; color: #fff; font-size: .78rem; font-weight: 600; }
.member-quick-actions {
  grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); padding: 16px 12px; background: #19253b;
}
.member-quick-actions > * {
  display: grid; justify-items: center; gap: 8px; padding: 8px; border: 0; background: transparent; color: #f5f7fb; font-size: .75rem;
}
.member-quick-actions > *:hover { color: #75b3ff; }
.member-quick-actions span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: #27354e; color: #fff; font-size: 1.05rem; }
.member-quick-actions strong { font-weight: 600; }

body.trading-mode { background: #0e182b; }
body.trading-mode .ticker, body.trading-mode .footer { display: none; }
body.trading-mode .nav { position: relative; }
body.trading-mode .nav-cta, body.trading-mode #kycNav { display: none; }
body.trading-mode #markets { padding: 24px 0 40px; }
body.trading-mode #markets .container { width: min(1180px, 100% - 40px); }
body.trading-mode .demo-banner { max-width: 760px; margin: 0 auto 16px; padding: 10px 14px; border-radius: 12px; background: #16243a; border: 1px solid var(--border); }
body.trading-mode .terminal { grid-template-columns: minmax(0, 1fr) 330px; gap: 14px; }
body.trading-mode .chart-wrap { min-height: max(410px, calc(100vh - 520px)); }

.modal:not(#authModal) { background: rgba(5, 12, 24, .8); }
.modal:not(#authModal) .modal-card { background: #f8fafc; color: #101827; border: 0; }
.modal:not(#authModal) .modal-sub, .modal:not(#authModal) .modal-foot,
.modal:not(#authModal) .field span, .modal:not(#authModal) .kyc-consent,
.modal:not(#authModal) .kyc-types legend { color: #687896; }
.modal:not(#authModal) .field input { background: #fff; border-color: #d9e1ec; color: #101827; }
.modal:not(#authModal) .field input:focus { border-color: #2478eb; box-shadow: 0 0 0 3px rgba(36,120,235,.12); }
.modal:not(#authModal) .modal-close { color: #687896; }
.wallet-balance { color: #176bdd; }

@media (max-width: 900px) {
  .container, body.trading-mode #markets .container { width: min(100% - 28px, 1180px); }
  .nav-links { background: rgba(13, 23, 41, .99); }
  body.dashboard-mode .member-dashboard { grid-template-columns: 1fr 1fr; }
  body.trading-mode .terminal { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .verify-strip { align-items: flex-start; text-align: left; }
  .verify-strip strong { display: none; }
  body.dashboard-mode .member-dashboard { grid-template-columns: 1fr; }
  .member-account-details, .member-quick-actions { grid-column: 1; }
  .member-quick-actions { grid-template-columns: repeat(2, 1fr); row-gap: 10px; }
  .member-account-card { min-height: 240px; }
  .member-card-balance { font-size: 2.15rem; }
}

/* ---------- Complete authenticated portal ---------- */
.portal-nav, .member-portal, .dashboard-extras { display: none; }
body.signed-in .portal-nav { display: flex; align-items: center; gap: 4px; }
.portal-nav button {
  padding: 8px 10px; border: 0; border-radius: 8px; background: transparent;
  color: #8fa1bd; font-size: .78rem; font-weight: 600;
}
.portal-nav button:hover, .portal-nav button.current { background: #1c2a42; color: #fff; }
body.signed-in .nav-cta, body.signed-in .view-btn { display: none !important; }
body.signed-in .nav-links > a:not(.btn) { display: none; }
body.signed-in #kycNav { display: none; }
body.dashboard-mode .ticker, body.dashboard-mode .footer,
body.portal-mode .ticker, body.portal-mode .footer { display: none; }
body.dashboard-mode main > section:not(#markets) { display: none; }
body.dashboard-mode #markets { padding: 24px 0 48px; }
body.dashboard-mode #markets .section-head,
body.dashboard-mode #markets .demo-banner,
body.dashboard-mode #markets .terminal { display: none; }
body.dashboard-mode #markets .container { width: min(760px, 100% - 32px); }
body.dashboard-mode .dashboard-extras { display: block; max-width: 760px; margin: 0 auto; }
body.portal-mode main > section:not(.member-portal) { display: none; }
body.portal-mode .member-portal { display: block; min-height: calc(100vh - 64px); padding: 30px 0 50px; }
body.portal-mode .verify-strip:not([hidden]), body.dashboard-mode .verify-strip:not([hidden]) { display: flex; }

.dashboard-shortcuts {
  display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 0 20px; padding: 14px 8px;
  border-radius: 22px; background: #19253b;
}
.dashboard-shortcuts button {
  display: grid; justify-items: center; gap: 8px; padding: 8px; border: 0; background: transparent; color: #fff; font-size: .72rem;
}
.dashboard-shortcuts button:hover { color: #75b3ff; }
.dashboard-shortcuts span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: #27354e; font-size: 1rem; }
.dashboard-promo-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 25px; }
.dashboard-promo {
  min-height: 105px; padding: 17px; border: 0; border-radius: 18px; color: #fff; text-align: left;
  display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden;
}
.dashboard-promo strong { display: block; margin-bottom: 5px; }
.dashboard-promo span { max-width: 220px; color: rgba(255,255,255,.78); font-size: .72rem; }
.promo-one { background: radial-gradient(circle at 90% 10%, #317eeb, transparent 42%), linear-gradient(135deg, #182b47, #101c30); }
.promo-two { background: radial-gradient(circle at 90% 10%, #a445ed, transparent 42%), linear-gradient(135deg, #3c1375, #1b1444); }
.portfolio-title { margin: 0 0 12px; font-size: 1.2rem; }
.portfolio-empty { padding: 38px 20px; border-radius: 22px; background: #19253b; text-align: center; color: #92a3be; }
.portfolio-empty > span { display: block; margin-bottom: 12px; font-size: 2rem; color: #51617c; }
.portfolio-empty strong { display: block; color: #fff; }
.portfolio-empty p { margin: 6px 0 18px; font-size: .8rem; }

.portal-container { width: min(1040px, 100% - 40px); margin: 0 auto; }
.portal-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.portal-heading h1 { margin-top: 4px; font-size: clamp(1.55rem, 3vw, 2.2rem); }
.portal-kicker { color: #66aaff; font-size: .7rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.portal-screen { display: none; }
.portal-screen.active { display: block; animation: portalIn .25s ease-out; }
@keyframes portalIn { from { opacity: 0; transform: translateY(7px); } }
.portal-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.portal-title h2 { margin-top: 5px; font-size: clamp(1.5rem, 3vw, 2rem); }
.portal-title > p { max-width: 420px; color: #91a2be; font-size: .82rem; text-align: right; }
.portal-grid { display: grid; gap: 16px; }
.portal-grid-3 { grid-template-columns: repeat(3, 1fr); }
.portal-card, .strategy-card {
  padding: 22px; border: 1px solid rgba(144, 165, 201, .12); border-radius: 20px; background: #19253b;
}
.portal-card-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 18px; border-radius: 13px; background: #283751; color: #79b6ff; font-size: 1.2rem; font-weight: 700; }
.portal-card h3, .strategy-card h3 { margin-bottom: 8px; font-size: 1rem; }
.portal-card p, .strategy-card p { color: #91a2be; font-size: .78rem; }
.portal-link { margin-top: 18px; padding: 0; border: 0; background: transparent; color: #69acff; font-size: .78rem; font-weight: 700; }
.portal-tag { display: inline-flex; margin-top: 16px; padding: 5px 9px; border-radius: 999px; background: #263650; color: #aac0df; font-size: .66rem; font-weight: 600; }
.portal-balance-card {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 5px 20px; margin-bottom: 18px; padding: 25px;
  border-radius: 22px; background: radial-gradient(circle at 80% 10%, rgba(73, 94, 255, .8), transparent 35%), linear-gradient(135deg, #73126f, #1024b7);
}
.portal-balance-card > span { color: rgba(255,255,255,.75); font-size: .76rem; }
.portal-balance-card > strong { grid-column: 1; font-family: var(--font); font-size: 2rem; }
.portal-balance-card > button { grid-column: 2; grid-row: 1 / 3; background: #fff; color: #101827; box-shadow: none; }
.portal-notice { display: flex; gap: 18px; margin: 18px 0; padding: 15px 18px; border: 1px solid #30435f; border-radius: 14px; background: #162339; font-size: .76rem; }
.portal-notice strong { color: #fff; white-space: nowrap; }
.portal-notice span { color: #93a6c4; }

.verification-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: 18px; }
.verification-status-card .btn { width: 100%; margin-top: 20px; }
.verification-steps { list-style: none; display: grid; gap: 10px; margin: 0; padding: 0; }
.verification-steps li { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 17px; background: #19253b; }
.verification-steps li > span { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: #2778e5; font-size: .76rem; font-weight: 700; }
.verification-steps strong, .verification-steps small { display: block; }
.verification-steps strong { font-size: .82rem; }
.verification-steps small { margin-top: 3px; color: #91a2be; font-size: .7rem; }

.promo-card { min-height: 260px; padding: 24px; border-radius: 21px; display: flex; flex-direction: column; justify-content: flex-end; }
.promo-card > span { margin-bottom: auto; font-size: .65rem; font-weight: 700; letter-spacing: .12em; }
.promo-card h3 { max-width: 230px; margin-bottom: 8px; font-size: 1.1rem; }
.promo-card p { color: rgba(255,255,255,.76); font-size: .76rem; }
.promo-card a, .promo-card button { align-self: flex-start; margin-top: 18px; padding: 9px 13px; border: 0; border-radius: 9px; background: #fff; color: #101827; font-size: .72rem; font-weight: 700; }
.promo-card button:disabled { opacity: .65; cursor: not-allowed; }
.promo-blue { background: radial-gradient(circle at 90% 0, #348df8, transparent 42%), linear-gradient(145deg, #172c4b, #122039); }
.promo-purple { background: radial-gradient(circle at 90% 0, #a444ed, transparent 42%), linear-gradient(145deg, #4c147d, #211548); }
.promo-orange { background: radial-gradient(circle at 90% 0, #ff9636, transparent 42%), linear-gradient(145deg, #7a2d22, #30172a); }

.referral-hero { padding: 30px; border-radius: 22px; background: radial-gradient(circle at 85% 20%, rgba(72,137,255,.45), transparent 35%), #19253b; }
.referral-hero h3 { margin: 13px 0 8px; font-size: 1.3rem; }
.referral-hero p { color: #96a8c4; font-size: .8rem; }
.referral-link { display: flex; margin-top: 24px; border: 1px solid #3a4b68; border-radius: 11px; overflow: hidden; }
.referral-link input { flex: 1; min-width: 0; padding: 12px 14px; border: 0; background: #111d31; color: #b7c5da; outline: 0; }
.referral-link button { padding: 0 20px; border: 0; background: #2778e5; color: #fff; font-weight: 700; }
.portal-stats { margin-top: 16px; }
.portal-stats article { padding: 20px; border-radius: 17px; background: #19253b; }
.portal-stats strong, .portal-stats span { display: block; }
.portal-stats strong { font-size: 1.35rem; }
.portal-stats span { color: #8fa1bd; font-size: .7rem; }

.strategy-card > div:first-child { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.strategy-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, #398cf6, #6c3ce9); font-weight: 800; }
.strategy-card .portal-tag { margin: 0; }
.strategy-card dl { display: grid; gap: 8px; margin: 17px 0; }
.strategy-card dl div { display: flex; justify-content: space-between; gap: 10px; font-size: .72rem; }
.strategy-card dt { color: #8fa1bd; }
.strategy-card dd { margin: 0; font-weight: 600; }
.strategy-card button { width: 100%; padding: 10px; border: 1px solid #344765; border-radius: 9px; background: #202e46; color: #7184a2; cursor: not-allowed; }

.profile-layout { display: grid; grid-template-columns: 280px 1fr; gap: 18px; }
.profile-card { text-align: center; }
.profile-avatar { display: grid; place-items: center; width: 74px; height: 74px; margin: 0 auto 16px; border-radius: 50%; background: linear-gradient(135deg, #3289fa, #613de1); font-size: 1.7rem; font-weight: 800; }
.profile-card p { overflow-wrap: anywhere; }
.security-list { display: grid; gap: 10px; }
.security-list article { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; border-radius: 16px; background: #19253b; }
.security-list strong, .security-list span { display: block; }
.security-list strong { margin-bottom: 3px; font-size: .82rem; }
.security-list span { color: #8fa1bd; font-size: .7rem; }
.security-list button { padding: 8px 12px; border: 1px solid #3b4c68; border-radius: 8px; background: #202e46; color: #fff; font-size: .72rem; }

.support-search { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 0 15px; border: 1px solid #344765; border-radius: 12px; background: #19253b; }
.support-search span { color: #7890b4; font-size: 1.4rem; }
.support-search input { width: 100%; padding: 14px 0; border: 0; outline: 0; background: transparent; color: #fff; }
.faq-list { display: grid; gap: 9px; }
.faq-list details { padding: 17px 19px; border-radius: 14px; background: #19253b; }
.faq-list summary { cursor: pointer; font-size: .82rem; font-weight: 600; }
.faq-list p { margin-top: 11px; color: #91a2be; font-size: .76rem; }
.portal-more-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border); }
.portal-more-nav button { padding: 9px 12px; border: 1px solid #31435f; border-radius: 9px; background: #18253b; color: #9eb0ca; font-size: .72rem; }
.portal-more-nav button:hover, .portal-more-nav button.current { border-color: #2778e5; color: #fff; }

@media (max-width: 900px) {
  body.signed-in .portal-nav { display: grid; grid-template-columns: repeat(5, 1fr); margin-bottom: 8px; }
  .portal-nav button { text-align: left; }
  .portal-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .profile-layout { grid-template-columns: 240px 1fr; }
}
@media (max-width: 680px) {
  .portal-container { width: calc(100% - 28px); }
  .portal-heading, .portal-title { align-items: flex-start; flex-direction: column; }
  .portal-title > p { text-align: left; }
  .portal-grid-3, .verification-layout, .profile-layout { grid-template-columns: 1fr; }
  .portal-balance-card { grid-template-columns: 1fr; }
  .portal-balance-card > button { grid-column: 1; grid-row: auto; margin-top: 12px; }
  .dashboard-shortcuts { grid-template-columns: repeat(2, 1fr); }
  .dashboard-promo-row { grid-template-columns: 1fr; }
  .security-list article { align-items: flex-start; }
}

/* ---------- Authenticated sidebar ---------- */
.member-sidebar, .member-sidebar-toggle, .sidebar-backdrop { display: none; }
body.signed-in .portal-nav { display: none !important; }
body.signed-in:not([data-portal-view="home"]) .member-sidebar {
  position: fixed; z-index: 45; top: 64px; bottom: 0; left: 0;
  display: flex; flex-direction: column; width: 238px;
  background: #111d31; border-right: 1px solid rgba(145, 166, 201, .12);
  box-shadow: 12px 0 35px rgba(3, 9, 20, .12); transition: width .25s ease, transform .25s ease;
}
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 22px 13px 14px; scrollbar-width: thin; }
.sidebar-label { margin: 8px 12px 7px; color: #607493; font-size: .61rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.sidebar-nav { display: grid; gap: 3px; margin-bottom: 19px; }
.sidebar-nav button {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 43px; padding: 9px 12px;
  border: 0; border-radius: 10px; background: transparent; color: #93a5c0; text-align: left;
  font-size: .76rem; font-weight: 600; white-space: nowrap; transition: background .18s, color .18s;
}
.sidebar-nav button:hover { background: #192943; color: #fff; }
.sidebar-nav button.current { background: linear-gradient(100deg, rgba(43,128,242,.23), rgba(43,128,242,.08)); color: #fff; }
.sidebar-nav button.current::before { content: ""; position: absolute; left: 0; width: 3px; height: 24px; border-radius: 0 4px 4px 0; background: #348af5; }
.sidebar-nav svg, .sidebar-account svg, .sidebar-collapse svg, .member-sidebar-toggle svg {
  width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.sidebar-account { display: flex; align-items: center; gap: 10px; margin: 0 12px 10px; padding: 12px 9px; border: 1px solid #2b3b56; border-radius: 13px; background: #17253b; }
.sidebar-avatar { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #3289fa, #613de1); color: #fff; font-weight: 800; }
.sidebar-user { min-width: 0; flex: 1; }
.sidebar-user strong, .sidebar-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { color: #fff; font-size: .72rem; }
.sidebar-user small { color: #7487a6; font-size: .61rem; }
.sidebar-account button { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; background: transparent; color: #7f92b0; }
.sidebar-account button:hover { color: #fff; }
.sidebar-collapse { display: flex; align-items: center; gap: 10px; min-height: 42px; margin: 0 13px 14px; padding: 9px 12px; border: 0; border-radius: 9px; background: transparent; color: #7185a4; font-size: .7rem; }
.sidebar-collapse:hover { background: #192943; color: #fff; }
body.dashboard-mode main, body.portal-mode main, body.trading-mode main { margin-left: 238px; transition: margin-left .25s ease; }
body.dashboard-mode .verify-strip, body.portal-mode .verify-strip, body.trading-mode .verify-strip { width: calc(100% - 238px); margin-left: 238px; transition: width .25s ease, margin-left .25s ease; }

body.sidebar-collapsed.signed-in:not([data-portal-view="home"]) .member-sidebar { width: 76px; }
body.sidebar-collapsed .sidebar-label, body.sidebar-collapsed .sidebar-nav span,
body.sidebar-collapsed .sidebar-user, body.sidebar-collapsed .sidebar-account > button,
body.sidebar-collapsed .sidebar-collapse span { display: none; }
body.sidebar-collapsed .sidebar-scroll { padding-inline: 10px; }
body.sidebar-collapsed .sidebar-nav button { justify-content: center; padding-inline: 8px; }
body.sidebar-collapsed .sidebar-account { justify-content: center; margin-inline: 10px; padding-inline: 7px; }
body.sidebar-collapsed .sidebar-collapse { justify-content: center; margin-inline: 10px; padding-inline: 8px; }
body.sidebar-collapsed .sidebar-collapse svg { transform: rotate(180deg); }
body.sidebar-collapsed.dashboard-mode main, body.sidebar-collapsed.portal-mode main, body.sidebar-collapsed.trading-mode main { margin-left: 76px; }
body.sidebar-collapsed.dashboard-mode .verify-strip, body.sidebar-collapsed.portal-mode .verify-strip, body.sidebar-collapsed.trading-mode .verify-strip { width: calc(100% - 76px); margin-left: 76px; }

@media (max-width: 1000px) {
  body.signed-in .nav-toggle { display: none; }
  body.signed-in:not([data-portal-view="home"]) .member-sidebar-toggle { display: grid !important; place-items: center; width: 40px; height: 40px; margin-left: auto; padding: 0; border: 1px solid #30415d; border-radius: 10px; background: #17253b; color: #fff; }
  body.signed-in:not([data-portal-view="home"]) .member-sidebar { top: 64px; width: min(280px, 86vw); transform: translateX(-105%); box-shadow: 22px 0 55px rgba(0,0,0,.35); }
  body.sidebar-open.signed-in:not([data-portal-view="home"]) .member-sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { position: fixed; z-index: 44; inset: 64px 0 0; display: block; border: 0; background: rgba(3, 9, 20, .66); backdrop-filter: blur(2px); }
  body.dashboard-mode main, body.portal-mode main, body.trading-mode main,
  body.sidebar-collapsed.dashboard-mode main, body.sidebar-collapsed.portal-mode main, body.sidebar-collapsed.trading-mode main { margin-left: 0; }
  body.dashboard-mode .verify-strip, body.portal-mode .verify-strip, body.trading-mode .verify-strip,
  body.sidebar-collapsed.dashboard-mode .verify-strip, body.sidebar-collapsed.portal-mode .verify-strip, body.sidebar-collapsed.trading-mode .verify-strip { width: 100%; margin-left: 0; }
  .sidebar-collapse { display: none; }
  body.sidebar-collapsed .sidebar-label { display: block; }
  body.sidebar-collapsed .sidebar-nav span, body.sidebar-collapsed .sidebar-user,
  body.sidebar-collapsed .sidebar-account > button { display: block; }
  body.sidebar-collapsed .sidebar-scroll { padding: 22px 13px 14px; }
  body.sidebar-collapsed .sidebar-nav button { justify-content: flex-start; padding-inline: 12px; }
  body.sidebar-collapsed .sidebar-account { justify-content: flex-start; margin-inline: 12px; padding-inline: 9px; }
}

@media (max-width: 640px) {
  body.signed-in .nav-inner { gap: 10px; }
  body.signed-in .brand-text { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.signed-in .nav-links { display: none; }
}

/* ==========================================================
   Public home page (light, broker-style layout)
   Applies while body[data-portal-view="home"]: signed-out
   visitors, and members viewing the academy website.
   ========================================================== */
.nav-start, .nav-account, .risk-bar, .chat-fab { display: none; }
.btn-dark { color: #fff; background: #1b2231; border: 1px solid #1b2231; border-radius: 8px; }
.btn-dark:hover { background: #2a3347; border-color: #2a3347; }
.btn-blue { color: #fff; background: #1f6feb; border: 1px solid #1f6feb; border-radius: 8px; }
.btn-blue:hover { background: #3a82f5; border-color: #3a82f5; }
.btn-outline-light { color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.35); border-radius: 8px; }
.btn-outline-light:hover { border-color: #fff; }
.accent { color: #1f6feb; }

body[data-portal-view="home"] {
  --home-ink: #0d111a; --home-text: #4b5566; --home-muted: #7a8494;
  --home-blue: #1f6feb; --home-grey: #f2f3f7; --home-line: #dde1e8;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: #fff; color: var(--home-ink); padding-bottom: 58px;
}
body[data-portal-view="home"] #markets { display: none; }

/* nav */
body[data-portal-view="home"] .nav { background: rgba(255,255,255,.97); border-bottom: 1px solid #eef0f4; box-shadow: none; }
body[data-portal-view="home"] .nav-inner { height: 76px; }
body[data-portal-view="home"] .brand-mark { background: linear-gradient(135deg, #1b2231 0 50%, #1f6feb 50%); box-shadow: none; }
body[data-portal-view="home"] .brand-mark svg { stroke: #fff; }
body[data-portal-view="home"] .brand-text { color: var(--home-ink); }
body[data-portal-view="home"] .brand-text em { color: var(--home-blue); }
body[data-portal-view="home"] .nav-links { gap: 30px; }
body[data-portal-view="home"] .nav-links > a:not(.btn) { color: var(--home-ink); font-size: .95rem; font-weight: 500; }
body[data-portal-view="home"] .nav-links > a:not(.btn):hover { color: var(--home-blue); }
body[data-portal-view="home"] .nav-cta { display: none; }
body[data-portal-view="home"] #navLogin { background: transparent; border: 0; color: var(--home-ink); font-weight: 500; font-size: .95rem; margin-left: auto; }
body[data-portal-view="home"] #navLogin:hover { color: var(--home-blue); transform: none; }
body[data-portal-view="home"]:not(.signed-in) .nav-start,
body[data-portal-view="home"].signed-in .nav-account { display: inline-flex; padding: 11px 18px; font-size: .95rem; font-weight: 600; }
body[data-portal-view="home"] #walletNav { background: var(--home-grey); border-color: var(--home-line); color: var(--home-ink); }
body[data-portal-view="home"] .nav-wallet-balance { color: var(--home-blue); }
body[data-portal-view="home"] .nav-name { color: var(--home-ink); }
body[data-portal-view="home"] .nav-toggle span { background: var(--home-ink); }

/* hero */
body[data-portal-view="home"] .hero {
  padding: 84px 0 0; color: #fff; overflow: hidden;
  background: radial-gradient(900px 420px at 78% 20%, rgba(31,111,235,.28), transparent 70%), #0b0f1a;
  border-radius: 0 0 96px 96px;
}
body[data-portal-view="home"] .hero::before, body[data-portal-view="home"] .hero-glow { display: none; }
body[data-portal-view="home"] .hero h1 { font-size: clamp(2.5rem, 5.2vw, 4.3rem); font-weight: 800; letter-spacing: -.03em; margin: 22px 0 20px; }
body[data-portal-view="home"] .hero .accent { color: #4d93ff; }
body[data-portal-view="home"] .hero .lead { color: #aeb7c7; font-size: 1.12rem; max-width: 560px; }
body[data-portal-view="home"] .hero .pill { color: #cfe0ff; background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); }
.hero-quote, .hero-signal {
  position: relative; border-radius: 22px; color: #fff;
  background: linear-gradient(155deg, rgba(34,44,66,.92), rgba(16,22,36,.92));
  border: 1px solid rgba(255,255,255,.1); box-shadow: 0 30px 60px -30px rgba(0,0,0,.8);
}
.hero-markets { margin-top: 64px; padding: 26px 0 38px; border-top: 1px solid rgba(255,255,255,.08); text-align: center; }
.hero-markets-title { margin-bottom: 14px; font-weight: 600; color: #fff; }
.hero-markets-title span { color: #7d8799; }
body[data-portal-view="home"] .hero .ticker { background: transparent; border: 0; }
body[data-portal-view="home"] .hero .tick-item { border-right-color: rgba(255,255,255,.1); color: #fff; }
body[data-portal-view="home"] .hero .tick-item .px { color: #aeb7c7; }

/* shared section heads */
.home-section { padding: 110px 0; }
.home-head { max-width: 820px; margin: 0 auto 56px; text-align: center; }
.home-head h2 { font-size: clamp(2rem, 4vw, 3.1rem); font-weight: 800; letter-spacing: -.03em; color: var(--home-ink); }
.home-head p { margin-top: 18px; font-size: 1.15rem; color: var(--home-text); }
.home-head .btn { margin-top: 36px; padding: 13px 18px; font-weight: 600; }

/* product bento */
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 40px; }
.bento-card {
  position: relative; overflow: hidden; min-height: 330px; padding: 32px; border-radius: 26px;
  color: #fff; display: flex; flex-direction: column;
}
.bento-card:nth-child(1) { grid-column: span 7; }
.bento-card:nth-child(2) { grid-column: span 5; }
.bento-card:nth-child(3) { grid-column: span 4; }
.bento-card:nth-child(4) { grid-column: span 8; }
.bento-copy { position: relative; z-index: 1; display: flex; flex-direction: column; flex: 1; max-width: 420px; }
.bento-card h3 { font-size: clamp(1.7rem, 2.6vw, 2.3rem); font-weight: 800; letter-spacing: -.02em; }
.bento-card p { margin-top: 16px; font-size: 1.02rem; font-weight: 500; line-height: 1.5; color: rgba(255,255,255,.92); }
.bento-link {
  margin-top: auto; padding: 24px 0 0; align-self: flex-start; border: 0; background: none;
  color: #fff; font-size: 1.08rem; font-weight: 700;
}
.bento-link span { display: inline-block; margin-left: 6px; transition: transform .2s; }
.bento-link:hover span { transform: translate(3px, -3px); }
.card-night { background: radial-gradient(420px 300px at 85% 90%, rgba(211,40,60,.35), transparent 70%), linear-gradient(135deg, #05070c, #16203a); }
.card-royal { background: radial-gradient(360px 260px at 90% 100%, rgba(120,170,255,.45), transparent 70%), linear-gradient(145deg, #1f3f95, #10266a); }
.card-ink { background: linear-gradient(150deg, #0c1224, #1b2544); }
.card-teal { background: radial-gradient(420px 320px at 90% 60%, rgba(52,211,153,.28), transparent 70%), linear-gradient(120deg, #0e3a6a, #0b5a78); }
.card-teal .bento-copy { max-width: 360px; }
.bento-art { position: absolute; right: 28px; bottom: 0; pointer-events: none; }
.phone {
  width: 190px; height: 250px; margin-bottom: -40px; padding: 16px 14px; border-radius: 28px;
  background: #0b0f1a; border: 6px solid #2a3140; transform: rotate(-8deg);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.8);
}
.phone-top { display: flex; justify-content: space-between; font-size: .72rem; color: #aeb7c7; }
.phone-top b { color: #fff; font-family: var(--mono); font-size: .7rem; }
.phone svg { width: 100%; height: 110px; margin: 18px 0; }
.phone-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.phone-btns span { padding: 8px 0; border-radius: 8px; text-align: center; font-size: .7rem; font-weight: 700; }
.phone-btns .sell { background: rgba(255,77,106,.2); color: #ff6d86; }
.phone-btns .buy { background: rgba(31,212,138,.2); color: #35e09b; }
.art-ticket { right: 24px; bottom: 24px; }
.ticket {
  width: 190px; padding: 14px; border-radius: 16px; transform: rotate(6deg);
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.ticket > div { display: flex; gap: 8px; align-items: center; font-size: .85rem; }
.ticket dl { margin: 12px 0 0; display: grid; gap: 6px; }
.ticket dl div { display: flex; justify-content: space-between; font-size: .75rem; }
.ticket dt { color: rgba(255,255,255,.7); }
.ticket dd { margin: 0; font-weight: 700; }
.art-cap { right: 22px; bottom: 22px; }
.art-cap svg { width: 150px; filter: drop-shadow(0 20px 30px rgba(0,0,0,.5)); }
.art-chat { right: 32px; top: 50%; bottom: auto; transform: translateY(-50%); display: grid; gap: 10px; width: 290px; }
.chat-bubble { display: flex; gap: 8px; align-items: flex-end; }
.bento-card .chat-bubble p { margin: 0; padding: 10px 12px; border-radius: 14px 14px 14px 4px; background: rgba(255,255,255,.14); font-size: .8rem; }
.chat-bubble.me { justify-content: flex-end; }
.bento-card .chat-bubble.me p { border-radius: 14px 14px 4px 14px; background: #1f6feb; }
.chat-bubble .av { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #f5b83d; color: #0b0f1a; font-size: .75rem; font-weight: 800; }

/* numbers (dark) */
.home-dark {
  position: relative; padding: 130px 0 190px; color: #fff; border-radius: 96px 96px 0 0;
  background: radial-gradient(700px 420px at 50% 55%, rgba(31,82,170,.45), transparent 70%), #000;
}
.home-dark .home-head h2 { color: #fff; }
.home-dark .home-head p { color: #9aa3b2; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; max-width: 1060px; margin: 0 auto 70px; }
.stats strong { display: block; font-size: clamp(2.6rem, 5vw, 4rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.stats p { margin-top: 18px; font-size: 1.12rem; font-weight: 500; }
.icon-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; }
.icon-cards article { padding: 24px; border-radius: 14px; background: rgba(11,16,28,.8); border: 1px solid rgba(255,255,255,.12); }
.icon-cards .ic { display: grid; place-items: center; width: 78px; height: 78px; border-radius: 50%; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.03); }
.icon-cards svg { width: 28px; height: 28px; fill: none; stroke: #4d93ff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-cards h3 { margin-top: 24px; font-size: 1.15rem; font-weight: 700; }
.icon-cards p { margin-top: 10px; color: #9aa3b2; font-size: .92rem; line-height: 1.5; }

/* fund security banner */
.home-security { background: linear-gradient(#000 0 50%, var(--home-grey) 50%); }
.security-card {
  position: relative; overflow: hidden; max-width: 1245px; margin: 0 auto; padding: 80px 24px 88px;
  border-radius: 26px; text-align: center; color: #fff;
  background: radial-gradient(500px 260px at 20% 110%, rgba(97,146,255,.35), transparent 70%), linear-gradient(120deg, #0b1a3c, #173a78 70%, #0f2a5e);
}
.security-card::before { content: ""; position: absolute; inset: 20px; border: 1px solid rgba(255,255,255,.14); border-radius: 18px; pointer-events: none; }
.security-card h2 { position: relative; font-size: clamp(1.8rem, 3.6vw, 3rem); font-weight: 800; letter-spacing: -.03em; }
.security-card p { position: relative; max-width: 760px; margin: 20px auto 0; color: #a9c6ff; font-size: 1.12rem; font-weight: 500; }
.security-card p strong { color: #fff; font-weight: 600; }
.security-shield { position: absolute; right: 30px; bottom: -20px; width: 170px; opacity: .85; }

/* every trader */
.home-grey { background: var(--home-grey); }
.home-grey .home-head p { color: var(--home-muted); }
.succeed-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.succeed-card { position: relative; overflow: hidden; min-height: 400px; padding: 34px; border-radius: 26px; display: flex; flex-direction: column; align-items: flex-start; }
.succeed-card h3 { font-size: clamp(1.7rem, 2.6vw, 2.3rem); font-weight: 800; letter-spacing: -.02em; }
.succeed-card p { position: relative; margin-top: 16px; max-width: 480px; font-size: 1rem; line-height: 1.55; }
.succeed-card ul { position: relative; margin: 20px 0 28px; padding: 0; list-style: none; display: grid; gap: 10px; }
.succeed-card li { padding-left: 28px; position: relative; font-weight: 500; }
.succeed-card li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; font-weight: 800; background: #1f6feb; color: #fff; }
.succeed-card .btn { position: relative; margin-top: auto; padding: 13px 20px; font-weight: 600; }
.succeed-light { background: #fff; color: var(--home-ink); }
.succeed-light p { color: var(--home-text); }
.succeed-dark { color: #fff; background: linear-gradient(140deg, #0b1224, #1a2750); }
.succeed-dark p { color: #b5bfd1; }
.succeed-art { position: absolute; right: 30px; bottom: 34px; display: flex; gap: 12px; pointer-events: none; }
.art-bars { align-items: flex-end; height: 130px; }
.art-bars i { width: 26px; border-radius: 13px; background: linear-gradient(90deg, #eef0f4, #b7bfcc 60%, #7d8696); box-shadow: 0 12px 24px -12px rgba(0,0,0,.4); }
.art-bars i:nth-child(1) { height: 50%; }
.art-bars i:nth-child(2) { height: 75%; }
.art-bars i:nth-child(3) { height: 62%; }
.art-bars i:nth-child(4) { height: 100%; background: linear-gradient(90deg, #6aa5ff, #1f6feb); }
.art-rings { width: 140px; height: 140px; }
.art-rings i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(77,147,255,.45); }
.art-rings i:nth-child(2) { inset: 22px; border-color: rgba(77,147,255,.65); }
.art-rings i:nth-child(3) { inset: 46px; background: radial-gradient(circle, #4d93ff, #1f4fb8); border: 0; box-shadow: 0 0 40px rgba(77,147,255,.6); }

/* support */
.home-support { position: relative; overflow: hidden; padding-bottom: 150px; }
.support-inner { position: relative; }
.home-support .home-head { position: relative; z-index: 1; }
.support-art { position: absolute; right: 0; bottom: -150px; width: 300px; }

/* footer (public page only; hidden in portal modes) */
.footer { padding: 50px 0 40px; background: #eceef2; border-top: 0; color: #0d111a; }
.footer .footer-top { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-bottom: 32px; margin-bottom: 36px; border-bottom: 1px solid #d3d7df; }
.footer .footer-top h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 600; letter-spacing: -.02em; }
.footer-social { display: flex; gap: 12px; }
.footer-social a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; border: 1px solid #c9ced8; background: #fff; }
.footer-social a:hover { border-color: #1f6feb; }
.footer-social svg { width: 22px; height: 22px; fill: #1b2231; }
.footer-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 40px; }
.footer-cols h4 { margin-bottom: 18px; color: #7a8494; font-size: .9rem; font-weight: 500; letter-spacing: .02em; text-transform: uppercase; }
.footer-cols a, .footer-cols button { display: block; margin-bottom: 12px; padding: 0; border: 0; background: none; color: #1b2231; font-size: .92rem; font-weight: 500; text-align: left; }
.footer-cols a:hover, .footer-cols button:hover { color: #1f6feb; }
.footer .disclaimer { color: #5d6778; font-size: .82rem; line-height: 1.7; }
.footer .disclaimer strong { color: #0d111a; }
.footer .copy { margin-top: 18px; color: #7a8494; font-size: .82rem; }

/* sticky risk bar + chat button */
body[data-portal-view="home"] .risk-bar:not([hidden]) {
  display: block; position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
  background: #fff; border-top: 1px solid #e3e6ec; box-shadow: 0 -6px 20px rgba(13,17,26,.05);
}
.risk-bar .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.risk-bar p { color: #4b5566; font-size: .88rem; }
.risk-bar strong { color: #0d111a; }
.risk-bar a { color: #1f6feb; }
.risk-bar button { flex: none; width: 32px; height: 32px; border: 0; background: none; color: #7a8494; font-size: 1.5rem; line-height: 1; }
body[data-portal-view="home"] .chat-fab {
  display: grid; place-items: center; position: fixed; z-index: 41; right: 28px; bottom: 90px;
  width: 58px; height: 58px; border-radius: 50%; background: #1f6feb; box-shadow: 0 12px 28px -8px rgba(31,111,235,.7);
}
.chat-fab svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chat-fab:hover { background: #3a82f5; }

@media (max-width: 1000px) {
  .bento { gap: 24px; }
  .bento-card:nth-child(n) { grid-column: span 12; }
  .icon-cards { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  body[data-portal-view="home"] .hero { padding-top: 56px; border-radius: 0 0 48px 48px; }
  body[data-portal-view="home"] .nav-links { top: 76px; background: #fff; border-bottom: 1px solid #eef0f4; }
  body[data-portal-view="home"] .nav-links > a:not(.btn) { border-bottom-color: #eef0f4; }
  body[data-portal-view="home"] #navLogin { margin: 12px 0 0; }
  body[data-portal-view="home"]:not(.signed-in) .nav-start,
  body[data-portal-view="home"].signed-in .nav-account { justify-content: center; margin-top: 10px; }
  .home-section { padding: 80px 0; }
  .home-dark { padding: 90px 0 150px; border-radius: 48px 48px 0 0; }
  .stats { grid-template-columns: 1fr; gap: 28px; text-align: center; }
  .succeed-grid { grid-template-columns: 1fr; gap: 24px; }
  .security-shield { width: 110px; right: 10px; opacity: .35; }
  .support-art { position: relative; right: auto; bottom: auto; display: block; width: 220px; margin: 40px auto -150px; }
}
@media (max-width: 640px) {
  body[data-portal-view="home"] .container { width: calc(100% - 32px); }
  .bento-card { min-height: 380px; padding: 26px; }
  .bento-art { transform: scale(.8); transform-origin: bottom right; }
  .art-chat { position: relative; right: auto; top: auto; transform: none; width: auto; margin-top: 22px; }
  .icon-cards { grid-template-columns: 1fr; }
  .succeed-art { opacity: .35; }
  .footer .footer-top { flex-direction: column; align-items: flex-start; }
  .risk-bar p { font-size: .78rem; }
  body[data-portal-view="home"] .chat-fab { right: 16px; bottom: 100px; width: 52px; height: 52px; }
  body[data-portal-view="home"] { padding-bottom: 80px; }
}

/* ---------- Demo / live account selector ---------- */
.tp-head > div:first-child { display: grid; gap: 3px; }
.trading-mode-caption { color: var(--text-faint); font-size: .67rem; }
.account-mode-switch {
  display: inline-flex; gap: 3px; padding: 4px; border: 1px solid #33445f;
  border-radius: 11px; background: #111d31;
}
.account-mode-switch button {
  min-height: 31px; padding: 0 10px; border: 0; border-radius: 7px;
  background: transparent; color: #879ab8; font-size: .7rem; font-weight: 700;
}
.account-mode-switch button.active { background: #2778e5; color: #fff; }
.account-mode-switch button[data-account-mode="live"]:hover { background: #202f48; color: #fff; }
.account-mode-switch button span {
  display: inline-block; margin-left: 3px; padding: 2px 4px; border-radius: 4px;
  background: #34445f; color: #b6c2d6; font-size: .52rem; text-transform: uppercase;
}
.dashboard-mode-switch { margin: -10px 0 18px; background: rgba(14, 24, 43, .75); }
.stepper[hidden], .lot-presets[hidden], #resetBtn[hidden], #historyTab[hidden] { display: none; }

.modal:not(#authModal) .live-setup-card { width: min(500px, 100%); padding: 30px; }
.live-setup-badge { display: inline-flex; margin-bottom: 12px; color: #1d6dd8; font-size: .66rem; font-weight: 800; letter-spacing: .12em; }
.live-readiness { display: grid; gap: 10px; margin: 22px 0; }
.live-readiness > div { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid #e0e6ee; border-radius: 12px; background: #f8fafc; }
.readiness-icon { display: grid; place-items: center; flex: none; width: 31px; height: 31px; border-radius: 50%; background: #fff2d6; color: #a86b00; font-size: .7rem; font-weight: 800; }
.readiness-icon.ready { background: #daf7e9; color: #08794e; }
.readiness-icon.pending { background: #eef1f6; color: #7a8799; }
.live-readiness strong, .live-readiness small { display: block; }
.live-readiness strong { color: #172033; font-size: .78rem; }
.live-readiness small { margin-top: 2px; color: #718097; font-size: .68rem; }
.live-safety-note { padding: 14px 15px; border-left: 3px solid #f2a516; border-radius: 8px; background: #fff8e8; }
.live-safety-note strong { color: #7c5200; font-size: .76rem; }
.live-safety-note p { margin-top: 4px; color: #75684f; font-size: .7rem; line-height: 1.5; }
.live-setup-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 18px; }
.live-setup-actions .btn { padding-inline: 12px; }
.modal:not(#authModal) .live-setup-actions .btn-ghost { color: #243047; background: #fff; border-color: #d7deea; }
.live-activate { width: 100%; margin-top: 10px; }
.live-activate:disabled { cursor: not-allowed; opacity: .45; }
.live-return { display: block; margin: 15px auto 0; padding: 0; border: 0; background: transparent; color: #65748c; font-size: .7rem; }
.live-return:hover { color: #1f6feb; }
.modal:not(#authModal) .live-order-card { width: min(460px, 100%); padding: 30px; }
.live-order-summary {
  display: grid; grid-template-columns: 1fr auto; gap: 9px 20px; margin: 18px 0;
  padding: 15px; border: 1px solid #e0e6ee; border-radius: 12px; background: #f8fafc;
  color: #718097; font-size: .74rem;
}
.live-order-summary strong { color: #172033; text-align: right; }
.live-order-summary strong.up { color: #078354; }
.live-order-summary strong.down { color: #ce334d; }
.live-order-consent { display: flex; align-items: flex-start; gap: 9px; color: #536278; font-size: .71rem; line-height: 1.45; }
.live-order-consent input { flex: none; margin-top: 2px; }

@media (max-width: 480px) {
  .tp-head { align-items: flex-start; }
  .account-mode-switch button { padding-inline: 8px; }
  .modal:not(#authModal) .live-setup-card { padding: 26px 20px 22px; }
  .live-setup-actions { grid-template-columns: 1fr; }
}

/* ==========================================================
   In-house trading engine UI: mode identity, ticket, confirmation, ledger, admin
   ========================================================== */
:root { --live: #ff6b3d; --live-bg: rgba(255, 107, 61, .14); --demo: #4aa3ff; --demo-bg: rgba(74, 163, 255, .14); }

/* Mode is impossible to miss: a bar under the nav on every member screen, plus tinted accents. */
.mode-bar {
  position: sticky; top: 64px; z-index: 40; display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  padding: 7px 16px; font-size: .78rem; font-weight: 600; letter-spacing: .01em;
  background: var(--demo-bg); color: #cfe6ff; border-bottom: 1px solid rgba(74, 163, 255, .35);
}
.mode-bar[hidden] { display: none; }
.mode-bar[data-mode="live"] { background: #3a1408; color: #ffd9cc; border-bottom: 2px solid var(--live); }
.mode-bar .link-btn { color: inherit; text-decoration: underline; font-size: .74rem; }
.mode-chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .68rem; font-weight: 800; letter-spacing: .12em; background: var(--demo); color: #06192f; }
[data-mode="live"] .mode-chip, .mode-tag.live { background: var(--live); color: #2a0c02; }
.mode-tag { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: .64rem; font-weight: 800; letter-spacing: .08em; background: var(--demo-bg); color: var(--demo); font-family: var(--font); }
.mode-tag.live { background: var(--live-bg); color: var(--live); }
body.mode-live .nav { box-shadow: 0 2px 0 var(--live); }
body.mode-live .trade-panel { border-color: rgba(255, 107, 61, .55); box-shadow: 0 0 0 1px rgba(255, 107, 61, .25), var(--shadow); }
.trade-panel[data-mode="live"] .tp-head h3 { color: var(--live); }
body.trading-mode .demo-banner[data-mode="live"] { background: #3a1408; border-color: var(--live); color: #ffd9cc; }
.pricing-note { display: none; max-width: 760px; margin: -6px auto 14px; font-size: .74rem; color: var(--text-faint); text-align: center; }
body.trading-mode .pricing-note { display: block; }
body.feed-down .pricing-note { color: var(--down); }

/* Order ticket */
.order-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 14px; padding: 4px; border-radius: 12px; background: var(--surface-2); }
.order-types button { padding: 7px 4px; border: 0; border-radius: 9px; background: transparent; color: var(--text-dim); font-size: .78rem; font-weight: 600; }
.order-types button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 0 var(--border-strong); }
.price-input { width: 100%; margin-bottom: 12px; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font: inherit; font-family: var(--mono); }
.price-input[hidden], #priceLabel[hidden] { display: none; }
.fee-preview { display: grid; gap: 6px; margin: 12px 0 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(255,255,255,.03); border: 1px dashed var(--border-strong); font-size: .76rem; }
.fee-preview > div { display: flex; justify-content: space-between; gap: 10px; }
.fee-preview dt { color: var(--text-faint); }
.fee-preview dd { margin: 0; color: var(--text); }
.form-msg { min-height: 1.1em; font-size: .76rem; color: var(--down); }
.form-msg.ok { color: var(--up); }
.trade-btn:disabled { opacity: .45; cursor: not-allowed; }
.pnl-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 4px; font-size: .74rem; }
.pnl-strip span { display: block; color: var(--text-faint); }
.pnl-strip strong { font-size: .92rem; }
.empty-note { padding: 18px 8px; text-align: center; color: var(--text-faint); font-size: .84rem; }
.empty-note:empty { display: none; }
.table td .badge, .table td .mode-tag, .table td .status-badge { font-family: var(--font); }
.close-btn[disabled] { opacity: .4; }
.mini { width: 120px; padding: 5px 8px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: .74rem; }

/* Depth */
.depth-book { display: grid; gap: 6px; margin: 10px 0; }
.depth-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 12px; border-radius: 10px; font-size: .78rem; }
.depth-row small { grid-column: 1 / -1; color: var(--text-faint); }
.depth-row.ask { background: var(--down-bg); }
.depth-row.bid { background: var(--up-bg); }
.depth-row.ask strong { color: var(--down); }
.depth-row.bid strong { color: var(--up); }
.depth-mid { text-align: center; font-size: .74rem; color: var(--text-dim); padding: 2px 0; }
.depth-own { display: grid; gap: 4px; font-size: .74rem; color: var(--text-dim); }
.depth-tape { max-height: 190px; overflow: auto; }

/* Light modals */
.live-setup-badge.live, #orderConfirmCard[data-mode="live"] #ocBadge { color: #c2410c; }
#orderConfirmCard[data-mode="live"] { border-top: 5px solid var(--live); }
#orderConfirmCard[data-mode="demo"] { border-top: 5px solid var(--demo); }
.confirm-table { display: grid; gap: 0; margin: 16px 0 8px; border: 1px solid #e0e6ee; border-radius: 12px; overflow: hidden; font-size: .78rem; }
.confirm-table > div { display: flex; justify-content: space-between; gap: 14px; padding: 9px 14px; border-top: 1px solid #edf1f6; background: #f8fafc; color: #718097; }
.confirm-table > div:first-child { border-top: 0; }
.confirm-table dt, .confirm-table dd { margin: 0; }
.confirm-table dd { color: #172033; text-align: right; font-weight: 600; }
.confirm-table .total { background: #fff; }
.confirm-table .total dd { font-size: .9rem; }
.confirm-table dd.down { color: #ce334d; }
.mode-text { letter-spacing: .04em; }
#orderConfirmCard[data-mode="live"] .mode-text { color: #c2410c; }
.disclosure-box { margin: 14px 0; padding: 14px; border-radius: 12px; background: #fff4ec; border: 1px solid #ffd2b8; color: #7a3412; font-size: .74rem; line-height: 1.5; }
.disclosure-box[hidden] { display: none; }
.disclosure-box p { margin: 6px 0 10px; }
#authModal .live-order-consent { color: var(--text-dim); margin: 6px 0 10px; }
#authModal .live-order-consent a { color: var(--gold-2); text-decoration: underline; }
.mfa-qr { display: grid; place-items: center; margin: 12px 0; }
.mfa-qr img { background: #fff; padding: 8px; border-radius: 12px; }
.mfa-secret { display: block; margin: 4px 0 14px; padding: 8px 10px; border-radius: 8px; background: #eef2f8; color: #172033; font-size: .78rem; word-break: break-all; text-align: center; }

/* Portal screens */
.portal-grid-2 { grid-template-columns: repeat(2, 1fr); }
.section-sub { margin: 26px 0 10px; font-size: 1rem; }
.stack-form { display: grid; gap: 4px; }
.stack-form .btn { margin-top: 6px; }
.portal-card .field select, .portal-card .field input, .filter-bar input, .filter-bar select { width: 100%; padding: 11px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font: inherit; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 14px 0; }
.filter-bar label { font-size: .72rem; color: var(--text-faint); display: grid; gap: 4px; }
.filter-bar .grow { flex: 1 1 260px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px 0; }
.reconcile-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.rules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 16px 0; }
.rule-item { display: grid; gap: 3px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.rule-item span { color: var(--text-faint); font-size: .72rem; }
.rule-item strong { font-size: 1.15rem; }
.rule-item small { color: var(--text-faint); font-size: .7rem; line-height: 1.4; }
.plain-list { padding-left: 20px; display: grid; gap: 6px; color: var(--text-dim); font-size: .86rem; }
.status-steps { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 10px; }
.status-steps li strong, .status-steps li small { display: block; }
.status-steps li small { color: var(--text-faint); }
.status-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .68rem; font-weight: 700; background: var(--surface-2); color: var(--text-dim); text-transform: capitalize; }
.status-badge.confirmed, .status-badge.paid, .status-badge.approved { background: var(--up-bg); color: var(--up); }
.status-badge.rejected, .status-badge.cancelled { background: var(--down-bg); color: var(--down); }
.status-badge.pending { background: rgba(245,184,61,.14); color: #f5b83d; }
.btn.danger { border-color: rgba(255,77,106,.5); color: var(--down); }
.notif-nav { position: relative; }
.notif-count { position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--down); color: #fff; font-size: .62rem; font-weight: 800; line-height: 17px; text-align: center; }
.notif-count[hidden] { display: none; }
.notif-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.notif { display: flex; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.notif.unread { border-color: var(--gold); cursor: pointer; }
.notif p { margin: 2px 0 0; color: var(--text-dim); font-size: .8rem; }
.notif time { color: var(--text-faint); font-size: .7rem; white-space: nowrap; }
.sig-illustration { font-size: .62rem; color: var(--text-faint); font-style: italic; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--border); margin: 12px 0 16px; }
.admin-panel { min-height: 200px; }
.rules-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; align-items: end; margin: 14px 0; }
.rules-form label { display: grid; gap: 4px; font-size: .72rem; color: var(--text-faint); text-transform: capitalize; }
.rules-form input { padding: 9px 10px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-2); color: var(--text); font: inherit; }
.rules-form .grow { grid-column: 1 / -1; text-transform: none; }

@media (max-width: 900px) { .portal-grid-2 { grid-template-columns: 1fr; } .mode-bar { top: 56px; } }
