/* ═══════════════════════════════════════════════════════════════════════
   FLUX v1 — OVERRIDES (minimal compat shim)
   All component styling lives in premium.css. This file holds only
   page-specific patches that don't fit the component model.
   ═══════════════════════════════════════════════════════════════════════ */

/* Trading data — always monospace */
#balance, #equity, #margin, #free-margin,
.price, .pnl, .percentage, .market-ticker, .ticker-item,
#positions-tbody td, #trades-tbody td {
  font-family: var(--mono) !important;
  font-variant-numeric: tabular-nums !important;
}

/* Directional colours */
.pnl-positive, .pos-buy, .text-up { color: var(--up) !important; }
.pnl-negative, .pos-sell, .text-down { color: var(--down) !important; }

/* base.html chrome positioning (replaces what used to be inline styles) */
.fx-particles-canvas, .pm-particles-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.fx-blob-1, .pm-blob-1 { top: -100px; left: -100px; width: 400px; height: 400px; }
.fx-blob-2, .pm-blob-2 { bottom: -100px; right: -100px; width: 300px; height: 300px; }

/* Ticker change indicators (landing.html) */
.tk-chg-up { color: var(--up); font-family: var(--mono); font-weight: 600; font-size: 10px; }
.tk-chg-dn { color: var(--down); font-family: var(--mono); font-weight: 600; font-size: 10px; }

/* ═══════════════════════════════════════════════════════════════════════
   FLUX v1.2 — Collapsible sidebar sections
   Top-level sections (.sb-section-toggle) are slightly bigger and bolder
   than nested sub-groups. State persists via localStorage.
   ═══════════════════════════════════════════════════════════════════════ */
.sb-group-toggle.sb-section-toggle {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 8px var(--space-3);
  margin-top: var(--space-2);
  margin-bottom: 2px;
  border-top: 1px solid var(--line);
  border-radius: 0;
}
.sb-group-toggle.sb-section-toggle:first-child {
  border-top: none;
  margin-top: 0;
}
.sb-group-toggle.sb-section-toggle .sb-dot {
  width: 5px; height: 5px;
  background: var(--accent);
  opacity: 0.8;
}
.sb-group-toggle.sb-section-toggle .sb-arrow {
  font-size: 10px;
  transition: transform var(--t-base);
}
.sb-group:not(.open) > .sb-group-toggle.sb-section-toggle .sb-arrow {
  transform: rotate(-90deg);
}
/* When a top-level section is collapsed, hide its entire body */
.sb-group:not(.open) > .sb-group-body {
  max-height: 0;
  overflow: hidden;
  padding: 0;
  opacity: 0;
}
.sb-group.open > .sb-group-body {
  max-height: 2000px;
  overflow: visible;
  opacity: 1;
  transition: max-height var(--t-base), opacity var(--t-base);
}

/* Make nested sub-groups visually distinct (slightly indented, smaller) */
.sb-group .sb-group .sb-group-toggle {
  font-size: 10px;
  padding: 5px var(--space-3);
  margin-left: var(--space-2);
  color: var(--dim);
}
.sb-group .sb-group .sb-group-toggle:hover {
  color: var(--ink);
}
.sb-group .sb-group .sb-link {
  padding-left: calc(var(--space-3) * 2.5) !important;
  font-size: 12px !important;
}

/* Market sub-group dot colours */
.sb-group .sb-group-toggle .sb-dot[style*="blue"] { background: var(--blue) !important; }
.sb-group .sb-group-toggle .sb-dot[style*="amber"] { background: var(--amber) !important; }

/* ═══════════════════════════════════════════════════════════════════════
   FLUX v1.2 — Admin Overview enrichment
   Bar chart for Six-Month Decision Ledger + supporting card widgets.
   ═══════════════════════════════════════════════════════════════════════ */

/* Pure-CSS bar chart (no JS chart library) */
.fx-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
  height: 160px;
  padding: var(--space-3) 0;
}
.fx-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}
.fx-bar {
  width: 100%;
  max-width: 40px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
  border-radius: 3px 3px 0 0;
  min-height: 4px;
  transition: height var(--t-base), background var(--t-fast);
  position: relative;
  cursor: pointer;
}
.fx-bar:hover {
  background: linear-gradient(180deg, var(--accent-3) 0%, var(--accent) 100%);
  filter: drop-shadow(0 0 8px var(--accent-glow-color));
}
.fx-bar-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dimmer);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.fx-bar-val {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ── Capital Flow card ── */
.capital-flow { display: flex; flex-direction: column; gap: var(--space-2); }
.capital-flow .flow-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0; border-bottom: 1px dashed var(--line);
}
.capital-flow .flow-row:last-child { border-bottom: none; }
.capital-flow .flow-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--dimmer);
}
.capital-flow .flow-label .dot {
  width: 6px; height: 6px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}
.capital-flow .flow-val {
  font-family: var(--mono); font-weight: 600; font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.capital-flow .flow-val.up { color: var(--up); }
.capital-flow .flow-val.down { color: var(--down); }
.capital-flow .flow-val.accent { color: var(--accent); }
.capital-flow .flow-val.warning { color: var(--amber); }
.capital-flow .flow-val.muted { color: var(--dimmer); }
.capital-flow .flow-divider {
  height: 1px; background: var(--line-2);
  margin: var(--space-1) 0;
}

/* ── License Distribution: horizontal stacked bar + legend ── */
.lic-distro { display: flex; flex-direction: column; gap: var(--space-3); }
.stacked-bar {
  display: flex; height: 14px; border-radius: 4px; overflow: hidden;
  background: var(--panel-2); border: 1px solid var(--line);
}
.stacked-bar .seg { height: 100%; transition: filter var(--t-fast); }
.stacked-bar .seg:hover { filter: brightness(1.2); }
.seg-trial     { background: var(--dimmer); }
.seg-basic     { background: var(--up); }
.seg-pro       { background: var(--accent); }
.seg-unlimited { background: var(--down); }
.seg-other     { background: var(--line-2); }
.legend-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 6px 12px;
}
.legend-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--dimmer);
}
.legend-dot {
  width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex-shrink: 0;
}
.legend-val {
  margin-left: auto;
  font-family: var(--mono); font-weight: 600; color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ── System Health card ── */
.health-list { display: flex; flex-direction: column; gap: 2px; }
.health-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--line);
  gap: var(--space-2);
}
.health-row:last-child { border-bottom: none; }
.health-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--ink); font-weight: 500;
}
.health-label .dot {
  width: 7px; height: 7px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}
