/* /single logged-in dashboard only. Keep data, ids, commands and callbacks in user.js unchanged. */
body.dashboard-active {
  --single-bg: #F2F5F2;
  --single-panel: #FFFFFF;
  --single-panel-deep: #F4F7F4;
  --single-line: #CAD5CE;
  --single-text: #20312A;
  --single-muted: #66756D;
  --single-gold: #A96032;
  --single-cyan: #287254;
  --single-ok: #217C52;
  --single-warn: #A6642F;
  --single-bad: #B64A45;
  background: var(--single-bg);
  color: var(--single-text);
}

body.dashboard-active main {
  width: min(1560px, 100%);
  padding: 18px 24px 32px;
}

body.dashboard-active .dashboard {
  width: 100%;
  max-width: none;
  gap: 14px;
}

body.dashboard-active .dashboard .topbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--single-line);
  border-radius: 6px;
  background: var(--single-panel);
  box-shadow: none;
}

body.dashboard-active .dashboard .topbar h2 {
  margin: 3px 0 2px;
  color: var(--single-text);
  font-size: 26px;
  letter-spacing: 0;
  text-shadow: none;
}

body.dashboard-active .dashboard .topbar .muted,
body.dashboard-active .dashboard .topbar .eyebrow {
  color: var(--single-muted);
}

body.dashboard-active .dashboard-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

body.dashboard-active .dashboard-nav a {
  padding: 7px 9px;
  border-bottom: 2px solid transparent;
  color: var(--single-muted);
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}

body.dashboard-active .dashboard-nav a:hover,
body.dashboard-active .dashboard-nav a:focus-visible {
  color: var(--single-text);
  border-color: var(--single-gold);
  outline: none;
}

body.dashboard-active .dashboard .top-actions {
  min-width: 0;
  justify-content: flex-end;
  gap: 8px;
}

body.dashboard-active .dashboard .top-actions .help-link,
body.dashboard-active .dashboard .top-actions button,
body.dashboard-active .dashboard .top-actions .pill {
  min-height: 34px;
  border-radius: 4px;
}

body.dashboard-active .dashboard .top-actions .pill {
  border-color: var(--single-line);
  background: var(--single-panel-deep);
}

body.dashboard-active .mode-switcher {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

body.dashboard-active .mode-card {
  min-height: 148px;
  padding: 16px;
  border: 1px solid var(--single-line);
  border-radius: 6px;
  background: var(--single-panel);
  box-shadow: none;
  transform: none;
}

body.dashboard-active .mode-card:hover,
body.dashboard-active .mode-card:focus-visible,
body.dashboard-active .mode-card.active {
  border-color: var(--single-gold);
  background: #E8F1EB;
  box-shadow: inset 0 0 0 1px rgba(40, 114, 84, .12);
  outline: none;
}

body.dashboard-active .mode-card::before,
body.dashboard-active .mode-card::after {
  display: none;
}

body.dashboard-active .mode-card strong {
  margin: 10px 0 8px;
  color: var(--single-text);
  font-size: 21px;
  background: none;
  -webkit-text-fill-color: currentColor;
  filter: none;
  text-shadow: none;
}

body.dashboard-active .mode-card small,
body.dashboard-active .mode-card .tier-inheritance {
  color: var(--single-muted);
  line-height: 1.5;
}

body.dashboard-active .mode-card .tier-kicker,
body.dashboard-active .mode-card .tier-state {
  color: var(--single-gold);
}

body.dashboard-active .mode-card .tier-inheritance { display: none; }
body.dashboard-active .workspace-action { min-height: 126px; }
body.dashboard-active .workspace-action small { min-height: 0; }
body.dashboard-active .planned-module:disabled {
  cursor: not-allowed;
  opacity: .72;
}
body.dashboard-active .planned-module:disabled:hover {
  border-color: var(--single-line);
  background: var(--single-panel);
  box-shadow: none;
}

body.dashboard-active .intro-dashboard,
body.dashboard-active .intro-trade-detail,
body.dashboard-active .intro-workbench {
  min-width: 0;
}

body.dashboard-active .intro-detail-toolbar,
body.dashboard-active .intro-board,
body.dashboard-active .panel,
body.dashboard-active .manual-panel,
body.dashboard-active .toolbar,
body.dashboard-active .card {
  border: 1px solid var(--single-line);
  border-radius: 6px;
  background: var(--single-panel);
  box-shadow: none;
  backdrop-filter: none;
}

body.dashboard-active .intro-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, .8fr) !important;
  grid-template-areas:
    "trade auto"
    "trade ai"
    "diagnosis profit" !important;
  gap: 12px;
}

body.dashboard-active .intro-workbench > .intro-trade-panel { grid-area: trade; }
body.dashboard-active .intro-workbench > .intro-auto-panel { grid-area: auto; }
body.dashboard-active .intro-workbench > .intro-ai-panel { grid-area: ai; }
body.dashboard-active .intro-workbench > .intro-diagnosis-panel { grid-area: diagnosis; }
body.dashboard-active .intro-workbench > .intro-profit-panel { grid-area: profit; }

body.dashboard-active .intro-trade-panel,
body.dashboard-active .intro-auto-panel,
body.dashboard-active .intro-ai-panel,
body.dashboard-active .intro-diagnosis-panel,
body.dashboard-active .intro-profit-panel {
  min-width: 0;
  background: var(--single-panel);
  border-color: var(--single-line);
  animation: none;
}

body.dashboard-active .panel-title {
  margin-bottom: 12px;
  color: var(--single-text);
  text-shadow: none;
  letter-spacing: 0;
}

body.dashboard-active .panel-title::before {
  width: 4px;
  height: 14px;
  background: var(--single-gold);
  filter: none;
  animation: none;
}

body.dashboard-active .intro-account-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

body.dashboard-active .intro-account-grid > div,
body.dashboard-active .intro-orders-summary > div,
body.dashboard-active .orders-summary > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(143, 165, 186, .24);
  border-radius: 4px;
  background: var(--single-panel-deep);
}

body.dashboard-active .intro-account-grid span,
body.dashboard-active .intro-orders-summary span,
body.dashboard-active .orders-summary span,
body.dashboard-active .card span {
  color: var(--single-muted);
}

body.dashboard-active .intro-account-grid strong,
body.dashboard-active .intro-orders-summary strong,
body.dashboard-active .orders-summary strong,
body.dashboard-active .card strong {
  color: var(--single-text);
  text-shadow: none;
}

body.dashboard-active .intro-orders-summary,
body.dashboard-active .orders-summary {
  gap: 8px;
}

body.dashboard-active .intro-orders-summary #intro-floating-profit,
body.dashboard-active .intro-floating-pill strong,
body.dashboard-active .intro-total-pnl-card strong,
body.dashboard-active .profit-card strong {
  color: var(--single-cyan);
  text-shadow: none;
}

body.dashboard-active .intro-auto-panel input,
body.dashboard-active .intro-auto-panel select,
body.dashboard-active .intro-select-label select,
body.dashboard-active input,
body.dashboard-active select {
  min-height: 38px;
  border: 1px solid var(--single-line);
  border-radius: 4px;
  background: #FFFFFF;
  color: var(--single-text);
}

body.dashboard-active input:focus,
body.dashboard-active select:focus {
  border-color: var(--single-cyan);
  box-shadow: 0 0 0 2px rgba(85, 191, 217, .16);
}

body.dashboard-active button {
  min-height: 36px;
  border-radius: 4px;
}

body.dashboard-active .intro-status-line,
body.dashboard-active .intro-active-stops,
body.dashboard-active .entry-detail,
body.dashboard-active .order-row,
body.dashboard-active .history-card {
  border-color: rgba(143, 165, 186, .24);
  border-radius: 4px;
  background: var(--single-panel-deep);
}

body.dashboard-active .intro-status-line span,
body.dashboard-active .entry-detail,
body.dashboard-active .order-main b,
body.dashboard-active .order-grid strong {
  color: var(--single-text);
}

body.dashboard-active #client-panel {
  gap: 12px;
}

body.dashboard-active #client-panel .metric-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

body.dashboard-active #client-panel .metric-board .spread-card,
body.dashboard-active #client-panel .metric-board .status-card,
body.dashboard-active #client-panel .metric-board .profit-card {
  grid-column: auto;
  min-height: 78px;
}

body.dashboard-active #client-panel .metric-board .spread-card {
  border-top: 2px solid var(--single-cyan);
}

body.dashboard-active #client-panel .metric-board .status-card {
  border-top: 2px solid var(--single-gold);
}

body.dashboard-active #client-panel .metric-board .profit-card {
  border-top: 2px solid var(--single-ok);
  background: var(--single-panel);
  border-color: var(--single-line);
  box-shadow: none;
}

body.dashboard-active .toolbar,
body.dashboard-active .manual-panel {
  margin: 0;
  padding: 12px;
  background: var(--single-panel);
}

body.dashboard-active .logs,
body.dashboard-active .table-wrap {
  border-color: var(--single-line);
}

body.dashboard-active .intro-market-chart {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--single-line);
  border-left: 3px solid var(--single-cyan);
  border-radius: 4px;
  background: var(--single-panel);
}

