.trade-heading-pnl {
  margin: -0.55rem 0 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.1;
}

.trade-card__top {
  align-items: flex-start;
  gap: 10px;
}

.trade-card__badges {
  flex: 0 0 auto;
  justify-content: flex-end;
  flex-wrap: wrap;
  max-width: 45%;
}

.trade-card__badges .tag {
  min-height: 27px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

.trade-pair {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.trade-pair__text {
  min-width: 0;
}

.trade-pair__label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  overflow: hidden;
  max-width: 100%;
  font-size: 15px;
  line-height: 1.12;
}

.trade-symbol-token {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.trade-symbol-token span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.trade-symbol-slash {
  color: #9aa3b2;
  font-weight: 800;
}

.trade-direction-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 999px;
}

.trade-direction-dot.is-long {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 166, 119, .12);
}

.trade-direction-dot.is-short {
  background: var(--coral);
  box-shadow: 0 0 0 3px rgba(246, 70, 93, .12);
}

.trade-pair__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  min-height: 18px;
}

.trade-pair__exchange-logo {
  display: block;
  width: 74px;
  max-width: 74px;
  height: 17px;
  object-fit: contain;
  object-position: left center;
}

.trade-card__exchange {
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-start;
  width: 76px;
  min-width: 76px;
  max-width: 76px;
  padding: 0 !important;
  overflow: hidden;
  background: transparent !important;
}

.trade-card__exchange img {
  display: block;
  width: 76px;
  max-width: 76px;
  height: 22px;
  object-fit: contain;
  object-position: left center;
}

.trade-summary-value {
  display: block;
  color: inherit;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-summary-metric > span:first-child,
.trade-exchange-card__metrics > div > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  overflow: visible;
}

.trade-exchange-card__metrics [data-exchange-pnl],
.trade-exchange-card__metrics [data-exchange-active-pnl],
.trade-exchange-card__metrics [data-exchange-portfolio-pnl],
.trade-exchange-card__metrics [data-exchange-guard] {
  display: block;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.08;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-exchange-summary__count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.trade-page-tabs--inline {
  width: fit-content;
  margin: 12px 0 1rem !important;
}

.trade-exchange-card__metrics [data-exchange-pnl].trade-pnl-positive,
.trade-summary-metric.trade-pnl-positive .trade-summary-value,
.trade-card__pnl-value.trade-pnl-positive {
  color: var(--green) !important;
}

.trade-exchange-card__metrics [data-exchange-pnl].trade-pnl-negative,
.trade-summary-metric.trade-pnl-negative .trade-summary-value,
.trade-card__pnl-value.trade-pnl-negative {
  color: var(--coral) !important;
}

.trade-card__pnl {
  flex: 0 0 250px;
  min-height: 86px;
  padding: 14px 16px;
}

.trade-card__pnl-current {
  display: grid;
  gap: 7px;
  height: 100%;
  align-content: center;
}

.trade-card__pnl-current > span:first-child,
.trade-card__detail-cell > span:first-child {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  line-height: 1;
  text-transform: uppercase;
}

.trade-card__pnl-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  font-size: 34px;
  line-height: 1;
  white-space: nowrap;
}

.trade-card__pnl-value small {
  color: inherit;
  font-size: 17px;
  font-weight: 700;
}

.trade-card__detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.trade-card__detail-cell {
  display: grid;
  gap: 6px;
  min-width: 0;
  min-height: 86px;
  align-content: center;
  padding: 13px 14px;
  border: 1px solid rgba(17, 24, 39, .055);
  border-radius: 8px;
  background: rgba(17, 24, 39, .025);
}

