.trader-page .az-header > .container,
.trader-page .az-content > .container {
  max-width: 1520px;
}

.trader-page .az-logo {
  text-transform: none;
}

.trader-page .az-logo span {
  display: inline;
  width: auto;
  height: auto;
  margin-right: 0;
  border-radius: 0;
  background: transparent;
  vertical-align: baseline;
}

.trader-page .az-content-body {
  width: 100%;
}

.trader-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.trader-hero-copy h1,
.trader-hero-copy h2 {
  margin-bottom: 6px;
}

.trader-hero-copy p {
  color: #596882;
  margin-bottom: 0;
}

.trader-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.trader-actions .btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.trader-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.trader-pill.buy,
.trader-pill.completed,
.trader-pill.ok {
  background: rgba(34, 197, 94, .12);
  color: #16a34a;
}

.trader-pill.sell,
.trader-pill.failed,
.trader-pill.error {
  background: rgba(239, 68, 68, .12);
  color: #dc2626;
}

.trader-pill.hold,
.trader-pill.running,
.trader-pill.warning {
  background: rgba(245, 158, 11, .12);
  color: #d97706;
}

.trader-metric-card,
.trader-table-card,
.trader-panel-card {
  height: 100%;
}

.trader-metric-card {
  background: #efefef;
}

.trader-metric-card .card-body,
.trader-table-card .card-body,
.trader-panel-card .card-body {
  padding: 20px;
}

.trader-metric-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #7987a1;
  margin-bottom: 6px;
}

.trader-metric-value {
  font-size: 25px;
  line-height: 1;
  font-weight: 700;
  margin-bottom: 6px;
  color: #1c273c;
}

.trader-metric-note {
  color: #596882;
  margin-bottom: 0;
  line-height: 1.2;
}

.trader-chart-shell {
  height: 300px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  overflow: hidden;
  margin-top: 16px;
}

.trader-chart-shell svg {
  display: block;
  width: 100%;
  height: 100%;
}

.trader-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
  color: #596882;
  font-size: 12px;
}

.trader-chart-legend span::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 2px;
  margin-right: 8px;
  vertical-align: middle;
}

.trader-chart-legend .price::before,
.trader-chart-legend .equity::before {
  background: #5b8def;
}

.trader-chart-legend .mean::before {
  background: #f5b942;
}

.trader-chart-legend .z::before {
  background: #10b981;
}

.trader-chart-legend .trend::before {
  background: #f43f5e;
}

.trader-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.trader-toolbar-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trader-toolbar-group .btn {
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
}

.trader-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.trader-market-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #e7f3ff;
  padding: 16px;
}

.trader-market-symbol {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #7987a1;
}

.trader-market-price {
  margin-top: 12px;
  font-size: 24px;
  line-height: 1;
  font-weight: 700;
}

.trader-market-meta {
  margin-top: 10px;
  color: #596882;
}

.trader-balance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.trader-balance-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.trader-balance-card.asset {
  background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
  border-color: #3b82f6;
  color: #fff;
  text-align: left;
  align-items: flex-start;
}

.trader-balance-card.asset .label,
.trader-balance-card.asset .meta,
.trader-balance-card.asset .value {
  color: #fff;
}

.trader-balance-card .label {
  color: #7987a1;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.trader-balance-card .value {
  margin-top: 6px;
  font-size: 24px;
  line-height: 1;
  font-weight: 700;
}

.trader-balance-card .meta {
  margin-top: 6px;
  color: #596882;
}

.trader-table-wrap {
  overflow: auto;
}

.trader-table-wrap table {
  min-width: 620px;
}

.trader-orders-table {
  min-width: 760px !important;
}

.trader-empty {
  padding: 24px;
  text-align: center;
  color: #7987a1;
}

.trader-raw {
  min-height: 220px;
  background: #0f172a;
  color: #cbd5e1;
  padding: 16px;
  border-radius: 8px;
  overflow: auto;
  font-size: 12px;
}

.trader-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1100;
  width: min(420px, calc(100vw - 32px));
  border-radius: 12px;
  background: #e0ecff;
  color: #111827;
  box-shadow: 0 20px 60px rgba(15, 23, 42, .2);
  padding: 18px 20px;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.trader-toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.trader-toast.large {
  left: 50%;
  right: auto;
  top: 50%;
  bottom: auto;
  width: min(780px, calc(100vw - 40px));
  transform: translate(-50%, -50%) scale(.96);
  padding: 32px;
}

.trader-toast.large.show {
  transform: translate(-50%, -50%) scale(1);
}

.trader-toast .close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: 0;
  background: transparent;
  font-size: 26px;
  line-height: 1;
}

.trader-toast-label {
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #475569;
}

.trader-toast-title {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
}

.trader-toast.large .trader-toast-title {
  font-size: 54px;
}

.trader-toast-meta {
  margin-top: 8px;
  color: #334155;
}

@media (max-width: 991px) {
  .trader-hero {
    flex-direction: column;
  }
}