body.dashboard-active .intro-market-chart.compact { margin-bottom: 14px; padding: 12px; }
body.dashboard-active .market-chart-heading,
body.dashboard-active .market-chart-current,
body.dashboard-active .market-range-labels,
body.dashboard-active .price-key-list {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
}
body.dashboard-active .market-chart-heading { color: var(--single-muted); font-size: 12px; }
body.dashboard-active .market-chart-heading strong { color: var(--single-text); font-size: 14px; }
body.dashboard-active .market-chart-heading span { text-align: right; }
body.dashboard-active .market-chart-current { justify-content: flex-start; margin-top: 10px; }
body.dashboard-active .market-chart-current span { color: var(--single-muted); }
body.dashboard-active .market-chart-current strong { color: var(--single-text); font-size: 21px; font-variant-numeric: tabular-nums; }
body.dashboard-active .market-range,
body.dashboard-active .price-track {
  position: relative;
  height: 18px;
  margin: 12px 2px 4px;
}
body.dashboard-active .market-range::before,
body.dashboard-active .price-track-line {
  position: absolute;
  top: 8px;
  right: 0;
  left: 0;
  height: 3px;
  background: #DCE4DF;
  content: "";
}
body.dashboard-active .market-range-fill {
  position: absolute;
  top: 7px;
  left: 0;
  width: 100%;
  height: 5px;
  background: #9CC9AE;
}
body.dashboard-active .market-range-marker,
body.dashboard-active .price-marker {
  position: absolute;
  top: 2px;
  z-index: 1;
  width: 12px;
  height: 12px;
  border: 2px solid #FFFFFF;
  border-radius: 50%;
  background: var(--single-gold);
  box-shadow: 0 0 0 1px var(--single-gold);
  transform: translateX(-50%);
}
body.dashboard-active .price-marker { top: 3px; }
body.dashboard-active .price-marker.long { background: var(--single-ok); box-shadow: 0 0 0 1px var(--single-ok); }
body.dashboard-active .price-marker.short { background: var(--single-bad); box-shadow: 0 0 0 1px var(--single-bad); }
body.dashboard-active .market-range-labels { color: var(--single-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
body.dashboard-active .price-key-list { justify-content: flex-start; flex-wrap: wrap; margin-top: 8px; }
body.dashboard-active .price-key { display: inline-flex; align-items: center; gap: 5px; color: var(--single-muted); font-size: 11px; }
body.dashboard-active .price-key b { color: var(--single-text); font-variant-numeric: tabular-nums; }
body.dashboard-active .price-key i { width: 7px; height: 7px; border-radius: 50%; background: var(--single-gold); }
body.dashboard-active .price-key.long i { background: var(--single-ok); }
body.dashboard-active .price-key.short i { background: var(--single-bad); }
body.dashboard-active .market-chart-note,
body.dashboard-active .market-chart-empty { margin: 9px 0 0; color: var(--single-muted); font-size: 11px; line-height: 1.5; }
body.dashboard-active .market-chart-empty { padding: 10px 0; }

@media (max-width: 1180px) {
  body.dashboard-active .dashboard .topbar {
    grid-template-columns: minmax(240px, 1fr) auto;
  }
  body.dashboard-active .dashboard-nav {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  body.dashboard-active .dashboard .top-actions {
    grid-column: 2;
    grid-row: 1;
  }
  body.dashboard-active .intro-account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  body.dashboard-active main { padding: 14px; }
  body.dashboard-active button { min-height: 44px; }
  body.dashboard-active .dashboard-nav a { min-height: 44px; display: inline-flex; align-items: center; }
  body.dashboard-active .dashboard .top-actions .help-link,
  body.dashboard-active .dashboard .top-actions button,
  body.dashboard-active .dashboard .top-actions .pill { min-height: 44px; }
  body.dashboard-active .mode-switcher,
  body.dashboard-active #client-panel .metric-board {
    grid-template-columns: 1fr;
  }
  body.dashboard-active .intro-workbench {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas: "trade" "auto" "ai" "diagnosis" "profit" !important;
  }
  body.dashboard-active #client-panel .metric-board .spread-card,
  body.dashboard-active #client-panel .metric-board .status-card,
  body.dashboard-active #client-panel .metric-board .profit-card {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  body.dashboard-active .dashboard .topbar,
  body.dashboard-active .dashboard .top-actions {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    min-width: 0;
    width: 100%;
  }
  body.dashboard-active .dashboard .topbar > *,
  body.dashboard-active .dashboard .top-actions > * {
    min-width: 0;
    max-width: 100%;
  }
  body.dashboard-active .dashboard .topbar h2,
  body.dashboard-active .dashboard .topbar .muted {
    overflow-wrap: anywhere;
  }
  body.dashboard-active .dashboard-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 4px;
  }
  body.dashboard-active .dashboard-nav a {
    text-align: center;
    white-space: normal;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 4px;
  }
  body.dashboard-active .dashboard .top-actions { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  body.dashboard-active .dashboard .top-actions .help-link,
  body.dashboard-active .dashboard .top-actions button,
  body.dashboard-active .dashboard .top-actions .pill { min-height: 44px; }
  body.dashboard-active .dashboard .topbar h2 {
    font-size: 22px;
  }
  body.dashboard-active button { min-height: 44px; }
  body.dashboard-active .intro-account-grid,
  body.dashboard-active .intro-profit-cards,
  body.dashboard-active .intro-orders-summary,
  body.dashboard-active .orders-summary {
    grid-template-columns: 1fr;
  }
  body.dashboard-active .market-chart-heading,
  body.dashboard-active .market-range-labels { align-items: flex-start; }
  body.dashboard-active .market-chart-heading { flex-wrap: wrap; }
  body.dashboard-active .market-chart-heading span { max-width: 100%; text-align: left; overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
  body.dashboard-active * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Portal visual follow-up: retain the existing workbench behavior while
   presenting it as a compact research terminal. */
body.dashboard-active {
  --single-bg: #0b0f12;
  --single-panel: #151a1d;
  --single-panel-deep: #101518;
  --single-line: #2b3539;
  --single-text: #edf2ef;
  --single-muted: #98a7a0;
  --single-gold: #c7a15a;
  --single-cyan: #48b38d;
  --single-ok: #55c998;
  --single-warn: #d1a84f;
  --single-bad: #e06b67;
  background: #0b0f12;
}

body.dashboard-active main { width: min(1720px, 100%); padding: 14px 18px 30px; }
body.dashboard-active #single-three-scene { display: none; }
body.dashboard-active::before,
body.dashboard-active::after,
body.dashboard-active .login-aurora,
body.dashboard-active .login-grid-sweep { display: none !important; }
body.dashboard-active .dashboard { grid-template-columns: minmax(220px, 242px) minmax(0, 1fr); gap: 10px 12px; }
body.dashboard-active .dashboard > .topbar {
  grid-column: 1 / -1;
  border-color: var(--single-line);
  background: rgba(19, 25, 28, .96);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .24);
}

body.dashboard-active #mode-switcher {
  max-height: calc(100vh - 28px);
  overflow-y: auto;
  scrollbar-width: thin;
  border-color: var(--single-line);
  background: rgba(15, 20, 23, .97);
  box-shadow: 0 16px 42px rgba(0, 0, 0, .22);
}

body.dashboard-active #mode-switcher .mode-card { flex: none; }
body.dashboard-active #mode-switcher .mode-card:hover,
body.dashboard-active #mode-switcher .mode-card:focus-visible,
body.dashboard-active #mode-switcher .mode-card.active { background: #1b2427; }

body.dashboard-active .workspace-strategy-nav {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--single-line);
}

body.dashboard-active .workspace-strategy-nav-head { display: grid; gap: 2px; padding: 0 6px; }
body.dashboard-active .workspace-strategy-nav-head span { color: var(--single-cyan); font-size: 9px; font-weight: 800; letter-spacing: .12em; }
body.dashboard-active .workspace-strategy-nav-head strong { color: var(--single-text); font-size: 13px; }
body.dashboard-active #workspace-strategy-links { display: grid; gap: 8px; }
body.dashboard-active .workspace-strategy-group { display: grid; gap: 4px; }
body.dashboard-active .workspace-strategy-group > strong { padding: 0 6px; color: #6f8179; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
body.dashboard-active .workspace-strategy-group > div { display: grid; gap: 2px; }

body.dashboard-active .workspace-strategy-link {
  width: 100%;
  min-height: 0;
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--single-text);
  text-align: left;
  box-shadow: none;
}
body.dashboard-active .workspace-strategy-link:hover,
body.dashboard-active .workspace-strategy-link:focus-visible,
body.dashboard-active .workspace-strategy-link.active {
  border-color: #40504d;
  background: #1b2427;
  box-shadow: inset 2px 0 0 var(--single-cyan);
}
body.dashboard-active .workspace-strategy-link span { overflow: hidden; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
body.dashboard-active .workspace-strategy-link small { overflow: hidden; color: var(--single-muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
body.dashboard-active .workspace-strategy-nav-empty { margin: 0; padding: 7px 8px; color: var(--single-muted); font-size: 10px; line-height: 1.5; }

body.dashboard-active #mode-detail-bar,
body.dashboard-active .intro-board,
body.dashboard-active .intro-trade-detail,
body.dashboard-active .panel,
body.dashboard-active .manual-panel,
body.dashboard-active .toolbar,
body.dashboard-active .card { border-color: var(--single-line); background: var(--single-panel); }

body.dashboard-active .intro-dashboard { min-height: 610px; }
body.dashboard-active #intro-overview-panel.basic-catalog { padding: 12px; border: 1px solid var(--single-line); background: var(--single-panel); }
body.dashboard-active .basic-catalog-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--single-line);
}
body.dashboard-active .basic-catalog-head h3 { font-size: 21px; }
body.dashboard-active .basic-catalog-head p { max-width: 760px; }
body.dashboard-active .intro-market-shell { border-color: var(--single-line); background: #0e1316; }
body.dashboard-active #intro-pair-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
body.dashboard-active #intro-pair-list .intro-market-section { padding: 0 0 12px; border-bottom-color: var(--single-line); }
body.dashboard-active #intro-pair-list .intro-market-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body.dashboard-active #intro-pair-list .intro-market-card { background: #171e21; }
body.dashboard-active #intro-pair-list .intro-market-card:hover,
body.dashboard-active #intro-pair-list .intro-market-card.selected { background: #1b2726; }

body.dashboard-active .intro-trade-detail { background: #0f1417; }
body.dashboard-active #intro-market-chart .intro-market-chart {
  min-height: 250px;
  display: grid;
  align-content: start;
  padding: 18px 20px;
  border-color: #32403e;
  background:
    linear-gradient(rgba(83, 113, 105, .09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(83, 113, 105, .09) 1px, transparent 1px),
    #101719;
  background-size: 44px 44px;
}
body.dashboard-active #intro-market-chart .market-chart-current { margin-top: 38px; }
body.dashboard-active #intro-market-chart .market-range,
body.dashboard-active #intro-market-chart .price-track { margin-top: 30px; }
body.dashboard-active #intro-market-chart .market-chart-note,
body.dashboard-active #intro-market-chart .market-chart-empty { margin-top: auto; }
body.dashboard-active .intro-workbench { grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr) !important; }

@media (max-width: 1220px) {
  body.dashboard-active #intro-pair-list .intro-market-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  body.dashboard-active main { padding: 8px 9px 18px; }
  body.dashboard-active #mode-switcher { max-height: none; overflow: visible; }
  body.dashboard-active .workspace-strategy-nav { margin-top: 2px; }
  body.dashboard-active #workspace-strategy-links { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 5px; scroll-snap-type: x proximity; }
  body.dashboard-active .workspace-strategy-group { flex: 0 0 220px; scroll-snap-align: start; }
  body.dashboard-active .workspace-strategy-group > div { display: grid; grid-template-columns: minmax(0, 1fr); }
  body.dashboard-active #intro-pair-list .intro-market-grid { grid-template-columns: minmax(0, 1fr); }
  body.dashboard-active .basic-catalog-head { align-items: flex-start; }
  body.dashboard-active #intro-market-chart .intro-market-chart { min-height: 220px; padding: 14px; }
  body.dashboard-active #intro-market-chart .market-chart-current { margin-top: 22px; }
}

body.dashboard-active {
  color-scheme: dark;
  --single-bg: #111719;
  --single-panel: #192124;
  --single-panel-deep: #202a2e;
  --single-line: #3b494c;
  --single-text: #e5eeeb;
  --single-muted: #a9b8b5;
  --single-gold: #d4ac61;
  --single-cyan: #72c9c2;
  --single-ok: #86c99d;
  --single-warn: #e0a56b;
  --single-bad: #e17870;
  background: var(--single-bg);
  color: var(--single-text);
}

body.dashboard-active main {
  width: min(1760px, 100%);
  padding: 12px 16px 24px;
}

body.dashboard-active .dashboard {
  display: grid;
  grid-template-columns: minmax(196px, 224px) minmax(0, 1fr);
  align-items: start;
  gap: 10px 14px;
}

body.dashboard-active .dashboard > .topbar {
  grid-column: 1 / -1;
  grid-template-columns: minmax(220px, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 8px 18px;
  padding: 11px 14px 8px;
  border-radius: 4px;
  background: #171f22;
}

body.dashboard-active .dashboard .topbar h2 {
  margin: 1px 0;
  font-size: 21px;
  line-height: 1.3;
}

body.dashboard-active .dashboard .topbar .muted,
body.dashboard-active .dashboard .topbar .eyebrow {
  color: var(--single-muted);
}

body.dashboard-active .dashboard-nav {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--single-line);
}

body.dashboard-active .dashboard-nav a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 3px;
  color: var(--single-muted);
  text-decoration: none;
}

body.dashboard-active .dashboard-nav a:hover,
body.dashboard-active .dashboard-nav a:focus-visible {
  border-color: var(--single-line);
  color: var(--single-text);
  outline: none;
}

body.dashboard-active .dashboard .top-actions {
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

body.dashboard-active .dashboard .top-actions .help-link,
body.dashboard-active .dashboard .top-actions button,
body.dashboard-active .dashboard .top-actions .pill {
  min-height: 32px;
  padding: 6px 9px;
  border-radius: 3px;
}

body.dashboard-active #mode-switcher {
  grid-column: 1;
  grid-row: 2 / span 8;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 5px;
  position: sticky;
  top: 10px;
  margin: 0;
  padding: 7px;
  border: 1px solid var(--single-line);
  border-radius: 4px;
  background: #151d20;
}

body.dashboard-active #mode-switcher .mode-card {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  box-shadow: none;
  text-align: left;
  transform: none;
}

body.dashboard-active #mode-switcher .mode-card:hover,
body.dashboard-active #mode-switcher .mode-card:focus-visible,
body.dashboard-active #mode-switcher .mode-card.active {
  border-color: #47585a;
  background: #202a2d;
  box-shadow: inset 2px 0 0 var(--single-cyan);
  outline: none;
}

body.dashboard-active #mode-switcher .mode-card strong {
  grid-column: 1 / -1;
  margin: 2px 0;
  color: var(--single-text);
  font-size: 15px;
  font-weight: 700;
}

body.dashboard-active #mode-switcher .mode-card .tier-kicker {
  grid-column: 1 / -1;
  color: var(--single-cyan);
  font-size: 9px;
  line-height: 1.3;
}

body.dashboard-active #mode-switcher .mode-card small {
  grid-column: 1 / -1;
  color: var(--single-muted);
  font-size: 11px;
  line-height: 1.4;
}

body.dashboard-active #mode-switcher .mode-card .tier-state {
  grid-column: 1 / -1;
  margin-top: 1px;
  color: var(--single-gold);
  font-size: 10px;
}

body.dashboard-active #mode-switcher .planned-module:disabled {
  min-height: 0;
  border-style: dashed;
  background: transparent;
  opacity: .68;
}

body.dashboard-active #dashboard-msg,
body.dashboard-active #mode-detail-bar,
body.dashboard-active #intro-panel,
body.dashboard-active #tier-preview-panel,
body.dashboard-active #client-panel {
  grid-column: 2;
  min-width: 0;
  margin: 0;
}

body.dashboard-active #dashboard-msg { min-height: 0; }

body.dashboard-active #mode-detail-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid var(--single-line);
  border-radius: 4px;
  background: var(--single-panel);
}

body.dashboard-active #mode-detail-bar #mode-home-btn {
  position: relative;
  min-height: 32px;
  padding: 5px 9px 5px 22px;
  border: 0;
  border-right: 1px solid var(--single-line);
  border-radius: 0;
  background: transparent;
  color: var(--terminal-muted);
  font-size: 11px;
  white-space: nowrap;
}

body.dashboard-active #mode-detail-bar #mode-home-btn::before {
  position: absolute;
  top: 12px;
  left: 7px;
  width: 7px;
  height: 7px;
  border-bottom: 1.5px solid currentColor;
  border-left: 1.5px solid currentColor;
  content: "";
  transform: rotate(45deg);
}

body.dashboard-active #mode-detail-bar #mode-home-btn:hover,
body.dashboard-active #mode-detail-bar #mode-home-btn:focus-visible {
  background: transparent;
  box-shadow: none;
  color: var(--terminal-text);
}

body.dashboard-active #mode-detail-bar > div { min-width: 0; display: grid; gap: 2px; }
body.dashboard-active #mode-detail-bar strong { font-size: 15px; }
body.dashboard-active #mode-detail-bar small { color: var(--single-muted); }

body.dashboard-active .intro-dashboard { display: grid; gap: 10px; }
body.dashboard-active .intro-board,
body.dashboard-active .intro-trade-detail { min-width: 0; padding: 12px; }

body.dashboard-active .basic-catalog-head { margin-bottom: 8px; }
body.dashboard-active .basic-catalog-head h3 { margin: 3px 0; font-size: 18px; }
body.dashboard-active .basic-catalog-head p { margin: 0; color: var(--single-muted); font-size: 12px; }

body.dashboard-active .intro-overview-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0;
}

body.dashboard-active .intro-overview-metrics > div {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--single-line);
  border-radius: 3px;
  background: var(--single-panel-deep);
}

body.dashboard-active .intro-overview-metrics span { color: var(--single-muted); font-size: 11px; }
body.dashboard-active .intro-overview-metrics strong { color: var(--single-text); font-size: 16px; }

body.dashboard-active #intro-pair-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  gap: 7px;
}

body.dashboard-active #intro-pair-list .intro-market-card {
  min-height: 0;
  padding: 10px 11px;
  border: 1px solid var(--single-line);
  border-radius: 3px;
  background: #1b2427;
  box-shadow: none;
  transform: none;
}

body.dashboard-active #intro-pair-list .intro-market-card.is-live:hover,
body.dashboard-active #intro-pair-list .intro-market-card.selected {
  border-color: var(--single-cyan);
  background: #202c2d;
  box-shadow: inset 2px 0 0 var(--single-cyan);
}

body.dashboard-active .intro-detail-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 8px;
  padding: 8px;
  border-radius: 3px;
}

body.dashboard-active .intro-detail-toolbar > div { flex: 1 1 190px; min-width: 0; }
body.dashboard-active .intro-detail-toolbar strong { font-size: 17px; }
body.dashboard-active .intro-floating-pill { padding: 6px 9px; }

body.dashboard-active #intro-market-chart {
  min-width: 0;
  margin-bottom: 8px;
}