.trade-card__detail-cell > span:nth-child(2) {
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-card__detail-cell small {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  width: fit-content;
  max-width: 100%;
  min-height: 21px;
  padding: 0 7px;
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
}

.trade-card__notice {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(247, 184, 75, 0.22);
  border-radius: 8px;
  background: rgba(255, 244, 214, 0.72);
  color: #8a5a00;
  font-size: 12px;
  font-weight: 600;
}

.trade-card__notice i {
  font-size: 11px;
}

.trade-card .trade-card__pnl .trade-card__pnl-value {
  font-size: 20px !important;
  line-height: 1;
}

.trade-card .trade-card__pnl .trade-card__pnl-value small {
  font-size: 11px !important;
}

.trade-summary-metric .trade-summary-value {
  font-size: clamp(20px, 2.4vw, 28px) !important;
}

@media (max-width: 760px) {
  .trade-heading-pnl {
    margin-top: -0.35rem;
    font-size: 1rem;
  }

  .trade-card__badges {
    max-width: 48%;
  }

  .trade-card__main {
    align-items: stretch;
    flex-direction: column;
  }

  .trade-card__pnl {
    flex-basis: auto;
    min-height: 74px;
  }

  .trade-card .trade-card__pnl .trade-card__pnl-value {
    font-size: 20px !important;
  }

  .trade-card .trade-card__pnl .trade-card__pnl-value small {
    font-size: 11px !important;
  }

  .trade-card__detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trade-card__detail-cell {
    min-height: 74px;
  }
}

@keyframes agentSkeletonPulse {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.app-body[data-agent-overview-state="loading"] #v2-net-pnl,
.app-body[data-agent-overview-state="loading"] #v2-net-pnl-sub,
.app-body[data-agent-overview-state="loading"] #v2-avg-profit,
.app-body[data-agent-overview-state="loading"] #v2-avg-profit-sub,
.app-body[data-agent-overview-state="loading"] #v2-exposure,
.app-body[data-agent-overview-state="loading"] #v2-exposure-sub,
.app-body[data-agent-overview-state="loading"] #v2-day-outcome,
.app-body[data-agent-overview-state="loading"] #v2-day-outcome-sub,
.app-body[data-agent-overview-state="loading"] .v2-metric strong,
.app-body[data-agent-overview-state="loading"] .v2-metric small,
.app-body[data-agent-orders-state="loading"] [data-trades-summary] .trade-summary-value,
.app-body[data-agent-orders-state="loading"] [data-trades-summary] small,
[data-trades-summary].is-agent-loading .trade-summary-value,
[data-trades-summary].is-agent-loading small,
.app-body[data-agent-orders-state="loading"] [data-exchange-summary] [data-exchange-pnl],
.app-body[data-agent-orders-state="loading"] [data-exchange-summary] [data-exchange-pnl-sub],
.app-body[data-agent-orders-state="loading"] [data-exchange-summary] [data-exchange-active-pnl],
.app-body[data-agent-orders-state="loading"] [data-exchange-summary] [data-exchange-active-pnl-sub],
.app-body[data-agent-orders-state="loading"] [data-exchange-summary] [data-exchange-portfolio-pnl],
.app-body[data-agent-orders-state="loading"] [data-exchange-summary] [data-exchange-portfolio-pnl-sub],
.app-body[data-agent-orders-state="loading"] [data-exchange-summary] [data-exchange-guard],
.app-body[data-agent-orders-state="loading"] [data-exchange-summary] [data-exchange-guard] + small,
[data-exchange-summary].is-agent-loading [data-exchange-pnl],
[data-exchange-summary].is-agent-loading [data-exchange-pnl-sub],
[data-exchange-summary].is-agent-loading [data-exchange-active-pnl],
[data-exchange-summary].is-agent-loading [data-exchange-active-pnl-sub],
[data-exchange-summary].is-agent-loading [data-exchange-portfolio-pnl],
[data-exchange-summary].is-agent-loading [data-exchange-portfolio-pnl-sub],
[data-exchange-summary].is-agent-loading [data-exchange-guard],
[data-exchange-summary].is-agent-loading [data-exchange-guard] + small,
.trade-page-tabs.is-agent-loading .trade-page-tabs__badge {
  width: fit-content;
  min-width: 72px;
  border-radius: 8px;
  color: transparent !important;
  background: linear-gradient(90deg, rgba(17, 24, 39, .055), rgba(17, 24, 39, .12), rgba(17, 24, 39, .055));
  background-size: 220% 100%;
  animation: agentSkeletonPulse 1.2s ease-in-out infinite;
}

.trade-page-tabs.is-agent-loading .trade-page-tabs__badge {
  display: inline-flex;
  height: 18px;
  min-width: 28px;
}

.app-body[data-agent-orders-state="loading"] [data-exchange-summary] .trade-exchange-summary__count,
[data-exchange-summary].is-agent-loading .trade-exchange-summary__count {
  display: none;
}

.app-body[data-agent-orders-state="loading"] [data-exchange-summary] [data-exchange-pnl-sub],
.app-body[data-agent-orders-state="loading"] [data-exchange-summary] [data-exchange-active-pnl-sub],
.app-body[data-agent-orders-state="loading"] [data-exchange-summary] [data-exchange-portfolio-pnl-sub],
[data-exchange-summary].is-agent-loading [data-exchange-pnl-sub],
[data-exchange-summary].is-agent-loading [data-exchange-active-pnl-sub],
[data-exchange-summary].is-agent-loading [data-exchange-portfolio-pnl-sub] {
  min-width: 58px;
}

.app-body[data-agent-overview-state="loading"] .v2-canvas-wrap {
  position: relative;
}

.app-body[data-agent-overview-state="loading"] .v2-canvas-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 3px solid rgba(47, 109, 246, .16);
  border-top-color: var(--blue);
  border-radius: 999px;
  animation: spin .78s linear infinite;
}

.app-body[data-agent-overview-state="loading"] .v2-canvas-wrap canvas {
  opacity: .18;
}

.app-body[data-agent-overview-state="offline"] .v2-canvas-wrap,
.app-body[data-agent-overview-state="empty"] .v2-canvas-wrap {
  position: relative;
}

.v2-strategy-config-list {
  display: grid;
  gap: 0;
  margin-top: 12px;
}

.v2-strategy-config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
}

