html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

:root {
  --trader-bg: #f3f6f8;
  --trader-surface: #ffffff;
  --trader-border: #dfe5ec;
  --trader-text: #101828;
  --trader-muted: #667085;
  --trader-blue: #2563eb;
  --trader-shadow: 0 0.45rem 1.4rem rgba(15, 23, 42, 0.07);
  --trader-radius: 0.5rem;
  --trader-font: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background: var(--trader-bg);
  color: var(--trader-text);
  font-family: var(--trader-font);
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}

.btn,
.form-control,
.form-select,
.card,
.dropdown-menu,
.alert {
  border-radius: var(--trader-radius);
}

.app-navbar {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--trader-border);
  box-shadow: 0 0.25rem 1rem rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(10px);
}

.app-navbar .navbar-brand {
  align-items: center;
  color: var(--trader-text);
  display: inline-flex;
  font-weight: 800;
  gap: 0.5rem;
  letter-spacing: 0;
}

.app-brand-mark {
  background: #0f172a;
  border-radius: 0.35rem;
  color: #fff;
  display: inline-grid;
  font-size: 0.72rem;
  height: 1.7rem;
  place-items: center;
  width: 1.7rem;
}

.app-navbar .nav-link {
  border-radius: 0.35rem;
  color: #475467;
  font-size: 0.9rem;
  font-weight: 650;
  padding-left: 0.65rem;
  padding-right: 0.65rem;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus {
  background: #eef4ff;
  color: #1d4ed8;
}

.app-navbar .dropdown-menu {
  max-width: min(18rem, calc(100vw - 1rem));
}

.app-main {
  padding: 1rem 0 2.75rem;
}

.page-shell,
.trader-shell {
  margin: 0 auto;
  max-width: none;
  padding-left: clamp(0.75rem, 1.4vw, 1.8rem);
  padding-right: clamp(0.75rem, 1.4vw, 1.8rem);
  width: 100%;
}

.trader-page-header {
  align-items: end;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.trader-kicker {
  color: #0f766e;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin: 0 0 0.2rem;
  text-transform: uppercase;
}

.trader-page-header h1,
.trader-page-header h2 {
  font-size: clamp(1.35rem, 1.4vw, 1.85rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.12;
  margin: 0;
}

.trader-page-header p {
  color: var(--trader-muted);
  margin: 0.25rem 0 0;
  max-width: 58rem;
}

.trader-card {
  background: var(--trader-surface);
  border: 1px solid var(--trader-border);
  box-shadow: var(--trader-shadow);
}

.metric-tile {
  background: #fff;
  border: 1px solid var(--trader-border);
  border-left: 4px solid var(--trader-blue);
  border-radius: var(--trader-radius);
  min-height: 4.6rem;
  padding: 0.75rem 0.85rem;
}

.metric-tile span {
  color: var(--trader-muted);
  display: block;
  font-size: 0.76rem;
  font-weight: 750;
}

.metric-tile strong {
  color: var(--trader-text);
  display: block;
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1.15;
  margin-top: 0.2rem;
}

.metric-tile-account strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-tile-account code {
  color: var(--trader-muted);
  display: block;
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1.25;
  margin-top: 0.28rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-tile-account small {
  color: var(--trader-muted);
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  margin-top: 0.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-dashboard-meta {
  align-items: flex-end;
  color: var(--trader-muted);
  display: grid;
  font-size: 0.78rem;
  gap: 0.2rem;
  text-align: right;
}

.live-dashboard-shell {
  display: grid;
  gap: 1rem;
}

.live-service-summary {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.e-grid,
.e-chart {
  font-family: var(--trader-font) !important;
}

.e-grid .e-headercell,
.e-grid .e-rowcell {
  font-size: 0.86rem;
}

.auth-shell {
  align-items: center;
  display: grid;
  min-height: min(76vh, 56rem);
  padding: 2rem 1rem;
}

.auth-card {
  background: #fff;
  border: 1px solid var(--trader-border);
  box-shadow: var(--trader-shadow);
  margin: 0 auto;
  max-width: 28rem;
  width: 100%;
}

.auth-card .card-body {
  padding: 1.4rem;
}

.app-footer {
  background: #fff;
  border-top: 1px solid var(--trader-border);
  color: var(--trader-muted);
  font-size: 0.72rem;
  line-height: 1.2;
}

.app-footer .form-select {
  color: var(--trader-muted);
  font-size: 0.72rem;
  width: auto;
}

.trading-range {
  color: var(--trader-muted);
  font-size: 0.72rem;
}

.trading-desk {
  display: grid;
  gap: 1rem;
}

.trading-desk-header {
  align-items: stretch;
}

.trading-select-bar {
  align-items: end;
  display: grid;
  gap: 0.55rem;
  grid-template-columns: minmax(11rem, 1.3fr) minmax(10rem, 1.2fr) minmax(6rem, 0.7fr) minmax(7rem, 0.8fr) minmax(5rem, 0.55fr) minmax(4rem, 0.4fr) auto;
  min-width: min(100%, 58rem);
}

.trading-select-bar label,
.trading-form label {
  color: var(--trader-muted);
  display: grid;
  font-size: 0.72rem;
  font-weight: 750;
  gap: 0.22rem;
  letter-spacing: 0;
  margin: 0;
}

.trading-select-bar .form-control,
.trading-select-bar .form-select,
.trading-form .form-control,
.trading-form .form-select {
  color: var(--trader-text);
  font-size: 0.8rem;
  min-height: 2rem;
}

.trading-short-input {
  min-width: 4.2rem;
}

.trading-metrics {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-tile-green {
  border-left-color: #0f766e;
}

.metric-tile-amber {
  border-left-color: #b45309;
}

.metric-tile-red {
  border-left-color: #dc2626;
}

.trading-workbench,
.trading-chart-grid,
.trading-data-grid {
  display: grid;
  gap: 1rem;
}

.trading-workbench {
  grid-template-columns: minmax(18rem, 0.9fr) minmax(21rem, 1fr) minmax(24rem, 1.15fr);
}

.trading-chart-grid {
  grid-template-columns: minmax(0, 1.6fr) minmax(22rem, 0.75fr);
}

.trading-data-grid {
  grid-template-columns: minmax(22rem, 0.85fr) minmax(0, 1.15fr);
}

.trading-panel {
  background: #fff;
  border: 1px solid var(--trader-border);
  border-radius: var(--trader-radius);
  box-shadow: var(--trader-shadow);
  min-width: 0;
  padding: 0.85rem;
}

.trading-panel-title {
  align-items: center;
  border-bottom: 1px solid #edf1f5;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin: -0.1rem 0 0.75rem;
  padding-bottom: 0.55rem;
}

.trading-panel-title h2 {
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.1;
  margin: 0;
}

.trading-panel-title span {
  color: var(--trader-muted);
  font-size: 0.76rem;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trading-form {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.trading-span-2 {
  grid-column: 1 / -1;
}

.syncfusion-chart-host {
  min-height: 420px;
  overflow: hidden;
  width: 100%;
}

.syncfusion-wallet-host {
  min-height: 245px;
}

.trading-empty-state {
  align-items: center;
  background: #f8fafc;
  border: 1px dashed #cfd8e3;
  color: var(--trader-muted);
  display: flex;
  font-size: 0.86rem;
  font-weight: 700;
  justify-content: center;
  min-height: 4.5rem;
}

.trading-orders-panel,
.trading-ledger-panel {
  min-height: 16rem;
}

.wallet-shell {
  display: grid;
  gap: 1rem;
}

.wallet-header {
  align-items: stretch;
}

.wallet-header-compact {
  justify-content: flex-end;
  margin-bottom: 0;
}

.wallet-select-bar {
  align-items: end;
  display: grid;
  gap: 0.55rem;
  grid-template-columns: minmax(14rem, 1.4fr) minmax(7rem, 0.7fr) minmax(5rem, 0.45fr) auto;
  min-width: min(100%, 34rem);
}

.wallet-select-bar label,
.wallet-create-form label {
  color: var(--trader-muted);
  display: grid;
  font-size: 0.72rem;
  font-weight: 750;
  gap: 0.22rem;
  letter-spacing: 0;
  margin: 0;
}

.wallet-select-bar .form-control,
.wallet-select-bar .form-select,
.wallet-create-form .form-control {
  color: var(--trader-text);
  font-size: 0.8rem;
  min-height: 2rem;
}

.wallet-short-input {
  min-width: 4.5rem;
}

.wallet-metrics {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.wallet-topology {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(20rem, 0.85fr) minmax(24rem, 1fr) minmax(0, 1.35fr);
}

.wallet-grid-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wallet-trading-layout {
  align-items: stretch;
  grid-template-columns: repeat(2, minmax(34rem, 1fr));
}

.wallet-risk-layout {
  align-items: start;
}

.wallet-positions-panel,
.wallet-open-orders-panel {
  min-height: 15.5rem;
}

.wallet-positions-panel {
  display: flex;
  flex-direction: column;
  min-height: 31rem;
}

.wallet-open-orders-panel {
  min-height: 31rem;
}

.wallet-positions-panel #WalletPositionsGrid {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.wallet-positions-panel #WalletPositionsGrid .e-gridcontent {
  flex: 1 1 auto;
  min-height: 0;
}

.wallet-positions-panel #WalletPositionsGrid .e-gridpager {
  flex: 0 0 auto;
  margin-top: auto;
}

.wallet-position-close-form {
  display: flex;
  justify-content: flex-end;
  margin: 0;
}

.wallet-position-close-form .btn {
  white-space: nowrap;
}

.wallet-trades-panel {
  min-height: 44rem;
}

.wallet-submit-alert[data-alert-level="error"] {
  background: #fef2f2;
  color: #991b1b;
}

.wallet-trade-chip {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 850;
  gap: 0.34rem;
  line-height: 1;
  min-height: 1.35rem;
  padding: 0.14rem 0.48rem;
  white-space: nowrap;
}

.wallet-trade-chip-dot {
  background: currentColor;
  border-radius: 999px;
  flex: 0 0 auto;
  height: 0.42rem;
  width: 0.42rem;
}

.wallet-trade-side-buy {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.wallet-trade-side-sell {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.wallet-trade-status-filled {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.wallet-trade-status-open,
.wallet-trade-status-pending,
.wallet-trade-status-triggered {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.wallet-trade-status-rejected,
.wallet-trade-status-cancelled,
.wallet-trade-status-expired {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.wallet-trade-row-rejected > td {
  background: rgba(254, 242, 242, 0.45);
}

.wallet-order-type-chip {
  background: #f8fafc;
  border-color: #d8e1eb;
  color: #334155;
}

.wallet-order-type-icon {
  align-items: center;
  color: currentColor;
  display: inline-flex;
  flex: 0 0 auto;
  height: 0.9rem;
  justify-content: center;
  position: relative;
  width: 0.9rem;
}

.wallet-order-type-icon::before,
.wallet-order-type-icon::after {
  content: "";
  display: block;
  position: absolute;
}

.wallet-order-type-icon[data-order-type="market"]::before {
  background: currentColor;
  border-radius: 999px;
  height: 0.44rem;
  width: 0.44rem;
}

.wallet-order-type-icon[data-order-type="limit"]::before {
  background: currentColor;
  height: 0.12rem;
  width: 0.7rem;
}

.wallet-order-type-icon[data-order-type="limiticeberg"]::before {
  background: currentColor;
  height: 0.12rem;
  width: 0.72rem;
}

.wallet-order-type-icon[data-order-type="limiticeberg"]::after {
  border-bottom: 0.48rem solid currentColor;
  border-left: 0.25rem solid transparent;
  border-right: 0.25rem solid transparent;
  height: 0;
  opacity: 0.72;
  top: 0.1rem;
  width: 0;
}

.wallet-order-type-icon[data-order-type="bracket"]::before {
  border-bottom: 0.12rem solid currentColor;
  border-left: 0.12rem solid currentColor;
  border-top: 0.12rem solid currentColor;
  height: 0.62rem;
  width: 0.72rem;
}

.wallet-order-type-icon[data-order-type="stoploss"]::before {
  background: currentColor;
  height: 0.12rem;
  transform: rotate(-35deg);
  width: 0.75rem;
}

.wallet-order-type-icon[data-order-type="stoplimit"]::before {
  background: currentColor;
  height: 0.12rem;
  width: 0.7rem;
}

.wallet-order-type-icon[data-order-type="stoplimit"]::after {
  background: currentColor;
  border-radius: 999px;
  height: 0.32rem;
  right: 0.05rem;
  width: 0.32rem;
}

.wallet-order-type-icon[data-order-type="takeprofit"]::before {
  border-left: 0.32rem solid transparent;
  border-right: 0.32rem solid transparent;
  border-bottom: 0.54rem solid currentColor;
  height: 0;
  width: 0;
}

.wallet-order-ticket[data-side="Buy"] #OrderTicket_Side {
  border-color: #34d399;
  color: #047857;
  font-weight: 800;
}

.wallet-order-ticket[data-side="Sell"] #OrderTicket_Side {
  border-color: #f87171;
  color: #b91c1c;
  font-weight: 800;
}

.wallet-order-chart-panel {
  min-height: 100%;
}

.wallet-overview-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.45fr) minmax(22rem, 0.75fr);
}

.wallet-new-layout {
  display: grid;
  grid-template-columns: minmax(20rem, 34rem);
}

.wallet-header-actions {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.wallet-panel {
  background: #fff;
  border: 1px solid var(--trader-border);
  border-radius: var(--trader-radius);
  box-shadow: var(--trader-shadow);
  min-width: 0;
  padding: 0.85rem;
}

.wallet-panel-title {
  align-items: center;
  border-bottom: 1px solid #edf1f5;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin: -0.1rem 0 0.75rem;
  padding-bottom: 0.55rem;
}

.wallet-panel-title h2 {
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.1;
  margin: 0;
}

.wallet-panel-title span {
  color: var(--trader-muted);
  font-size: 0.76rem;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-allocation-title-actions {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  min-width: 0;
}

.wallet-allocation-toggle {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #d7e0ea;
  border-radius: 6px;
  display: inline-flex;
  overflow: hidden;
}

.wallet-allocation-toggle-button {
  background: transparent;
  border: 0;
  color: var(--trader-muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  min-height: 1.5rem;
  padding: 0.25rem 0.45rem;
}

.wallet-allocation-toggle-button + .wallet-allocation-toggle-button {
  border-left: 1px solid #d7e0ea;
}

.wallet-allocation-toggle-button.active,
.wallet-allocation-toggle-button:focus,
.wallet-allocation-toggle-button:hover {
  background: #eaf5f2;
  color: #0f766e;
  outline: none;
}

.wallet-assets-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.wallet-assets-panel #WalletAssetsGrid {
  flex: 1 1 auto;
  min-height: 0;
}

.wallet-assets-panel #WalletAssetsGrid .e-headercell,
.wallet-assets-panel #WalletAssetsGrid .e-rowcell {
  font-size: 0.78rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
  white-space: nowrap;
}

.wallet-assets-panel #WalletAssetsGrid .e-gridcontent {
  flex: 1 1 auto;
}

.wallet-assets-panel #WalletAssetsGrid .e-content {
  overflow-x: hidden !important;
}

.wallet-detail-topology {
  grid-template-columns: minmax(16rem, 22rem) minmax(0, 1fr) minmax(34rem, calc(50% - 0.5rem));
}

.wallet-detail-topology .wallet-pie-panel {
  align-self: stretch;
}

.wallet-detail-topology .wallet-pie-host {
  aspect-ratio: 1 / 1;
  height: 18.75rem;
  margin: 0 auto;
  min-height: 18.75rem;
  width: min(100%, 18.75rem);
}

.wallet-create-form {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wallet-create-form button {
  grid-column: 1 / -1;
}

.wallet-create-form-large {
  grid-template-columns: 1fr;
}

.wallet-order-ticket {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.wallet-order-ticket-panel {
  display: flex;
  flex-direction: column;
}

.wallet-order-ticket-panel .wallet-order-ticket {
  flex: 1 1 auto;
}

.wallet-order-ticket label {
  color: var(--trader-muted);
  display: block;
  font-size: 0.72rem;
  font-weight: 750;
  margin-bottom: 0.2rem;
}

.wallet-help-label-inner {
  align-items: center;
  display: inline-flex;
  gap: 0.28rem;
}

.wallet-help-trigger {
  align-items: center;
  background: #eef6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  color: #1d4ed8;
  display: inline-flex;
  font-size: 0.62rem;
  font-weight: 900;
  height: 1rem;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 1rem;
}

.wallet-help-trigger:focus,
.wallet-help-trigger:hover,
[data-help-rich-tooltip="true"]:focus {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
  outline: none;
}

.wallet-order-type-help {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e4eaf1;
  border-radius: 6px;
  display: grid;
  gap: 0.6rem;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  min-height: 5.3rem;
  padding: 0.5rem;
}

.wallet-type-help-visual svg {
  display: block;
  height: 4.2rem;
  width: 100%;
}

.wallet-type-help-copy {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.wallet-type-help-copy strong {
  color: var(--trader-text);
  font-size: 0.82rem;
}

.wallet-type-help-copy span,
.wallet-type-help-copy small {
  color: var(--trader-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.wallet-order-ticket-wide {
  grid-column: span 2;
}

.wallet-order-ticket button {
  align-self: end;
  min-height: 2rem;
}

.wallet-order-ticket .wallet-help-trigger {
  align-self: center;
  min-height: 1rem;
}

.wallet-quote-amount-group .form-control,
.wallet-quote-amount-group .input-group-text,
.wallet-price-input-group .form-control,
.wallet-price-input-group .input-group-text {
  font-size: 0.78rem;
  min-height: 2rem;
}

.wallet-quote-amount-group .input-group-text,
.wallet-price-input-group .input-group-text {
  background: #f8fafc;
  color: var(--trader-muted);
  font-weight: 800;
  min-width: 3.6rem;
  justify-content: center;
}

.wallet-order-meta-start {
  grid-column: 1;
}

.wallet-order-submit {
  align-items: center;
  column-gap: 0.65rem;
  display: grid;
  grid-column: 3 / 5;
  grid-template-columns: auto minmax(0, 1fr);
  justify-self: stretch;
  font-weight: 500;
  line-height: 1.15;
  min-height: 2.45rem;
  padding: 0.35rem 0.68rem;
  text-align: left;
  white-space: normal;
}

.wallet-submit-action {
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1;
}

.wallet-submit-summary {
  border-left: 1px solid rgba(4, 120, 87, 0.22);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.68rem;
  font-weight: 500;
  gap: 0.18rem 0.48rem;
  justify-content: flex-end;
  line-height: 1.15;
  min-width: 0;
  padding-left: 0.65rem;
  text-align: right;
}

.wallet-submit-summary-item {
  font-weight: 500;
  min-width: 0;
  opacity: 0.86;
}

.wallet-submit-summary-item-primary {
  font-size: 0.76rem;
  font-weight: 900;
  opacity: 1;
}

.wallet-submit-unit {
  font-weight: inherit;
}

.wallet-order-submit[data-side="Buy"] {
  background-color: #ecfdf5 !important;
  border-color: #86efac !important;
  color: #047857 !important;
}

.wallet-order-submit[data-side="Buy"]:hover,
.wallet-order-submit[data-side="Buy"]:focus {
  background-color: #d1fae5 !important;
  border-color: #4ade80 !important;
  color: #065f46 !important;
}

.wallet-order-submit[data-side="Sell"] {
  background-color: #fef2f2 !important;
  border-color: #fecaca !important;
  color: #b91c1c !important;
}

.wallet-order-submit[data-side="Sell"]:hover,
.wallet-order-submit[data-side="Sell"]:focus {
  background-color: #fee2e2 !important;
  border-color: #fca5a5 !important;
  color: #991b1b !important;
}

.wallet-order-help {
  align-self: end;
  background: #f8fafc;
  border: 1px solid #e4eaf1;
  border-radius: 6px;
  color: var(--trader-muted);
  font-size: 0.76rem;
  font-weight: 650;
  min-height: 2rem;
  padding: 0.42rem 0.55rem;
  justify-self: start;
  width: min(100%, 32rem);
}

.wallet-order-help[data-level="ok"] {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.wallet-order-help[data-level="warning"] {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.wallet-order-help[data-level="error"] {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.wallet-position-size {
  background: #f8fafc;
  border: 1px solid #e4eaf1;
  border-radius: 6px;
  padding: 0.48rem 0.55rem 0.36rem;
}

.wallet-position-size-head {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.wallet-position-size-head output {
  color: var(--trader-muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: right;
}

.wallet-position-size .form-range {
  margin: 0.2rem 0 0;
}

.wallet-order-preview {
  display: grid;
  gap: 0.55rem;
}

.wallet-order-preview-header,
.wallet-order-preview-foot {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.wallet-order-preview-header div {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.wallet-order-preview-header strong {
  font-size: 0.84rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-order-preview-actions {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e4eaf1;
  border-radius: 6px;
  display: flex !important;
  gap: 0.35rem;
  justify-content: flex-end;
  padding: 0.22rem;
}

.wallet-preview-action-label {
  margin: 0 0.05rem 0 0;
}

.wallet-order-preview-actions select {
  font-size: 0.74rem;
  max-width: 6rem;
  min-height: 1.75rem;
  padding-bottom: 0.16rem;
  padding-top: 0.16rem;
}

.wallet-order-preview-actions #OrderOhlcPriceSelect {
  max-width: none;
  min-width: 5.8rem;
}

.wallet-chart-zoom-buttons {
  align-items: center;
  display: inline-flex !important;
  gap: 0.18rem;
  min-width: auto !important;
}

.wallet-order-preview-actions .wallet-help-label-inner {
  white-space: nowrap;
}

.wallet-chart-icon-button,
.wallet-live-price-button,
.wallet-use-last-price-button {
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  min-height: 1.75rem;
  padding-bottom: 0.16rem;
  padding-top: 0.16rem;
}

.wallet-chart-icon-button {
  min-width: 1.75rem;
  padding-left: 0;
  padding-right: 0;
}

.wallet-live-price-button {
  min-width: 2.55rem;
  padding-left: 0.38rem;
  padding-right: 0.38rem;
}

.wallet-live-price-button[data-loading="true"],
.wallet-use-last-price-button[data-loading="true"] {
  opacity: 0.72;
}

.wallet-use-last-price-button {
  min-width: 3.05rem;
  padding-left: 0.42rem;
  padding-right: 0.42rem;
}

.wallet-order-preview-header span,
.wallet-order-preview-foot {
  color: var(--trader-muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.wallet-order-chart-wrap {
  background: #f8fafc;
  border: 1px solid #e4eaf1;
  border-radius: 6px;
  min-height: 470px;
  overflow: hidden;
  position: relative;
}

.wallet-order-chart {
  height: 470px;
  width: 100%;
}

.wallet-chart-volume-overlay {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.wallet-chart-scrollbar {
  align-items: center;
  display: grid;
  gap: 0.4rem;
  grid-template-columns: auto minmax(12rem, 1fr) auto auto auto;
}

.wallet-chart-scrollbar label {
  color: var(--trader-muted);
  font-size: 0.72rem;
  font-weight: 750;
  margin: 0;
}

.wallet-chart-scrollbar .form-range {
  margin: 0;
}

.wallet-chart-scrollbar output {
  color: var(--trader-muted);
  font-size: 0.72rem;
  font-weight: 800;
  min-width: 8rem;
  text-align: right;
}

.wallet-chart-candle-count-label {
  justify-self: end;
}

.wallet-chart-candle-count {
  font-size: 0.78rem;
  font-weight: 800;
  height: 1.9rem;
  min-width: 5.5rem;
  padding-bottom: 0.2rem;
  padding-top: 0.2rem;
}

.wallet-price-line {
  align-items: center;
  cursor: ns-resize;
  display: flex;
  gap: 0.35rem;
  left: 0;
  pointer-events: auto;
  position: absolute;
  right: 0;
  transform: translateY(-50%);
  z-index: 3;
}

.wallet-price-line::before {
  content: "";
  flex: 1;
  height: 2px;
}

.wallet-price-line span {
  border-radius: 999px;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  margin-right: 0.85rem;
  min-width: 5.8rem;
  padding: 0.18rem 0.42rem;
  text-align: center;
  white-space: nowrap;
}

.wallet-price-line-entry::before {
  background: rgba(245, 158, 11, 0.5);
  height: 1px;
}

.wallet-price-line-entry span {
  background: rgba(254, 243, 199, 0.86);
  border: 1px solid rgba(245, 158, 11, 0.42);
  color: #854d0e;
}

.wallet-price-line-stop::before {
  background: transparent;
  border-top: 2px dashed #dc2626;
  height: 0;
}

.wallet-price-line-stop span {
  background: #dc2626;
}

.wallet-price-line-take::before {
  background: transparent;
  border-top: 2px dashed #059669;
  height: 0;
}

.wallet-price-line-take span {
  background: #059669;
}

.wallet-chart-extreme-line {
  cursor: default;
  pointer-events: none;
  z-index: 2;
}

.wallet-chart-extreme-line::before {
  background: transparent;
  border-top: 1px dashed rgba(100, 116, 139, 0.58);
  height: 0;
}

.wallet-chart-extreme-line span {
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.52);
  color: #475569;
  font-size: 0.64rem;
  font-weight: 800;
  min-width: 8.4rem;
  padding: 0.14rem 0.38rem;
}

.wallet-chart-extreme-high::before {
  border-color: rgba(5, 150, 105, 0.5);
}

.wallet-chart-extreme-low::before {
  border-color: rgba(220, 38, 38, 0.42);
}

.wallet-risk-reward {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 6px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  left: 0.6rem;
  line-height: 1.25;
  max-width: min(24rem, calc(100% - 1.2rem));
  padding: 0.35rem 0.5rem;
  position: absolute;
  top: 0.55rem;
  z-index: 4;
}

.wallet-risk-reward[data-level="ok"] {
  background: rgba(4, 120, 87, 0.92);
  border-color: rgba(167, 243, 208, 0.75);
}

.wallet-risk-reward[data-level="warning"] {
  background: rgba(254, 243, 199, 0.78);
  border-color: rgba(245, 158, 11, 0.42);
  color: #854d0e;
}

.rich-help-tooltip {
  background: #fff;
  border: 1px solid #d7e0ea;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
  max-width: 25rem;
  padding: 0.65rem;
  position: fixed;
  z-index: 3000;
}

.help-tooltip-content {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 7rem minmax(0, 1fr);
}

.help-tooltip-visual {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e4eaf1;
  border-radius: 6px;
  display: flex;
  justify-content: center;
  min-height: 4.8rem;
  padding: 0.25rem;
}

.help-tooltip-visual svg {
  display: block;
  height: 4.4rem;
  width: 100%;
}

.help-tooltip-visual text {
  fill: #334155;
  font-size: 0.7rem;
  font-weight: 800;
}

.help-tooltip-copy {
  display: grid;
  gap: 0.28rem;
}

.help-tooltip-title {
  color: var(--trader-text);
  font-size: 0.86rem;
  font-weight: 900;
}

.help-tooltip-body,
.help-tooltip-example {
  color: var(--trader-muted);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.35;
}

.help-tooltip-example {
  background: #f8fafc;
  border-radius: 5px;
  padding: 0.28rem 0.36rem;
}

.wallet-open-orders {
  display: grid;
  gap: 0.5rem;
}

  .wallet-open-order-row {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e4eaf1;
  border-radius: var(--trader-radius);
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.58rem 0.68rem;
}

.wallet-open-order-row div {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.wallet-open-order-row strong,
.wallet-open-order-row span,
.wallet-open-order-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-open-order-row strong {
  font-size: 0.83rem;
}

.wallet-open-order-row span,
.wallet-open-order-row small,
.wallet-empty-state {
  color: var(--trader-muted);
  font-size: 0.76rem;
}

.wallet-agent-id {
  background: #f8fafc;
  border: 1px solid #e4eaf1;
  border-radius: var(--trader-radius);
  display: grid;
  gap: 0.3rem;
  margin-top: 0.8rem;
  padding: 0.65rem;
}

.wallet-agent-id span {
  color: var(--trader-muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.wallet-agent-id code {
  color: #0f172a;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.wallet-note {
  color: var(--trader-muted);
  font-size: 0.82rem;
  margin-top: 0.8rem;
}

.wallet-settings-facts,
.wallet-delete-form {
  display: grid;
  gap: 0.65rem;
}

.wallet-delete-confirm {
  align-items: center;
  display: flex;
  gap: 0.55rem;
  margin: 0;
}

.wallet-delete-confirm span {
  font-size: 0.83rem;
  font-weight: 700;
}

.wallet-settings-facts div {
  align-items: center;
  border-bottom: 1px solid #edf1f5;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  padding-bottom: 0.55rem;
}

.wallet-settings-facts div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.wallet-settings-facts span {
  color: var(--trader-muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.wallet-settings-facts strong {
  font-size: 0.86rem;
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.wallet-danger-panel {
  border-color: #fecaca;
}

.wallet-account-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.wallet-account-row {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e4eaf1;
  border-radius: var(--trader-radius);
  color: var(--trader-text);
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.58rem 0.68rem;
  text-decoration: none;
}

.wallet-account-row:hover,
.wallet-account-row:focus {
  background: #edf7f4;
  border-color: #9ccdc2;
  color: #0f766e;
}

.wallet-account-row span,
.wallet-account-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-account-row strong {
  font-size: 0.82rem;
}

.wallet-chart-host,
.wallet-pie-host {
  min-height: 300px;
  overflow: hidden;
  width: 100%;
}

.wallet-asset-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.wallet-asset-pill {
  background: #fff;
  border: 1px solid var(--trader-border);
  border-radius: 999px;
  color: #344054;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1;
  padding: 0.5rem 0.72rem;
  text-decoration: none;
}

.wallet-asset-pill:hover,
.wallet-asset-pill:focus,
.wallet-asset-pill.active {
  background: #eaf5f2;
  border-color: #9ccdc2;
  color: #0f766e;
}

@media (max-width: 991.98px) {
  .trader-page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .market-dashboard-meta {
    text-align: left;
  }

  .live-service-summary {
    grid-template-columns: 1fr;
  }

  .trading-select-bar,
  .trading-workbench,
  .trading-chart-grid,
  .trading-data-grid,
  .trading-metrics,
  .wallet-select-bar,
  .wallet-metrics,
  .wallet-topology,
  .wallet-grid-layout,
  .wallet-overview-grid,
  .wallet-new-layout {
    grid-template-columns: 1fr;
  }

  .wallet-order-ticket {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wallet-order-submit {
    grid-column: 1 / -1;
  }

  .wallet-header-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 575.98px) {
  .wallet-order-ticket,
  .wallet-order-ticket-wide {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .wallet-order-submit {
    grid-column: auto;
    grid-template-columns: 1fr;
    row-gap: 0.22rem;
    text-align: center;
  }

  .wallet-submit-summary {
    border-left: 0;
    padding-left: 0;
    text-align: center;
  }

.wallet-open-order-row {
    align-items: stretch;
    flex-direction: column;
  }
}

.journal-shell {
  --journal-surface: var(--trader-surface);
  --journal-surface-2: #f8fafc;
  --journal-border: var(--trader-border);
  --journal-text: var(--trader-text);
  --journal-muted: var(--trader-muted);
  --journal-green: #0f766e;
  --journal-red: #dc2626;
  --journal-amber: #b45309;
  --journal-blue: var(--trader-blue);
  border-radius: var(--trader-radius);
  display: grid;
  gap: 1rem;
  margin-top: -0.25rem;
  padding-bottom: 1.2rem;
  padding-top: 1rem;
}

.journal-shell .trader-page-header h1,
.journal-shell .trader-page-header h2,
.journal-shell .wallet-panel-title h2,
.journal-shell .metric-tile strong,
.journal-shell h3 {
  color: var(--journal-text);
}

.journal-shell .trader-page-header p,
.journal-shell .wallet-panel-title span,
.journal-shell .metric-tile span,
.journal-shell small {
  color: var(--journal-muted);
}

.journal-shell .wallet-panel,
.journal-shell .metric-tile,
.journal-filter-bar {
  background: var(--journal-surface);
  border-color: var(--journal-border);
  box-shadow: var(--trader-shadow);
}

.journal-shell .metric-tile {
  border-left-color: var(--journal-blue);
}

.journal-shell .metric-tile-green {
  border-left-color: var(--journal-green);
}

.journal-shell .metric-tile-amber {
  border-left-color: var(--journal-amber);
}

.journal-shell .metric-tile-red {
  border-left-color: var(--journal-red);
}

.journal-filter-bar {
  align-items: end;
  border: 1px solid var(--journal-border);
  border-radius: var(--trader-radius);
  display: grid;
  gap: 0.6rem;
  grid-template-columns: minmax(9rem, 0.8fr) minmax(12rem, 1fr) minmax(14rem, 1.15fr) minmax(9rem, 0.75fr) minmax(13rem, 1fr) minmax(12rem, 1fr) minmax(9rem, 0.75fr) minmax(8rem, 0.65fr) auto;
  padding: 0.8rem;
}

.journal-filter-bar label {
  color: var(--journal-muted);
  display: grid;
  font-size: 0.72rem;
  font-weight: 750;
  gap: 0.24rem;
  margin: 0;
}

.journal-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.journal-metrics {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.journal-main-grid,
.journal-secondary-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.45fr) minmax(23rem, 0.55fr);
}

.journal-secondary-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(28rem, 0.9fr);
}

.journal-calendar-panel,
.journal-table-panel,
.journal-side-panel {
  min-width: 0;
}

.journal-schedule-host {
  min-height: 640px;
}

.journal-equity-title {
  margin-top: 1rem;
}

.journal-equity-host {
  min-height: 260px;
}

.journal-chip {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  min-height: 1.35rem;
  padding: 0.18rem 0.48rem;
  white-space: nowrap;
}

.journal-outcome-win,
.journal-event-win {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.journal-outcome-loss,
.journal-event-loss {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.journal-outcome-open,
.journal-event-open,
.journal-outcome-breakeven,
.journal-event-breakeven {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.journal-outcome-cancelled,
.journal-event-cancelled {
  background: #f8fafc;
  border-color: #d8e1eb;
  color: #334155;
}

.journal-side-long {
  background: #ecfdf5;
  color: #047857;
}

.journal-side-short {
  background: #fef2f2;
  color: #b91c1c;
}

.journal-number-positive {
  color: #047857 !important;
  font-weight: 800;
}

.journal-number-negative {
  color: #b91c1c !important;
  font-weight: 800;
}

.journal-calendar-card {
  background: #fff;
  border: 1px solid #d8e1eb;
  border-radius: 0.4rem;
  color: var(--trader-text);
  display: grid;
  gap: 0.12rem;
  min-height: 3.3rem;
  padding: 0.32rem 0.4rem;
}

.journal-calendar-card.win,
.journal-calendar-card.journal-event-win {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.journal-calendar-card.loss,
.journal-calendar-card.journal-event-loss {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.journal-calendar-card.open,
.journal-calendar-card.breakeven,
.journal-calendar-card.journal-event-open,
.journal-calendar-card.journal-event-breakeven {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.journal-calendar-card.cancelled,
.journal-calendar-card.journal-event-cancelled {
  background: #f8fafc;
  border-color: #d8e1eb;
  color: #334155;
}

.journal-calendar-card-head,
.journal-calendar-card-foot {
  align-items: center;
  display: flex;
  gap: 0.35rem;
  justify-content: space-between;
}

.journal-calendar-card strong,
.journal-calendar-card b {
  color: inherit;
  font-size: 0.75rem;
}

.journal-calendar-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.journal-day-summary {
  display: grid;
  gap: 0.75rem;
}

.journal-day-kpis {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.journal-day-kpis div,
.journal-day-trades button,
.journal-period-row,
.journal-heatmap-cell {
  background: var(--journal-surface-2);
  border: 1px solid var(--journal-border);
  border-radius: var(--trader-radius);
}

.journal-day-kpis div {
  padding: 0.55rem;
}

.journal-day-kpis span,
.journal-day-trades small {
  color: var(--journal-muted);
  display: block;
  font-size: 0.72rem;
  font-weight: 750;
}

.journal-day-trades {
  display: grid;
  gap: 0.45rem;
}

.journal-day-trades button {
  color: var(--journal-text);
  display: grid;
  gap: 0.12rem;
  padding: 0.5rem;
  text-align: left;
}

.journal-grid-detail {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0.75rem;
}

.journal-grid-detail div {
  background: #f8fafc;
  border: 1px solid #e4eaf1;
  border-radius: var(--trader-radius);
  display: grid;
  gap: 0.2rem;
  padding: 0.55rem;
}

.journal-grid-detail strong {
  color: var(--journal-muted);
  font-size: 0.72rem;
}

.journal-detail-content {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.journal-detail-content section {
  background: #fff;
  border: 1px solid var(--trader-border);
  border-radius: var(--trader-radius);
  padding: 0.8rem;
}

.journal-detail-content h3,
.journal-period-layout h3 {
  font-size: 0.9rem;
  font-weight: 800;
  margin: 0 0 0.55rem;
}

.journal-detail-content dl {
  display: grid;
  gap: 0.4rem;
  margin: 0;
}

.journal-detail-content dl div {
  display: grid;
  gap: 0.35rem;
  grid-template-columns: minmax(7rem, 0.35fr) minmax(0, 1fr);
}

.journal-detail-content dt {
  color: var(--journal-muted);
  font-size: 0.74rem;
}

.journal-detail-content dd {
  color: var(--journal-text);
  font-size: 0.82rem;
  margin: 0;
  overflow-wrap: anywhere;
}

.journal-detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.journal-period-layout {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: minmax(0, 1.4fr) minmax(11rem, 0.8fr) minmax(11rem, 0.8fr);
}

.journal-heatmap {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
}

.journal-heatmap-cell,
.journal-period-row {
  display: grid;
  gap: 0.18rem;
  padding: 0.55rem;
}

.journal-heatmap-cell.positive,
.journal-period-row.positive {
  border-color: rgba(22, 163, 123, 0.45);
}

.journal-heatmap-cell.negative,
.journal-period-row.negative {
  border-color: rgba(224, 82, 82, 0.45);
}

.journal-heatmap-cell strong,
.journal-period-row strong {
  color: var(--journal-text);
}

.journal-period-list {
  display: grid;
  gap: 0.45rem;
}

.journal-shell .e-schedule .e-appointment {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

@media (max-width: 1500px) {
  .journal-filter-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .journal-filter-actions {
    justify-content: flex-start;
  }

  .journal-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .journal-main-grid,
  .journal-secondary-grid,
  .journal-period-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .journal-filter-bar,
  .journal-metrics,
  .journal-day-kpis,
  .journal-detail-content,
  .journal-grid-detail {
    grid-template-columns: 1fr;
  }

  .journal-schedule-host {
    min-height: 520px;
  }
}