.health-meta {
  font-family: var(--mono); font-size: 10px;
  color: var(--dimmer); text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── Status-dot helpers for timeline / health rows ── */
.status-dot-online {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--up); display: inline-block;
  box-shadow: 0 0 0 3px var(--up-soft);
  flex-shrink: 0;
}
.status-dot-danger {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--down); display: inline-block;
  box-shadow: 0 0 0 3px var(--down-soft);
  flex-shrink: 0;
}
.status-dot-neutral {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--dimmer); display: inline-block;
  box-shadow: 0 0 0 3px rgba(90, 100, 120, 0.18);
  flex-shrink: 0;
}

/* ── Recent Activity timeline ── */
.activity-timeline {
  display: flex; flex-direction: column;
  position: relative;
  padding-left: var(--space-2);
}
.activity-timeline::before {
  content: ''; position: absolute;
  left: 13px; top: 6px; bottom: 6px;
  width: 1px; background: var(--line);
}
.timeline-item {
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: 8px 0;
  position: relative;
}
.timeline-item .timeline-dot {
  width: 9px; height: 9px; border-radius: 50%;
  margin-top: 4px; flex-shrink: 0; position: relative; z-index: 1;
  background: var(--dimmer);
}
.timeline-item .timeline-dot.status-dot-online { background: var(--up); box-shadow: 0 0 0 3px var(--up-soft); }
.timeline-item .timeline-dot.status-dot-danger { background: var(--down); box-shadow: 0 0 0 3px var(--down-soft); }
.timeline-item .timeline-dot.status-dot-neutral { background: var(--dimmer); box-shadow: 0 0 0 3px rgba(90, 100, 120, 0.18); }
.timeline-body { flex: 1; min-width: 0; }
.timeline-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink);
  flex-wrap: wrap;
}
.timeline-title strong { font-weight: 600; }
.timeline-action {
  font-family: var(--mono); font-size: 11px;
  color: var(--accent); background: var(--accent-soft);
  padding: 1px 6px; border-radius: 3px;
}
.timeline-detail {
  font-size: 12px; color: var(--dimmer);
  margin-top: 2px; word-break: break-word;
}
.timeline-time {
  font-family: var(--mono); font-size: 10px;
  color: var(--dimmer); margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* ── Top Clients table cells ── */
.cell-strong { font-weight: 500; color: var(--ink); font-size: 13px; }
.cell-sub { font-size: 11px; color: var(--dimmer); margin-top: 1px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ── Geographic Distribution bar list ── */
.geo-list { display: flex; flex-direction: column; gap: var(--space-2); }
.geo-row {
  display: grid;
  grid-template-columns: 22px 110px 1fr 32px;
  align-items: center; gap: var(--space-2);
  padding: 4px 0;
}
.geo-flag { font-size: 16px; line-height: 1; }
.geo-name { font-size: 12px; color: var(--ink); }
.geo-bar {
  height: 8px; background: var(--panel-2);
  border-radius: 4px; overflow: hidden;
  border: 1px solid var(--line);
}
.geo-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-3) 100%);
  transition: width var(--t-base);
  min-width: 2px;
}
.geo-val {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  color: var(--ink); text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── Quick Actions icon spacing ── */
.fx-btn.pm-btn .qa-ico {
  margin-right: 6px;
  font-style: normal;
  font-size: 14px;
  line-height: 1;
}

/* ── Responsive: collapse 3-col / 2-col grids on small screens ── */
@media (max-width: 960px) {
  .fx-grid.pm-grid.cols-3 { grid-template-columns: 1fr; }
  .fx-grid.pm-grid.cols-2 { grid-template-columns: 1fr; }
  .fx-grid.pm-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .legend-grid { grid-template-columns: 1fr; }
  .geo-row { grid-template-columns: 22px 90px 1fr 28px; }
}
@media (max-width: 560px) {
  .fx-grid.pm-grid.cols-4 { grid-template-columns: 1fr; }
  .capital-flow .flow-row { flex-direction: column; align-items: flex-start; gap: 2px; }
  .capital-flow .flow-val { align-self: flex-end; }
}

/* ── Subtle entrance animation for overview cards ── */
.reveal {
  animation: flux-fade-up 0.4s var(--ease-out) both;
}
@keyframes flux-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ═══════════════════════════════════════════════════════════════════════
   FLUX v1.3 — EULA SCROLL BOX (signup.html)
   Makes the End User License Agreement a fixed-height scrollable box
   so the consent checkbox stays disabled until user scrolls to bottom.
   ═══════════════════════════════════════════════════════════════════════ */
#eulaScrollBox {
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg);
  padding: var(--space-4);
  margin: var(--space-2) 0;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--dim);
  scroll-behavior: smooth;
  position: relative;
}
#eulaScrollBox::-webkit-scrollbar { width: 6px; }
#eulaScrollBox::-webkit-scrollbar-track { background: var(--panel-2); }
#eulaScrollBox::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 3px; }
#eulaScrollBox::-webkit-scrollbar-thumb:hover { background: var(--accent); }
#eulaContent h3 {
  font-family: var(--display);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--line);
}
#eulaContent h4 {
  font-family: var(--display);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--accent);
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
  text-transform: none;
  letter-spacing: normal;
}
#eulaContent p {
  color: var(--dim);
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  line-height: 1.6;
}
#eulaContent p strong { color: var(--ink); }
#eulaScrollHint {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10px;
  color: var(--amber); text-transform: uppercase; letter-spacing: 0.06em;
  margin: var(--space-2) 0;
}
#eulaScrollHint span:first-child { animation: pulse-dot 2s infinite; }
#eulaScrolledOk {
  display: none;
  align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10px;
  color: var(--up); text-transform: uppercase; letter-spacing: 0.06em;
  margin: var(--space-2) 0;
}
#eulaScrolledOk.show { display: flex; }
#eulaScrolledOk span:first-child { font-weight: 700; }
#eulaCheckboxWrap {
  opacity: 0.4;
  pointer-events: none;
  margin-top: var(--space-3);
  padding: var(--space-3);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  transition: opacity var(--t-base);
}
#eulaCheckboxWrap.enabled {
  opacity: 1;
  pointer-events: auto;
  border-color: var(--accent);
}
#eulaCheckbox[disabled] { cursor: not-allowed; }