body.dashboard-active .intro-workbench {
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr) !important;
  grid-template-areas:
    "trade auto"
    "trade ai"
    "diagnosis profit" !important;
  gap: 8px;
}

body.dashboard-active .intro-workbench > .panel { padding: 11px; }
body.dashboard-active .intro-account-grid { gap: 5px; }
body.dashboard-active .intro-account-grid > div { padding: 7px 8px; }
body.dashboard-active .intro-account-grid span { font-size: 10px; }
body.dashboard-active .intro-account-grid strong { font-size: 13px; overflow-wrap: anywhere; }

body.dashboard-active .intro-auto-panel input,
body.dashboard-active .intro-auto-panel select,
body.dashboard-active .intro-select-label select,
body.dashboard-active input,
body.dashboard-active select {
  border-color: var(--single-line);
  background: #202a2e;
  color: var(--single-text);
}

body.dashboard-active input:focus-visible,
body.dashboard-active select:focus-visible,
body.dashboard-active button:focus-visible,
body.dashboard-active a:focus-visible,
body.dashboard-active summary:focus-visible {
  outline: 2px solid var(--single-cyan);
  outline-offset: 2px;
  box-shadow: none;
}

body.dashboard-active .intro-status-line,
body.dashboard-active .intro-active-stops,
body.dashboard-active .entry-detail,
body.dashboard-active .order-row,
body.dashboard-active .history-card {
  border-color: var(--single-line);
  background: var(--single-panel-deep);
}

body.dashboard-active .market-range::before,
body.dashboard-active .price-track-line { background: #3c494b; }
body.dashboard-active .market-range-fill { background: #4b8577; }
body.dashboard-active .market-range-marker,
body.dashboard-active .price-marker { border-color: var(--single-panel); }

@media (max-width: 1100px) {
  body.dashboard-active main { padding-right: 12px; padding-left: 12px; }
  body.dashboard-active .dashboard { grid-template-columns: minmax(180px, 198px) minmax(0, 1fr); gap: 8px 10px; }
  body.dashboard-active .intro-workbench {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas: "trade" "auto" "ai" "diagnosis" "profit" !important;
  }
}

@media (max-width: 700px) {
  body.dashboard-active main { padding: 8px 10px 18px; }
  body.dashboard-active .dashboard { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  body.dashboard-active .dashboard > .topbar,
  body.dashboard-active #mode-switcher,
  body.dashboard-active #dashboard-msg,
  body.dashboard-active #mode-detail-bar,
  body.dashboard-active #intro-panel,
  body.dashboard-active #tier-preview-panel,
  body.dashboard-active #client-panel { grid-column: 1; }
  body.dashboard-active #mode-switcher { grid-row: auto; position: static; }
  body.dashboard-active .dashboard > .topbar { grid-template-columns: minmax(0, 1fr); }
  body.dashboard-active .dashboard .top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }
  body.dashboard-active .dashboard .top-actions > * { width: auto; max-width: 100%; flex: 0 0 auto; }
  body.dashboard-active .dashboard .top-actions .help-link,
  body.dashboard-active .dashboard .top-actions button,
  body.dashboard-active .dashboard .top-actions .pill { min-height: 44px; }
  body.dashboard-active .dashboard-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.dashboard-active .dashboard-nav a { min-height: 40px; justify-content: center; padding: 5px; text-align: center; }
  body.dashboard-active #mode-switcher { grid-template-columns: minmax(0, 1fr); }
  body.dashboard-active #mode-switcher .mode-card { grid-template-columns: minmax(0, 1fr); padding: 8px 10px; }
  body.dashboard-active .intro-overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.dashboard-active .intro-workbench { grid-template-columns: minmax(0, 1fr) !important; }
  body.dashboard-active .intro-workbench > .panel { padding: 10px; }
  body.dashboard-active #intro-pair-list { grid-template-columns: minmax(0, 1fr); }
  body.dashboard-active #intro-market-chart { overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
  body.dashboard-active *,
  body.dashboard-active *::before,
  body.dashboard-active *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* Final workspace shell: keep the existing portal actions and data, with a
   persistent product rail and a compact trading-terminal content area. */
body.dashboard-active {
  color-scheme: dark;
  --single-bg: #121719;
  --single-panel: #1a2225;
  --single-panel-deep: #171e20;
  --single-line: #344044;
  --single-text: #e8efed;
  --single-muted: #9cadaa;
  --single-gold: #d8b16b;
  --single-cyan: #79c7c0;
  --single-ok: #7cc69d;
  --single-warn: #e2ae72;
  --single-bad: #e17d78;
  background: var(--single-bg);
  color: var(--single-text);
}

body.dashboard-active main {
  width: 100%;
  max-width: none;
  padding: 0;
}

body.dashboard-active .dashboard {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  align-items: start;
  gap: 0;
  width: 100%;
  max-width: none;
}

body.dashboard-active .dashboard > .topbar {
  grid-column: 2;
  grid-row: 1;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 8px 16px;
  margin: 0;
  padding: 13px 26px 9px;
  border: 0;
  border-bottom: 1px solid var(--single-line);
  border-radius: 0;
  background: #151c1e;
  box-shadow: none;
}

body.dashboard-active .dashboard .topbar h2 {
  margin: 1px 0 2px;
  font-size: 20px;
  line-height: 1.35;
}

body.dashboard-active .dashboard .topbar .eyebrow,
body.dashboard-active .dashboard .topbar .muted { color: var(--single-muted); }

body.dashboard-active .dashboard-nav {
  grid-column: 1 / -1;
  display: flex;
  gap: 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(156, 173, 170, .14);
}

body.dashboard-active .dashboard-nav a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--single-muted);
  text-decoration: none;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}

body.dashboard-active .dashboard-nav a:hover,
body.dashboard-active .dashboard-nav a:focus-visible {
  border-color: var(--single-line);
  background: #202a2d;
  color: var(--single-text);
  outline: none;
}

body.dashboard-active .dashboard .top-actions {
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

body.dashboard-active .dashboard .top-actions .help-link,
body.dashboard-active .dashboard .top-actions button,
body.dashboard-active .dashboard .top-actions .pill {
  min-height: 34px;
  padding: 6px 9px;
  border-radius: 4px;
}

body.dashboard-active .dashboard .top-actions .pill {
  border-color: var(--single-line);
  background: #1b2528;
}

body.dashboard-active #mode-switcher {
  grid-column: 1;
  grid-row: 1 / span 20;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 5px;
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  max-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0;
  padding: 16px 11px 20px;
  border: 0;
  border-right: 1px solid var(--single-line);
  border-radius: 0;
  background: #171e20;
  box-shadow: none;
  scrollbar-width: thin;
  scrollbar-color: #435052 transparent;
}

body.dashboard-active .workspace-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  margin: 0 0 14px;
  padding: 0 5px 13px;
  border-bottom: 1px solid var(--single-line);
}

body.dashboard-active .workspace-brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 8px;
  background: #91ddc4;
  color: #162522;
  font-size: 18px;
  font-weight: 800;
}

body.dashboard-active .workspace-brand > span:last-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

body.dashboard-active .workspace-brand strong { color: var(--single-text); font-size: 14px; }
body.dashboard-active .workspace-brand small { color: var(--single-muted); font-size: 9px; font-weight: 700; }

body.dashboard-active #mode-switcher .mode-card {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  box-shadow: none;
  text-align: left;
  transform: none;
  transition: border-color .18s ease, background-color .18s ease;
}

body.dashboard-active #mode-switcher .mode-card::before,
body.dashboard-active #mode-switcher .mode-card::after { display: none; }

body.dashboard-active #mode-switcher .mode-card:hover,
body.dashboard-active #mode-switcher .mode-card:focus-visible,
body.dashboard-active #mode-switcher .mode-card.active {
  border-color: #42514d;
  background: #22312d;
  box-shadow: inset 3px 0 0 var(--single-ok);
  outline: none;
}

body.dashboard-active #mode-switcher .mode-card .tier-kicker {
  color: var(--single-cyan);
  font-size: 9px;
  line-height: 1.35;
}

body.dashboard-active #mode-switcher .mode-card strong {
  margin: 1px 0;
  color: var(--single-text);
  font-size: 14px;
  line-height: 1.4;
  text-shadow: none;
}

body.dashboard-active #mode-switcher .mode-card small { display: none; }
body.dashboard-active #mode-switcher .mode-card .tier-state { margin-top: 1px; color: var(--single-muted); font-size: 10px; }
body.dashboard-active #mode-switcher .planned-module:disabled { opacity: .62; }

body.dashboard-active .workspace-strategy-nav {
  display: grid;
  gap: 8px;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--single-line);
}

body.dashboard-active .workspace-strategy-nav-head { display: grid; gap: 3px; padding: 0 6px; }
body.dashboard-active .workspace-strategy-nav-head span { color: var(--single-cyan); font-size: 9px; font-weight: 800; }
body.dashboard-active .workspace-strategy-nav-head strong { color: var(--single-text); font-size: 13px; }
body.dashboard-active #workspace-strategy-links { display: grid; gap: 8px; }
body.dashboard-active .workspace-strategy-group { display: grid; gap: 3px; }
body.dashboard-active .workspace-strategy-group > strong { padding: 0 6px; color: #899a95; font-size: 10px; font-weight: 800; }
body.dashboard-active .workspace-strategy-group > div { display: grid; gap: 1px; }

body.dashboard-active .workspace-strategy-link {
  width: 100%;
  min-height: 34px;
  display: grid;
  gap: 1px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--single-text);
  text-align: left;
  box-shadow: none;
  cursor: pointer;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}

body.dashboard-active .workspace-strategy-link:hover,
body.dashboard-active .workspace-strategy-link:focus-visible,
body.dashboard-active .workspace-strategy-link.active {
  border-color: #42514d;
  background: #202a2d;
  box-shadow: inset 2px 0 0 var(--single-ok);
  outline: none;
}

body.dashboard-active .workspace-strategy-link span { overflow: hidden; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
body.dashboard-active .workspace-strategy-link small { overflow: hidden; color: var(--single-muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
body.dashboard-active .workspace-strategy-nav-empty { margin: 0; padding: 7px 8px; color: var(--single-muted); font-size: 10px; line-height: 1.5; }

body.dashboard-active #dashboard-msg,
body.dashboard-active #mode-detail-bar,
body.dashboard-active #intro-panel,
body.dashboard-active #tier-preview-panel,
body.dashboard-active #client-panel {
  grid-column: 2;
  min-width: 0;
  margin: 0;
}

body.dashboard-active #dashboard-msg { padding: 0 26px; }
body.dashboard-active #mode-detail-bar { margin: 16px 26px 0; }
body.dashboard-active #intro-panel,
body.dashboard-active #tier-preview-panel,
body.dashboard-active #client-panel { padding: 16px 26px 28px; }
body.dashboard-active .intro-dashboard { display: grid; gap: 16px; min-height: 0; }
body.dashboard-active #intro-overview-panel.basic-catalog { padding: 0; border: 0; background: transparent; }

body.dashboard-active .basic-catalog-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 14px;
  border-bottom: 1px solid var(--single-line);
}

body.dashboard-active .basic-catalog-head h3 { margin: 4px 0; color: var(--single-text); font-size: 22px; }
body.dashboard-active .basic-catalog-head p { max-width: 820px; margin: 0; color: var(--single-muted); font-size: 12px; line-height: 1.6; }
body.dashboard-active .basic-catalog-head > div > span { color: var(--single-cyan); font-size: 9px; font-weight: 800; }

body.dashboard-active .intro-overview-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

body.dashboard-active .intro-overview-metrics > div {
  min-width: 0;
  min-height: 86px;
  padding: 12px 14px;
  border: 1px solid var(--single-line);
  border-radius: 6px;
  background: #1a2225;
}

body.dashboard-active .intro-overview-metrics > div:nth-child(1) { box-shadow: inset 0 2px 0 var(--single-ok); }
body.dashboard-active .intro-overview-metrics > div:nth-child(2) { box-shadow: inset 0 2px 0 var(--single-cyan); }
body.dashboard-active .intro-overview-metrics > div:nth-child(3) { box-shadow: inset 0 2px 0 var(--single-gold); }
body.dashboard-active .intro-overview-metrics > div:nth-child(4) { box-shadow: inset 0 2px 0 #cf8d6d; }
body.dashboard-active .intro-overview-metrics span { color: var(--single-muted); font-size: 11px; }
body.dashboard-active .intro-overview-metrics strong { margin-top: 7px; color: var(--single-text); font-size: 22px; font-variant-numeric: tabular-nums; }
body.dashboard-active .intro-overview-metrics .intro-total-pnl-card strong { color: var(--single-ok); }

body.dashboard-active .intro-market-shell { padding: 0; border: 0; background: transparent; }
body.dashboard-active #intro-pair-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
body.dashboard-active #intro-pair-list .intro-market-section {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--single-line);
  border-radius: 6px;
  background: #181f21;
}

body.dashboard-active #intro-pair-list .intro-market-section-head {
  margin: 0 0 10px;
  padding: 0 0 9px;
  border-bottom: 1px solid rgba(156, 173, 170, .16);
}

body.dashboard-active #intro-pair-list .intro-market-section-head strong { color: var(--single-text); font-size: 14px; text-shadow: none; }
body.dashboard-active #intro-pair-list .intro-market-section-head small { color: var(--single-muted); }
body.dashboard-active #intro-pair-list .intro-market-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 8px; }

body.dashboard-active #intro-pair-list .intro-market-card {
  min-width: 0;
  min-height: 140px;
  padding: 11px;
  border: 1px solid #354246;
  border-radius: 5px;
  background: #131a1c;
  box-shadow: none;
  color: var(--single-text);
  text-align: left;
  transform: none;
  transition: border-color .18s ease, background-color .18s ease;
}

