/* ============================================================================
   BxPip design system — demo / educational broker-style app (not a real broker)
   ========================================================================== */

:root,
html[data-theme="dark"] {
  --bg: #080d16;
  --bg2: #0b1220;
  --panel: #0f1929;
  --card: #121c2e;
  --card-2: #16213412;
  --border: #1d2a3f;
  --border-2: #28394f;
  --text: #e7eef8;
  --dim: #8ba0bd;
  --muted: #62748f;
  --brand: #3b82f6;
  --brand-2: #2563eb;
  --brand-soft: rgba(59,130,246,.14);
  --up: #17c964;
  --up-soft: rgba(23,201,100,.13);
  --down: #f31260;
  --down-soft: rgba(243,18,96,.13);
  --warn: #f5a524;
  --warn-soft: rgba(245,165,36,.14);
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --shadow-sm: 0 4px 14px rgba(0,0,0,.28);
  --grid: #16233a;
  --chart-bg: #0c1524;
}

html[data-theme="light"] {
  --bg: #f4f7fc;
  --bg2: #ffffff;
  --panel: #ffffff;
  --card: #ffffff;
  --card-2: #f7f9fc;
  --border: #e4e9f2;
  --border-2: #d6deea;
  --text: #0d1a2b;
  --dim: #5c6b82;
  --muted: #8494ab;
  --brand: #2563eb;
  --brand-2: #1d4ed8;
  --brand-soft: rgba(37,99,235,.1);
  --up: #059669;
  --up-soft: rgba(5,150,105,.12);
  --down: #dc2626;
  --down-soft: rgba(220,38,38,.1);
  --warn: #d97706;
  --warn-soft: rgba(217,119,6,.12);
  --shadow: 0 10px 30px rgba(20,40,80,.12);
  --shadow-sm: 0 4px 14px rgba(20,40,80,.08);
  --grid: #eef2f8;
  --chart-bg: #ffffff;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar { display: none; width: 0; height: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 .4em; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.up { color: var(--up) !important; }
.down { color: var(--down) !important; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.hide-sm { }
svg { display: block; }

/* ------------------------------- Top bar -------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 18px;
  padding: 10px 20px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; }
.brand-mark { letter-spacing: -.02em; }
.brand-mark span { color: var(--brand); }
.mainnav { display: flex; gap: 6px; margin-left: 10px; }
.mainnav a { padding: 8px 14px; border-radius: 9px; color: var(--dim); font-weight: 600; }
.mainnav a:hover { color: var(--text); background: var(--brand-soft); }
.mainnav a.active { color: var(--text); background: var(--brand-soft); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.profile-menu { position: relative; }
.profile-btn { display: flex; align-items: center; gap: 6px; padding: 4px 8px 4px 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--text); cursor: pointer; }
.profile-btn:hover { border-color: var(--border-2); }
.profile-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 700; font-size: 12px; letter-spacing: .02em; }
.profile-avatar.lg { width: 40px; height: 40px; font-size: 14px; }
.profile-btn .caret { color: var(--dim); }
.profile-dropdown { position: absolute; right: 0; top: calc(100% + 10px); min-width: 232px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; z-index: 80; animation: pop .14s ease; }
.pd-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.pd-id { display: flex; flex-direction: column; min-width: 0; }
.pd-id b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-id span { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.pd-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 10px; border-radius: 9px; border: 0; background: none; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.pd-item:hover { background: var(--brand-soft); }
.pd-item svg { color: var(--dim); }
.pd-item.danger { color: var(--down); }
.pd-item.danger svg { color: var(--down); }
.pd-item.danger:hover { background: var(--down-soft); }
.account-menu { position: relative; }
.account-chip { display: flex; align-items: center; gap: 8px; padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px; font-family: inherit; font-weight: 600; font-size: 12px; background: var(--card); color: var(--text); cursor: pointer; }
.account-chip:hover { border-color: var(--border-2); }
.account-chip .caret { color: var(--dim); }
.account-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--up); }
#acText { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.ac-type { padding: 3px 6px; border-radius: 5px; font-size: 9px; font-weight: 800; letter-spacing: .045em; line-height: 1.2; }
.ac-type.demo { background: var(--brand-soft); color: var(--brand); }
.ac-type.real { background: var(--up-soft); color: var(--up); }
.ac-type.none { background: var(--card-2); color: var(--muted); }
.ac-detail { white-space: nowrap; }
.account-dropdown { position: absolute; right: 0; top: calc(100% + 10px); min-width: 300px; max-width: calc(100vw - 24px); background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; z-index: 80; animation: pop .14s ease; }
.ad-label { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px 5px; }
.ad-list { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; }
.ad-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; background: none; color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.ad-item:hover { background: var(--brand-soft); }
.ad-item.active { background: var(--brand-soft); }
.ad-badge { flex: none; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 3px 7px; border-radius: 6px; }
.ad-badge.demo { background: var(--brand-soft); color: var(--brand); }
.ad-badge.real { background: var(--up-soft); color: var(--up); }
.ad-meta { display: flex; flex-direction: column; margin-right: auto; min-width: 0; }
.ad-meta b { font-size: 12.5px; }
.ad-meta span { font-size: 11px; }
.ad-bal { font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.ad-empty { padding: 10px; font-size: 12.5px; color: var(--dim); }
.ad-new { display: block; width: 100%; text-align: left; padding: 9px 10px; border: 0; border-radius: 9px; background: none; cursor: pointer; font-family: inherit; font-weight: 600; font-size: 12.5px; color: var(--brand); }
.ad-new:hover { background: var(--brand-soft); }
.acct-choices { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.acct-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; text-align: left; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--text); font-family: inherit; cursor: pointer; }
.acct-choice:hover { border-color: var(--brand); background: var(--brand-soft); }
.acct-choice b { font-size: 14px; }
.acct-choice .dim { font-size: 12.5px; }
.auth-actions { display: flex; gap: 8px; align-items: center; }

.iconbtn {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--card);
  color: var(--text); cursor: pointer;
}
.iconbtn:hover { border-color: var(--border-2); }
html[data-theme="dark"] .i-sun { display: none; }
html[data-theme="light"] .i-moon { display: none; }

/* ------------------------------- Buttons -------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-weight: 600; font-size: 14px;
  cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--border-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
/* .buy / .sell (not .up / .down) so the global .up/.down !important colour
   helpers cannot repaint the label to match the button background. */
.btn.buy, .side-toggle button.buy.active { background: var(--up); border-color: var(--up); color: #fff; }
.btn.sell, .side-toggle button.sell.active { background: var(--down); border-color: var(--down); color: #fff; }
.btn.buy small, .btn.sell small { color: #fff; opacity: .9; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn.lg { padding: 12px 22px; font-size: 15px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ----------------------------- Ticker ------------------------------------ */
.ticker { overflow: hidden; border-bottom: 1px solid var(--border); background: var(--bg2); height: 38px; }
.ticker-track { display: inline-flex; gap: 26px; padding: 0 16px; height: 38px; align-items: center; white-space: nowrap; will-change: transform; animation: ticker 90s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tk { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; }
.tk b { font-weight: 700; }
.tk .p { font-variant-numeric: tabular-nums; }
.tk.flash-up .p { color: var(--up); }
.tk.flash-down .p { color: var(--down); }

/* ------------------------------- Layout ---------------------------------- */
.view { max-width: 1280px; margin: 0 auto; padding: 22px 20px 90px; min-height: 60vh; }
.view.terminal-wide {
  display: flex; flex-direction: column; height: calc(100vh - 99px); min-height: 0;
  max-width: none; margin: 0; padding: 12px 0 0; overflow: hidden;
}
@supports (height: 100dvh) {
  .view.terminal-wide { height: calc(100dvh - 99px); }
}
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 26px; }
.page-head p { margin: 0; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); }
.card.pad { padding: 18px; }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: 1fr 1fr; }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }

/* ------------------------------- Hero ------------------------------------ */
.hero {
  position: relative; overflow: hidden; border-radius: 18px; padding: 46px 40px;
  background:
    radial-gradient(1000px 400px at 90% -10%, var(--brand-soft), transparent 60%),
    linear-gradient(150deg, var(--bg2), var(--panel));
  border: 1px solid var(--border);
}
.hero h1 { font-size: 40px; line-height: 1.1; max-width: 620px; }
.hero .lead { font-size: 16px; color: var(--dim); max-width: 560px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.hero-badges { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 26px; margin-top: 30px; }
.hero-badges .b { font-size: 13px; }
.hero-badges .b b { display: block; font-size: 20px; color: var(--text); }

/* --------------------------- XM-style hero -------------------------------- */
.hero-xm {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 34px; align-items: stretch;
  position: relative; overflow: hidden; border-radius: 18px; padding: 42px 40px;
  background:
    radial-gradient(1000px 420px at 88% -20%, var(--brand-soft), transparent 62%),
    linear-gradient(150deg, var(--bg2), var(--panel));
  border: 1px solid var(--border);
}
.hero-main { display: flex; flex-direction: column; justify-content: center; }
.hero-main h1 { font-size: 38px; line-height: 1.1; max-width: 560px; margin-top: 16px; }
.hero-main .lead { font-size: 16px; color: var(--dim); max-width: 480px; margin-bottom: 0; }
.hero-main .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.hero-card { border: 1px solid var(--border); border-radius: 16px; background: var(--card); box-shadow: var(--shadow-sm); padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.hc-tag { align-self: flex-start; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); background: var(--brand-soft); padding: 4px 10px; border-radius: 999px; }
.hc-bonus { display: flex; align-items: center; gap: 14px; }
.hc-gift { flex: none; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; color: #fff; background: linear-gradient(150deg, var(--brand), var(--brand-2)); box-shadow: var(--shadow-sm); }
.hc-bonus h3 { margin: 0; font-size: 18px; line-height: 1.28; }
.btn.block { width: 100%; justify-content: center; }
.hero-assets { border-top: 1px solid var(--border); padding-top: 14px; }
.hero-assets-head { font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--dim); margin-bottom: 10px; }
.asset-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.asset-ico { flex: none; width: 30px; height: 30px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; }
.ha-flags { display: flex; width: 30px; height: 30px; border-radius: 8px; overflow: hidden; }
.ha-flags img { width: 50%; height: 100%; object-fit: cover; }
.ha-tile { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: -.02em; }
.asset-meta { display: flex; flex-direction: column; min-width: 0; }
.asset-meta b { font-size: 13px; }
.asset-meta span { font-size: 11.5px; color: var(--muted); }

/* ------------------------------ Awards ----------------------------------- */
.award-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.award-card { display: flex; flex-direction: column; gap: 4px; padding: 18px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.award-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 8px; }
.award-card b { font-size: 13.5px; line-height: 1.3; }
.award-card .muted { font-size: 11.5px; }
.promo {
  position: relative; overflow: hidden; margin-top: 22px;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 22px;
  padding: 24px 28px; border-radius: 18px; border: 1px solid var(--border);
  background: linear-gradient(120deg, var(--brand-soft), var(--card) 62%);
}
.promo::after { content: ""; position: absolute; right: -70px; top: -90px; width: 240px; height: 240px; background: radial-gradient(circle, var(--brand-soft), transparent 70%); pointer-events: none; }
.promo-icon {
  width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center;
  color: #fff; background: linear-gradient(150deg, var(--brand), var(--brand-2)); box-shadow: var(--shadow-sm);
}
.promo-tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--brand); }
.promo h2 { font-size: 20px; line-height: 1.3; margin: 6px 0 6px; }
.promo-hl { color: var(--brand); }
.promo .dim { margin: 0; font-size: 13.5px; max-width: 640px; }
.promo-action { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); font-size: 12px; font-weight: 600; }