/* Section subheadings inside signup form (the §01 · Operator identity etc.) */
.auth-card .formgrid + div > div:first-child,
.auth-card > div > div > div:first-child {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
  padding-bottom: var(--space-1);
  border-bottom: 1px solid var(--line);
}

/* ═══════════════════════════════════════════════════════════════════════
   PHASE 24/25 — Strategy Intelligence + EA Management dashboard classes
   ═══════════════════════════════════════════════════════════════════════ */

/* Strategy Intelligence (si-*) */
.si-section { margin-bottom: var(--space-5); }
.si-arrow { font-size: 10px; opacity: 0.5; transition: transform var(--t-base); }
.sb-group.open .si-arrow { transform: rotate(90deg); }
.si-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.si-dot.online { background: var(--up); animation: pulse-dot 2s infinite; }
.si-dot.offline { background: var(--dimmer); }
.si-manager-row { background: var(--accent-soft); border-left: 3px solid var(--accent); }
.si-manager-row td { font-weight: 700; color: var(--ink); }
.si-market-pills { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.si-market-pill { font-family: var(--mono); font-size: 9px; padding: 1px 6px; border-radius: 3px; background: var(--panel-3); color: var(--dim); text-transform: uppercase; }
.si-progress { height: 4px; background: var(--panel-3); border-radius: 2px; overflow: hidden; }
.si-progress > div { height: 100%; background: var(--grad-1); border-radius: 2px; transition: width var(--t-base); }
.si-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.si-skel { background: linear-gradient(90deg, var(--panel-2) 0%, var(--panel-3) 50%, var(--panel-2) 100%); background-size: 200% 100%; animation: skeleton-shimmer 1.4s linear infinite; border-radius: var(--r-sm); display: inline-block; min-width: 40px; height: 14px; }
.si-strat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--space-3); }
.si-strat-card { background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur)); border: 1px solid var(--glass-brd); border-radius: var(--r); padding: var(--space-4); transition: all var(--t-base); }
.si-strat-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.si-tab { font-family: var(--mono); font-size: 10px; padding: 4px 10px; border-radius: var(--r-sm); cursor: pointer; color: var(--dim); border: 1px solid var(--line); background: var(--bg); transition: all var(--t-fast); }
.si-tab.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.si-explain-row { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: var(--text-sm); }
.si-explain-row:last-child { border-bottom: none; }
.meta-cell { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.best { color: var(--up); font-weight: 700; }
.l { color: var(--down); }

/* EA Management (em-*) */
.em-arrow { font-size: 10px; opacity: 0.5; transition: transform var(--t-base); }
.sb-group.open .em-arrow { transform: rotate(90deg); }
.em-detail { padding: var(--space-3) 0; border-top: 1px solid var(--line); }
.em-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-3); }
.em-detail-inner { display: none; }
.em-detail-inner.show { display: block; }
.em-detail-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: var(--text-sm); border-bottom: 1px solid var(--line); }
.em-detail-row:last-child { border-bottom: none; }
.em-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.em-dot.online { background: var(--up); animation: pulse-dot 2s infinite; }
.em-dot.offline { background: var(--red); }
.em-dot.warn { background: var(--amber); }
.em-explain-row { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: var(--text-sm); }
.em-explain-row:last-child { border-bottom: none; }
.em-lat-good { color: var(--up); font-family: var(--mono); font-weight: 600; }
.em-lat-bad { color: var(--red); font-family: var(--mono); font-weight: 600; }
.em-mode-pill { font-family: var(--mono); font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.04em; }
.em-mode-pill.ai { background: var(--accent-soft); color: var(--accent); }
.em-mode-pill.local { background: var(--amber-soft); color: var(--amber); }
.em-mode-pill.hybrid { background: rgba(34,211,238,0.14); color: var(--cyan); }
.em-mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.em-row { cursor: pointer; transition: background var(--t-fast); }
.em-row:hover { background: var(--panel-2); }
.em-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.em-section { margin-bottom: var(--space-5); }
.em-skel { background: linear-gradient(90deg, var(--panel-2) 0%, var(--panel-3) 50%, var(--panel-2) 100%); background-size: 200% 100%; animation: skeleton-shimmer 1.4s linear infinite; border-radius: var(--r-sm); display: inline-block; min-width: 40px; height: 14px; }
.em-spark { width: 100%; height: 32px; }
.em-status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.em-status-dot.online { background: var(--up); animation: pulse-dot 2s infinite; }
.em-status-dot.offline { background: var(--red); }
.em-status-dot.warn { background: var(--amber); }
.em-strat-item { display: flex; align-items: center; gap: 6px; padding: 3px 0; font-size: var(--text-sm); }
.em-strat-list { display: flex; flex-direction: column; gap: 2px; }
.em-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); background: var(--glass-bg); border: 1px solid var(--glass-brd); border-radius: var(--r); overflow: hidden; }
.em-table th { text-align: left; padding: 8px 12px; font-family: var(--mono); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dimmer); background: var(--panel-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.em-table td { padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--ink); vertical-align: middle; }
.em-table tbody tr:last-child td { border-bottom: none; }
.em-table-wrap { overflow-x: auto; border-radius: var(--r); }

