.trade-gate-shell {
  --trade-gate-ready: #20c997;
  --trade-gate-waiting: #f5b942;
  --trade-gate-blocked: #ff5b5b;
  --trade-gate-muted: #8a94a6;
}

.trade-gate-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.08), transparent 38%),
    rgba(23, 29, 40, 0.92);
}

.trade-gate-hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--trade-gate-muted);
}

.trade-gate-hero[data-state="ready"]::before { background: var(--trade-gate-ready); }
.trade-gate-hero[data-state="waiting"]::before { background: var(--trade-gate-waiting); }
.trade-gate-hero[data-state="blocked"]::before { background: var(--trade-gate-blocked); }

.trade-gate-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(138, 148, 166, 0.15);
  color: #c2c8d2;
}

.trade-gate-hero[data-state="ready"] .trade-gate-status-pill {
  background: rgba(32, 201, 151, 0.14);
  color: #6fe0be;
}

.trade-gate-hero[data-state="waiting"] .trade-gate-status-pill {
  background: rgba(245, 185, 66, 0.14);
  color: #ffd47b;
}

.trade-gate-hero[data-state="blocked"] .trade-gate-status-pill {
  background: rgba(255, 91, 91, 0.14);
  color: #ff9696;
}

.trade-gate-overall {
  max-width: 920px;
  font-size: clamp(1.1rem, 2vw, 1.8rem);
  font-weight: 750;
  line-height: 1.22;
}

.trade-gate-reason {
  max-width: 920px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.95rem;
  line-height: 1.55;
}

.trade-gate-meta {
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.76rem;
}

.trade-gate-section {
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(23, 29, 40, 0.74);
}

.trade-gate-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.trade-gate-section-title {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 700;
}

.trade-gate-count {
  min-width: 2rem;
  padding: 0.26rem 0.55rem;
  border-radius: 999px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
}

.trade-gate-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.trade-gate-chip {
  padding: 0.62rem 0.75rem;
  border-radius: 999px;
  background: rgba(32, 201, 151, 0.12);
  color: #d8fff1;
  font-size: 0.82rem;
  line-height: 1.2;
  font-weight: 600;
}

.trade-gate-row-list {
  display: grid;
  gap: 0.55rem;
  max-height: 320px;
  overflow: auto;
  padding-right: 0.2rem;
}

.trade-gate-row {
  padding: 0.72rem 0.8rem;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
}

.trade-gate-row-label {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
}

.trade-gate-row-reason {
  margin-top: 0.24rem;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.76rem;
  line-height: 1.4;
}

.trade-gate-list-item.is-empty {
  color: rgba(255, 255, 255, 0.38);
  font-style: italic;
}

.trade-gate-details {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(23, 29, 40, 0.74);
}

.trade-gate-details summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.trade-gate-details summary::-webkit-details-marker {
  display: none;
}

.trade-gate-details-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
}

.trade-gate-details-summary::after {
  content: "Show";
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.78rem;
}

.trade-gate-details[open] .trade-gate-details-summary::after {
  content: "Hide";
}

.trade-gate-engine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 0.75rem;
  padding: 0 1.1rem 1.1rem;
}

.trade-gate-engine {
  border-radius: 13px;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.035);
}

.trade-gate-engine-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.trade-gate-engine-name {
  font-weight: 700;
  font-size: 0.83rem;
}

.trade-gate-engine-mode {
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.7rem;
  white-space: nowrap;
}

.trade-gate-engine-strategy {
  margin-top: 0.22rem;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.74rem;
}

.trade-gate-engine-reason {
  margin-top: 0.65rem;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.76rem;
  line-height: 1.45;
  white-space: pre-line;
}

.trade-gate-error {
  display: none;
  border-radius: 12px;
  background: rgba(255, 91, 91, 0.1);
  color: #ffaaaa;
}

.trade-gate-error.is-visible {
  display: block;
}

@media (max-width: 767.98px) {
  .trade-gate-overall {
    font-size: 1.2rem;
  }

  .trade-gate-section,
  .trade-gate-hero {
    border-radius: 14px;
  }
}


/* Trade Gate final compact tidy */
.trade-gate-hero {
  padding-top: 2rem !important;
  padding-bottom: 2rem !important;
}

.trade-gate-row.is-collapsed {
  display: none;
}

.trade-gate-show-all {
  width: 100%;
  padding: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(255, 255, 255, 0.62);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.trade-gate-show-all:hover {
  background: rgba(255, 255, 255, 0.065);
  color: rgba(255, 255, 255, 0.88);
}

@media (max-width: 767.98px) {
  .trade-gate-hero {
    padding-top: 1.4rem !important;
    padding-bottom: 1.4rem !important;
  }
}