/* --------------------------- Landing sections ----------------------------- */
.trust-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
.trust-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.trust-item svg { color: var(--brand); flex: none; }
.trust-item b { display: block; font-size: 13.5px; }
.trust-item span { font-size: 11.5px; color: var(--muted); }
.sec { margin-top: 46px; }
.sec-head { margin-bottom: 20px; }
.sec-head h2 { font-size: 26px; margin: 0 0 6px; }
.sec-head p { margin: 0; max-width: 620px; }
.feat .feat-ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 14px; }
.feat h3 { margin: 0 0 6px; font-size: 16px; }
.feat p { margin: 0; font-size: 13.5px; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.step { padding: 22px 20px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.step-n { font-size: 12px; font-weight: 800; letter-spacing: .09em; color: var(--brand); }
.step h3 { margin: 9px 0 6px; font-size: 16px; }
.step p { margin: 0; font-size: 13.5px; }
.cta-band {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  margin-top: 46px; padding: 34px 38px; border-radius: 18px; border: 1px solid var(--border);
  background: radial-gradient(800px 300px at 100% -20%, var(--brand-soft), transparent 60%), linear-gradient(150deg, var(--bg2), var(--panel));
}
.cta-band h2 { margin: 0 0 6px; font-size: 24px; }
.cta-band p { margin: 0; }

/* ------------------------------- Tables ---------------------------------- */
.table-wrap { overflow-x: auto; }
table.dt { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.dt th { text-align: right; padding: 11px 14px; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.dt td { padding: 11px 14px; text-align: right; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.dt th:first-child, table.dt td:first-child { text-align: left; }
table.dt.market-dt { table-layout: fixed; }
table.dt.market-dt th, table.dt.market-dt td { width: 25%; }
table.dt.market-dt .trend-col { text-align: right; }
table.dt.market-dt .trend-col .spark { margin-left: auto; }
table.dt.market-dt .symcell { overflow: hidden; }
table.dt.market-dt .symcell .nm { min-width: 0; }
table.dt.market-dt .symcell .nm b,
table.dt.market-dt .symcell .nm small { display: block; overflow: hidden; text-overflow: ellipsis; }
table.dt tbody tr { cursor: pointer; transition: background .12s; }
table.dt tbody tr:hover { background: var(--brand-soft); }
.symcell { display: flex; align-items: center; gap: 10px; }
.symcell .nm { display: flex; flex-direction: column; line-height: 1.2; }
.symcell .nm b { font-weight: 700; }
.symcell .nm small { color: var(--muted); font-size: 11px; }

/* ------------------------- Instrument icons ------------------------------ */
.sym-ico {
  width: 30px; height: 30px; min-width: 30px; flex: none;
  display: inline-grid; place-items: center; overflow: hidden;
  border-radius: 50%; font-size: 11px; font-weight: 800; color: #fff; line-height: 1;
  background: var(--brand);
}
.sym-ico img { display: block; width: 100%; height: 100%; object-fit: contain; }
.sym-ico.crypto { background: transparent; }
.sym-ico.fx { position: relative; background: transparent; overflow: visible; }
.sym-ico.fx img { position: absolute; width: 20px; height: 20px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1.5px var(--card); }
.sym-ico.fx img:first-child { left: 0; top: 0; }
.sym-ico.fx img:last-child { right: 0; bottom: 0; }
.sym-ico.lg { width: 40px; height: 40px; min-width: 40px; font-size: 14px; }
.sym-ico.lg.fx img { width: 27px; height: 27px; }

/* ----------------------------- Skeletons --------------------------------- */
.skel {
  display: inline-block; height: 12px; width: 100%; border-radius: 6px;
  background: linear-gradient(90deg, var(--card-2) 25%, var(--border) 37%, var(--card-2) 63%);
  background-size: 400% 100%; animation: shimmer 1.3s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.skel-table td { padding-top: 16px; padding-bottom: 16px; }
.skel-row { cursor: default !important; }
.skel-row:hover { background: transparent !important; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.pill.up { background: var(--up-soft); }
.pill.down { background: var(--down-soft); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.dim { background: var(--card-2); color: var(--dim); }
.spark { width: 92px; height: 30px; display: block; }

/* ------------------------------- Terminal -------------------------------- */
.terminal { display: grid; grid-template-columns: 220px minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.view.terminal-wide > .terminal { flex: 1; min-height: 0; height: auto; overflow: hidden; align-items: stretch; }
.view.terminal-wide > .terminal > * { min-height: 0; }
.terminal-center { min-width: 0; }
.terminal-wide .terminal-center { height: 100%; overflow-y: auto; scrollbar-width: none; }
.terminal-wide .terminal-center::-webkit-scrollbar { display: none; }
.terminal-wide .market-watch { position: relative; top: auto; height: 100%; max-height: none; }
.terminal-wide .order-panel { height: 100%; max-height: 100%; overflow-y: auto; scrollbar-width: none; }
.terminal-wide .order-panel::-webkit-scrollbar { display: none; }
.market-watch {
  position: sticky; top: 108px; display: flex; flex-direction: column; min-width: 0;
  max-height: calc(100vh - 128px); overflow: hidden;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
}
.market-watch-head { display: flex; align-items: center; justify-content: space-between; min-height: 46px; padding: 0 12px; border-bottom: 1px solid var(--border); }
.market-watch-head b { font-size: 13px; }
.market-watch-toggle { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--dim); cursor: pointer; }
.market-watch-toggle:hover { background: var(--brand-soft); color: var(--text); }
.market-watch-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.market-search { display: flex; align-items: center; gap: 8px; margin: 10px; padding: 8px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg2); color: var(--muted); }
.market-search svg { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.market-search input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 12px; }
.market-search input::placeholder { color: var(--muted); }
.market-groups { flex: 1; min-height: 0; overflow-y: auto; padding: 0 7px 8px; }
.market-group { border-bottom: 1px solid var(--border); }
.market-group-toggle { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 7px; border: 0; background: transparent; color: var(--dim); text-align: left; font: inherit; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; cursor: pointer; }
.market-group-toggle span { flex: 1; }
.market-group-toggle small { color: var(--muted); font-size: 10px; font-weight: 600; }
.market-group-toggle svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.market-group-toggle[aria-expanded="false"] svg { transform: rotate(-90deg); }
.market-group-items { display: flex; flex-direction: column; gap: 2px; padding-bottom: 7px; }
.market-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-width: 0; padding: 7px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.market-item:hover { background: var(--card-2); }
.market-item.active { background: var(--brand-soft); box-shadow: inset 2px 0 var(--brand); }
.market-item .sym-ico { width: 24px; height: 24px; min-width: 24px; font-size: 9px; }
.market-item .sym-ico.fx img { width: 16px; height: 16px; }
.market-item-info { display: flex; flex: 1; flex-direction: column; min-width: 0; gap: 1px; }
.market-item-info b { font-size: 11.5px; font-weight: 700; }
.market-item-info small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.market-item-price { flex: none; color: var(--dim); font-size: 10px; font-variant-numeric: tabular-nums; }
.terminal.market-collapsed { grid-template-columns: 42px minmax(0, 1fr) 340px; }
.market-watch.collapsed .market-watch-head { justify-content: center; padding: 0 5px; }
.market-watch.collapsed .market-watch-head b, .market-watch.collapsed .market-search, .market-watch.collapsed .market-groups { display: none; }
.market-watch.collapsed .market-watch-toggle svg { transform: rotate(180deg); }
.chart-box { position: relative; display: flex; flex-direction: column; height: 460px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.tv-chart { position: relative; flex: 1 1 auto; min-height: 0; padding-left: 42px; background: var(--panel); }
.tv-loading { display: flex; align-items: center; justify-content: center; height: 100%; }

/* ---- Lightweight-charts left vertical toolbar (TradingView style) ---- */
.tv-sidebar { position: absolute; left: 0; top: 0; bottom: 0; width: 42px; z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 0; background: var(--bg2); border-right: 1px solid var(--border); }
.tv-sb-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; color: var(--muted); background: transparent; border: none; border-radius: 4px; cursor: pointer; transition: background .12s, color .12s; }
.tv-sb-btn svg { pointer-events: none; }
.tv-sb-btn:hover { color: var(--text); background: var(--border); }
.tv-sb-btn.on { color: #fff; background: var(--brand); }
.tv-sb-sep { width: 24px; height: 1px; margin: 4px 0; background: var(--border); }

/* ---- HTML order-line overlay (entry / SL / TP) on top of the chart ---- */
.tv-ord-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 4; }
.tv-ord-line { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed; pointer-events: none; }
.tv-ord-line.entry { border-top-style: dashed; border-top-width: 1px; }
.tv-ord-line.sl { border-top-color: #ef4444; border-top-style: dashed; }
.tv-ord-line.tp { border-top-color: #16a34a; border-top-style: dashed; }
.tv-ord-line.ghost { opacity: .5; }
.tv-ord-line.draw { border-top-color: #f5a623; border-top-style: solid; }

.tv-ord-tag { position: absolute; right: 0; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; font-size: 11px; font-weight: 700; line-height: 1.4; letter-spacing: .2px; color: #fff; background: #64748b; border-radius: 3px; white-space: nowrap; pointer-events: auto; cursor: ns-resize; box-shadow: 0 1px 2px rgba(15,23,42,.25); }
.tv-ord-tag.entry { right: 0; background: #2962ff; }
.tv-ord-tag.sl { background: #ef4444; }
.tv-ord-tag.tp { background: #16a34a; }
.tv-ord-tag.ghost { color: #64748b; background: transparent; border: 1px dashed #94a3b8; box-shadow: none; font-weight: 600; }
.tv-ord-side { font-weight: 800; }
.tv-ord-pnl { font-weight: 700; padding: 0 5px; border-radius: 3px; background: rgba(255,255,255,.18); }
.tv-ord-pnl.pos { color: #bbf7d0; }
.tv-ord-pnl.neg { color: #fecaca; }

/* user drawings */
.tv-draw-layer { z-index: 3; }
.tv-draw-label { position: absolute; left: 4px; transform: translateY(-50%); padding: 0 5px; font-size: 10px; font-weight: 600; color: #f5a623; background: rgba(245,166,35,.12); border-radius: 3px; pointer-events: auto; cursor: ns-resize; }
.tv-draw-vline { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid #f5a623; }
.quote-strip { display: flex; gap: 22px; padding: 10px 16px; margin-top: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); font-size: 12.5px; flex-wrap: wrap; }
.quote-strip .q b { font-variant-numeric: tabular-nums; }

/* Chart drawing toolbar — a real bar above the candles, never covering them */
.chart-toolbar { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: var(--bg2); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ct-tools { display: flex; align-items: center; gap: 3px; row-gap: 4px; flex: 1 1 auto; min-width: 0; flex-wrap: wrap; }
.ct-hint { flex: 0 1 auto; font-size: 12px; font-weight: 600; color: var(--brand); white-space: nowrap; }
/* Right-axis price tags for the entry / SL / TP lines (Exness / XM style). */
.kl-tags { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 4; }
.kl-tag { position: absolute; right: 2px; transform: translateY(-50%); padding: 2px 6px; font-size: 11px; font-weight: 700; line-height: 1.3; letter-spacing: .2px; color: #fff; background: #64748b; border-radius: 4px; white-space: nowrap; box-shadow: 0 1px 2px rgba(15,23,42,.25); }
.kl-tag.entry { right: 6px; }
.kl-tag.ghost { color: #64748b; font-weight: 600; background: rgba(148,163,184,.16); border: 1px dashed #94a3b8; box-shadow: none; }
.ct-sep { flex: 0 0 auto; width: 1px; align-self: stretch; margin: 3px 4px; background: var(--border); }
.ct-foot { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.ct-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 28px; padding: 0 7px; font-size: 13px; font-weight: 600; line-height: 1; color: var(--muted); background: var(--panel); border: 1px solid var(--border); border-radius: 7px; cursor: pointer; white-space: nowrap; }
.ct-btn:hover { color: var(--brand); border-color: var(--brand); }
.ct-btn.on { color: #fff; background: var(--brand); border-color: var(--brand); }
.ct-btn.ct-wide { padding: 0 12px; }
.ct-ind { height: 28px; padding: 0 8px; font-size: 12px; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 7px; cursor: pointer; }
.order-hint { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--dim); }
.order-hint .oh { display: inline-flex; align-items: center; gap: 6px; }
.order-hint .oh i { display: inline-block; width: 14px; height: 2px; border-radius: 2px; }

.order-panel { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.order-panel h3 { font-size: 15px; }
.order-title { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.side-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.side-toggle button { padding: 9px; border-radius: 9px; border: 1px solid var(--border); background: var(--card-2); font-weight: 700; cursor: pointer; color: var(--dim); }
.side-toggle button.buy.active { background: var(--up); color: #fff; border-color: var(--up); }
.side-toggle button.sell.active { background: var(--down); color: #fff; border-color: var(--down); }
.field { margin-bottom: 11px; }
.field label { display: block; font-size: 12px; color: var(--dim); margin-bottom: 5px; font-weight: 600; }
.input, select.input {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg2); color: var(--text); font-size: 14px; outline: none; font-variant-numeric: tabular-nums;
}
.input:focus { border-color: var(--brand); }
.quick-lots { display: flex; gap: 6px; margin-top: 6px; }
.quick-lots button { flex: 1; padding: 5px; border-radius: 7px; border: 1px solid var(--border); background: var(--card-2); color: var(--dim); font-size: 11px; font-weight: 700; cursor: pointer; }
.quick-lots button:hover { color: var(--text); border-color: var(--brand); }
.order-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--dim); margin: 4px 0; }
.order-submit { margin-top: 12px; padding: 13px; font-size: 15px; }

/* positions table */
.pos-wrap { margin-top: 14px; }
.pos-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.pos-head h3 { margin: 0; font-size: 15px; }

/* ------------------------------ Stat cards ------------------------------- */
.stat { padding: 16px; }
.stat .k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.stat .v { font-size: 24px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12px; color: var(--dim); margin-top: 2px; }

/* ------------------------- Account management ---------------------------- */
.accounts-page { max-width: 1220px; margin: 10px auto 0; }
.accounts-heading, .account-section-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.accounts-heading { margin-bottom: 25px; }
.accounts-heading h1 { margin: 0; font-size: 28px; letter-spacing: -.025em; }
.accounts-heading p, .account-section-heading p { margin: 4px 0 0; }
.account-create { min-height: 40px; padding: 9px 17px; background: var(--card-2); }
.account-create > span { font-size: 20px; line-height: 14px; font-weight: 400; }
.accounts-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 14px; border-bottom: 1px solid var(--border);
}
.account-tabs { display: flex; gap: 4px; align-self: stretch; }
.account-tabs button {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 15px;
  color: var(--dim); background: transparent; border: 0; border-bottom: 2px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer;
}
.account-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--brand); }
.account-tabs button span { min-width: 19px; padding: 1px 6px; border-radius: 20px; background: var(--card-2); color: var(--muted); font-size: 11px; text-align: center; }
.account-tools { display: flex; align-items: center; gap: 10px; padding-bottom: 6px; }
.account-sort { width: 180px; }
.account-sort .input { padding: 8px 10px; font-size: 12.5px; }
.account-view-toggle { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg2); }
.account-view-toggle button {
  display: grid; place-items: center; width: 31px; height: 30px; padding: 0;
  border: 0; border-radius: 6px; background: transparent; color: var(--dim); cursor: pointer;
}
.account-view-toggle button.active { color: var(--text); background: var(--card); box-shadow: var(--shadow-sm); }
.account-view-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.account-list { display: flex; flex-direction: column; gap: 12px; }
.acc-card.account-row {
  display: flex; align-items: center; justify-content: space-between; gap: 22px;
  min-height: 126px; padding: 18px 20px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--card); box-shadow: none; transition: border-color .15s, background .15s;
}
.acc-card.account-row.demo, .acc-card.account-row.real { border-left: 1px solid var(--border); }
.acc-card.account-row:hover { border-color: var(--border-2); }
.acc-card.account-row.is-active { border-color: color-mix(in srgb, var(--brand) 35%, var(--border)); }
.account-row-main { flex: 1; min-width: 0; }
.account-row-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; min-height: 24px; }
.account-tag { padding: 3px 8px; border-radius: 20px; background: var(--card-2); color: var(--dim); font-size: 11px; line-height: 1.2; }
.account-tag.demo { background: var(--brand-soft); color: var(--brand); }
.account-tag.real { background: var(--up-soft); color: var(--up); }
.account-login { margin-left: 5px; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.account-leverage { color: var(--muted); font-size: 12px; }
.account-current { padding: 3px 8px; border-radius: 20px; background: var(--brand-soft); color: var(--brand); font-size: 10.5px; font-weight: 700; }
.account-row-balance { display: flex; align-items: baseline; gap: 5px; margin-top: 12px; }
.acc-card.account-row .balance { font-size: 27px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.account-currency { color: var(--dim); font-size: 13px; }
.acc-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.acc-actions .btn { min-height: 38px; padding: 8px 14px; font-size: 12.5px; border-radius: 7px; }
.account-trade { min-width: 94px; color: #111827; background: #f5cf00; border-color: #f5cf00; }
.account-trade:hover { background: #e8c300; border-color: #e8c300; }
.account-trade svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.account-action { background: var(--card-2); }
.account-more { width: 38px; padding: 0 !important; font-size: 17px !important; letter-spacing: 1px; }
.account-more svg { width: 16px; height: 16px; fill: currentColor; }
.account-details { display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr)); gap: 10px 20px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.account-details > div { display: flex; justify-content: space-between; gap: 10px; color: var(--dim); font-size: 12px; }
.account-details b { color: var(--text); font-variant-numeric: tabular-nums; }
.account-list.grid-mode { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.account-list.grid-mode .acc-card.account-row { align-items: stretch; flex-direction: column; gap: 15px; }
.account-list.grid-mode .acc-actions { flex-wrap: wrap; }
.account-filter-empty, .account-empty { padding: 52px 20px; border: 1px dashed var(--border-2); border-radius: 12px; background: var(--card); text-align: center; }
.account-filter-empty h3, .account-empty h3 { margin: 12px 0 4px; font-size: 17px; }
.account-filter-empty p, .account-empty p { margin: 0 auto 16px; max-width: 420px; }
.empty-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); font-size: 22px; font-weight: 500; }
.account-history { margin-top: 36px; }
.account-section-heading { margin-bottom: 14px; }
.account-section-heading h2 { margin: 0; font-size: 19px; }
.account-section-heading .input { width: auto; min-width: 250px; padding: 8px 11px; font-size: 12.5px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ------------------------------- Forms ----------------------------------- */
.auth-wrap { max-width: 420px; margin: 30px auto; }
.auth-card { padding: 26px; }
.auth-card h1 { font-size: 24px; }
.form-err { background: var(--down-soft); color: var(--down); padding: 9px 12px; border-radius: 9px; font-size: 13px; margin-bottom: 12px; }
.form-ok { background: var(--up-soft); color: var(--up); padding: 9px 12px; border-radius: 9px; font-size: 13px; margin-bottom: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* --------------------------- OTP verification ---------------------------- */
.otp-row { display: flex; gap: 9px; justify-content: space-between; margin: 8px 0 16px; }
.otp-box {
  flex: 1 1 0; min-width: 0; height: 56px; text-align: center; font-size: 22px; font-weight: 700;
  padding: 0; border-radius: 12px; border: 1.5px solid var(--border); background: var(--bg2);
  color: var(--text); outline: none; font-variant-numeric: tabular-nums; transition: border-color .12s, box-shadow .12s;
}
.otp-box:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.pw-hint { font-size: 12px; color: var(--dim); margin: -4px 0 12px; }
.linklike { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; }
.linklike:disabled { color: var(--muted); cursor: default; }
.linklike:not(:disabled):hover { text-decoration: underline; }

/* ---------------------- Password show / hide toggle ---------------------- */
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; }
.pw-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  display: inline-grid; place-items: center; width: 32px; height: 32px;
  border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 8px;
}
.pw-toggle:hover { color: var(--text); background: var(--brand-soft); }
.pw-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.pw-toggle svg { width: 18px; height: 18px; }
.pw-toggle .eye-off { display: none; }
.pw-toggle.on .eye-on { display: none; }
.pw-toggle.on .eye-off { display: block; }

/* ------------------------------- Toast/modal ----------------------------- */
.toast-wrap { position: fixed; right: 18px; bottom: 84px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--brand); border-radius: 10px; padding: 11px 15px; box-shadow: var(--shadow); min-width: 220px; animation: pop .18s ease; }
.toast.ok { border-left-color: var(--up); }
.toast.err { border-left-color: var(--down); }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.modal-wrap { position: fixed; inset: 0; z-index: 300; background: rgba(4,8,16,.6); display: grid; place-items: center; padding: 18px; }
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 22px; max-width: 440px; width: 100%; box-shadow: var(--shadow); }

/* ------------------------------- Footer ---------------------------------- */
.sitefooter { display: none; border-top: 1px solid var(--border); background: var(--bg2); padding: 44px 20px 90px; margin-top: 30px; }
body.landing-page .sitefooter { display: block; }
.foot-cols { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 1.7fr 1fr 1fr; gap: 30px 40px; align-items: start; }
.foot-brand .brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 21px; }
.logo-mark { display: inline-flex; }
.logo-mark svg { display: block; border-radius: 7px; }
.foot-brand p { margin: 14px 0 0; max-width: 430px; font-size: 13.5px; line-height: 1.6; }
.foot-col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 12px; }
.foot-col a, .foot-col span { display: block; padding: 4px 0; color: var(--dim); font-size: 13.5px; }
.foot-col a:hover { color: var(--text); }
.foot-note { max-width: 1280px; margin: 34px auto 0; padding-top: 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }

/* --------------------------- Mobile bottom nav --------------------------- */
.mobilenav { display: none; }

/* ------------------------------ Utilities -------------------------------- */
.flex { display: flex; gap: 12px; align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.mt { margin-top: 14px; }
.mt2 { margin-top: 24px; }
.center { text-align: center; }
.empty { padding: 34px 18px; text-align: center; color: var(--dim); }
.loader { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--border-2); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
.loader.sm { width: 14px; height: 14px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 52vh; }
.boot-wrap .loader { width: 32px; height: 32px; border-width: 3px; }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 0 var(--up); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(23,201,100,.5);} 70% { box-shadow: 0 0 0 7px rgba(23,201,100,0);} 100%{box-shadow:0 0 0 0 rgba(23,201,100,0);} }
.badge-src { font-size: 10.5px; color: var(--muted); }

/* ------------------------- live support chat --------------------------- */
.support-panel {
  position: fixed; right: 18px; bottom: 18px; z-index: 190;
  width: 370px; max-width: calc(100vw - 24px);
  height: 540px; max-height: calc(100vh - 120px);
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow); overflow: hidden;
  animation: pop .18s ease;
}
.support-panel[hidden] { display: none; }
.sp-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--card); }
.sp-agent { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 700; font-size: 13px; }
.sp-title { display: flex; flex-direction: column; margin-right: auto; }
.sp-title b { font-size: 13.5px; }
.sp-status { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--up); font-weight: 600; }
.sp-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--up); }
.sp-close { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--dim); cursor: pointer; }
.sp-close:hover { color: var(--text); border-color: var(--border-2); }
.sp-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.sp-msg { max-width: 84%; padding: 9px 12px; border-radius: 13px; font-size: 13px; line-height: 1.45; white-space: pre-wrap; }
.sp-msg.sp-bot { align-self: flex-start; background: var(--card-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.sp-msg.sp-user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.sp-menu { border-top: 1px solid var(--border); padding: 10px; display: flex; flex-direction: column; gap: 7px; max-height: 46%; overflow-y: auto; background: var(--card); }
.sp-menu-label { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 0 2px; }
.sp-topic { text-align: left; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.sp-topic:hover { border-color: var(--brand); background: var(--brand-soft); }

/* ============================ Responsive ================================= */
@media (max-width: 1024px) {
  .mainnav { display: none; }
  .terminal, .terminal.market-collapsed { grid-template-columns: 210px minmax(0, 1fr); }
  .terminal .order-panel { grid-column: 1 / -1; }
  .market-watch { top: 68px; max-height: calc(100vh - 90px); }
  .view.terminal-wide { height: calc(100vh - 94px - 70px); }
  .view.terminal-wide > .terminal { overflow-x: hidden; overflow-y: auto; scrollbar-width: none; }
  .view.terminal-wide > .terminal::-webkit-scrollbar { display: none; }
  .view.terminal-wide .market-watch { height: auto; max-height: 300px; }
  .view.terminal-wide .terminal-center { height: auto; overflow: visible; }
  .view.terminal-wide .order-panel { height: auto; max-height: none; overflow: visible; }
  @supports (height: 100dvh) {
    .view.terminal-wide { height: calc(100dvh - 94px - 70px - env(safe-area-inset-bottom)); }
  }
  .foot-cols { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
  .grid.c4 { grid-template-columns: 1fr 1fr; }
  .grid.c3 { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .trust-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sec-head h2 { font-size: 23px; }
  .hero-badges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-xm { grid-template-columns: 1fr; gap: 22px; }
  .award-grid { grid-template-columns: 1fr 1fr; }
  .mobilenav {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
    background: color-mix(in srgb, var(--panel) 96%, transparent);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .mobilenav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 0; color: var(--muted); font-size: 11px; font-weight: 600; border-radius: 10px; }
  .mobilenav a svg { width: 22px; height: 22px; }
  .mobilenav a.active { color: var(--brand); background: var(--brand-soft); }
  .view { padding-bottom: 110px; }
}

@media (max-width: 700px) {
  .topbar { padding: 9px 12px; gap: 10px; }
  .brand { font-size: 18px; }
  .view { padding: 14px 12px 110px; }
  .hero { padding: 28px 18px; border-radius: 14px; }
  .hero h1 { font-size: 27px; }
  .hero .lead { font-size: 14px; }
  .hero-badges { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 20px; }
  .hero-xm { padding: 26px 18px; gap: 20px; border-radius: 14px; }
  .hero-main h1 { font-size: 26px; }
  .hero-main .lead { font-size: 14px; }
  .award-grid { grid-template-columns: 1fr; }
  .promo { grid-template-columns: 1fr; gap: 16px; padding: 22px 20px; }
  .promo-icon { width: 46px; height: 46px; border-radius: 13px; }
  .promo h2 { font-size: 18px; }
  .promo-action { grid-column: 1 / -1; }
  .page-head h1 { font-size: 21px; }
  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; }
  .trust-strip, .steps { grid-template-columns: 1fr; }
  .sec { margin-top: 34px; }
  .sec-head h2 { font-size: 21px; }
  .cta-band { padding: 24px 20px; margin-top: 34px; }
  .cta-band h2 { font-size: 20px; }
  .foot-cols { grid-template-columns: 1fr; gap: 18px; }
  .chart-box { height: 340px; }
  .terminal, .terminal.market-collapsed { grid-template-columns: 1fr; }
  .terminal .order-panel { grid-column: auto; }
  .market-watch { position: static; max-height: 250px; }
  .hide-sm { display: none; }
  .auth-actions .btn.ghost { display: none; }
  table.dt th, table.dt td { padding: 9px 10px; font-size: 12.5px; }
  .spark { width: 60px; height: 24px; }
  .toast-wrap { right: 10px; left: 10px; bottom: 78px; }
  .modal { padding: 18px; }
  .support-panel { right: 10px; left: 10px; bottom: 74px; top: 68px; width: auto; height: auto; max-height: none; }
  .accounts-page { margin-top: 2px; }
  .accounts-heading { align-items: flex-start; margin-bottom: 18px; }
  .accounts-heading h1 { font-size: 23px; }
  .account-create { padding: 8px 11px; font-size: 12px; }
  .accounts-toolbar { align-items: flex-start; flex-direction: column; gap: 10px; }
  .account-tabs { width: 100%; }
  .account-tabs button { flex: 1; justify-content: center; }
  .account-tools { width: 100%; justify-content: space-between; padding: 0 0 10px; }
  .account-sort { width: min(220px, calc(100% - 100px)); }
  .acc-card.account-row { align-items: stretch; flex-direction: column; gap: 14px; padding: 16px; }
  .acc-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acc-actions .btn { justify-content: center; }
  .account-list.grid-mode { grid-template-columns: 1fr; }
  .account-details { grid-template-columns: 1fr 1fr; gap: 9px 12px; }
  .account-section-heading { align-items: flex-start; flex-direction: column; }
  .account-section-heading .input { width: 100%; min-width: 0; }
  .account-history { margin-top: 28px; }
}

/* Fix 5 Dec: [hidden] must actually hide — .modal-wrap display:grid was overriding the hidden attribute, leaving a full-screen mask over the site */
[hidden]{display:none!important}