/* Chart helpers */
.area { fill: var(--accent-soft); stroke: none; }
.line { stroke: var(--accent); stroke-width: 1.5; fill: none; }
.local { color: var(--amber); }

/* Additional si-* + strat-* helpers */
.si-tab-bar { display: flex; gap: 4px; margin-bottom: var(--space-3); flex-wrap: wrap; }
.si-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); background: var(--glass-bg); border: 1px solid var(--glass-brd); border-radius: var(--r); overflow: hidden; }
.si-table th { text-align: left; padding: 8px 12px; font-family: var(--mono); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dimmer); background: var(--panel-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.si-table td { padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--ink); vertical-align: middle; }
.si-table tbody tr:last-child td { border-bottom: none; }
.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: var(--accent); }
.sort-ind { font-size: 9px; margin-left: 4px; opacity: 0.6; }
.statusDot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.strat-actions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: var(--space-2); }
.strat-desc { font-size: var(--text-xs); color: var(--dim); margin: 4px 0; line-height: var(--leading-normal); }
.strat-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: var(--space-2); }
.strat-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); margin: var(--space-2) 0; padding: var(--space-2) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.strat-name { font-family: var(--display); font-size: var(--text-md); font-weight: 700; color: var(--ink); }

/* ═══════════════════════════════════════════════════════════════════════
   PANEL GROUP SYSTEM — hide inactive panels, show only active
   Generic: works for ALL data-panel-group pages (portal, ge, cms, perf, smm, tenant)
   ═══════════════════════════════════════════════════════════════════════ */
[data-panel-group] > [data-panel] { display: none; }
[data-panel-group] > [data-panel].is-active { display: block; }
[data-panel-group] > [data-panel]:first-child { display: block; } /* fallback if JS hasn't run yet */
/* Once JS runs, it adds .is-active to the correct panel and removes :first-child fallback */
.js-ready [data-panel-group] > [data-panel]:first-child:not(.is-active) { display: none; }

/* ═══════════════════════════════════════════════════════════════════════
   CURRENCY SWITCHER — full styling for currency.js pill + dropdown
   The JS builds: #aspCurrencyPill > .asp-currency-btn + .asp-currency-menu
   ═══════════════════════════════════════════════════════════════════════ */

/* The pill container — relative positioned so the dropdown anchors to it */
#aspCurrencyPill {
  position: relative;
  display: inline-block;
}

/* The toggle button */
.asp-currency-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink);
  font-family: var(--mono);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
  line-height: 1.4;
}
.asp-currency-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.asp-currency-btn .asp-currency-ico { font-size: 13px; }
.asp-currency-btn .asp-currency-code { font-weight: 700; }
.asp-currency-btn .asp-currency-sym { color: var(--dim); font-size: var(--text-sm); }
.asp-currency-btn .asp-currency-chev { font-size: 9px; opacity: 0.5; margin-left: 2px; }

/* The dropdown menu — hidden by default, shown when .open */
.asp-currency-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 280px;
  max-width: 340px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  z-index: var(--z-dropdown);
  overflow: hidden;
  font-family: var(--sans);
}
.asp-currency-menu.open {
  display: block;
  animation: fadeInUp 0.2s var(--ease-out);
}

/* Menu header */
.asp-currency-menu-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 6px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dimmer);
  border-bottom: 1px solid var(--line);
}
.asp-currency-auto-badge {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--up-soft);
  color: var(--up);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Menu subtitle */
.asp-currency-menu-sub {
  padding: 6px 14px 8px;
  font-size: var(--text-xs);
  color: var(--dim);
  line-height: var(--leading-normal);
  border-bottom: 1px solid var(--line);
}

/* Currency list */
.asp-currency-list {
  max-height: 280px;
  overflow-y: auto;
  padding: 4px;
}

/* Each currency row */
.asp-currency-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t-fast);
}
.asp-currency-row:hover {
  background: var(--panel-3);
}
.asp-currency-row.active {
  background: var(--accent-soft);
}

.asp-currency-row-code {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-width: 60px;
}
.asp-currency-row-sym {
  font-family: var(--mono);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--accent);
  width: 20px;
  text-align: center;
}
.asp-currency-row-code-txt {
  font-family: var(--mono);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
}
.asp-currency-row-check {
  font-size: 11px;
  color: var(--up);
  font-weight: 700;
  margin-left: 2px;
}