body.dashboard-active #intro-pair-list .intro-market-card::before,
body.dashboard-active #intro-pair-list .intro-market-card::after { display: none; }
body.dashboard-active #intro-pair-list .intro-market-card:hover,
body.dashboard-active #intro-pair-list .intro-market-card:focus-visible,
body.dashboard-active #intro-pair-list .intro-market-card.selected { border-color: var(--single-cyan); background: #1b2726; outline: none; }
body.dashboard-active #intro-pair-list .intro-card-top { align-items: center; gap: 8px; }
body.dashboard-active #intro-pair-list .intro-card-top b { min-width: 0; color: var(--single-text); font-size: 13px; }
body.dashboard-active #intro-pair-list .intro-card-top em { flex: 0 0 auto; border-radius: 4px; background: #26352f; color: #9adbb7; font-size: 10px; }
body.dashboard-active #intro-pair-list .intro-market-card small { color: var(--single-muted); font-size: 10px; }
body.dashboard-active #intro-pair-list .intro-card-spread strong { color: var(--single-ok); text-shadow: none; }
body.dashboard-active #intro-pair-list .intro-card-range i { border-color: #354246; background: #1b2426; color: var(--single-muted); }

body.dashboard-active .intro-trade-detail { padding: 12px; border: 1px solid var(--single-line); border-radius: 6px; background: #171e20; }
body.dashboard-active .intro-detail-toolbar { margin-bottom: 10px; border: 1px solid var(--single-line); border-radius: 5px; background: #1a2225; }
body.dashboard-active .intro-detail-toolbar strong { color: var(--single-text); }
body.dashboard-active .intro-floating-pill { border-color: var(--single-line); border-radius: 5px; background: #11191b; }
body.dashboard-active #intro-market-chart { min-width: 0; margin-bottom: 10px; }

body.dashboard-active #intro-market-chart .intro-market-chart {
  min-width: 0;
  min-height: 260px;
  display: grid;
  align-content: start;
  padding: 20px;
  border: 1px solid #42514d;
  border-left: 3px solid var(--single-cyan);
  border-radius: 6px;
  background:
    linear-gradient(rgba(121, 199, 192, .075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(121, 199, 192, .075) 1px, transparent 1px),
    #141c1e;
  background-size: 44px 44px;
}

body.dashboard-active #intro-market-chart .market-chart-current { margin-top: 36px; }
body.dashboard-active #intro-market-chart .market-chart-current strong { color: var(--single-text); font-size: 30px; }
body.dashboard-active #intro-market-chart .market-range,
body.dashboard-active #intro-market-chart .price-track { margin-top: 26px; }
body.dashboard-active #intro-market-chart .market-chart-note,
body.dashboard-active #intro-market-chart .market-chart-empty { margin-top: auto; color: var(--single-muted); }
body.dashboard-active .intro-workbench { grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr) !important; gap: 10px; }
body.dashboard-active .intro-workbench > .panel { border-radius: 5px; }

@media (max-width: 1180px) {
  body.dashboard-active .dashboard { grid-template-columns: 208px minmax(0, 1fr); }
  body.dashboard-active .dashboard > .topbar { padding-right: 18px; padding-left: 18px; }
  body.dashboard-active #intro-panel,
  body.dashboard-active #tier-preview-panel,
  body.dashboard-active #client-panel { padding-right: 18px; padding-left: 18px; }
  body.dashboard-active .intro-overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  body.dashboard-active main { padding: 0; }
  body.dashboard-active .dashboard { grid-template-columns: minmax(0, 1fr); gap: 0; }
  body.dashboard-active .dashboard > .topbar,
  body.dashboard-active #mode-switcher,
  body.dashboard-active #dashboard-msg,
  body.dashboard-active #mode-detail-bar,
  body.dashboard-active #intro-panel,
  body.dashboard-active #tier-preview-panel,
  body.dashboard-active #client-panel { grid-column: 1; }
  body.dashboard-active .dashboard > .topbar {
    grid-row: 1;
    grid-template-columns: minmax(0, 1fr);
    padding: 12px 12px 8px;
  }
  body.dashboard-active .dashboard .top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  body.dashboard-active .dashboard .top-actions > * {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    white-space: nowrap;
  }
  body.dashboard-active .dashboard .top-actions .help-link,
  body.dashboard-active .dashboard .top-actions button,
  body.dashboard-active .dashboard .top-actions .pill {
    min-height: 36px;
    padding: 5px 8px;
  }
  body.dashboard-active .dashboard-nav { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  body.dashboard-active .dashboard-nav a { flex: 0 0 auto; min-height: 40px; }
  body.dashboard-active #mode-switcher { grid-row: 2; position: static; width: 100%; height: auto; max-height: none; overflow: visible; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--single-line); }
  body.dashboard-active .workspace-brand { min-height: 42px; margin: 0 0 8px; padding: 0 2px 8px; }
  body.dashboard-active .workspace-brand-mark { width: 32px; height: 32px; flex-basis: 32px; }
  body.dashboard-active #mode-switcher .mode-card { min-height: 58px; align-content: center; padding: 7px 9px; }
  body.dashboard-active #mode-switcher .mode-card .tier-kicker { font-size: 8px; }
  body.dashboard-active #mode-switcher .mode-card strong { font-size: 12px; }
  body.dashboard-active #mode-switcher .mode-card .tier-state { display: none; }
  body.dashboard-active .workspace-strategy-nav { margin-top: 8px; }
  body.dashboard-active #workspace-strategy-links { display: flex; gap: 7px; max-width: 100%; overflow-x: auto; padding-bottom: 5px; scroll-snap-type: x proximity; }
  body.dashboard-active .workspace-strategy-group { flex: 0 0 min(78vw, 260px); scroll-snap-align: start; }
  body.dashboard-active .workspace-strategy-group > div { max-height: 132px; overflow-y: auto; }
  body.dashboard-active .workspace-strategy-link { min-height: 44px; }
  body.dashboard-active #intro-panel,
  body.dashboard-active #tier-preview-panel,
  body.dashboard-active #client-panel { padding: 14px 12px 22px; }
  body.dashboard-active #dashboard-msg { padding: 0 12px; }
  body.dashboard-active #mode-detail-bar { margin: 12px 12px 0; }
  body.dashboard-active .basic-catalog-head { align-items: flex-start; }
  body.dashboard-active .intro-overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  body.dashboard-active .intro-overview-metrics > div { min-height: 76px; padding: 9px 10px; }
  body.dashboard-active .intro-overview-metrics strong { font-size: 19px; }
  body.dashboard-active #intro-pair-list .intro-market-grid { grid-template-columns: minmax(0, 1fr); }
  body.dashboard-active #intro-pair-list .intro-market-card { min-height: 0; }
  body.dashboard-active #intro-market-chart .intro-market-chart { min-height: 220px; padding: 14px; }
  body.dashboard-active #intro-market-chart .market-chart-current { margin-top: 24px; }
  body.dashboard-active .intro-workbench { grid-template-columns: minmax(0, 1fr) !important; }
}

@media (max-width: 420px) {
  body.dashboard-active #mode-switcher { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.dashboard-active .workspace-brand,
  body.dashboard-active .workspace-strategy-nav { grid-column: 1 / -1; }
  body.dashboard-active .workspace-brand { grid-row: 1; }
  body.dashboard-active .workspace-strategy-nav { grid-row: 4; }
  body.dashboard-active #workspace-catalog-btn { grid-column: 1; grid-row: 2; }
  body.dashboard-active #workspace-live-btn { grid-column: 2; grid-row: 2; }
  body.dashboard-active #workspace-local-btn { grid-column: 1; grid-row: 3; }
  body.dashboard-active #workspace-ai-plan-btn { grid-column: 2; grid-row: 3; }
  body.dashboard-active .basic-catalog-head h3 { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  body.dashboard-active .dashboard-nav a,
  body.dashboard-active #mode-switcher .mode-card,
  body.dashboard-active .workspace-strategy-link,
  body.dashboard-active #intro-pair-list .intro-market-card { transition: none; }
}


/* Full-viewport terminal shell: persistent navigation rail, independently
   scrolling workspace content, and a compact top status/header band. */
body.dashboard-active {
  --single-bg: var(--terminal-bg);
  --single-panel: var(--terminal-panel);
  --single-panel-deep: var(--terminal-panel-2);
  --single-line: var(--terminal-line);
  --single-text: var(--terminal-text);
  --single-muted: var(--terminal-muted);
  --single-gold: var(--terminal-gold);
  --single-cyan: var(--terminal-cyan);
  --single-ok: var(--terminal-green);
  --single-warn: var(--terminal-gold);
  --single-bad: var(--terminal-red);
  width: 100%;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: var(--single-bg);
}

body.dashboard-active main {
  width: 100%;
  height: 100dvh;
  min-height: 0;
  max-width: none;
  padding: 0;
  overflow: hidden;
}

body.dashboard-active .dashboard {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: none;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  grid-template-rows: 76px minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  overflow: hidden;
}

body.dashboard-active .dashboard > .topbar {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto;
  grid-template-rows: auto auto;
  align-content: center;
  gap: 2px 18px;
  margin: 0;
  padding: 9px 24px 7px;
  border: 0;
  border-bottom: 1px solid var(--single-line);
  border-radius: 0;
  background: #0f1b2a;
  box-shadow: none;
}

body.dashboard-active #workspace-content {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

body.dashboard-active #workspace-content > #dashboard-msg { flex: 0 0 auto; padding: 0 22px; }
body.dashboard-active #workspace-content > #mode-detail-bar { flex: 0 0 auto; margin: 12px 22px 0; }
body.dashboard-active #workspace-content > #intro-panel,
body.dashboard-active #workspace-content > #global-market-panel,
body.dashboard-active #workspace-content > #tier-preview-panel,
body.dashboard-active #workspace-content > #client-panel {
  flex: 1 1 0;
  width: 100%;
  max-height: none;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px 22px 24px;
}

body.dashboard-active #workspace-content:has(> #global-market-panel:not([hidden])) > #intro-panel {
  display: none;
}

body.dashboard-active .dashboard > .topbar > div:first-child {
  grid-column: 1;
  grid-row: 1 / span 2;
  min-width: 0;
  align-self: center;
}

body.dashboard-active .dashboard .topbar h2 {
  margin: 2px 0 1px;
  color: var(--single-text);
  font-size: 19px;
  line-height: 1.3;
}

body.dashboard-active .dashboard .topbar .eyebrow { color: var(--single-cyan); font-size: 10px; }
body.dashboard-active .dashboard .topbar .muted { color: var(--single-muted); font-size: 11px; }

body.dashboard-active .dashboard-nav {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-wrap: nowrap;
  gap: 3px;
  min-width: 0;
  padding: 0;
  border: 0;
}

body.dashboard-active .dashboard-nav a {
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 11px;
}

body.dashboard-active .dashboard .top-actions { grid-column: 2; grid-row: 1; gap: 6px; }
body.dashboard-active .dashboard .top-actions .help-link,
body.dashboard-active .dashboard .top-actions button,
body.dashboard-active .dashboard .top-actions .pill { min-height: 36px; padding: 5px 8px; border-radius: 4px; font-size: 11px; }
body.dashboard-active .dashboard .top-actions .help-link,
body.dashboard-active .dashboard .top-actions button { min-height: 36px; padding: 6px 9px; border-radius: 4px; font-size: 11px; }

body.dashboard-active #mode-switcher {
  grid-column: 1;
  grid-row: 1 / -1;
  position: relative;
  top: auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  align-content: start;
  gap: 3px;
  padding: 14px 10px max(18px, env(safe-area-inset-bottom));
  border: 0;
  border-right: 1px solid var(--single-line);
  border-radius: 0;
  background: #101b29;
  scrollbar-color: #3a4b60 transparent;
}

body.dashboard-active .workspace-brand {
  min-height: 58px;
  margin: 0 0 8px;
  padding: 0 7px 11px;
  border-color: var(--single-line);
}

body.dashboard-active .workspace-brand-mark {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  border: 1px solid rgba(105, 195, 207, .3);
  border-radius: 7px;
  background: #15363e;
  color: #a7e2dc;
}

body.dashboard-active .workspace-brand strong { font-size: 14px; }
body.dashboard-active .workspace-brand small { color: #8799ad; font-size: 9px; }

body.dashboard-active #mode-switcher .mode-card {
  min-height: 37px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  text-align: left;
}

body.dashboard-active #mode-switcher .mode-card .tier-kicker { display: none; }
body.dashboard-active #mode-switcher .mode-card strong { margin: 0; font-size: 12px; font-weight: 650; }
body.dashboard-active #mode-switcher .mode-card .tier-state { display: none; }
body.dashboard-active #mode-switcher .mode-card:hover,
body.dashboard-active #mode-switcher .mode-card:focus-visible,
body.dashboard-active #mode-switcher .mode-card.active {
  border-color: #2d4b52;
  background: #172b36;
  box-shadow: inset 3px 0 0 var(--single-cyan);
}

body.dashboard-active #workspace-catalog-btn::before,
body.dashboard-active #workspace-live-btn::before,
body.dashboard-active #workspace-local-btn::before,
body.dashboard-active #workspace-ai-plan-btn::before {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border: 1px solid #7f93a7;
  border-radius: 2px;
  content: "";
}

body.dashboard-active #workspace-live-btn::before { border-color: var(--single-cyan); background: var(--single-cyan); }
body.dashboard-active #workspace-ai-plan-btn { opacity: .58; }
body.dashboard-active #mode-switcher #workspace-ai-plan-btn .tier-state { display: inline-flex !important; margin-left: auto; color: #9aabc0; font-size: 10px; }

body.dashboard-active .workspace-strategy-nav {
  min-height: 0;
  gap: 7px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--single-line);
}

