.grid .full-row {
  grid-column: 1 / -1;
}

.leverage-row {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.leverage-row span {
  justify-self: end;
  color: var(--cyan);
  font-weight: 800;
}

.leverage-row input {
  grid-column: 1 / -1;
}

.live-position > span {
  display: grid;
  gap: 4px;
}

.live-position {
  position: relative;
}

.live-position > strong {
  text-align: right;
}

.live-position > strong > span {
  font-size: 14px;
  line-height: 1.45;
}

.live-position > strong > span small {
  font-size: 18px;
  font-weight: 900;
}

.history-position > strong {
  font-size: 14px;
  line-height: 1.45;
  align-self: flex-end;
  margin-left: auto;
  text-align: right;
  transform: translate(4px, 4px);
}

.history-position > strong small {
  font-size: 18px;
  font-weight: 900;
}

.position-realized {
  display: block;
  position: absolute;
  right: 12px;
  bottom: 12px;
  margin-top: 0;
  color: var(--muted);
  font-size: 14px;
  font-style: normal;
  font-weight: 700;
}

.position-realized.metric-profit { color: var(--green); }
.position-realized.metric-loss { color: var(--pink); }

#recentActivitySection .position {
  font-size: 14px;
  line-height: 1.35;
}

#recentActivitySection .position b { font-size: 14px; }
#recentActivitySection .position small { font-size: 12px; }

.position-head {
  display: flex;
  align-items: center;
  gap: 7px;
}

.position-head > small:not(.position-direction):not(.trade-outcome) {
  color: #a9bed0 !important;
  font-size: 11px !important;
  font-weight: 800;
  white-space: nowrap;
}

.position-direction,
.trade-outcome {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 9px;
  border: 1px solid currentColor;
  border-radius: 10px;
  font-size: 10px !important;
  font-weight: 900;
  line-height: 1.25;
  white-space: nowrap;
}

.position-entry-stage {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border: 1px solid #35cfff66;
  border-radius: 10px;
  color: #67dfff !important;
  background: #27d9ff0d;
  font-size: 10px !important;
  font-weight: 900;
  white-space: nowrap;
}

.position-direction.long { color: var(--green) !important; background: #24e6a20e; }
.position-direction.short { color: var(--pink) !important; background: #ff4f9a0e; }
.trade-outcome.win { color: var(--green) !important; background: #24e6a218; }
.trade-outcome.lose { color: var(--pink) !important; background: #ff4f9a18; }
.trade-outcome.even { color: var(--muted) !important; background: #7f9aaf12; }
.native-stop-label { color: var(--amber) !important; font-weight: 750; }
.credential-box { border-color: #27d9ff55; }
.credential-actions { display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px;color:var(--muted);font-size:12px }
.credential-ok { color:var(--green) }

#recentActivitySection .trade-list-title h3 { font-size: 14px; }

.live-position > strong.metric-profit small { color: var(--green); }
.live-position > strong.metric-loss small { color: var(--pink); }
.live-position > strong .metric-profit small { color: var(--green); }
.live-position > strong .metric-loss small { color: var(--pink); }

.toast {
  position: fixed;
  z-index: 9999;
  top: 20px;
  left: 50%;
  max-width: calc(100vw - 32px);
  padding: 13px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: white;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -18px);
  transition: .2s ease;
  box-shadow: 0 16px 45px #0009;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast-success { background: #0d6558; }
.toast-error { background: #812641; }

#recentActivitySection .live-position > strong > span > small,
#recentActivitySection .history-position > strong > small {
  font-size: 18px !important;
  font-weight: 900 !important;
  line-height: 1.2;
}

#adoptBtn.adopted {
  background: #0d6558;
  color: #d9fff7;
  border: 1px solid #24d7b5;
  box-shadow: 0 0 18px #24d7b52b;
}

.trade-stage-box {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.trade-stage-box legend {
  padding: 0 8px;
  color: var(--cyan);
  font-weight: 800;
}

.sub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.take-profit-box { border-color: #28d7a855; }

@media (max-width: 560px) {
  .sub-grid { grid-template-columns: 1fr; }
}