.asp-currency-row-meta {
  flex: 1;
  min-width: 0;
}
.asp-currency-row-name {
  font-size: var(--text-sm);
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.asp-currency-row-rate {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.asp-currency-row-rate.err {
  color: var(--red);
}

/* Menu footer */
.asp-currency-menu-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  background: var(--panel-2);
}
.asp-currency-menu-foot a {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.asp-currency-menu-foot a:hover {
  color: var(--accent-3);
  text-decoration: underline;
}
.asp-currency-status {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dimmer);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .asp-currency-menu {
    min-width: 240px;
    right: -40px;
  }
  .asp-currency-btn .asp-currency-sym { display: none; }
}
@media (max-width: 480px) {
  .asp-currency-menu {
    min-width: 220px;
    right: 0;
    left: auto;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   COIN DISPLAY — consistent ◈ symbol + fiat equivalent
   Used by ASPCurrency.formatCoinsWithFiat() + renderCoinDisplay()
   ═══════════════════════════════════════════════════════════════════════ */
.asp-coin-amt {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.asp-coin-fiat {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--dim);
  font-weight: 500;
  margin-left: 4px;
  white-space: nowrap;
}
/* In KPI value context, make the coin amount larger */
.fx-kpi .asp-coin-amt, .pm-kpi .asp-coin-amt, .kpi .asp-coin-amt {
  font-size: var(--text-lg);
  display: block;
  margin-bottom: 2px;
}
.fx-kpi .asp-coin-fiat, .pm-kpi .asp-coin-fiat, .kpi .asp-coin-fiat {
  font-size: var(--text-xs);
  display: block;
}
/* Coin symbol inline (for transaction rows, labels) */
.asp-coin-sym {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent);
  margin-right: 2px;
}
/* Fiat hint next to coin input */
.asp-coin-input-hint {
  font-family: var(--mono);
  font-size: var(--text-xs);
  color: var(--dim);
  margin-top: 4px;
}
.asp-coin-input-hint .asp-coin-fiat { margin-left: 0; }

/* Portal panel-group fix: panels have data-panel-group ON THEMSELVES (not a parent container).
   Handle both patterns: (a) parent[data-panel-group] > child[data-panel], (b) sibling[data-panel-group][data-panel] */
[data-panel-group][data-panel] { display: none; }
[data-panel-group][data-panel].is-active { display: block; }
[data-panel-group][data-panel]:first-child { display: block; }
.js-ready [data-panel-group][data-panel]:first-child:not(.is-active) { display: none; }

/* ═══════════════════════════════════════════════════════════════════════
   SIDEBAR ICONS — colourful emoji with subtle tinted backgrounds
   ═══════════════════════════════════════════════════════════════════════ */
.fx-sidebar .nav-item .ico,
.pm-sidebar .nav-item .ico {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
  border-radius: 6px;
  background: var(--panel-3);
  flex-shrink: 0;
  transition: all var(--t-fast);
  opacity: 0.9;
}
.fx-sidebar .nav-item:hover .ico,
.pm-sidebar .nav-item:hover .ico {
  background: var(--accent-soft);
  transform: scale(1.1);
  opacity: 1;
}
.fx-sidebar .nav-item.active .ico,
.pm-sidebar .nav-item.active .ico {
  background: var(--accent-soft);
  opacity: 1;
  transform: scale(1.05);
}
/* Section toggle icons (sb-dot) — make them slightly bigger + coloured */
.sb-group-toggle.sb-section-toggle .sb-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
/* Collapsed sidebar — center the icons */
.fx-app.sb-collapsed .fx-sidebar .nav-item .ico,
.premium-app.sb-collapsed .pm-sidebar .nav-item .ico {
  margin: 0 auto;
}
/* Mobile — slightly smaller icons */
@media (max-width: 768px) {
  .fx-sidebar .nav-item .ico,
  .pm-sidebar .nav-item .ico {
    width: 24px;
    height: 24px;
    font-size: 13px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   KINETIC CARBON — MATERIAL + SIGNATURE MOTION
   Graph-paper grid texture + signal-pulse line on active nav + live cards.
   This is the ONE kinetic element; everything else stays calm.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Graph-paper grid background texture (very subtle) ── */
.fx-mesh {
  background:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px),
    radial-gradient(ellipse 800px 500px at 15% -5%, rgba(198, 242, 78, 0.04), transparent 60%),
    radial-gradient(ellipse 700px 400px at 85% 105%, rgba(52, 211, 153, 0.03), transparent 60%) !important;
  background-size: 48px 48px, 48px 48px, 100% 100%, 100% 100% !important;
}
[data-theme="light"] .fx-mesh {
  background:
    linear-gradient(rgba(0,0,0,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.02) 1px, transparent 1px),
    radial-gradient(ellipse 800px 500px at 15% -5%, rgba(123, 181, 46, 0.05), transparent 60%),
    radial-gradient(ellipse 700px 400px at 85% 105%, rgba(16, 185, 129, 0.04), transparent 60%) !important;
  background-size: 48px 48px, 48px 48px, 100% 100%, 100% 100% !important;
}

/* ── Signal pulse — the signature kinetic element ── */
/* A thin animated lime line that traces the active nav item */
.fx-sidebar .nav-item.active::before,
.pm-sidebar .nav-item.active::before,
.sidebar .sb-link.active::before {
  background: var(--accent) !important;
  width: 2px !important;
  box-shadow: 0 0 8px var(--accent), 0 0 2px var(--accent);
  animation: signal-pulse 2.5s ease-in-out infinite;
}
@keyframes signal-pulse {
  0%, 100% { opacity: 0.6; box-shadow: 0 0 4px var(--accent); }
  50%      { opacity: 1; box-shadow: 0 0 12px var(--accent), 0 0 3px var(--accent); }
}

/* Signal pulse on the header seam */
.fx-header::after, .pm-header::after, .topbar::after {
  background: linear-gradient(90deg, transparent 0%, var(--accent) 20%, var(--up) 50%, var(--accent) 80%, transparent 100%) !important;
  background-size: 200% 100% !important;
  animation: seam-flow 6s linear infinite !important;
  height: 1px !important;
  opacity: 0.5 !important;
}
@keyframes seam-flow {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* Live cards — subtle top-edge glow when data updates (add .is-live class via JS) */
.fx-card.is-live, .pm-card.is-live, .glass-card.is-live {
  border-top: 1px solid var(--accent);
  box-shadow: var(--shadow-1), 0 -1px 8px rgba(198, 242, 78, 0.08);
}
.fx-card.is-live::before, .pm-card.is-live::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 200% 100%;
  animation: seam-flow 3s linear infinite;
}

/* Primary buttons — lime fill with dark text (high contrast) */
.fx-btn.primary, .pm-btn.primary, .btn-primary, .btn-glow {
  background: var(--accent) !important;
  color: #121316 !important;  /* dark text on lime — razor sharp */
  border: none !important;
  font-weight: 700 !important;
}
.fx-btn.primary:hover, .pm-btn.primary:hover, .btn-primary:hover, .btn-glow:hover {
  background: var(--accent-3) !important;
  box-shadow: 0 4px 20px rgba(198, 242, 78, 0.3) !important;
  transform: translateY(-1px);
}

/* KPI value accent colours — razor sharp */
.fx-kpi .value.primary, .pm-kpi .value.primary, .kpi-value.primary { color: var(--accent) !important; }
.fx-kpi .value.accent, .pm-kpi .value.accent, .kpi-value.accent { color: var(--up) !important; }

/* Brand mark — lime gradient */
.fx-header .brand .mark {
  background: var(--accent) !important;
  color: #121316 !important;
}
.fx-header .brand .mark::after {
  background: var(--up) !important;
}

/* Active tab — lime underline */
.fx-tab.active, .pm-tab.active, .tab.active, .tab-link.active, .admin-tab.active {
  color: var(--accent) !important;
  border-bottom-color: var(--accent) !important;
}

/* Pills — sharper colours */
.fx-pill.success, .pm-pill.success { background: var(--up-soft) !important; color: var(--up) !important; }
.fx-pill.danger, .pm-pill.danger { background: var(--down-soft) !important; color: var(--down) !important; }
.fx-pill.info, .pm-pill.info { background: var(--blue-soft) !important; color: var(--blue) !important; }
.fx-pill.warning, .pm-pill.warning { background: var(--amber-soft) !important; color: var(--amber) !important; }

/* Auth card seam — lime pulse */
.auth-card::before {
  background: linear-gradient(90deg, var(--accent), var(--up)) !important;
  background-size: 200% 100% !important;
  animation: seam-flow 6s linear infinite !important;
  height: 2px !important;
}

/* Aurora blobs — subtle lime/emerald glow */
.aurora-blob.violet { background: rgba(198, 242, 78, 0.15) !important; opacity: 0.4 !important; }
.aurora-blob.cyan   { background: rgba(52, 211, 153, 0.12) !important; opacity: 0.3 !important; }
.aurora-blob.rose   { background: rgba(248, 113, 113, 0.08) !important; opacity: 0.2 !important; }

/* Light theme — soften grid + blobs */
[data-theme="light"] .aurora-blob.violet { background: rgba(123, 181, 46, 0.10) !important; }
[data-theme="light"] .aurora-blob.cyan   { background: rgba(16, 185, 129, 0.08) !important; }
[data-theme="light"] .fx-mesh { opacity: 0.6; }

/* Focus rings — lime, visible */
*:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Inputs — lime focus */
.fx-input:focus, .fx-select:focus, .fx-textarea:focus,
.pm-input:focus, .pm-select:focus, .pm-textarea:focus,
.input:focus, input:focus, select:focus, textarea:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px var(--accent-soft) !important;
}

/* Coin amount — lime */
.asp-coin-amt { color: var(--accent) !important; }

/* Sidebar icon hover — lime tint */
.fx-sidebar .nav-item:hover .ico,
.pm-sidebar .nav-item:hover .ico {
  background: var(--accent-soft) !important;
}
.fx-sidebar .nav-item.active .ico,
.pm-sidebar .nav-item.active .ico {
  background: var(--accent-soft) !important;
}

/* Reduced motion — kill all ambient/kinetic motion */
@media (prefers-reduced-motion: reduce) {
  .fx-sidebar .nav-item.active::before,
  .pm-sidebar .nav-item.active::before,
  .fx-header::after, .pm-header::after, .topbar::after,
  .auth-card::before, .fx-card.is-live::before, .pm-card.is-live::before {
    animation: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   NAV-STYLE GROUP TOGGLE — Forex/India look like regular nav items
   Same height, icon tile, font size as .nav-item, but expandable.
   ═══════════════════════════════════════════════════════════════════════ */
.sb-group-toggle-nav {
  display: flex !important;
  align-items: center;
  gap: var(--space-2);
  padding: 6px var(--space-3) !important;
  border-radius: var(--r-sm);
  color: var(--dim);
  font-size: var(--text-sm) !important;
  font-weight: var(--font-medium) !important;
  font-family: var(--sans) !important;
  text-decoration: none !important;
  transition: all var(--t-fast);
  margin-bottom: 1px;
  position: relative;
  white-space: nowrap;
  text-transform: none !important;
  letter-spacing: normal !important;
}
.sb-group-toggle-nav:hover {
  background: var(--panel);
  color: var(--ink) !important;
}
.sb-group-toggle-nav .ico {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
  border-radius: 6px;
  background: var(--panel-3);
  flex-shrink: 0;
  transition: all var(--t-fast);
  opacity: 0.9;
}
.sb-group-toggle-nav:hover .ico {
  background: var(--accent-soft);
  transform: scale(1.1);
  opacity: 1;
}
.sb-group-toggle-nav .lbl {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-group-toggle-nav .sb-arrow {
  margin-left: auto;
  font-size: 12px;
  color: var(--dimmer);
  transition: transform var(--t-base);
  flex-shrink: 0;
}
.sb-group.open > .sb-group-toggle-nav .sb-arrow {
  transform: rotate(90deg);
}
/* When the group is open, highlight the toggle slightly */
.sb-group.open > .sb-group-toggle-nav {
  color: var(--ink) !important;
}
.sb-group.open > .sb-group-toggle-nav .ico {
  background: var(--accent-soft);
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════════
   PUBLIC/AUTH PAGES — no sidebar, full-width layout
   Pages that suppress the sidebar add the body.no-sidebar class.
   ═══════════════════════════════════════════════════════════════════════ */
body.no-sidebar .fx-app,
body.no-sidebar .premium-app {
  grid-template-columns: 1fr !important;
  grid-template-areas: "header" "main" !important;
}

/* Mode preset inputs in AI Settings */
.mode-input { margin-bottom: 4px; }

/* Checkout payment method cards */
.asp-method-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: var(--space-4); margin-bottom: var(--space-3); transition: all var(--t-fast); cursor: pointer; }
.asp-method-card:hover { border-color: var(--accent); }
.asp-method-card.asp-selected { border-color: var(--accent); background: var(--accent-soft); }

/* ═══════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — comprehensive mobile-first fixes
   Handles: canvas overflow, header collapse, ticker scroll, tables,
   cards, grids, buttons, touch targets, sidebar drawer, landing page
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Canvas: prevent overflow ── */
.fx-particles, #pmParticles {
  max-width: 100vw !important;
  overflow: hidden;
}

/* ── Body: no horizontal scroll ── */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* ── 768px and below: tablet/mobile ── */
@media (max-width: 768px) {
  /* Header: compact, hide non-essential */
  .fx-header, .pm-header {
    padding: 0 var(--space-2) !important;
    gap: 4px !important;
    height: 48px !important;
  }
  .fx-header .brand, .pm-header .brand {
    font-size: var(--text-sm) !important;
  }
  .fx-header .brand .mark, .pm-header .brand .mark {
    width: 22px !important;
    height: 22px !important;
    font-size: 11px !important;
  }
  .fx-header .search, .pm-header .search {
    display: none !important;
  }
  .fx-header .market-pill, .pm-header .market-pill {
    display: none !important;
  }
  .fx-header .icon-btn, .pm-header .icon-btn {
    width: 28px !important;
    height: 28px !important;
  }
  .fx-header .user-chip .name, .pm-header .user-chip .name {
    display: none !important;
  }
  .fx-header .user-chip, .pm-header .user-chip {
    padding: 2px !important;
  }
  .fx-header .user-chip .avatar, .pm-header .user-chip .avatar {
    width: 24px !important;
    height: 24px !important;
    font-size: 10px !important;
  }
  #aspCurrencyPill {
    font-size: 10px !important;
    padding: 2px 6px !important;
  }
  #aspCurrencyPill .asp-currency-sym,
  #aspCurrencyPill .asp-currency-chev {
    display: none !important;
  }

  /* Sidebar: drawer on mobile (already handled but reinforce) */
  .fx-sidebar, .pm-sidebar {
    width: 260px !important;
    box-shadow: var(--shadow-2) !important;
  }

  /* Main content: full width, reduced padding */
  .fx-main, .pm-main {
    padding: var(--space-2) !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Page header: stack vertically */
  .fx-page-header, .pm-page-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: var(--space-2) !important;
  }
  .fx-page-header h1, .pm-page-header h1 {
    font-size: var(--text-md) !important;
  }
  .fx-page-header .actions, .pm-page-header .actions {
    width: 100% !important;
    flex-wrap: wrap !important;
  }

  /* KPI grid: 2 columns on mobile */
  .fx-kpi-grid, .pm-kpi-grid, .kpi-grid, .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: var(--space-2) !important;
  }
  .fx-kpi, .pm-kpi, .kpi, .stat-card {
    padding: var(--space-2) var(--space-3) !important;
    min-height: 72px !important;
  }
  .fx-kpi .value, .pm-kpi .value, .kpi-value {
    font-size: var(--text-md) !important;
  }
  .fx-kpi .label, .pm-kpi .label, .kpi-label {
    font-size: 9px !important;
  }

  /* Cards: reduced padding */
  .fx-card, .pm-card, .card, .panel {
    padding: var(--space-3) !important;
    margin-bottom: var(--space-2) !important;
    border-radius: var(--r-sm) !important;
  }

  /* Tables: horizontal scroll wrapper */
  .table-wrap, .fx-table, .pm-table {
    font-size: var(--text-xs) !important;
  }
  .table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .fx-table th, .pm-table th {
    padding: 6px 8px !important;
    font-size: 9px !important;
    white-space: nowrap !important;
  }
  .fx-table td, .pm-table td {
    padding: 6px 8px !important;
    white-space: nowrap !important;
  }

  /* Buttons: minimum 36px touch target */
  .fx-btn, .pm-btn, .btn {
    padding: 6px 12px !important;
    font-size: var(--text-xs) !important;
    min-height: 32px !important;
  }
  .fx-btn.sm, .pm-btn.sm, .btn.sm {
    padding: 4px 8px !important;
    min-height: 28px !important;
  }
  .fx-btn.lg, .pm-btn.lg {
    padding: 10px 20px !important;
    min-height: 40px !important;
    font-size: var(--text-sm) !important;
  }

  /* Tabs: horizontal scroll */
  .fx-tabs, .pm-tabs, .tabs {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    gap: 0 !important;
  }
  .fx-tab, .pm-tab, .tab {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    padding: 6px 10px !important;
    font-size: var(--text-xs) !important;
  }

  /* Forms: single column */
  .formgrid, .form-grid {
    grid-template-columns: 1fr !important;
  }
  .fx-input, .pm-input, .fx-select, .pm-select, .fx-textarea, .pm-textarea, .input {
    font-size: 16px !important; /* prevent iOS zoom */
    padding: 8px 10px !important;
  }

  /* Hero: smaller text */
  .fx-hero, .pm-hero, .hero {
    padding: var(--space-4) var(--space-2) !important;
  }
  .fx-hero h1, .pm-hero h1, .hero h1 {
    font-size: var(--text-lg) !important;
    line-height: 1.2 !important;
  }
  .fx-hero .subtitle, .pm-hero .subtitle, .hero p {
    font-size: var(--text-sm) !important;
  }

  /* Footer: single column */
  .fx-footer .inner, .pm-footer .inner, .footer-inner {
    grid-template-columns: 1fr !important;
    gap: var(--space-3) !important;
  }
  .fx-footer, .pm-footer, .site-footer {
    padding: var(--space-4) var(--space-2) !important;
  }

  /* Ticker bar: horizontal scroll */
  .fx-ticker-bar {
    height: 32px !important;
  }
  .fx-ticker-label {
    padding: 0 8px !important;
    font-size: 9px !important;
  }
  .fx-ticker-track .tk-item {
    font-size: 11px !important;
    padding: 2px 6px !important;
  }

  /* Modal: full width on mobile */
  .fx-modal, .pm-modal, .modal {
    width: 95% !important;
    max-width: 95% !important;
    padding: var(--space-3) !important;
  }

  /* Pills: smaller */
  .fx-pill, .pm-pill, .pill, .badge, .chip {
    font-size: 9px !important;
    padding: 1px 6px !important;
  }

  /* Admin layout: stack */
  .admin-layout {
    grid-template-columns: 1fr !important;
  }
  .admin-sidebar {
    position: relative !important;
    top: 0 !important;
    max-height: 200px !important;
  }

  /* Hero ribbon: stack */
  .hero-ribbon {
    flex-direction: column !important;
  }
  .hero-ribbon .ribbon-item {
    border-right: none !important;
    border-bottom: 1px solid var(--line) !important;
    padding: var(--space-2) var(--space-3) !important;
  }
  .hero-ribbon .ribbon-item:last-child {
    border-bottom: none !important;
  }
  .hero-ribbon .ribbon-item .value {
    font-size: var(--text-md) !important;
  }

  /* Strategy/EA grids: single column */
  .si-strat-grid, .em-detail-grid {
    grid-template-columns: 1fr !important;
  }

  /* Trading activity widget */
  .ta-stats {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .ta-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ── 480px and below: small phones ── */
@media (max-width: 480px) {
  /* KPI grid: 1 column on very small screens */
  .fx-kpi-grid, .pm-kpi-grid, .kpi-grid, .stats-grid {
    grid-template-columns: 1fr !important;
  }

  /* Header: even more compact */
  .fx-header .brand span, .pm-header .brand span {
    font-size: 11px !important;
  }
  .fx-header .icon-btn[title="AI Status"], .pm-header .icon-btn[title="AI Status"] {
    display: none !important;
  }

  /* Hero: even smaller */
  .fx-hero h1, .pm-hero h1, .hero h1 {
    font-size: var(--text-md) !important;
  }

  /* Cards: minimal padding */
  .fx-card, .pm-card, .card, .panel {
    padding: var(--space-2) !important;
  }

  /* Footer risk: smaller text */
  .fx-footer .footer-risk p, .pm-footer .footer-risk p {
    font-size: 10px !important;
  }

  /* Ticker: hide label, just show scrolling items */
  .fx-ticker-label {
    display: none !important;
  }
  .fx-ticker-viewport {
    mask-image: none !important;
    -webkit-mask-image: none !important;
  }
}

/* ── 360px and below: very small phones ── */
@media (max-width: 360px) {
  .fx-header .brand span, .pm-header .brand span {
    display: none !important;
  }
  .fx-header .brand .mark, .pm-header .brand .mark {
    width: 24px !important;
    height: 24px !important;
  }
  .fx-kpi .value, .pm-kpi .value, .kpi-value {
    font-size: var(--text-sm) !important;
  }
}

/* ── Landing page specific mobile fixes ── */
@media (max-width: 768px) {
  .fx-hero .actions, .pm-hero .actions, .hero .actions {
    flex-direction: column !important;
    width: 100% !important;
  }
  .fx-hero .actions .fx-btn, .pm-hero .actions .fx-btn {
    width: 100% !important;
    margin-bottom: var(--space-2) !important;
  }
  .fx-section, .pm-section, .section {
    padding: var(--space-4) var(--space-2) !important;
  }
  .fx-feature, .feature-card {
    padding: var(--space-3) !important;
  }
  .fx-pricing, .pm-pricing, .pricing-card {
    padding: var(--space-3) !important;
  }
  .fx-pricing .price, .pm-pricing .price {
    font-size: var(--text-xl) !important;
  }
}

/* ── Auth card mobile ── */
@media (max-width: 768px) {
  .auth-card {
    margin: var(--space-4) var(--space-2) !important;
    padding: var(--space-4) !important;
    max-width: 100% !important;
    border-radius: var(--r-md) !important;
  }
  .auth-card .auth-title {
    font-size: var(--text-md) !important;
  }
  /* EULA scroll box: shorter on mobile */
  #eulaScrollBox {
    max-height: 200px !important;
  }
}

/* ── Checkout mobile ── */
@media (max-width: 768px) {
  .asp-method-card {
    padding: var(--space-2) !important;
  }
  .asp-currency-menu {
    min-width: 200px !important;
    right: 0 !important;
  }
}

/* ── Prevent iOS input zoom ── */
@media (max-width: 768px) {
  input[type="text"], input[type="email"], input[type="password"],
  input[type="number"], input[type="url"], input[type="tel"],
  select, textarea {
    font-size: 16px !important;
  }
}

/* Reward pool + referral config admin UI helpers */
.labelCls { font-family: var(--mono); font-size: 10px; font-weight: 600; color: var(--dimmer); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; display: block; }
.pillCls { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--r-sm); font-size: 10px; font-weight: 600; font-family: var(--mono); }