body.dashboard-active .workspace-strategy-nav-head { gap: 2px; padding: 0 7px 4px; }
body.dashboard-active .workspace-strategy-nav-head span { color: #8194a9; font-size: 9px; letter-spacing: .08em; }
body.dashboard-active .workspace-strategy-nav-head strong { color: #dce6ef; font-size: 12px; }
body.dashboard-active #workspace-strategy-links { gap: 8px; }
body.dashboard-active .workspace-strategy-group { gap: 3px; }
body.dashboard-active .workspace-strategy-group > strong {
  padding: 7px 7px 3px;
  border-top: 1px solid rgba(148, 166, 187, .12);
  color: #8194a9;
  font-size: 9px;
  font-weight: 700;
}
body.dashboard-active .workspace-strategy-group:first-child > strong { border-top: 0; }
body.dashboard-active .workspace-strategy-group > div { gap: 2px; }

body.dashboard-active .workspace-strategy-link {
  min-height: 35px;
  gap: 1px;
  padding: 5px 8px;
  border-radius: 4px;
  color: #d7e0e9;
}

body.dashboard-active .workspace-strategy-link span { font-size: 10px; font-weight: 600; }
body.dashboard-active .workspace-strategy-link small { color: #8396aa; font-size: 9px; }
body.dashboard-active .workspace-strategy-link.active { border-color: #324754; background: #172a37; box-shadow: inset 2px 0 0 var(--single-cyan); }

body.dashboard-active #workspace-content > #intro-panel,
body.dashboard-active #workspace-content > #global-market-panel,
body.dashboard-active #workspace-content > #tier-preview-panel,
body.dashboard-active #workspace-content > #client-panel { margin: 0; scrollbar-color: #405168 transparent; }

body.dashboard-active .intro-dashboard { min-height: 0; gap: 12px; }
body.dashboard-active .intro-workbench { grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr) !important; gap: 12px; }
body.dashboard-active .intro-trade-detail,
body.dashboard-active .intro-market-section,
body.dashboard-active .intro-overview-metrics > div { background-color: var(--single-panel); }

body.dashboard-active.workspace-home-view .dashboard {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 76px minmax(0, 1fr);
  overflow-y: auto;
}

body.dashboard-active.workspace-home-view .dashboard > .topbar { grid-column: 1; grid-row: 1; }
body.dashboard-active.workspace-home-view #workspace-content { display: none; }
body.dashboard-active.workspace-home-view #mode-switcher {
  grid-column: 1;
  grid-row: 2;
  width: 100%;
  height: auto;
  min-height: calc(100dvh - 76px);
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-content: start;
  gap: 12px;
  padding: 22px max(22px, calc((100vw - 1500px) / 2));
  border: 0;
  background: var(--single-bg);
}

body.dashboard-active.workspace-home-view .workspace-brand { grid-column: 1 / -1; margin-bottom: 4px; }
body.dashboard-active.workspace-home-view #mode-switcher .mode-card {
  min-height: 144px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 16px;
  border-color: var(--single-line);
  background: var(--single-panel);
}
body.dashboard-active.workspace-home-view #mode-switcher .mode-card .tier-kicker { display: block; }
body.dashboard-active.workspace-home-view #mode-switcher .mode-card strong { font-size: 18px; }
body.dashboard-active.workspace-home-view #mode-switcher .mode-card small { display: block; color: var(--single-muted); font-size: 11px; line-height: 1.5; }
body.dashboard-active.workspace-home-view #mode-switcher .mode-card .tier-state { display: inline-flex; margin-top: auto; }
body.dashboard-active.workspace-home-view .workspace-strategy-nav { grid-column: 1 / -1; }
body.dashboard-active.workspace-home-view #workspace-strategy-links { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; }

@media (max-width: 1100px) and (min-width: 761px) {
  body.dashboard-active .dashboard { grid-template-columns: 220px minmax(0, 1fr); }
  body.dashboard-active #intro-panel,
  body.dashboard-active #tier-preview-panel,
  body.dashboard-active #client-panel { padding-right: 16px; padding-left: 16px; }
  body.dashboard-active .intro-workbench { grid-template-columns: minmax(0, 1fr) !important; }
}

@media (max-width: 760px) {
  body.dashboard-active,
  body.dashboard-active main { height: auto; min-height: 100dvh; overflow: visible; }
  body.dashboard-active .dashboard {
    height: auto;
    min-height: 100dvh;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    overflow: visible;
  }
  body.dashboard-active .dashboard > .topbar { grid-column: 1; grid-row: 1; min-height: 0; padding: 10px 12px 6px; }
  body.dashboard-active .dashboard > .topbar > div:first-child { grid-column: 1; grid-row: 1; }
  body.dashboard-active .dashboard .top-actions { grid-column: 1; grid-row: 2; justify-content: flex-start; overflow-x: auto; }
  body.dashboard-active .dashboard-nav { grid-column: 1; grid-row: 3; max-width: 100%; overflow-x: auto; }
  body.dashboard-active #mode-switcher {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    height: auto;
    max-height: 36dvh;
    overflow: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 9px 10px;
    border: 0;
    border-bottom: 1px solid var(--single-line);
  }
  body.dashboard-active .workspace-brand,
  body.dashboard-active .workspace-strategy-nav { grid-column: 1 / -1; }
  body.dashboard-active .workspace-brand { min-height: 42px; margin: 0 0 3px; padding: 0 3px 7px; }
  body.dashboard-active .workspace-brand-mark { width: 30px; height: 30px; flex-basis: 30px; }
  body.dashboard-active #mode-switcher .mode-card { min-height: 40px; padding: 6px 8px; }
  body.dashboard-active .workspace-strategy-nav { margin-top: 4px; padding-top: 7px; }
  body.dashboard-active #workspace-strategy-links { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
  body.dashboard-active .workspace-strategy-group { flex: 0 0 min(72vw, 260px); max-height: 130px; overflow: auto; }
  body.dashboard-active .workspace-strategy-link { min-height: 40px; }
  body.dashboard-active #workspace-content {
    grid-column: 1;
    grid-row: 3;
    min-height: 0;
    overflow: visible;
  }
  body.dashboard-active #workspace-content > #dashboard-msg { padding: 0 12px; }
  body.dashboard-active #workspace-content > #mode-detail-bar { margin: 10px 12px 0; }
  body.dashboard-active #workspace-content > #intro-panel,
  body.dashboard-active #workspace-content > #global-market-panel,
  body.dashboard-active #workspace-content > #tier-preview-panel,
  body.dashboard-active #workspace-content > #client-panel { flex: 0 0 auto; max-height: none; overflow: visible; padding: 12px 12px 22px; }
  body.dashboard-active .intro-workbench { grid-template-columns: minmax(0, 1fr) !important; }
  body.dashboard-active.workspace-home-view .dashboard { grid-template-rows: auto minmax(0, 1fr); }
  body.dashboard-active.workspace-home-view .dashboard > .topbar { grid-column: 1; grid-row: 1; }
  body.dashboard-active.workspace-home-view #workspace-content { display: none; }
  body.dashboard-active.workspace-home-view #mode-switcher {
    grid-column: 1;
    grid-row: 2;
    min-height: calc(100dvh - 62px);
    max-height: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 16px 12px;
  }
  body.dashboard-active.workspace-home-view #workspace-strategy-links { display: grid; grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  body.dashboard-active #mode-switcher .mode-card,
  body.dashboard-active .workspace-strategy-link { transition: none; }
}

@media (min-width: 761px) {
  body.dashboard-active:not(.workspace-home-view) .dashboard {
    grid-template-columns: 236px minmax(0, 1fr);
  }

  body.dashboard-active:not(.workspace-home-view) #mode-switcher {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  body.dashboard-active:not(.workspace-home-view) .workspace-brand,
  body.dashboard-active:not(.workspace-home-view) #mode-switcher > .mode-card {
    flex: 0 0 auto;
  }

  body.dashboard-active:not(.workspace-home-view) .workspace-strategy-nav {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  body.dashboard-active:not(.workspace-home-view) .workspace-strategy-nav-head {
    flex: 0 0 auto;
  }

  body.dashboard-active:not(.workspace-home-view) #workspace-strategy-links {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 3px;
    scrollbar-width: thin;
    scrollbar-color: #405168 transparent;
  }

  body.dashboard-active:not(.workspace-home-view) .workspace-strategy-group > strong {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #101b29;
  }
}

/* Compact accordion rail: keep the shell calm while making every product one click away. */
body.dashboard-active .workspace-strategy-group {
  gap: 4px;
}

body.dashboard-active .workspace-strategy-group-toggle {
  width: 100%;
  min-height: 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 6px;
  padding: 6px 7px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #9aabbd;
  text-align: left;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

body.dashboard-active .workspace-strategy-group-toggle:hover,
body.dashboard-active .workspace-strategy-group-toggle:focus-visible {
  border-color: #2e4351;
  background: #162635;
  color: #e8eef5;
  outline: none;
}

body.dashboard-active .workspace-strategy-group-toggle span {
  overflow: hidden;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

body.dashboard-active .workspace-strategy-group-toggle small {
  min-width: 20px;
  padding: 2px 5px;
  border: 1px solid #304457;
  border-radius: 999px;
  color: #7f97ab;
  font-size: 9px;
  line-height: 1.2;
  text-align: center;
}

body.dashboard-active .workspace-strategy-group-toggle i {
  color: var(--single-cyan);
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 1;
  text-align: center;
}

body.dashboard-active .workspace-strategy-group-items {
  display: grid;
  gap: 2px;
  padding-left: 4px;
}

body.dashboard-active .workspace-strategy-group-items[hidden] { display: none; }

body.dashboard-active .workspace-strategy-group.is-open .workspace-strategy-group-toggle {
  color: #dce6ef;
}

body.dashboard-active:not(.workspace-home-view) #workspace-strategy-links {
  gap: 6px;
}

body.dashboard-active:not(.workspace-home-view) .workspace-strategy-link {
  min-height: 32px;
  padding: 5px 8px;
}

body.dashboard-active:not(.workspace-home-view) .workspace-strategy-link.active {
  border-color: #38727a;
  background: #17313a;
}

body.dashboard-active .intro-dashboard > .basic-catalog,
body.dashboard-active .intro-dashboard > .intro-workbench,
body.dashboard-active .intro-dashboard > .intro-trade-detail {
  border-radius: 8px;
}

body.dashboard-active .intro-overview-metrics > div,
body.dashboard-active #intro-pair-list .intro-market-card {
  border-radius: 6px;
}

body.dashboard-active .intro-overview-metrics > div {
  min-height: 92px;
  padding: 14px 15px;
}

body.dashboard-active .intro-overview-metrics strong {
  font-size: 25px;
  letter-spacing: 0;
}

body.dashboard-active #intro-pair-list .intro-market-card {
  min-height: 124px;
  padding: 13px;
}

body.dashboard-active #intro-pair-list .intro-market-card:hover,
body.dashboard-active #intro-pair-list .intro-market-card:focus-visible,
body.dashboard-active #intro-pair-list .intro-market-card.selected {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .18);
}

@media (max-width: 760px) {
  body.dashboard-active .workspace-strategy-group-toggle {
    min-height: 34px;
  }

  body.dashboard-active .workspace-strategy-group-items {
    padding-left: 0;
  }

  body.dashboard-active .workspace-strategy-group {
    max-height: none;
  }

  body.dashboard-active .workspace-strategy-group-items[hidden] { display: none; }

  body.dashboard-active .intro-overview-metrics > div {
    min-height: 76px;
    padding: 10px;
  }

  body.dashboard-active .intro-overview-metrics strong { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  body.dashboard-active .intro-market-card,
  body.dashboard-active .workspace-strategy-group-toggle { transition: none; }
}

/* Workspace polish: clearer navigation states and denser strategy catalog cards. */
body.dashboard-active #workspace-content > #intro-panel,
body.dashboard-active #workspace-content > #tier-preview-panel,
body.dashboard-active #workspace-content > #client-panel {
  padding-right: 16px;
  padding-left: 16px;
}

body.dashboard-active .workspace-strategy-nav {
  padding: 12px 8px 0;
  border-top-color: #34444d;
}

body.dashboard-active .workspace-strategy-nav-head {
  padding: 0 4px 5px;
}

body.dashboard-active .workspace-strategy-nav-head span {
  color: #7bcbb5;
}

body.dashboard-active .workspace-strategy-nav-head strong {
  font-size: 13px;
}

body.dashboard-active #workspace-strategy-links {
  gap: 7px;
}

body.dashboard-active .workspace-strategy-group {
  gap: 4px;
  padding: 4px;
  border: 1px solid #263843;
  border-radius: 5px;
  background: #0e1925;
}

body.dashboard-active .workspace-strategy-group-toggle {
  min-height: 36px;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  padding: 6px 8px;
  border-color: #31424e;
  background: #172532;
  color: #c1d0db;
}

body.dashboard-active .workspace-strategy-group.is-open .workspace-strategy-group-toggle {
  border-color: #39645d;
  background: #192f32;
  color: #e5f0ec;
}

body.dashboard-active .workspace-strategy-group-toggle small {
  border-color: #3e5960;
  background: #102229;
  color: #a5c8c1;
}

body.dashboard-active .workspace-strategy-group-items {
  gap: 3px;
  padding: 2px 0 0 5px;
}

body.dashboard-active .workspace-strategy-link {
  min-height: 38px;
  padding: 6px 8px;
  border-color: #22313c;
  background: #121e2a;
}

body.dashboard-active .workspace-strategy-link:hover,
body.dashboard-active .workspace-strategy-link:focus-visible {
  border-color: #426f68;
  background: #1a2d32;
}

body.dashboard-active .workspace-strategy-link.active {
  border-color: #4a917e;
  background: #1a3937;
  box-shadow: inset 3px 0 0 var(--single-ok);
}

body.dashboard-active .workspace-strategy-link.active span {
  color: #f1fbf5;
}

body.dashboard-active #intro-overview-panel.basic-catalog {
  width: 100%;
  max-width: none;
}

body.dashboard-active .basic-catalog-head {
  padding-top: 2px;
  padding-bottom: 10px;
}

body.dashboard-active .basic-catalog-head p {
  max-width: 68ch;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

body.dashboard-active #intro-pair-list .intro-market-section {
  padding: 10px;
}

body.dashboard-active #intro-pair-list .intro-market-section-head {
  margin-bottom: 8px;
  padding-bottom: 7px;
}

body.dashboard-active #intro-pair-list .intro-market-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 8px;
}

body.dashboard-active #intro-pair-list .intro-strategy-card {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 10px;
}

body.dashboard-active #intro-pair-list .intro-strategy-card .intro-card-top b {
  font-size: 14px;
}

body.dashboard-active #intro-pair-list .intro-strategy-card .intro-card-summary {
  grid-template-columns: 1fr;
  gap: 3px;
  margin: 0;
  padding: 7px 9px;
  border-color: #31454a;
  border-radius: 4px;
  background: #101d22;
}

body.dashboard-active #intro-pair-list .intro-strategy-card .intro-card-summary > span {
  color: #8ccbb7;
  font-size: 10px;
  letter-spacing: 0;
}

body.dashboard-active #intro-pair-list .intro-strategy-card .intro-card-summary strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: #d2dfda;
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
  overflow-wrap: anywhere;
}

