.trader-shell,
.account-popover {
  --terminal-bg: #08090c;
  --terminal-panel: #101115;
  --terminal-raised: #191b21;
  --terminal-line: #252830;
  --terminal-text: #e4e7ef;
  --terminal-muted: #898e9e;
  --terminal-accent: #526dff;
  --terminal-buy: #45c78b;
  --terminal-sell: #fa646c;
}
.trader-shell {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--terminal-bg);
  color: var(--terminal-text);
  font:
    400 12px/1.45 Inter,
    system-ui,
    sans-serif;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  --sidebar-width: 340px;
  --portfolio-height: 240px;
}
.trader-shell * {
  box-sizing: border-box;
}
.trader-shell .font-mono {
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}
.trader-shell .font-bold {
  font-weight: 600;
}
.trader-shell .tracking-widest,
.trader-shell .tracking-wider {
  letter-spacing: 0.025em;
}
.trader-shell button:focus-visible,
.trader-shell input:focus-visible,
.trader-shell select:focus-visible,
.account-switcher button:focus-visible {
  outline: 2px solid var(--terminal-accent, #526dff);
  outline-offset: 2px;
}
.trader-shell button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.terminal-header {
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 14px 0 9px;
  border-bottom: 1px solid var(--terminal-line);
  background: var(--terminal-bg);
}
.terminal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-size: 12px;
}
.brand-mark,
.account-avatar {
  display: grid;
  place-content: center;
  position: relative;
  width: 30px;
  height: 30px;
  border: 1px solid #3d4669;
  border-radius: 8px;
  background: #1c2547;
  color: #a9baff;
  font-size: 16px;
  font-weight: 650;
}
.brand-mark span,
.account-avatar span {
  font-size: 9px;
  position: absolute;
  right: 4px;
  bottom: 2px;
}
.terminal-connection {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  color: var(--terminal-muted);
}
.terminal-account-label {
  border-left: 1px solid var(--terminal-line);
  padding-left: 10px;
  margin-left: 6px;
}
.connection-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--terminal-sell);
}
.connection-dot.connected {
  background: var(--terminal-buy);
  box-shadow: 0 0 0 3px #45c78b12;
}
.terminal-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.terminal-icon,
.rail-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--terminal-muted);
  font-size: 14px;
  cursor: pointer;
}
.terminal-icon:hover,
.rail-button:hover {
  background: var(--terminal-raised);
  color: var(--terminal-text);
}
.terminal-body {
  display: flex;
  flex: 1;
  min-height: 0;
}
.terminal-rail {
  width: 48px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 0 10px;
}
.rail-caption {
  font-size: 7px;
  letter-spacing: 0.04em;
  color: var(--terminal-muted);
}
.rail-button.active {
  background: #526dff14;
  border-color: #526dff32;
  color: #8094ff;
}
.rail-spacer {
  flex: 1;
}
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 6px var(--sidebar-width);
  grid-template-rows: minmax(160px, 1fr) 6px var(--portfolio-height);
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: 7px 8px 8px 0;
}
.terminal-surface {
  background: var(--terminal-panel);
  border: 1px solid #ffffff05;
  border-radius: 9px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.chart-region {
  grid-column: 1;
  grid-row: 1;
}
.workspace-sidebar {
  grid-column: 3;
  grid-row: 1;
  display: grid;
  grid-template-rows: minmax(120px, 1fr) auto;
  gap: 7px;
  min-height: 0;
  min-width: 0;
}
.market-section,
.trade-section {
  min-height: 0;
}
.trade-section {
  max-height: 53vh;
  overflow: auto;
}
.portfolio-region {
  grid-column: 1 / 4;
  grid-row: 3;
}
.workspace-divider {
  touch-action: none;
  position: relative;
  outline: none;
}
.workspace-divider:after {
  content: "";
  position: absolute;
  background: transparent;
  border-radius: 2px;
  transition: background 0.15s;
}
.workspace-divider:hover:after,
.workspace-divider:focus-visible:after {
  background: var(--terminal-accent);
}
.divider-vertical {
  grid-column: 2;
  grid-row: 1;
  cursor: col-resize;
}
.divider-vertical:after {
  width: 2px;
  top: 20%;
  bottom: 20%;
  left: 2px;
}
.divider-horizontal {
  grid-column: 1 / 4;
  grid-row: 2;
  cursor: row-resize;
}
.divider-horizontal:after {
  height: 2px;
  left: 40%;
  right: 40%;
  top: 2px;
}
.workspace-grid.without-sidebar {
  grid-template-columns: minmax(0, 1fr) 0 0;
}
.without-sidebar .workspace-sidebar,
.without-sidebar .divider-vertical {
  display: none;
}
.workspace-sidebar.market-hidden {
  grid-template-rows: 1fr;
}
.market-hidden .market-section,
.ticket-hidden .trade-section {
  display: none;
}
.market-hidden .trade-section {
  max-height: none;
}
.ticket-hidden {
  grid-template-rows: 1fr;
}
.without-portfolio {
  grid-template-rows: minmax(0, 1fr) 0 0;
}
.without-portfolio .portfolio-region,
.without-portfolio .divider-horizontal {
  display: none;
}
.trader-shell .bg-\[\#0f0f0f\],
.trader-shell .bg-\[\#0a0a0a\],
.trader-shell .bg-\[\#0c0c0c\],
.trader-shell .bg-\[\#111\] {
  background: var(--terminal-panel);
}
.trader-shell .border-gray-800,
.trader-shell .border-gray-900 {
  border-color: var(--terminal-line);
}
.trader-shell .no-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: #424652 transparent;
}
.trader-shell .no-scrollbar::-webkit-scrollbar {
  display: block;
  width: 5px;
  height: 5px;
}
.trader-shell .no-scrollbar::-webkit-scrollbar-thumb {
  background: #424652;
  border-radius: 4px;
}
.chart-region > div > div:first-child {
  background: var(--terminal-panel);
  border-color: var(--terminal-line);
}
.chart-region button {
  box-shadow: none !important;
  border-radius: 4px !important;
}
.chart-region .bg-gradient-to-b {
  background: #526dff19 !important;
  color: #91a0ff !important;
}
.chart-region .text-violet-300 {
  color: #9bacff;
}
.chart-region .text-sm {
  font-size: 12px;
}
.chart-region .text-\[10px\] {
  font-size: 11px;
}
.market-section input,
.market-section select {
  font-size: 11px !important;
  height: 30px;
  background: var(--terminal-raised) !important;
  border-color: var(--terminal-line) !important;
  border-radius: 5px !important;
}
.market-section [style*="padding:10px 12px"] {
  padding: 8px 11px !important;
  min-height: 36px;
}
.market-section .text-xs {
  font-size: 11px;
}
.market-section .text-\[9px\] {
  font-size: 9px;
}
.market-section .text-white {
  font-weight: 500;
}
.market-section .text-green-400 {
  color: var(--terminal-buy);
}
.market-section .text-red-400 {
  color: var(--terminal-sell);
}
.portfolio-toolbar {
  min-height: 55px;
  gap: 1px;
  padding: 4px 10px;
  flex-wrap: wrap;
}
.portfolio-toolbar > button {
  flex: 0 0 auto;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  padding: 11px 9px;
}
.portfolio-toolbar .account-metrics {
  margin-left: auto;
}
.account-metrics {
  display: flex;
  gap: 19px;
  align-items: center;
  margin: 0;
  min-width: 0;
  padding: 4px 0;
}
.account-metrics > div {
  flex: 0 0 auto;
}
.account-metrics dt {
  font-size: 8px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--terminal-muted);
  letter-spacing: 0.025em;
  white-space: nowrap;
}
.account-metrics dd {
  font-size: 10px;
  font-weight: 550;
  margin: 2px 0 0;
  white-space: nowrap;
  color: var(--terminal-text);
}
.account-metrics .value-down,
.value-down {
  color: var(--terminal-sell);
}
.account-metrics .value-up,
.value-up {
  color: var(--terminal-buy);
}
.portfolio-panel table {
  font-size: 11px;
}
.portfolio-panel thead {
  font-size: 9px;
  letter-spacing: 0;
  text-transform: none;
}
.portfolio-panel td {
  height: 35px;
}
.portfolio-panel .opacity-0 {
  opacity: 1;
}
.portfolio-panel button[title="Close position"],
.portfolio-panel td > button {
  width: 27px;
  height: 27px;
}
.order-ticket {
  padding: 11px 12px;
  background: var(--terminal-panel);
  font-size: 11px;
}
.ticket-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.ticket-heading strong {
  font-size: 12px;
  font-weight: 600;
  flex: 1;
}
.symbol-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffbd59;
}
.ticket-type {
  display: flex;
  background: var(--terminal-raised);
  padding: 2px;
  border-radius: 5px;
  gap: 2px;
}
.ticket-type button {
  border: 0;
  border-radius: 3px;
  font-size: 9px;
  padding: 4px 7px;
  color: var(--terminal-muted);
  background: transparent;
}
.ticket-type button.selected {
  background: #30374a;
  color: #ebefff;
}
.ticket-options {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 10px;
}
.ticket-options button {
  font-size: 9px;
  border: 1px solid var(--terminal-line);
  color: var(--terminal-muted);
  padding: 3px 7px;
  border-radius: 4px;
  background: transparent;
}
.ticket-options button.selected {
  border-color: #526dff77;
  color: #a3b0ff;
  background: #526dff14;
}
.ticket-options .one-click-status {
  margin-left: auto;
}
.ticket-options .one-click-status.enabled {
  color: var(--terminal-buy);
}
.ticket-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.ticket-fields label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 9px;
  color: var(--terminal-muted);
}
.ticket-fields input,
.ticket-fields select {
  width: 100%;
  min-width: 0;
  height: 30px;
  border: 1px solid var(--terminal-line);
  background: var(--terminal-raised);
  border-radius: 4px;
  color: var(--terminal-text);
  padding: 0 7px;
  font: inherit;
  font-size: 11px;
}
.ticket-calculator {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 12px;
  border: 1px solid var(--terminal-line);
  border-radius: 5px;
  padding: 8px;
  margin-bottom: 10px;
}
.ticket-calculator dt {
  color: var(--terminal-muted);
  font-size: 10px;
}
.ticket-calculator dd {
  text-align: right;
  margin: 0;
  font-size: 10px;
}
.ticket-margin {
  text-align: center;
  color: var(--terminal-muted);
  font-size: 9px;
  margin: 8px 0;
}
.ticket-margin strong {
  color: var(--terminal-text);
  font-weight: 500;
}
.ticket-execution {
  display: grid;
  grid-template-columns: minmax(68px, 1fr) minmax(95px, 1.2fr) minmax(68px, 1fr);
  gap: 6px;
}
.trade-side {
  height: 45px;
  border: 0;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  color: #102019;
}
.trade-side small {
  font-size: 9px;
  font-weight: 650;
  line-height: 1.1;
  margin-top: 3px;
}
.trade-side.sell {
  background: var(--terminal-sell);
  color: #290d12;
}
.trade-side.buy {
  background: var(--terminal-buy);
}
.trade-side:hover {
  filter: brightness(1.08);
}
.volume-control {
  display: grid;
  grid-template-columns: 24px 1fr 24px;
  align-items: center;
  border: 1px solid var(--terminal-line);
  border-radius: 5px;
  min-width: 0;
}
.volume-control button {
  border: 0;
  background: transparent;
  color: var(--terminal-muted);
  font-size: 17px;
  min-height: 38px;
}
.volume-control label {
  min-width: 0;
  text-align: center;
  font-size: 8px;
  color: var(--terminal-muted);
}
.volume-control input {
  width: 100%;
  padding: 0;
  appearance: textfield;
  background: transparent;
  color: var(--terminal-text);
  text-align: center;
  border: 0;
  font:
    600 12px Inter,
    system-ui,
    sans-serif;
}
.volume-control input::-webkit-inner-spin-button {
  appearance: none;
}
.ticket-error,
.ticket-success {
  padding: 8px;
  border-radius: 5px;
  font-size: 11px;
  margin: 7px 0;
  overflow-wrap: anywhere;
}
.ticket-error {
  background: #fa646c14;
  color: #ff979e;
}
.ticket-success {
  background: #45c78b12;
  color: #72d9ad;
}
.ticket-offline,
.ticket-stale {
  color: #e2b979;
  font-size: 10px;
  margin: 8px 0;
}
.trade-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: #000a;
  display: grid;
  place-items: center;
  padding: 20px;
}
.trade-confirm {
  background: var(--terminal-panel);
  border: 1px solid var(--terminal-line);
  box-shadow: 0 24px 90px #0008;
  border-radius: 10px;
  padding: 26px;
  width: min(370px, calc(100vw - 32px));
  max-width: 100%;
  max-height: calc(100dvh - 32px);
  overflow: auto;
  outline: none;
}
.confirm-symbol {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  margin: 0 auto 16px;
  background: #526dff16;
  color: #9cafff;
  font-size: 19px;
}
.trade-confirm h2 {
  text-align: center;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 6px;
}
.trade-confirm .confirm-account {
  text-align: center;
  color: var(--terminal-muted);
  font-size: 10px;
  margin-bottom: 18px;
}
.confirm-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  font-size: 11px;
  margin-bottom: 15px;
}
.confirm-details dt {
  color: var(--terminal-muted);
}
.confirm-details dd {
  text-align: right;
  margin: 0;
}
.one-click-choice {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--terminal-line);
  font-size: 11px;
  color: var(--terminal-muted);
}
.one-click-choice input {
  appearance: none;
  position: relative;
  width: 35px;
  height: 20px;
  border-radius: 20px;
  background: #30333f;
  border: 1px solid #596178;
  cursor: pointer;
}
.one-click-choice input:before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  transition: transform 0.12s;
}
.one-click-choice input:checked {
  background: var(--terminal-accent);
  border-color: var(--terminal-accent);
}
.one-click-choice input:checked:before {
  transform: translateX(15px);
}
.one-click-explanation {
  color: var(--terminal-muted);
  font-size: 10px;
  margin: 0 0 16px;
}
.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.terminal-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--terminal-line, #30333f);
  background: var(--terminal-raised, #1c1e25);
  color: var(--terminal-text, #e4e7ef);
  border-radius: 5px;
  min-height: 34px;
  padding: 7px 13px;
  font:
    600 11px Inter,
    system-ui,
    sans-serif;
  cursor: pointer;
}
.terminal-button.primary {
  background: var(--terminal-accent, #526dff);
  color: white;
  border-color: transparent;
}
.account-switcher {
  position: relative;
  font:
    400 12px Inter,
    system-ui,
    sans-serif;
}
.account-trigger {
  border: 0;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  cursor: pointer;
}
.account-trigger-label {
  font-size: 11px;
  font-weight: 500;
}
.account-trigger-label small {
  display: block;
  font-size: 9px;
  font-weight: 400;
  color: #898e9e;
}
.account-trigger > i {
  font-size: 10px;
  margin-left: 8px;
}
.account-dismiss {
  position: fixed;
  inset: 0;
  background: transparent;
  border: 0;
  z-index: 450;
  cursor: default;
}
.account-popover {
  position: absolute;
  bottom: 0;
  left: 42px;
  z-index: 460;
  width: 310px;
  max-width: calc(100vw - 24px);
  background: var(--terminal-panel);
  color: var(--terminal-text);
  border: 1px solid var(--terminal-line);
  border-radius: 9px;
  box-shadow: 0 15px 60px #0008;
  padding: 16px;
}
.account-switcher:not(.account-switcher-compact) .account-popover {
  top: 40px;
  bottom: auto;
  left: 0;
}
.account-popover header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.account-popover header small {
  font-size: 8px;
  color: var(--terminal-muted);
  letter-spacing: 0.06em;
}
.account-popover h2 {
  font-size: 15px;
  font-weight: 550;
  margin: 4px 0 0;
}
.account-list {
  max-height: 50vh;
  overflow: auto;
}
.saved-account-row {
  position: relative;
}
.saved-account {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 24px 11px 9px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  margin-bottom: 7px;
}
.saved-account.selected {
  background: var(--terminal-raised);
  border-color: #526dff30;
}
.saved-account:hover {
  background: var(--terminal-raised);
}
.account-kind {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  border-radius: 3px;
  background: #343c54;
  color: #b7c8ff;
  padding: 5px 3px;
  font-size: 8px;
  text-transform: uppercase;
}
.account-kind.demo {
  background: #41336b;
  color: #d8c8ff;
}
.saved-account-details {
  flex: 1;
  min-width: 0;
}
.saved-account-details strong,
.saved-account-details span,
.saved-account-details b,
.saved-account-details small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.saved-account-details strong {
  font-size: 10px;
  font-weight: 500;
}
.saved-account-details span {
  font-size: 9px;
  color: var(--terminal-muted);
  margin: 3px 0 6px;
}
.saved-account-details b {
  font-size: 14px;
  font-weight: 550;
}
.saved-account-details small {
  font-size: 8px;
  color: var(--terminal-muted);
  margin-top: 5px;
}
.saved-account > i {
  color: #a8b6dc;
}
.forget-account {
  position: absolute;
  right: 2px;
  top: 8px;
  border: 0;
  background: transparent;
  color: #898e9e;
  width: 24px;
  height: 26px;
}
.account-popover footer {
  display: flex;
  gap: 7px;
  border-top: 1px solid var(--terminal-line);
  padding-top: 12px;
  margin-top: 9px;
}
.account-popover footer .primary {
  flex: 1;
}
.account-empty {
  padding: 16px 0;
  color: var(--terminal-muted);
}
.account-catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--terminal-muted);
  margin-bottom: 8px;
  font-size: 10px;
}
.saved-account:disabled { opacity: 0.6; cursor: default; }
.terminal-offline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  background: #392b17;
  padding: 8px 15px;
  font-size: 11px;
  color: #ead4a1;
}
.terminal-offline button {
  margin-left: auto;
  text-decoration: underline;
}
.terminal-loading {
  display: grid;
  place-content: center;
  text-align: center;
  gap: 18px;
  flex: 1;
  color: var(--terminal-muted);
}
.terminal-spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #526dff30;
  border-top-color: #8094ff;
  margin: auto;
  animation: terminal-spin 0.8s linear infinite;
}
@keyframes terminal-spin {
  to {
    transform: rotate(360deg);
  }
}
.terminal-mobile-nav,
.mobile-account-strip,
.mobile-account-trigger {
  display: none;
}
.trader-shell.terminal-light,
.terminal-light .account-popover {
  --terminal-bg: #e9edf3;
  --terminal-panel: #fff;
  --terminal-raised: #f1f3f7;
  --terminal-line: #dce1e9;
  --terminal-text: #243047;
  --terminal-muted: #6b7689;
  --terminal-buy: #23966a;
  --terminal-sell: #d95060;
}
.terminal-light [class*="text-white/"],
.terminal-light .text-white,
.terminal-light .text-gray-100,
.terminal-light .text-gray-200,
.terminal-light .text-gray-300 {
  color: var(--terminal-text);
}
.terminal-light .text-gray-400,
.terminal-light .text-gray-500,
.terminal-light .text-gray-600 {
  color: var(--terminal-muted);
}
.terminal-light input,
.terminal-light select {
  background: var(--terminal-raised) !important;
  color: var(--terminal-text) !important;
}
.terminal-light .chart-container {
  background: #fff;
}
.terminal-light .trade-side {
  color: white;
}
@media (min-width: 901px) and (max-width: 1280px) {
  .account-metrics {
    gap: 13px;
  }
  .portfolio-toolbar .account-metrics {
    order: 5;
    width: 100%;
    justify-content: space-between;
    border-top: 1px solid var(--terminal-line);
    padding-top: 7px;
    margin-top: 2px;
  }
  .portfolio-toolbar {
    min-height: 79px;
  }
}
@media (max-width: 900px) {
  .trader-shell {
    min-height: 0;
  }
  .terminal-header {
    height: 48px;
    padding: 0 10px;
    gap: 10px;
  }
  .terminal-brand strong,
  .terminal-connection,
  .desktop-help,
  .terminal-rail {
    display: none;
  }
  .terminal-header-actions {
    flex: 1;
  }
  .mobile-account-trigger {
    display: block;
    margin-right: auto;
  }
  .terminal-header .brand-mark {
    display: none;
  }
  .account-avatar {
    width: 27px;
    height: 27px;
  }
  .workspace-grid {
    display: flex;
    flex-direction: column;
    padding: 5px;
    gap: 0;
    min-height: 0;
  }
  .chart-region,
  .workspace-sidebar,
  .portfolio-region,
  .workspace-divider {
    display: none !important;
  }
  .trader-shell[data-mobile-tab="chart"] .chart-region {
    display: block !important;
    flex: 1;
  }
  .trader-shell[data-mobile-tab="market"] .workspace-sidebar,
  .trader-shell[data-mobile-tab="trade"] .workspace-sidebar {
    display: flex !important;
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }
  .trader-shell[data-mobile-tab="market"] .market-section {
    display: block !important;
    flex: 1;
  }
  .trader-shell[data-mobile-tab="market"] .trade-section {
    display: none !important;
  }
  .trader-shell[data-mobile-tab="trade"] .market-section {
    display: none !important;
  }
  .trader-shell[data-mobile-tab="trade"] .trade-section {
    display: block !important;
    flex: 1;
    max-height: none;
  }
  .trader-shell[data-mobile-tab="history"] .portfolio-region {
    display: block !important;
    flex: 1;
  }
  .portfolio-toolbar .account-metrics {
    display: none;
  }
  .portfolio-toolbar {
    min-height: 45px;
    padding: 4px 6px;
    flex-wrap: nowrap;
  }
  .portfolio-toolbar > button {
    padding: 10px 7px;
    font-size: 10px;
  }
  .portfolio-panel td {
    height: 40px;
  }
  .account-popover {
    position: fixed !important;
    left: 10px !important;
    top: 53px !important;
    bottom: auto !important;
    width: 320px;
  }
  .mobile-account-strip {
    display: block;
    flex-shrink: 0;
    border-top: 1px solid var(--terminal-line);
    padding: 6px 12px;
    background: var(--terminal-panel);
  }
  .mobile-account-strip .account-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px 10px;
    padding: 0;
  }
  .account-metrics dt {
    font-size: 8px;
  }
  .account-metrics dd {
    font-size: 10px;
  }
  .terminal-mobile-nav {
    display: flex;
    flex-shrink: 0;
    padding: 4px 8px max(5px, env(safe-area-inset-bottom));
    background: var(--terminal-panel);
    border-top: 1px solid var(--terminal-line);
    gap: 4px;
  }
  .terminal-mobile-nav button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--terminal-muted);
    font:
      500 10px Inter,
      system-ui,
      sans-serif;
    min-height: 42px;
  }
  .terminal-mobile-nav button i {
    font-size: 17px;
  }
  .terminal-mobile-nav button[aria-pressed="true"] {
    background: #526dff12;
    color: #8c9fff;
  }
  .order-ticket {
    padding: 17px 15px;
  }
  .ticket-heading {
    margin-bottom: 16px;
  }
  .ticket-heading strong {
    font-size: 15px;
  }
  .ticket-options {
    margin-bottom: 18px;
  }
  .ticket-options button {
    font-size: 11px;
    padding: 5px 9px;
  }
  .ticket-fields input,
  .ticket-fields select {
    height: 39px;
    font-size: 14px;
  }
  .ticket-calculator {
    padding: 12px;
    gap: 10px;
  }
  .ticket-calculator dt,
  .ticket-calculator dd {
    font-size: 12px;
  }
  .ticket-margin {
    font-size: 11px;
    padding: 9px;
  }
  .trade-side {
    height: 53px;
    font-size: 15px;
  }
  .trade-side small {
    font-size: 10px;
  }
  .volume-control input {
    font-size: 15px;
  }
  .volume-control button {
    min-height: 48px;
  }
  .volume-control label {
    font-size: 10px;
  }
  .trade-confirm {
    padding: 24px 20px;
  }
  .trade-confirm h2 {
    font-size: 16px;
  }
  .confirm-actions .terminal-button {
    min-height: 42px;
  }
  .chart-region > div > div:first-child > div {
    padding: 5px;
    gap: 2px;
    overflow: auto;
    white-space: nowrap;
  }
  .chart-region > div > div:first-child button {
    padding: 7px 9px;
    font-size: 10px;
  }
  .chart-region .ml-3 {
    margin-left: 0;
    padding-left: 5px;
  }
  .chart-region .ml-3 span:last-child {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .trader-shell * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
.portfolio-tabs { display: flex; min-width: 0; max-width: 100%; overflow-x: auto; flex: 0 1 auto; }
.portfolio-tabs > button { flex: 0 0 auto; font-size: 11px; letter-spacing: 0; text-transform: none; white-space: nowrap; padding: 11px 9px; }
.terminal-details { padding: 12px; color: var(--terminal-text); font-size: 11px; user-select: text; }
.terminal-details-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.terminal-details-toolbar strong { margin-right: auto; }
.terminal-details-toolbar small { color: var(--terminal-muted); margin-left: 8px; font-weight: 400; }
.terminal-details-toolbar select, .terminal-details-toolbar > input { background: var(--terminal-raised); color: var(--terminal-text); border: 1px solid var(--terminal-line); border-radius: 4px; padding: 6px 8px; max-width: 100%; min-width: 0; }
.terminal-details-toolbar label { display: flex; align-items: center; gap: 5px; color: var(--terminal-muted); white-space: nowrap; }
.terminal-details-table { border-collapse: collapse; width: 100%; text-align: left; }
.terminal-details-table th { color: var(--terminal-muted); font-size: 10px; font-weight: 500; }
.terminal-details-table th, .terminal-details-table td { padding: 7px 10px; border-bottom: 1px solid var(--terminal-line); white-space: nowrap; vertical-align: top; }
.terminal-log-table td:last-child { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 170px; }
.terminal-log-table { font-family: ui-monospace, monospace; font-size: 11px; }
.terminal-details-empty { padding: 22px 8px; color: var(--terminal-muted); }
.terminal-details-note { color: var(--terminal-muted); font-size: 10px; margin-top: 8px; }
.expert-log-actions .terminal-button { margin-right: 5px; }
@media (max-width: 900px) {
  .portfolio-tabs { flex: 1 1 0; }
  .portfolio-tabs > button { font-size: 10px; padding: 10px 7px; }
  .terminal-details { padding: 8px; }
}
.portfolio-panel .expert-log-actions > .terminal-button { display: inline-flex; width: auto; height: auto; }

/* ── cTrader additions ─────────────────────────────────────────────────
   Suspended is the account state the service reports when the balance is empty: amber, not red,
   because the connection is alive and recovers by itself after a deposit. */
.connection-dot.suspended { background: #e0a43b; box-shadow: 0 0 0 3px #e0a43b22; }
.terminal-offline.suspended { background: #3a2f12; }
/* A figure the trader computed from live quotes because the API did not supply it. */
.est { color: var(--terminal-muted); margin-right: 2px; cursor: help; font-weight: 400; }
.oauth-accounts { display: grid; gap: 8px; }
.oauth-accounts button { text-align: left; }
.log-code { color: var(--terminal-muted); font-size: 10px; margin-left: 6px; }

/* Closing a position or cancelling an order: the question, and always the answer. */
.close-confirm { display: inline-flex; gap: 4px; justify-content: flex-end; }
.close-confirm button { padding: 1px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; border: 1px solid var(--terminal-line); }
.close-confirm .confirm-close { background: #7a2b35; color: #fff; border-color: #a53b48; }
.portfolio-notice { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: 11px; border-bottom: 1px solid var(--terminal-line); }
.portfolio-notice span { flex: 1; }
.portfolio-notice.error { color: #f0a0a8; background: #2a1519; }
.portfolio-notice.ok { color: #9ed9b8; background: #12251c; }
.terminal-light .portfolio-notice.error { color: #8c2f3a; background: #fbe9eb; }
.terminal-light .portfolio-notice.ok { color: #1d6b49; background: #e6f5ec; }

/* The stop loss / take profit of an open position, changed after the fact. */
.protection-editor .protection-hint { font-size: 11px; color: var(--terminal-muted, #8b93a1); margin: 8px 0; }

/* The answer to the customer's Reconnect press (and, when the service throttled it, how long to wait). */
.terminal-offline.reconnect-note { background: #3a2f12; }
.terminal-offline.reconnect-note.ok { background: #12251c; color: #9ed9b8; }
.terminal-light .terminal-offline.reconnect-note { background: #fbf0d8; color: #6b5316; }
.terminal-light .terminal-offline.reconnect-note.ok { background: #e6f5ec; color: #1d6b49; }