.v2-strategy-config-row span,
.v2-strategy-config-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.v2-strategy-config-row span {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.v2-strategy-config-row strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.v2-strategy-config-empty {
  padding: 12px 0;
}

.app-body[data-agent-overview-state="offline"] .v2-canvas-wrap::after,
.app-body[data-agent-overview-state="empty"] .v2-canvas-wrap::after {
  content: "Waiting for agent data";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.agent-health-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.agent-health-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--coral);
}

.agent-health-dot.is-success {
  background: var(--green);
}

.agent-health-dot.is-warning {
  background: #f7b84b;
}

.agent-health-dot.is-neutral {
  background: #c2c8d2;
}

.agent-health-dot.is-danger {
  background: var(--coral);
}

.v2-allocation-legend-row i {
  display: block;
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 999px;
}

.agent-trade-skeleton {
  min-height: 184px;
  display: grid;
  gap: 16px;
}

.agent-trade-skeleton span {
  display: block;
  height: 20px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(17, 24, 39, .055), rgba(17, 24, 39, .12), rgba(17, 24, 39, .055));
  background-size: 220% 100%;
  animation: agentSkeletonPulse 1.2s ease-in-out infinite;
}

.agent-trade-skeleton span:nth-child(1) {
  width: 44%;
}

.agent-trade-skeleton span:nth-child(2) {
  width: 88%;
}

.agent-trade-skeleton span:nth-child(3) {
  width: 62%;
}

.trade-lot-ledger {
  display: grid;
  gap: 0;
  flex: 1 1 100%;
  width: 100%;
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid rgba(17, 24, 39, .07);
  border-radius: 8px;
  background: #fff;
}