body.dashboard-active #intro-pair-list .intro-strategy-card .intro-card-range i {
  padding: 5px 7px;
  border-radius: 4px;
}

@media (min-width: 761px) {
  body.dashboard-active:not(.workspace-home-view) #workspace-strategy-links {
    padding: 0 4px 0 0;
  }
}

@media (max-width: 900px) {
  body.dashboard-active .dashboard {
    grid-template-rows: auto minmax(0, 1fr);
  }

  body.dashboard-active .dashboard > .topbar {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    gap: 4px;
    padding-right: 14px;
    padding-left: 14px;
  }

  body.dashboard-active .dashboard > .topbar > div:first-child {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  body.dashboard-active .dashboard .top-actions {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    flex-wrap: wrap;
  }

  body.dashboard-active .dashboard .top-actions .help-link,
  body.dashboard-active .dashboard .top-actions button,
  body.dashboard-active .dashboard .top-actions .pill {
    min-height: 44px;
  }

  body.dashboard-active .dashboard-nav {
    grid-column: 1;
    grid-row: 3;
    min-height: 38px;
  }

  body.dashboard-active .dashboard-nav a {
    min-height: 44px;
  }
}

@media (max-width: 760px) {
  body.dashboard-active #workspace-content > #intro-panel,
  body.dashboard-active #workspace-content > #tier-preview-panel,
  body.dashboard-active #workspace-content > #client-panel {
    padding-right: 12px;
    padding-left: 12px;
  }

  body.dashboard-active .workspace-strategy-nav {
    padding-right: 0;
    padding-left: 0;
  }

  body.dashboard-active #workspace-strategy-links {
    gap: 8px;
    padding: 2px 1px 8px;
  }

  body.dashboard-active .workspace-strategy-group {
    flex-basis: min(78vw, 280px);
    max-height: 176px;
    padding: 5px;
  }

  body.dashboard-active .workspace-strategy-group-toggle {
    min-height: 44px;
  }

  body.dashboard-active .workspace-strategy-group-items {
    max-height: 120px;
    overflow-y: auto;
  }

  body.dashboard-active:not(.workspace-home-view) .workspace-strategy-link {
    min-height: 44px;
  }

  body.dashboard-active .basic-catalog-head p {
    max-width: 100%;
    -webkit-line-clamp: 2;
  }
}

@media (max-width: 420px) {
  body.dashboard-active .dashboard > .topbar {
    grid-template-columns: minmax(0, 1fr);
    padding: 10px 12px 6px;
  }

  body.dashboard-active .dashboard > .topbar > div:first-child {
    grid-column: 1;
    grid-row: 1;
  }

  body.dashboard-active .dashboard .top-actions {
    grid-column: 1;
    grid-row: 2;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  body.dashboard-active .dashboard-nav {
    grid-column: 1;
    grid-row: 3;
    min-height: 44px;
  }

  body.dashboard-active .dashboard-nav a {
    min-height: 44px;
  }
}

@media (min-width: 761px) {
  body.dashboard-active main > #dashboard-view.dashboard {
    width: 100% !important;
    margin-right: 0;
    margin-left: 0;
  }
}

/* 2026-10 trading-terminal redesign. This layer changes presentation only;
   ids, commands, authorization gates and API-backed content remain unchanged. */
body.dashboard-active {
  --terminal-bg: #111417;
  --terminal-rail: #15191c;
  --terminal-panel: #181c20;
  --terminal-panel-2: #20252a;
  --terminal-line: #2a3036;
  --terminal-line-strong: #394149;
  --terminal-text: #e8ecef;
  --terminal-muted: #8c969f;
  --terminal-cyan: #97b6c8;
  --terminal-green: #83dfb8;
  --terminal-gold: #bda77c;
  --terminal-red: #ee929b;
  background: var(--terminal-bg);
  color: var(--terminal-text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
}

body.dashboard-active main {
  width: 100%;
  max-width: none;
  height: 100dvh;
  min-height: 100dvh;
  padding: 0;
  overflow: hidden;
}

body.dashboard-active .dashboard {
  width: 100%;
  max-width: none;
  height: 100dvh;
  min-height: 100dvh;
  display: flex !important;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}

body.dashboard-active:not(.workspace-home-view) .dashboard {
  padding-left: 244px;
}

body.dashboard-active #workspace-content {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}

body.dashboard-active #workspace-content > #intro-panel,
body.dashboard-active #workspace-content > #tier-preview-panel,
body.dashboard-active #workspace-content > #client-panel {
  width: auto;
  margin-right: 16px;
  margin-left: 16px;
  padding-right: 0;
  padding-left: 0;
}

body.dashboard-active .dashboard > .topbar {
  grid-column: auto;
  grid-row: auto;
  position: sticky;
  top: 0;
  z-index: 30;
  flex: 0 0 auto;
  min-height: 68px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 14px;
  margin: 0;
  padding: 10px 18px;
  border: 0;
  border-bottom: 1px solid var(--terminal-line);
  border-radius: 0;
  background: var(--terminal-bg);
  box-shadow: none;
}

body.dashboard-active .dashboard > .topbar > div:first-child {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
}

body.dashboard-active .dashboard > .topbar > .dashboard-nav {
  grid-column: 2;
  grid-row: 1;
}

body.dashboard-active .dashboard > .topbar > .top-actions {
  grid-column: 3;
  grid-row: 1;
}

body.dashboard-active .dashboard > .topbar h2 {
  margin: 2px 0 0;
  color: var(--terminal-text);
  font-size: clamp(17px, 1.7vw, 23px);
  line-height: 1.15;
}

body.dashboard-active .dashboard > .topbar .eyebrow {
  color: var(--terminal-cyan);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .16em;
}

body.dashboard-active .dashboard > .topbar .muted {
  margin: 3px 0 0;
  color: var(--terminal-muted);
  font-size: 10px;
}

body.dashboard-active .dashboard-nav {
  gap: 3px;
  align-self: stretch;
}

body.dashboard-active .dashboard-nav a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--terminal-muted);
  font-size: 10px;
}

body.dashboard-active .dashboard-nav a:hover,
body.dashboard-active .dashboard-nav a:focus-visible {
  border-color: var(--terminal-line-strong);
  background: var(--terminal-panel);
  color: var(--terminal-text);
}

body.dashboard-active .dashboard .top-actions {
  gap: 6px;
}

body.dashboard-active .dashboard .top-actions .help-link,
body.dashboard-active .dashboard .top-actions button,
body.dashboard-active .dashboard .top-actions .pill {
  min-height: 34px;
  padding: 6px 10px;
  border-color: var(--terminal-line);
  border-radius: 4px;
  background: var(--terminal-panel);
  color: var(--terminal-text);
  font-size: 10px;
}

body.dashboard-active .dashboard .top-actions .pill {
  color: var(--terminal-green);
}

body.dashboard-active #mode-switcher {
  border-color: var(--terminal-line);
  background: var(--terminal-rail);
}

body.dashboard-active:not(.workspace-home-view) #mode-switcher {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: 244px;
  height: 100dvh;
  max-height: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px 12px max(16px, env(safe-area-inset-bottom));
  border: 0;
  border-right: 1px solid var(--terminal-line);
  border-radius: 0;
  box-shadow: 14px 0 34px rgba(0, 0, 0, .18);
}

body.dashboard-active .workspace-brand {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  padding: 0 6px 12px;
  border-bottom: 1px solid var(--terminal-line);
}

body.dashboard-active .workspace-brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(215, 171, 83, .5);
  border-radius: 8px;
  background: linear-gradient(145deg, #6e5425, #302817);
  color: #f7d58a;
  font-size: 19px;
  font-weight: 800;
}

body.dashboard-active .workspace-brand > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

body.dashboard-active .workspace-brand strong {
  color: var(--terminal-text);
  font-size: 15px;
  letter-spacing: .04em;
}

body.dashboard-active .workspace-brand small {
  color: var(--terminal-muted);
  font-size: 8px;
  letter-spacing: .13em;
}

body.dashboard-active .workspace-nav-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 8px 5px;
  color: var(--terminal-muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
}

body.dashboard-active .workspace-nav-label small {
  color: var(--terminal-muted);
  font-size: 8px;
}

body.dashboard-active:not(.workspace-home-view) #mode-switcher .mode-card {
  min-height: 42px;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  text-align: left;
}

body.dashboard-active:not(.workspace-home-view) #mode-switcher .mode-card::before {
  grid-column: 1;
  grid-row: 1;
  width: 7px;
  height: 7px;
  display: block;
  border: 1px solid #6f879e;
  border-radius: 2px;
  content: "";
}

body.dashboard-active:not(.workspace-home-view) #workspace-live-btn::before {
  border-color: var(--terminal-cyan);
  background: var(--terminal-cyan);
}

body.dashboard-active:not(.workspace-home-view) #mode-switcher .mode-card .tier-kicker,
body.dashboard-active:not(.workspace-home-view) #mode-switcher .mode-card small,
body.dashboard-active:not(.workspace-home-view) #mode-switcher .mode-card .tier-state {
  display: none;
}

body.dashboard-active:not(.workspace-home-view) #mode-switcher .mode-card strong {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  color: var(--terminal-text);
  font-size: 12px;
  font-weight: 650;
}

body.dashboard-active:not(.workspace-home-view) #mode-switcher .mode-card:hover,
body.dashboard-active:not(.workspace-home-view) #mode-switcher .mode-card:focus-visible,
body.dashboard-active:not(.workspace-home-view) #mode-switcher .mode-card.active {
  border-color: var(--terminal-line-strong);
  background: var(--terminal-panel-2);
  box-shadow: inset 3px 0 0 var(--terminal-green);
}

body.dashboard-active .workspace-rail-foot {
  display: grid;
  gap: 5px;
  margin-top: auto;
  padding: 12px 10px;
  border: 1px solid var(--terminal-line);
  border-radius: 6px;
  background: var(--terminal-panel);
}

body.dashboard-active .workspace-rail-foot span {
  color: var(--terminal-text);
  font-size: 10px;
  font-weight: 650;
}

body.dashboard-active .workspace-rail-foot i {
  width: 6px;
  height: 6px;
  display: inline-block;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--terminal-green);
  box-shadow: none;
}

body.dashboard-active .workspace-rail-foot small {
  color: var(--terminal-muted);
  font-size: 9px;
  line-height: 1.5;
}

body.dashboard-active.workspace-home-view #mode-switcher {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px;
  padding: 18px;
  border: 1px solid var(--terminal-line);
  border-radius: 8px;
}

body.dashboard-active.workspace-home-view .dashboard {
  overflow-y: auto;
}

body.dashboard-active.workspace-home-view .workspace-brand,
body.dashboard-active.workspace-home-view .workspace-nav-label,
body.dashboard-active.workspace-home-view .workspace-rail-foot {
  grid-column: 1 / -1;
}

body.dashboard-active.workspace-home-view .workspace-nav-label {
  padding-top: 2px;
}

body.dashboard-active.workspace-home-view .workspace-rail-foot {
  margin-top: 2px;
}

body.dashboard-active.workspace-home-view #mode-switcher .mode-card {
  min-height: 150px;
  border-color: var(--terminal-line);
  background: var(--terminal-panel);
}

body.dashboard-active.workspace-home-view #mode-switcher .mode-card:hover,
body.dashboard-active.workspace-home-view #mode-switcher .mode-card:focus-visible,
body.dashboard-active.workspace-home-view #mode-switcher .mode-card.active {
  border-color: var(--terminal-gold);
  background: var(--terminal-panel-2);
  box-shadow: inset 0 3px 0 var(--terminal-gold);
}

body.dashboard-active #dashboard-msg,
body.dashboard-active #mode-detail-bar,
body.dashboard-active #intro-panel,
body.dashboard-active #tier-preview-panel,
body.dashboard-active #client-panel {
  min-width: 0;
  margin-right: 16px;
  margin-left: 16px;
}

body.dashboard-active #mode-detail-bar {
  flex: 0 0 auto;
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px solid var(--terminal-line);
  border-radius: 5px;
  background: var(--terminal-panel);
}

body.dashboard-active #intro-panel,
body.dashboard-active #tier-preview-panel,
body.dashboard-active #client-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-top: 14px;
  padding-bottom: 24px;
}

body.dashboard-active .intro-detail-toolbar,
body.dashboard-active .intro-board,
body.dashboard-active .panel,
body.dashboard-active .card,
body.dashboard-active .toolbar,
body.dashboard-active .manual-panel {
  border-color: var(--terminal-line);
  border-radius: 6px;
  background: var(--terminal-panel);
  color: var(--terminal-text);
  box-shadow: none;
}

body.dashboard-active .intro-trade-detail {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(330px, .72fr);
  grid-template-rows: auto auto auto min-content auto auto auto;
  grid-template-areas:
    "toolbar toolbar"
    "kpi kpi"
    "chart execution"
    "warning execution"
    "positions execution"
    "ai diagnosis"
    "profit profit";
  gap: 12px;
}

body.dashboard-active .intro-detail-toolbar { grid-area: toolbar; }
body.dashboard-active .terminal-kpi-row { grid-area: kpi; }
body.dashboard-active #intro-market-chart { grid-area: chart; }
body.dashboard-active #intro-strategy-mount-warning { grid-area: warning; }
body.dashboard-active .intro-workbench { display: contents !important; }
body.dashboard-active .intro-workbench > .intro-trade-panel { grid-area: positions; }
body.dashboard-active .intro-workbench > .intro-auto-panel { grid-area: execution; align-self: start; position: static; }
body.dashboard-active .intro-ai-panel { grid-area: ai; }
body.dashboard-active .intro-diagnosis-panel { grid-area: diagnosis; }
body.dashboard-active .intro-profit-panel { grid-area: profit; }

body.dashboard-active .terminal-kpi-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

body.dashboard-active .terminal-kpi-row > div {
  min-height: 78px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 12px 13px;
  border: 1px solid var(--terminal-line);
  border-radius: 6px;
  background: var(--terminal-panel);
}

body.dashboard-active .terminal-kpi-row > div:nth-child(3n + 1) { border-top: 2px solid var(--terminal-cyan); }
body.dashboard-active .terminal-kpi-row > div:nth-child(3n + 2) { border-top: 2px solid var(--terminal-green); }
body.dashboard-active .terminal-kpi-row > div:nth-child(3n) { border-top: 2px solid var(--terminal-gold); }

body.dashboard-active .terminal-kpi-row span {
  color: var(--terminal-muted);
  font-size: 10px;
}

body.dashboard-active .terminal-kpi-row strong {
  color: var(--terminal-text);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, "PingFang SC", "Microsoft YaHei", system-ui, monospace;
  font-size: clamp(17px, 1.45vw, 23px);
  font-variant-numeric: tabular-nums;
}

body.dashboard-active #intro-market-chart {
  min-width: 0;
  min-height: 350px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

body.dashboard-active #intro-market-chart > .intro-market-chart {
  width: 100%;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 22px;
  border: 1px solid var(--terminal-line);
  border-left: 3px solid var(--terminal-cyan);
  border-radius: 6px;
  background:
    linear-gradient(rgba(88, 199, 230, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 199, 230, .04) 1px, transparent 1px),
    var(--terminal-panel);
  background-size: 48px 48px;
}

body.dashboard-active #intro-market-chart > .public-market-chart {
  order: -1;
  flex: 1;
  min-width: 0;
  min-height: 260px;
  margin: 0;
  border-color: var(--terminal-line);
  background: var(--terminal-panel);
}

body.dashboard-active .market-chart-heading,
body.dashboard-active .market-chart-current,
body.dashboard-active .market-range-labels,
body.dashboard-active .price-key-list {
  color: var(--terminal-muted);
}

body.dashboard-active .market-chart-heading strong,
body.dashboard-active .market-chart-current strong,
body.dashboard-active .price-key b {
  color: var(--terminal-text);
}

body.dashboard-active .market-range,
body.dashboard-active .price-track {
  height: 92px;
  margin-top: 28px;
  margin-bottom: 12px;
}

body.dashboard-active .market-range::before,
body.dashboard-active .price-track-line {
  top: 44px;
  height: 2px;
  background: var(--terminal-line-strong);
}

body.dashboard-active .market-range-fill {
  top: 42px;
  height: 6px;
  background: var(--terminal-green);
}

body.dashboard-active .market-range-marker,
body.dashboard-active .price-marker {
  top: 35px;
  width: 18px;
  height: 18px;
  border-color: var(--terminal-panel);
  background: var(--terminal-gold);
  box-shadow: 0 0 0 1px var(--terminal-gold);
}

body.dashboard-active .panel-title {
  color: var(--terminal-text);
  font-size: 15px;
}

body.dashboard-active .panel-title::before { background: var(--terminal-gold); }

body.dashboard-active .intro-auto-panel {
  max-height: calc(100dvh - 96px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--terminal-line-strong) transparent;
}

body.dashboard-active .intro-auto-panel label,
body.dashboard-active .intro-select-label {
  color: var(--terminal-muted);
  font-size: 10px;
}

body.dashboard-active .intro-auto-panel input,
body.dashboard-active .intro-auto-panel select,
body.dashboard-active .intro-select-label select,
body.dashboard-active input,
body.dashboard-active select {
  border-color: var(--terminal-line-strong);
  background: var(--terminal-bg);
  color: var(--terminal-text);
}

body.dashboard-active .intro-status-line,
body.dashboard-active .intro-active-stops,
body.dashboard-active .order-row,
body.dashboard-active .entry-detail,
body.dashboard-active .history-card,
body.dashboard-active .intro-account-grid > div,
body.dashboard-active .intro-orders-summary > div,
body.dashboard-active .orders-summary > div {
  border-color: var(--terminal-line);
  background: var(--terminal-panel-2);
  color: var(--terminal-text);
}

body.dashboard-active .intro-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

body.dashboard-active .intro-actions button {
  min-height: 42px;
  border-color: var(--terminal-line-strong);
  background: var(--terminal-panel-2);
  color: var(--terminal-text);
}

body.dashboard-active .intro-actions button.good { background: var(--terminal-panel-2); border-color: var(--terminal-green); color: var(--terminal-green); }
body.dashboard-active .intro-actions button.danger { background: var(--terminal-panel-2); border-color: var(--terminal-red); color: var(--terminal-red); }

body.dashboard-active .intro-trade-panel .intro-select-label {
  display: grid;
  grid-template-columns: minmax(150px, .65fr) minmax(220px, 1.35fr);
  align-items: center;
  gap: 10px;
}

body.dashboard-active .intro-orders-summary,
body.dashboard-active .orders-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.dashboard-active .intro-profit-cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.dashboard-active .intro-overview-metrics,
body.dashboard-active #client-panel .metric-board {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

body.dashboard-active :where(button, a, select, input):focus-visible {
  outline: 2px solid var(--terminal-cyan);
  outline-offset: 2px;
}

@media (max-width: 1180px) {
  body.dashboard-active .terminal-kpi-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body.dashboard-active .intro-trade-detail {
    grid-template-columns: minmax(0, 1fr) minmax(310px, .74fr);
  }
  body.dashboard-active .intro-overview-metrics,
  body.dashboard-active #client-panel .metric-board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  body.dashboard-active,
  body.dashboard-active main,
  body.dashboard-active .dashboard {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }
  body.dashboard-active:not(.workspace-home-view) .dashboard { padding-left: 0; }
  body.dashboard-active #workspace-content { flex: 0 0 auto; overflow: visible; }
  body.dashboard-active #workspace-content > #intro-panel,
  body.dashboard-active #workspace-content > #tier-preview-panel,
  body.dashboard-active #workspace-content > #client-panel {
    flex: 0 0 auto;
    overflow: visible;
    margin-right: 10px;
    margin-left: 10px;
    padding-right: 0;
    padding-left: 0;
  }
  body.dashboard-active .workspace-strategy-nav {
    grid-column: 1 / -1;
    flex: 0 0 auto;
    min-width: 0;
    margin: 0;
    padding: 6px 0 0;
  }
  body.dashboard-active .workspace-strategy-nav-head { display: none; }
  body.dashboard-active #workspace-strategy-links {
    display: flex;
    gap: 8px;
    max-height: 112px;
    overflow: auto;
  }
  body.dashboard-active .workspace-strategy-group {
    flex: 0 0 260px;
    max-height: 108px;
    overflow: auto;
    padding: 3px;
  }
  body.dashboard-active .workspace-strategy-group-toggle,
  body.dashboard-active:not(.workspace-home-view) .workspace-strategy-link { min-height: 44px; touch-action: manipulation; }
  body.dashboard-active .workspace-strategy-group-items { max-height: none; }
  body.dashboard-active .dashboard > .topbar {
    position: relative;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
  }
  body.dashboard-active .dashboard > .topbar > div:first-child { grid-column: 1; grid-row: 1; }
  body.dashboard-active .dashboard > .topbar > .dashboard-nav { grid-column: 1 / -1; grid-row: 2; }
  body.dashboard-active .dashboard > .topbar > .top-actions { grid-column: 2; grid-row: 1; }
  body.dashboard-active:not(.workspace-home-view) #mode-switcher,
  body.dashboard-active.workspace-home-view #mode-switcher {
    position: relative;
    inset: 0 auto auto;
    z-index: 25;
    width: 100%;
    height: auto;
    max-height: none;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    margin: 0;
    padding: 8px 10px;
    border: 0;
    border-bottom: 1px solid var(--terminal-line);
    border-radius: 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .2);
  }
  body.dashboard-active .workspace-brand,
  body.dashboard-active .workspace-nav-label,
  body.dashboard-active .workspace-rail-foot { display: none; }
  body.dashboard-active:not(.workspace-home-view) #mode-switcher .mode-card,
  body.dashboard-active.workspace-home-view #mode-switcher .mode-card {
    min-width: 0;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 6px;
    border-color: var(--terminal-line);
    background: var(--terminal-panel);
    text-align: center;
    touch-action: manipulation;
  }
  body.dashboard-active #mode-switcher .mode-card .tier-kicker,
  body.dashboard-active #mode-switcher .mode-card small,
  body.dashboard-active #mode-switcher .mode-card .tier-state,
  body.dashboard-active #mode-switcher .mode-card::before { display: none !important; }
  body.dashboard-active #mode-switcher .mode-card strong {
    min-width: 0;
    margin: 0;
    font-size: 11px;
    overflow-wrap: anywhere;
  }
  body.dashboard-active #mode-switcher #workspace-ai-plan-btn .tier-state { display: none !important; }
  body.dashboard-active .intro-detail-toolbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
  }
  body.dashboard-active .intro-detail-toolbar > div { min-height: 0; }
  body.dashboard-active .intro-detail-toolbar .intro-floating-pill {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
  }
  body.dashboard-active .dashboard-nav a,
  body.dashboard-active .intro-actions button,
  body.dashboard-active .intro-detail-toolbar button,
  body.dashboard-active #mode-detail-bar button,
  body.dashboard-active .dashboard .top-actions .help-link,
  body.dashboard-active .dashboard .top-actions button,
  body.dashboard-active .dashboard .top-actions .pill {
    min-width: 44px;
    min-height: 44px;
    touch-action: manipulation;
  }
  body.dashboard-active .intro-auto-panel input,
  body.dashboard-active .intro-auto-panel select,
  body.dashboard-active .intro-select-label select,
  body.dashboard-active input,
  body.dashboard-active select { min-height: 44px; touch-action: manipulation; }
  body.dashboard-active #intro-panel,
  body.dashboard-active #tier-preview-panel,
  body.dashboard-active #client-panel {
    flex: 0 0 auto;
    max-height: none;
    overflow: visible;
    margin-right: 10px;
    margin-left: 10px;
    padding-right: 0;
    padding-left: 0;
  }
  body.dashboard-active .intro-trade-detail {
    padding: 8px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-template-areas:
      "toolbar"
      "kpi"
      "chart"
      "warning"
      "execution"
      "positions"
      "ai"
      "diagnosis"
      "profit";
  }
  body.dashboard-active .intro-workbench > .intro-auto-panel {
    position: static;
    max-height: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.dashboard-active .intro-auto-panel .panel-title,
  body.dashboard-active .intro-auto-panel .intro-status-line,
  body.dashboard-active .intro-auto-panel .intro-active-stops,
  body.dashboard-active .intro-auto-panel .intro-actions,
  body.dashboard-active .intro-auto-panel .intro-pair-close-list,
  body.dashboard-active .intro-auto-panel .msg { grid-column: 1 / -1; }
  body.dashboard-active #intro-market-chart,
  body.dashboard-active #intro-market-chart > .intro-market-chart { min-height: 300px; }
  body.dashboard-active .intro-profit-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  body.dashboard-active:not(.workspace-home-view) .dashboard { padding-left: 0; }
  body.dashboard-active .dashboard > .topbar {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    padding: 10px 12px;
  }
  body.dashboard-active .dashboard > .topbar > div:first-child { grid-column: 1; grid-row: 1; }
  body.dashboard-active .dashboard > .topbar > .top-actions { grid-column: 1; grid-row: 2; justify-content: flex-start; overflow-x: auto; }
  body.dashboard-active .dashboard > .topbar > .dashboard-nav { grid-column: 1; grid-row: 3; overflow-x: auto; }
  body.dashboard-active:not(.workspace-home-view) #mode-switcher,
  body.dashboard-active.workspace-home-view #mode-switcher {
    position: relative;
    inset: 0 auto auto;
    z-index: 25;
    width: 100%;
    height: auto;
    max-height: none;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    margin: 0;
    padding: 8px 10px;
    border: 0;
    border-bottom: 1px solid var(--terminal-line);
    border-radius: 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .2);
  }
  body.dashboard-active .workspace-brand,
  body.dashboard-active .workspace-nav-label,
  body.dashboard-active .workspace-rail-foot { display: none; }
  body.dashboard-active:not(.workspace-home-view) #mode-switcher .mode-card,
  body.dashboard-active.workspace-home-view #mode-switcher .mode-card {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border-color: var(--terminal-line);
    background: var(--terminal-panel);
    text-align: center;
  }
  body.dashboard-active #mode-switcher .mode-card .tier-kicker,
  body.dashboard-active #mode-switcher .mode-card small,
  body.dashboard-active #mode-switcher .mode-card .tier-state,
  body.dashboard-active #mode-switcher .mode-card::before { display: none !important; }
  body.dashboard-active #mode-switcher .mode-card strong { margin: 0; font-size: 11px; }
  body.dashboard-active #dashboard-msg,
  body.dashboard-active #mode-detail-bar,
  body.dashboard-active #intro-panel,
  body.dashboard-active #tier-preview-panel,
  body.dashboard-active #client-panel { margin-right: 10px; margin-left: 10px; }
  body.dashboard-active .terminal-kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.dashboard-active .intro-trade-panel .intro-select-label { grid-template-columns: minmax(0, 1fr); }
  body.dashboard-active .intro-overview-metrics,
  body.dashboard-active #client-panel .metric-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  body.dashboard-active .intro-detail-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.dashboard-active .intro-detail-toolbar > div:not(.intro-floating-pill) { grid-column: 1 / -1; grid-row: 2; }
  body.dashboard-active #intro-back-btn { grid-column: 1; grid-row: 1; }
  body.dashboard-active #intro-product-info-btn { grid-column: 2; grid-row: 1; }
  body.dashboard-active .dashboard > .topbar {
    grid-template-rows: auto auto;
  }
  body.dashboard-active .dashboard > .topbar > .dashboard-nav { display: none; }
  body.dashboard-active .dashboard > .topbar h2 { font-size: 18px; }
  body.dashboard-active .dashboard .top-actions .help-link,
  body.dashboard-active .dashboard .top-actions button,
  body.dashboard-active .dashboard .top-actions .pill { flex: 0 0 auto; min-height: 40px; }
  body.dashboard-active .dashboard-nav a { min-height: 40px; }
  body.dashboard-active .terminal-kpi-row,
  body.dashboard-active .intro-overview-metrics,
  body.dashboard-active #client-panel .metric-board,
  body.dashboard-active .intro-profit-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.dashboard-active .intro-orders-summary,
  body.dashboard-active .orders-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.dashboard-active #intro-market-chart,
  body.dashboard-active #intro-market-chart > .intro-market-chart { min-height: 260px; }
  body.dashboard-active #intro-market-chart > .intro-market-chart { padding: 16px 12px; }
  body.dashboard-active .market-range,
  body.dashboard-active .price-track { height: 74px; }
  body.dashboard-active .market-range::before,
  body.dashboard-active .price-track-line { top: 36px; }
  body.dashboard-active .market-range-fill { top: 34px; }
  body.dashboard-active .market-range-marker,
  body.dashboard-active .price-marker { top: 27px; }
  body.dashboard-active .intro-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.dashboard-active .intro-actions button,
  body.dashboard-active .intro-detail-toolbar button,
  body.dashboard-active #mode-detail-bar button,
  body.dashboard-active .dashboard-nav a,
  body.dashboard-active .dashboard .top-actions .help-link,
  body.dashboard-active .dashboard .top-actions button,
  body.dashboard-active .dashboard .top-actions .pill { min-height: 44px; touch-action: manipulation; }
  body.dashboard-active:not(.workspace-home-view) #mode-switcher,
  body.dashboard-active.workspace-home-view #mode-switcher { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.dashboard-active #mode-switcher > .mode-card {
    grid-column: auto !important;
    grid-row: auto !important;
    min-height: 48px !important;
  }
  body.dashboard-active .intro-workbench > .intro-auto-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.dashboard-active .intro-auto-panel > label:first-of-type { grid-column: 1 / -1; }
  body.dashboard-active .intro-auto-panel input,
  body.dashboard-active .intro-auto-panel select,
  body.dashboard-active .intro-select-label select,
  body.dashboard-active input,
  body.dashboard-active select { min-height: 44px; touch-action: manipulation; }
}