.trade-lot-ledger__head,
.trade-lot-ledger__row {
  display: grid;
  grid-template-columns: 72px minmax(88px, .8fr) minmax(110px, .9fr) minmax(220px, 1.7fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.trade-lot-ledger__head {
  min-height: 30px;
  padding: 0 12px;
  background: rgba(17, 24, 39, .025);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.trade-lot-ledger__row {
  position: relative;
  min-height: 42px;
  padding: 7px 12px;
  border-top: 1px solid rgba(17, 24, 39, .06);
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.trade-lot-ledger__row::before {
  content: "";
  position: absolute;
  left: 34px;
  top: -1px;
  bottom: -1px;
  width: 2px;
  background: rgba(47, 109, 246, .14);
}

.trade-lot-ledger__row:first-of-type::before {
  top: 50%;
}

.trade-lot-ledger__row:last-of-type::before {
  bottom: 50%;
}

.trade-lot-ledger__row > span {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2px;
  min-width: 0;
}

.trade-lot-ledger__row > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trade-lot-ledger__row > span:first-child strong {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 24px;
  border-radius: 7px;
  background: #eef5ff;
  color: #234eb7;
  font-size: 12px;
}

.trade-lot-ledger__row small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .trade-lot-ledger__head {
    display: none;
  }

  .trade-lot-ledger__row {
    grid-template-columns: 64px 1fr;
    gap: 6px 12px;
  }

  .trade-lot-ledger__row > span:nth-child(4) {
    grid-column: 1 / -1;
  }
}

.trade-lot-ledger__row .trade-pnl-positive {
  color: var(--green);
}

.trade-lot-ledger__row .trade-pnl-negative {
  color: var(--coral);
}

.backtest-trades-list {
  display: grid;
  gap: 8px;
}

.backtest-trades-table-head,
.backtest-trade-row {
  grid-template-columns: minmax(230px, 1.35fr) 78px minmax(124px, .72fr) minmax(126px, .7fr) minmax(82px, .45fr) minmax(100px, .55fr);
}

.backtest-trades-table-head {
  align-items: center;
  color: #7a8496;
  display: grid;
  gap: 12px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  margin: 0 20px 10px;
  text-transform: uppercase;
}

.backtest-trades-table-head span:last-child {
  text-align: right;
}

.backtest-trade-row {
  align-items: center;
  background: linear-gradient(180deg, #fff 0%, #fbfcfe 100%);
  border: 1px solid #e5ebf4;
  border-radius: 12px;
  display: grid;
  gap: 12px;
  min-height: 78px;
  padding: 12px 14px;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.backtest-trade-row:hover {
  border-color: #d7e0ed;
  box-shadow: 0 18px 42px rgba(17, 24, 39, .07);
  transform: translateY(-1px);
}

.backtest-trade-identity {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 46px minmax(0, 1fr);
  min-width: 0;
}

.backtest-trade-icons {
  height: 36px;
  position: relative;
  width: 46px;
}

.backtest-coin-avatar {
  align-items: center;
  background: #f6f8fb;
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(17, 24, 39, .12);
  display: inline-flex;
  height: 30px;
  justify-content: center;
  overflow: hidden;
  position: absolute;
  top: 3px;
  width: 30px;
}

.backtest-coin-avatar:first-child {
  left: 0;
  z-index: 2;
}

.backtest-coin-avatar:last-child {
  left: 19px;
  z-index: 1;
}

.backtest-coin-avatar img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.backtest-coin-avatar span {
  color: #657084;
  display: none;
  font-size: 10px;
  font-weight: 900;
}

.backtest-coin-avatar.is-fallback span {
  display: inline;
}

.backtest-trade-pair {
  min-width: 0;
}

.backtest-trade-pair strong,
.backtest-trade-time strong,
.backtest-trade-z strong,
.backtest-trade-pnl strong,
.backtest-lot-card strong {
  color: #111827;
  display: block;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
}

.backtest-trade-pair strong {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 7px;
  overflow: hidden;
}

.backtest-symbol-token {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  min-width: 0;
}

.backtest-symbol-token span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.backtest-symbol-token sub {
  font-size: .68em;
  font-weight: 850;
  line-height: 0;
}

.backtest-symbol-slash {
  color: #9aa3b2;
  font-weight: 800;
}

.backtest-direction-dot {
  border-radius: 999px;
  flex: 0 0 6px;
  height: 6px;
  width: 6px;
}

.backtest-direction-dot.is-long {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 166, 119, .12);
}

.backtest-direction-dot.is-short {
  background: var(--coral);
  box-shadow: 0 0 0 3px rgba(246, 70, 93, .12);
}

.backtest-trade-pair small,
.backtest-trade-status small,
.backtest-trade-time small,
.backtest-trade-z small,
.backtest-trade-pnl small,
.backtest-lot-card small {
  color: #657084;
  display: block;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  margin-top: 4px;
}

.backtest-trade-status-badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 9px;
  font-weight: 850;
  justify-content: center;
  min-width: 56px;
  padding: 4px 8px;
  text-transform: uppercase;
}

.backtest-trade-status-badge.is-open {
  background: #eaf8f2;
  color: #14704d;
}

.backtest-trade-status-badge.is-closed {
  background: #eef7fb;
  color: #075b75;
}

.backtest-trade-status-badge.is-pending {
  background: #fff4d6;
  color: #8a5a00;
}

.backtest-trade-status-badge.is-error {
  background: #ffe8ed;
  color: #a3152e;
}

.backtest-trade-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.backtest-exchange-logo {
  display: block;
  height: 15px;
  max-width: 68px;
  object-fit: contain;
  object-position: left center;
  width: 68px;
}

.backtest-trade-lots {
  align-items: center;
  color: #111827;
  display: flex;
  font-size: 12px;
  font-weight: 850;
}

.backtest-lot-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  display: inline;
  padding: 0;
}

.backtest-lot-card strong {
  font-size: 12px;
}

.backtest-lot-card small {
  display: none;
}

.backtest-trade-pnl {
  text-align: right;
}

.backtest-trade-pnl strong {
  font-size: 13px;
}

.backtest-trade-pnl.is-positive strong,
.backtest-trade-pnl.is-positive .backtest-trade-pct {
  color: var(--green);
}

.backtest-trade-pnl.is-negative strong,
.backtest-trade-pnl.is-negative .backtest-trade-pct {
  color: var(--coral);
}

.backtest-trade-z strong.is-zscore-take-profit,
.backtest-trade-z strong .is-zscore-take-profit {
  color: var(--green);
}

.backtest-trade-z small .is-zscore-take-profit {
  color: var(--green);
}

.backtest-trade-z strong.is-zscore-stop,
.backtest-trade-z strong .is-zscore-stop {
  color: var(--coral);
}

.backtest-trade-z small .is-zscore-stop {
  color: var(--coral);
}

.backtest-trade-z strong.is-zscore-take-profit .backtest-z-arrow,
.backtest-trade-z strong.is-zscore-stop .backtest-z-arrow {
  color: currentColor;
  opacity: 0.85;
}

.backtest-z-arrow {
  color: #8b95a7;
  font-size: 10px;
  margin: 0 3px;
}

.backtest-trades-footer {
  align-items: center;
  display: flex;
  justify-content: center;
  width: 100%;
}

.backtest-trades-footer[hidden] {
  display: none !important;
}

.backtest-trades-footer .button {
  min-width: 132px;
}

.agent-trade-skeleton.backtest-trade-row {
  min-height: 86px;
}

@media (max-width: 760px) {
  .backtest-trades-table-head {
    display: none !important;
  }

  .backtest-trade-row {
    grid-template-columns: 1fr;
  }

  .backtest-trade-pnl {
    text-align: left;
  }
}

/* Portfolio history on the open trades page. */
.trade-portfolio-charts { margin-bottom: 1.25rem; }
.trade-portfolio-toolbar { display: flex; justify-content: flex-end; gap: .6rem; margin-bottom: .75rem; }
.trade-portfolio-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.trade-portfolio-card.box { margin: 0; min-width: 0; }
.trade-portfolio-description { color: #68758b; font-size: .8rem; margin-bottom: 1rem; }
.trade-portfolio-canvas { position: relative; height: 210px; }
.trade-portfolio-empty { position: absolute; inset: 0; display: grid; place-content: center; color: #68758b; font-size: .85rem; }
.trade-portfolio-empty[hidden] { display: none; }
@media (max-width: 768px) {
  .trade-portfolio-grid { grid-template-columns: minmax(0, 1fr); }
  .trade-portfolio-toolbar { justify-content: flex-start; }
}

/* Agent trade details: compact summary, responsive inset information panels. */
.agent-trade-details { grid-column: 1 / -1; min-width: 0; border-top: 1px solid #edf0f5; }
.agent-trade-details > summary { display: flex; align-items: center; gap: 10px; padding: 9px 2px 0; color: #718096; font-size: 12px; cursor: pointer; list-style: none; }
.agent-trade-details > summary::-webkit-details-marker { display: none; }
.agent-trade-details > summary:focus-visible { outline: 2px solid #548dff; outline-offset: 4px; border-radius: 4px; }
.agent-trade-details > summary > i { margin-left: auto; font-size: 10px; transition: transform .18s ease; }
.agent-trade-details[open] > summary > i { transform: rotate(180deg); }
.agent-detail-mode { padding: 2px 7px; border-radius: 20px; background: #eef3fc; color: #5d76a0; font-size: 10px; }
.agent-detail-content { display: grid; grid-template-columns: minmax(180px,.85fr) minmax(310px,1.55fr) minmax(220px,1.2fr); gap: 14px; padding: 16px 0 2px; }
.agent-detail-content section { min-width: 0; padding: 14px; background: #f4f7fb; border: 1px solid #e9eef5; border-radius: 10px; }
.agent-detail-content h3 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #8a97a9; margin: 0 0 12px; }
.agent-detail-item { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; font-size: 12px; }
.agent-detail-item > span { color: #8994a5; }
.agent-detail-item > strong { font-weight: 500; text-align: right; color: #253248; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.agent-detail-legs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.agent-detail-leg-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 11px; }
.agent-detail-leg-heading strong { font-size: 12px; font-weight: 600; }
.agent-detail-leg-heading > span:last-child { color: #8a97a9; }
.agent-detail-side { padding: 3px 6px; border-radius: 4px; background: #e7f5ef; color: #23986a; font-size: 10px; }
.agent-detail-side.is-short { background: #fff0f2; color: #df5268; }
.agent-detail-high { background: #fff0f2; color: #df5268; font-size: 10px; padding: 2px 5px; border-radius: 4px; margin-right: 6px; }
@media (max-width: 1100px) { .agent-detail-content { grid-template-columns: 1fr 1fr; } .agent-detail-legs { grid-column: 1 / -1; grid-row: 1; } }
@media (max-width: 600px) { .agent-detail-content { grid-template-columns: 1fr; } .agent-detail-legs { grid-template-columns: 1fr; } .agent-detail-content section { padding: 12px; } }
@media (prefers-reduced-motion: reduce) { .agent-trade-details > summary > i { transition: none; } }