@media (min-width: 1181px) {
  body.dashboard-active .terminal-kpi-row { grid-template-columns: repeat(7, minmax(0, 1fr)) !important; }
}

@media (min-width: 901px) {
  body.dashboard-active .intro-trade-detail:has(> #intro-strategy-mount-warning.hidden) {
    grid-template-rows: auto auto auto 0 auto auto auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.dashboard-active *,
  body.dashboard-active *::before,
  body.dashboard-active *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Keep module navigation in the left rail at every workbench viewport. */
body.dashboard-active .dashboard {
  padding-left: 244px;
}

body.dashboard-active #mode-switcher {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: 244px;
  height: 100dvh;
  max-height: none;
  display: flex !important;
  flex-direction: column;
  gap: 4px;
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0;
  padding: max(18px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom));
  border: 0;
  border-right: 1px solid var(--terminal-line);
  border-radius: 0;
  background: var(--terminal-rail);
  box-shadow: 14px 0 34px rgba(0, 0, 0, .18);
  scrollbar-width: thin;
  scrollbar-color: #40566b transparent;
}

body.dashboard-active.workspace-home-view .dashboard {
  overflow: hidden;
}

body.dashboard-active.workspace-home-view #workspace-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

body.dashboard-active #workspace-home-overview {
  display: none;
}

body.dashboard-active.workspace-home-view #workspace-home-overview {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 24px 26px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--terminal-line);
}

body.dashboard-active.workspace-home-view #workspace-home-overview > div {
  display: grid;
  gap: 5px;
}

body.dashboard-active.workspace-home-view #workspace-home-overview > div > span {
  color: var(--terminal-cyan);
  font-size: 9px;
  font-weight: 800;
}

body.dashboard-active.workspace-home-view #workspace-home-overview h3 {
  margin: 0;
  color: var(--terminal-text);
  font-size: 22px;
}

body.dashboard-active .workspace-home-overview-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--terminal-line);
  border-radius: 4px;
  color: var(--terminal-muted);
  font-size: 10px;
  white-space: nowrap;
}

body.dashboard-active .workspace-home-overview-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--terminal-gold);
}

body.dashboard-active.workspace-home-view .workspace-brand {
  position: relative;
}

body.dashboard-active .workspace-brand > span:nth-of-type(2) {
  min-width: 0;
  display: grid;
  gap: 2px;
}

body.dashboard-active #mode-switcher .mode-card {
  min-height: 44px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  text-align: left;
  box-shadow: none;
}

body.dashboard-active #mode-switcher .mode-card::before,
body.dashboard-active #mode-switcher .mode-card::after {
  display: none !important;
}

body.dashboard-active #mode-switcher .workspace-module-icon {
  width: 16px;
  height: 16px;
  grid-column: 1;
  grid-row: 1;
  display: block;
  color: var(--terminal-muted);
}

body.dashboard-active #mode-switcher .mode-card .tier-kicker,
body.dashboard-active #mode-switcher .mode-card small,
body.dashboard-active #mode-switcher .mode-card .tier-state {
  display: none;
}

body.dashboard-active #mode-switcher .mode-card strong {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  color: var(--terminal-text);
  font-size: 12px;
  font-weight: 650;
}

body.dashboard-active #mode-switcher .mode-card:hover,
body.dashboard-active #mode-switcher .mode-card:focus-visible,
body.dashboard-active #mode-switcher .mode-card.active {
  border-color: var(--terminal-line-strong);
  background: var(--terminal-panel-2);
  box-shadow: inset 3px 0 0 var(--terminal-gold);
}

body.dashboard-active #mode-switcher .mode-card.active .workspace-module-icon {
  color: var(--terminal-cyan);
}

body.dashboard-active #mode-switcher .planned-module:disabled {
  opacity: .58;
  cursor: not-allowed;
}

body.dashboard-active .workspace-menu-toggle,
body.dashboard-active .workspace-nav-close {
  display: none;
}

body.dashboard-active .workspace-menu-toggle:focus-visible,
body.dashboard-active .workspace-nav-close:focus-visible {
  outline: 2px solid var(--terminal-cyan);
  outline-offset: 2px;
}

body.dashboard-active .workspace-nav-backdrop {
  display: none;
}

@media (max-width: 900px) {
  body.dashboard-active .dashboard {
    padding-left: 0 !important;
  }

  body.dashboard-active #mode-switcher {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: min(280px, calc(100vw - 64px));
    height: 100dvh;
    max-height: 100dvh;
    display: flex !important;
    flex-direction: column;
    gap: 4px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: max(12px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom));
    border-right: 1px solid var(--terminal-line-strong);
    box-shadow: 18px 0 36px rgba(0, 0, 0, .32);
    transform: translateX(-102%);
    visibility: hidden;
    pointer-events: none;
    transition: transform .2s ease, visibility .2s step-end;
    overscroll-behavior: contain;
  }

  body.dashboard-active.workspace-nav-open #mode-switcher {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition: transform .2s ease, visibility 0s;
  }

  body.dashboard-active .workspace-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 59;
    width: 100%;
    height: 100%;
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(1, 8, 16, .68);
    cursor: pointer;
  }

  body.dashboard-active.workspace-nav-open {
    overflow: hidden;
  }

  body.dashboard-active .workspace-menu-toggle {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 6px 10px;
    border: 1px solid var(--terminal-line-strong);
    border-radius: 4px;
    background: var(--terminal-panel);
    color: var(--terminal-text);
    font-size: 11px;
    cursor: pointer;
    touch-action: manipulation;
  }

  body.dashboard-active .workspace-menu-toggle svg,
  body.dashboard-active .workspace-nav-close svg {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
  }

  body.dashboard-active .workspace-nav-close {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    margin-left: auto;
    padding: 0;
    border: 1px solid var(--terminal-line-strong);
    border-radius: 4px;
    background: var(--terminal-panel);
    color: var(--terminal-text);
    cursor: pointer;
    touch-action: manipulation;
  }

  body.dashboard-active.workspace-home-view .dashboard {
    overflow: visible;
  }

  body.dashboard-active.workspace-home-view #workspace-content {
    display: flex;
    overflow: visible;
  }

  body.dashboard-active.workspace-home-view #workspace-home-overview {
    min-height: 82px;
    margin: 12px;
    padding: 12px 4px;
  }

  body.dashboard-active.workspace-home-view #workspace-home-overview h3 {
    font-size: 18px;
  }

  body.dashboard-active #mode-switcher .mode-card,
  body.dashboard-active .workspace-strategy-group-toggle,
  body.dashboard-active .workspace-strategy-link {
    min-height: 44px;
    touch-action: manipulation;
  }

  body.dashboard-active .workspace-strategy-nav {
    flex: 0 0 auto;
    min-width: 0;
    margin: 4px 0 0;
    padding: 10px 4px 0;
  }

  body.dashboard-active .workspace-strategy-nav-head {
    display: grid;
  }

  body.dashboard-active #workspace-strategy-links {
    display: grid;
    gap: 6px;
    max-height: none;
    overflow: visible;
  }

  body.dashboard-active .workspace-strategy-group {
    min-width: 0;
    max-height: none;
    flex: 0 0 auto;
    overflow: visible;
  }

  body.dashboard-active .workspace-strategy-group-items {
    max-height: min(32dvh, 260px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  body.dashboard-active #workspace-content {
    min-width: 0;
  }

  body.dashboard-active.workspace-home-view #workspace-content > #dashboard-msg {
    flex: 0 0 auto;
  }
}

@media (max-width: 480px) {
  body.dashboard-active .workspace-menu-toggle {
    padding-inline: 8px;
  }

  body.dashboard-active.workspace-home-view .workspace-home-overview-state {
    min-height: 30px;
    padding: 4px 7px;
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.dashboard-active #mode-switcher,
  body.dashboard-active .workspace-nav-backdrop {
    transition: none !important;
  }
}

@media (min-width: 901px) {
  body.dashboard-active.workspace-home-view .dashboard {
    padding-left: 244px;
    overflow: hidden;
  }

  body.dashboard-active.workspace-home-view #mode-switcher {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: 244px;
    height: 100dvh;
    max-height: none;
    display: flex !important;
    flex-direction: column;
    gap: 4px;
    overflow-x: hidden;
    overflow-y: auto;
    margin: 0;
    padding: max(18px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom));
    border: 0;
    border-right: 1px solid var(--terminal-line);
    border-radius: 0;
    box-shadow: 14px 0 34px rgba(0, 0, 0, .18);
  }
}

body.dashboard-active:not(.workspace-home-view) #mode-switcher .mode-card,
body.dashboard-active.workspace-home-view #mode-switcher .mode-card {
  min-height: 44px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  justify-content: initial;
  gap: 8px;
  padding: 8px 10px;
  border-color: transparent;
  background: transparent;
  text-align: left;
  box-shadow: none;
}

body.dashboard-active:not(.workspace-home-view) #mode-switcher .mode-card:hover,
body.dashboard-active:not(.workspace-home-view) #mode-switcher .mode-card:focus-visible,
body.dashboard-active:not(.workspace-home-view) #mode-switcher .mode-card.active,
body.dashboard-active.workspace-home-view #mode-switcher .mode-card:hover,
body.dashboard-active.workspace-home-view #mode-switcher .mode-card:focus-visible,
body.dashboard-active.workspace-home-view #mode-switcher .mode-card.active {
  border-color: var(--terminal-line-strong);
  background: var(--terminal-panel-2);
  box-shadow: inset 3px 0 0 var(--terminal-gold);
}

body.dashboard-active:not(.workspace-home-view) #mode-switcher .mode-card strong,
body.dashboard-active.workspace-home-view #mode-switcher .mode-card strong {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  color: var(--terminal-text);
  font-size: 12px;
  font-weight: 650;
}

@media (max-width: 900px) {
  body.dashboard-active:not(.workspace-home-view) #mode-switcher,
  body.dashboard-active.workspace-home-view #mode-switcher {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: min(280px, calc(100vw - 64px));
    height: 100dvh;
    max-height: 100dvh;
    display: flex !important;
    flex-direction: column;
    gap: 4px;
    overflow-x: hidden;
    overflow-y: auto;
    margin: 0;
    padding: max(12px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom));
    border: 0;
    border-right: 1px solid var(--terminal-line-strong);
    border-radius: 0;
    box-shadow: 18px 0 36px rgba(0, 0, 0, .32);
    transform: translateX(-102%);
    visibility: hidden;
    pointer-events: none;
    transition: transform .2s ease, visibility .2s step-end;
    overscroll-behavior: contain;
  }

  body.dashboard-active:not(.workspace-home-view) #mode-switcher .mode-card,
  body.dashboard-active.workspace-home-view #mode-switcher .mode-card {
    min-width: 0;
    min-height: 44px;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    justify-content: initial;
    padding: 8px 10px;
    border-color: transparent;
    background: transparent;
    text-align: left;
    touch-action: manipulation;
  }

  body.dashboard-active .workspace-brand,
  body.dashboard-active .workspace-nav-label {
    display: flex;
  }

  body.dashboard-active .workspace-rail-foot {
    display: grid;
  }
}

@media (max-width: 900px) {
  body.dashboard-active.workspace-nav-open #mode-switcher {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition: transform .2s ease, visibility 0s;
  }
}

body.dashboard-active.workspace-home-view #mode-switcher .mode-card {
  min-width: 0;
  min-height: 44px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-content: center;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-color: transparent;
  background: transparent;
  text-align: left;
  box-shadow: none;
}

body.dashboard-active.workspace-home-view #mode-switcher .mode-card .workspace-module-icon {
  width: 16px;
  height: 16px;
  grid-column: 1;
  grid-row: 1;
  display: block;
  color: var(--terminal-muted);
}

body.dashboard-active.workspace-home-view #mode-switcher .mode-card .tier-kicker,
body.dashboard-active.workspace-home-view #mode-switcher .mode-card small,
body.dashboard-active.workspace-home-view #mode-switcher .mode-card .tier-state {
  display: none;
}

body.dashboard-active.workspace-home-view #mode-switcher .mode-card strong {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  color: var(--terminal-text);
  font-size: 12px;
  font-weight: 650;
}

body.dashboard-active.workspace-home-view #workspace-strategy-links {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  overflow-x: hidden;
}

body.dashboard-active.workspace-home-view .workspace-strategy-group {
  width: 100%;
  min-width: 0;
  max-height: none;
  flex: 0 0 auto;
  overflow: hidden;
}

body.dashboard-active.workspace-home-view .workspace-strategy-group-items {
  max-width: 100%;
  max-height: min(32dvh, 260px);
  overflow-x: hidden;
  overflow-y: auto;
}

.observation-workspace-panel[hidden],
.observation-account-panel[hidden] {
  display: none !important;
}

#observation-strategy-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
}

body.dashboard-active #observation-strategy-panel > #intro-overview-panel,
body.dashboard-active #observation-strategy-panel > #intro-trade-detail {
  border-radius: 8px;
}
