/* Agent Marketplace styles — extends styles.css (TD Pro design system) */

/* ── color helpers ── */
.green { color: var(--green-bright); }
.red { color: var(--red-bright); }
.amber { color: var(--amber); }

/* ════ LOGIN ════ */
.login-wrap {
  min-height: 100vh;
  display: grid; place-items: center;
  position: relative;
  overflow: hidden;
  padding: 24px;
}
.login-bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}
.login-bg-orb.one { width: 480px; height: 480px; background: rgba(63,123,255,0.16); top: -120px; right: -80px; }
.login-bg-orb.two { width: 420px; height: 420px; background: rgba(63,123,255,0.14); bottom: -120px; left: -80px; }
.login-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 420px;
  background: linear-gradient(180deg, rgba(15,22,51,0.92), rgba(13,18,48,0.88));
  border: 1px solid var(--card-border-strong, rgba(63,123,255,0.25));
  border-radius: 18px;
  padding: 32px;
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.7);
}
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.login-brand .brand-icon {
  width: 52px; height: 52px; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #14244a, #101d3d);
  display: grid; place-items: center;
  border: 2px solid #f0c674;
}
.login-title { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.login-sub { font-size: 12px; color: var(--blue); font-weight: 600; letter-spacing: 0.04em; }
.login-lead { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin: 0 0 24px; }
.login-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.login-field span { font-size: 11px; font-weight: 700; color: var(--text-dim); letter-spacing: 0.06em; text-transform: uppercase; }
.login-field input {
  height: 44px; padding: 0 14px;
  background: rgba(8,12,33,0.8);
  border: 1px solid var(--border-faint);
  border-radius: 9px;
  color: var(--text); font-size: 14px; outline: none;
}
.login-field input:focus { border-color: rgba(63,123,255,0.55); box-shadow: 0 0 0 3px rgba(63,123,255,0.12); }
.login-btn {
  width: 100%; height: 46px; margin-top: 8px;
  background: linear-gradient(180deg, #3f7bff, #2f63e0);
  border: 0; border-radius: 10px;
  color: white; font-weight: 700; font-size: 15px;
  box-shadow: 0 6px 18px -4px rgba(63,123,255,0.5);
  transition: filter .15s, transform .15s;
}
.login-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.login-foot { display: flex; justify-content: space-between; margin-top: 18px; font-size: 12px; color: var(--text-dim); }
.login-foot a { color: var(--blue); cursor: pointer; }

/* ════ NAV EXTRAS ════ */
.broker-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 7px;
  background: rgba(16,185,129,0.10); border: 1px solid rgba(16,185,129,0.28);
  color: var(--green-bright); font-size: 11.5px; font-weight: 700;
  white-space: nowrap;
}
.broker-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green-bright); box-shadow: 0 0 6px var(--green-bright); }
.nav-badge {
  margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  background: var(--blue-soft); color: var(--blue);
  font-size: 10px; font-weight: 800; font-family: var(--font-mono);
  border: 1px solid rgba(63,123,255,0.3);
}
.agents-shell { max-width: 1240px; }

/* ════ MARKETPLACE ════ */
.market-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; margin-bottom: 6px;
}
.market-head h1 { margin: 0 0 4px; font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.market-head p { margin: 0; font-size: 13px; color: var(--text-dim); max-width: 60ch; }
.market-filters { display: inline-flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.seg {
  display: inline-flex; gap: 2px; padding: 3px;
  background: rgba(8,12,33,0.6); border: 1px solid var(--border-faint); border-radius: 9px;
}
.seg button {
  padding: 6px 12px; border: 0; background: transparent;
  color: var(--text-muted); font-size: 11.5px; font-weight: 700; border-radius: 6px;
}
.seg button.active { background: var(--blue-soft); color: var(--blue); }
.sort-select {
  height: 34px; padding: 0 30px 0 12px;
  background: rgba(8,12,33,0.6) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2364748b'><path d='M7 10l5 5 5-5z'/></svg>") right 8px center/14px no-repeat;
  border: 1px solid var(--border-faint); border-radius: 8px;
  color: var(--text); font-size: 12px; font-weight: 600; appearance: none; outline: none; cursor: pointer;
}

.market-strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(8,12,33,0.4);
  border: 1px solid var(--border-faint); border-radius: 12px;
  overflow: hidden; margin: 16px 0 4px;
}
.ms-cell { padding: 14px 18px; border-right: 1px solid var(--divider); }
.ms-cell:last-child { border-right: 0; }
.ms-cell .l { font-size: 10px; font-weight: 700; color: var(--text-dim); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 5px; }
.ms-cell .v { font-size: 18px; font-weight: 700; color: var(--text); }
@media (max-width: 760px) { .market-strip { grid-template-columns: repeat(2, 1fr); } }

.agent-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px; margin-top: 16px;
}
.empty-note { grid-column: 1/-1; text-align: center; padding: 40px; color: var(--text-dim); }

/* ════ AGENT CARD ════ */
.agent-card {
  background: linear-gradient(180deg, rgba(15,22,51,0.7), rgba(13,18,48,0.6));
  border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 14px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.agent-card:hover { border-color: var(--card-border-strong, rgba(63,123,255,0.32)); transform: translateY(-2px); box-shadow: 0 14px 30px -16px rgba(0,0,0,0.6); }
.agent-card.subbed { border-color: rgba(16,185,129,0.28); }
.ac-head { display: flex; flex-direction: column; align-items: stretch; gap: 8px; justify-content: flex-start; }
.ac-id { display: inline-flex; align-items: center; gap: 12px; }
.ac-glyph {
  width: 44px; height: 44px; border-radius: 11px;
  background: rgba(63,123,255,0.10); border: 1px solid rgba(63,123,255,0.22);
  display: grid; place-items: center; font-size: 22px; flex-shrink: 0;
}
.ac-name { font-size: 15px; font-weight: 700; color: var(--text); }
.ac-tag { font-size: 11px; font-weight: 600; color: var(--blue); margin-top: 2px; }
.risk-chip {
  padding: 4px 9px; border-radius: 6px; font-size: 10px; font-weight: 800;
  letter-spacing: 0.04em; white-space: nowrap; text-transform: uppercase;
}
.risk-chip.green { background: rgba(16,185,129,0.14); color: var(--green-bright); border: 1px solid rgba(16,185,129,0.3); }
.risk-chip.amber { background: rgba(240,198,116,0.14); color: var(--amber); border: 1px solid rgba(240,198,116,0.3); }
.risk-chip.red { background: rgba(239,68,68,0.14); color: var(--red-bright); border: 1px solid rgba(239,68,68,0.3); }

/* Card status chips (Active / Coming soon) + header right cluster */
.ac-head-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex-shrink: 0; }
.status-chip {
  padding: 4px 9px; border-radius: 6px; font-size: 10px; font-weight: 800;
  letter-spacing: 0.04em; white-space: nowrap; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 5px;
}
.status-chip.active { background: rgba(16,185,129,0.16); color: var(--green-bright); border: 1px solid rgba(16,185,129,0.36); }
.status-chip.active .sc-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px var(--green-bright); }
.status-chip.soon { background: rgba(100,116,139,0.12); color: var(--text-dim); border: 1px solid var(--border-faint); }
.status-chip.paper { background: rgba(240,198,116,0.14); color: var(--amber); border: 1px solid rgba(240,198,116,0.36); }
.status-chip.verified { color: var(--amber); border-color: var(--amber-soft); }
.ac-soon-note { flex: 1; display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; color: var(--text-dim); font-style: italic; }

.ac-blurb { font-size: 12.5px; line-height: 1.55; color: var(--text-muted); margin: 0; min-height: 56px; }

.ac-spark { position: relative; display: flex; align-items: flex-end; justify-content: space-between; }
.mini-spark { display: block; }
.ac-return { font-size: 18px; font-weight: 700; }
.ac-return-lbl { font-size: 11px; color: var(--text-dim); font-weight: 600; }
.ac-pretrack { font-size: 12px; color: var(--text-dim); font-weight: 600; }

.ac-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(8,12,33,0.5); border: 1px solid var(--border-faint);
  border-radius: 10px; overflow: hidden;
}
.ac-stat { padding: 10px 12px; border-right: 1px solid var(--divider); }
.ac-stat:last-child { border-right: 0; }
.ac-stat .v { font-size: 15px; font-weight: 700; color: var(--text); font-family: var(--font-mono); }
.ac-stat .v.red { color: var(--red-bright); }
.ac-stat .l { font-size: 9.5px; color: var(--text-dim); font-weight: 600; letter-spacing: 0.04em; margin-top: 2px; }

.ac-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 11px; color: var(--text-dim); }
.ac-meta span { display: inline-flex; align-items: center; gap: 4px; }

.ac-actions { display: flex; gap: 8px; margin-top: 2px; }
.ac-btn {
  flex: 1; height: 38px; border-radius: 9px; border: 1px solid transparent;
  font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: filter .15s, background .15s;
}
.ac-btn.sub { background: linear-gradient(180deg, #3f7bff, #2f63e0); color: white; box-shadow: 0 4px 14px -4px rgba(63,123,255,0.5); }
.ac-btn.sub:hover { filter: brightness(1.08); }
.ac-btn.sub:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.ac-btn.config { background: rgba(63,123,255,0.10); color: var(--blue); border-color: rgba(63,123,255,0.28); }
.ac-btn.config:hover { background: rgba(63,123,255,0.18); }
.ac-btn.ghost { background: rgba(15,22,51,0.6); color: var(--text-muted); border-color: var(--border-faint); }
.ac-btn.ghost:hover { color: var(--text); }
.ac-btn.locked { background: rgba(240,198,116,0.08); color: var(--amber); border-color: rgba(240,198,116,0.35); }
.ac-btn.locked:hover { background: rgba(240,198,116,0.14); }
.ac-toggle {
  flex: 1; height: 38px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 12.5px; font-weight: 700; border: 1px solid;
}
.ac-toggle.on { background: rgba(16,185,129,0.12); color: var(--green-bright); border-color: rgba(16,185,129,0.32); }
.ac-toggle.off { background: rgba(100,116,139,0.10); color: var(--text-muted); border-color: var(--border-faint); }
.ac-toggle .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ac-toggle.on .dot { box-shadow: 0 0 8px var(--green-bright); }

/* ════ CONFIG DRAWER ════ */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4,6,16,0.7); backdrop-filter: blur(4px);
  display: flex; justify-content: flex-end;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  width: 100%; max-width: 480px; height: 100%;
  background: linear-gradient(180deg, #0d1230, #0a0e22);
  border-left: 1px solid var(--card-border-strong, rgba(63,123,255,0.25));
  display: flex; flex-direction: column;
  box-shadow: -24px 0 60px -20px rgba(0,0,0,0.8);
  animation: slideIn .2s cubic-bezier(0.16,1,0.3,1);
}
@keyframes slideIn { from { transform: translateX(40px); opacity: 0.6; } to { transform: translateX(0); opacity: 1; } }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px; border-bottom: 1px solid var(--border-faint);
}
.drawer-close {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(15,22,51,0.7); border: 1px solid var(--border-faint);
  color: var(--text-muted); font-size: 14px;
}
.drawer-close:hover { color: var(--text); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px; }
.drawer-perf {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(8,12,33,0.5); border: 1px solid var(--border-faint);
  border-radius: 10px; overflow: hidden; margin-bottom: 18px;
}
.dp-cell { padding: 12px 14px; border-right: 1px solid var(--divider); text-align: center; }
.dp-cell:last-child { border-right: 0; }
.dp-cell .v { font-size: 16px; font-weight: 700; font-family: var(--font-mono); color: var(--text); }
.dp-cell .l { font-size: 9px; color: var(--text-dim); font-weight: 700; letter-spacing: 0.06em; margin-top: 3px; text-transform: uppercase; }

.drawer-subcta {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; margin-bottom: 18px;
  background: rgba(63,123,255,0.08); border: 1px solid rgba(63,123,255,0.25); border-radius: 10px;
}
.drawer-subcta .t { font-size: 13px; font-weight: 700; color: var(--text); }
.drawer-subcta .s { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.drawer-subcta .ac-btn { flex: 0 0 auto; padding: 0 18px; }

.cfg-section { margin-bottom: 18px; }
.cfg-section-title {
  font-size: 10.5px; font-weight: 700; color: var(--blue);
  letter-spacing: 0.1em; margin-bottom: 8px;
  padding-bottom: 8px; border-bottom: 1px solid var(--divider);
}
.cfg-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 0; border-bottom: 1px solid rgba(148,163,184,0.06);
}
.cfg-row:last-child { border-bottom: 0; }
.cfg-row.disabled { opacity: 0.45; }
.cfg-meta { min-width: 0; }
.cfg-label { font-size: 13px; font-weight: 600; color: var(--text); }
.cfg-help { font-size: 11px; color: var(--text-dim); line-height: 1.45; margin-top: 3px; }
.cfg-control { flex-shrink: 0; }

.cfg-toggle {
  width: 44px; height: 25px; border-radius: 999px; padding: 0; position: relative;
  background: rgba(15,22,51,0.8); border: 1px solid var(--border-faint); transition: background .15s, border-color .15s;
}
.cfg-toggle .knob { position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: var(--text-muted); transition: left .15s, background .15s; }
.cfg-toggle.on { background: rgba(16,185,129,0.3); border-color: rgba(16,185,129,0.5); }
.cfg-toggle.on .knob { left: 21px; background: var(--green-bright); }

.cfg-seg { display: inline-flex; gap: 2px; padding: 3px; background: rgba(8,12,33,0.6); border: 1px solid var(--border-faint); border-radius: 8px; }
.cfg-seg button { padding: 5px 11px; border: 0; background: transparent; color: var(--text-muted); font-size: 11px; font-weight: 700; border-radius: 5px; }
.cfg-seg button.active { background: var(--blue-soft); color: var(--blue); }

.cfg-stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-faint); border-radius: 8px; overflow: hidden; background: rgba(8,12,33,0.6); }
.cfg-stepper button { width: 30px; height: 32px; border: 0; background: transparent; color: var(--text-muted); font-size: 16px; font-weight: 700; }
.cfg-stepper button:hover { color: var(--text); background: rgba(63,123,255,0.1); }
.cfg-stepper input { width: 56px; height: 32px; border: 0; border-left: 1px solid var(--divider); border-right: 1px solid var(--divider); background: transparent; color: var(--text); text-align: center; font-family: var(--font-mono); font-size: 13px; font-weight: 700; outline: none; }

.drawer-foot {
  display: flex; gap: 10px; padding: 16px 22px;
  border-top: 1px solid var(--border-faint);
}
.drawer-foot .ac-btn { height: 42px; }

/* ════ LIVE TRADING ════ */
.live-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.live-head h1 { margin: 0 0 4px; font-size: 26px; font-weight: 700; color: var(--text); }
.live-head p { margin: 0; font-size: 13px; color: var(--text-dim); display: inline-flex; align-items: center; gap: 8px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-bright); box-shadow: 0 0 8px var(--green-bright); animation: pulse 2s ease infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.live-active-agents { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.laa-chip { padding: 6px 12px; border-radius: 999px; background: rgba(16,185,129,0.10); border: 1px solid rgba(16,185,129,0.28); color: var(--green-bright); font-size: 11.5px; font-weight: 700; }

.live-summary {
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(8,12,33,0.4); border: 1px solid var(--border-faint);
  border-radius: 12px; overflow: hidden; margin-bottom: 18px;
}
.lsum { padding: 14px 18px; border-right: 1px solid var(--divider); }
.lsum:last-child { border-right: 0; }
.lsum .l { font-size: 10px; font-weight: 700; color: var(--text-dim); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px; }
.lsum .v { font-size: 22px; font-weight: 700; color: var(--text); font-family: var(--font-mono); }
.lsum .v.green { color: var(--green-bright); }
.lsum .v.red { color: var(--red-bright); }
.lsum .v.amber { color: var(--amber); }
.lsum .s { font-size: 11px; font-weight: 700; margin-top: 2px; }
.lsum .s.green { color: var(--green-bright); }
@media (max-width: 760px) { .live-summary { grid-template-columns: repeat(2, 1fr); } }

.live-cols { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .live-cols { grid-template-columns: 1fr; } }
.live-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.live-card { padding: 0; overflow: hidden; }
.live-card-head {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 20px; border-bottom: 1px solid var(--border-faint);
  font-size: 12px; font-weight: 700; color: var(--blue); letter-spacing: 0.08em;
}
.live-card-head .ic { display: inline-flex; }
.lc-count { margin-left: auto; padding: 2px 9px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 11px; font-family: var(--font-mono); }

/* positions table */
.pos-table-wrap { overflow-x: auto; }
.pos-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pos-table thead th {
  text-align: left; font-size: 9.5px; font-weight: 700; color: var(--text-dim);
  letter-spacing: 0.08em; padding: 10px 14px; border-bottom: 1px solid var(--divider);
  white-space: nowrap;
}
.pos-table thead th.r { text-align: right; }
.pos-table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--divider); vertical-align: middle; }
.pos-table tbody tr:last-child td { border-bottom: 0; }
.pos-table tbody tr:hover td { background: rgba(63,123,255,0.04); }
.pos-table td.r { text-align: right; }
.pos-agent { font-size: 18px; }
.pos-ticker { font-weight: 700; color: var(--text); font-size: 13px; }
.pos-occ { font-size: 10.5px; color: var(--text-dim); font-family: var(--font-mono); margin-top: 1px; }
.dir-chip { padding: 3px 8px; border-radius: 5px; font-size: 10px; font-weight: 800; letter-spacing: 0.04em; }
.dir-chip.long { background: rgba(16,185,129,0.14); color: var(--green-bright); border: 1px solid rgba(16,185,129,0.3); }
.dir-chip.short { background: rgba(239,68,68,0.14); color: var(--red-bright); border: 1px solid rgba(239,68,68,0.3); }
.pos-pnlpct { font-size: 10.5px; margin-top: 1px; }
.pos-st { font-size: 11px; }

/* executions */
.exec-list { list-style: none; margin: 0; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.exec-item {
  display: grid; grid-template-columns: 84px 24px 58px 1fr auto;
  align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
}
.exec-item:hover { background: rgba(63,123,255,0.04); }
.exec-time { font-size: 11px; color: var(--text-dim); }
.exec-agent { font-size: 16px; }
.exec-action { font-size: 10px; font-weight: 800; letter-spacing: 0.04em; padding: 3px 7px; border-radius: 5px; text-align: center; }
.exec-action.buy { background: rgba(16,185,129,0.14); color: var(--green-bright); }
.exec-action.sell { background: rgba(239,68,68,0.14); color: var(--red-bright); }
.exec-action.trail { background: rgba(63,123,255,0.14); color: var(--blue); }
.exec-action.reject { background: rgba(100,116,139,0.14); color: var(--text-muted); }
.exec-detail { font-size: 12px; color: var(--text); min-width: 0; }
.exec-detail .dim { color: var(--text-dim); font-family: var(--font-mono); font-size: 11px; }
.exec-status { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.exec-status.filled { color: var(--green-bright); }
.exec-status.rejected { color: var(--text-muted); }
.exec-status.adjusted { color: var(--blue); }
@media (max-width: 600px) { .exec-item { grid-template-columns: 1fr auto; } .exec-time, .exec-agent { display: none; } }

/* ladders */
.ladders-card { position: sticky; top: 90px; }
.ladders-sub { font-size: 11px; color: var(--text-dim); margin: 0; padding: 12px 20px 0; line-height: 1.5; }
.ladder-list { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; max-height: 560px; overflow-y: auto; }
.ladder { background: rgba(8,12,33,0.5); border: 1px solid var(--border-faint); border-radius: 10px; padding: 12px 14px; }
.ladder.triggered { border-left: 3px solid var(--green-bright); }
.ladder.watching { border-left: 3px solid var(--amber); }
.ladder.idle { border-left: 3px solid rgba(100,116,139,0.5); opacity: 0.7; }
.ladder-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.ladder-id { font-size: 12.5px; color: var(--text); }
.ladder-id .dim { color: var(--text-dim); font-size: 11px; }
.ladder-status { font-size: 9.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 8px; border-radius: 5px; }
.ladder-status.triggered { background: rgba(16,185,129,0.16); color: var(--green-bright); }
.ladder-status.watching { background: rgba(240,198,116,0.16); color: var(--amber); }
.ladder-status.idle { background: rgba(100,116,139,0.14); color: var(--text-muted); }
.ladder-stages { display: flex; flex-direction: column; gap: 6px; }
.stage { display: flex; align-items: center; gap: 8px; font-size: 11.5px; }
.stage-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; border: 1.5px solid; }
.stage.passed .stage-dot { background: var(--green-bright); border-color: var(--green-bright); box-shadow: 0 0 5px var(--green-bright); }
.stage.passed .stage-name { color: var(--text); }
.stage.watching .stage-dot { background: var(--amber); border-color: var(--amber); animation: pulse 1.5s ease infinite; }
.stage.watching .stage-name { color: var(--amber); }
.stage.pending .stage-dot { background: transparent; border-color: rgba(100,116,139,0.5); }
.stage.pending .stage-name { color: var(--text-dim); }
.stage.failed .stage-dot { background: var(--red-bright); border-color: var(--red-bright); }
.stage.failed .stage-name { color: var(--red-bright); }
.stage.skipped .stage-dot { background: transparent; border-color: rgba(100,116,139,0.3); border-style: dashed; }
.stage.skipped .stage-name { color: var(--text-faint, #4a5878); text-decoration: line-through; }

/* ════ BROKER PILL — variants ════ */
.broker-pill-connected {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 7px; border: 0;
  background: rgba(16,185,129,0.10); border: 1px solid rgba(16,185,129,0.28);
  color: var(--green-bright); font-size: 11.5px; font-weight: 700;
  white-space: nowrap; cursor: pointer;
  transition: background .15s;
}
.broker-pill-connected:hover { background: rgba(16,185,129,0.18); }
.broker-pill-connected .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green-bright); box-shadow: 0 0 6px var(--green-bright); }
.broker-pill-disconnected {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 7px;
  background: rgba(63,123,255,0.10); border: 1px solid rgba(63,123,255,0.28);
  color: var(--blue); font-size: 11.5px; font-weight: 700;
  white-space: nowrap; cursor: pointer;
  transition: background .15s;
}
.broker-pill-disconnected:hover { background: rgba(63,123,255,0.18); }

/* ════ PAPER / LIVE MODE SWITCH ════ */
.mode-switch {
  display: inline-flex; gap: 2px; padding: 3px;
  background: rgba(8,12,33,0.7); border: 1px solid var(--border-faint); border-radius: 9px;
}
.mode-btn {
  padding: 5px 13px; border: 0; background: transparent;
  color: var(--text-muted); font-size: 11.5px; font-weight: 700; border-radius: 6px;
  transition: background .15s, color .15s;
}
.mode-btn.active { background: var(--blue-soft); color: var(--blue); }
.mode-btn.active.live { background: rgba(16,185,129,0.18); color: var(--green-bright); }
.mode-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ════ BROKER MODAL ════ */
.broker-modal {
  width: 100%; max-width: 440px;
  background: linear-gradient(180deg, #0d1230, #0a0e22);
  border: 1px solid var(--card-border-strong, rgba(63,123,255,0.25));
  border-radius: 16px;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.85);
  animation: slideUp .2s cubic-bezier(0.16,1,0.3,1);
  align-self: center;
  overflow: hidden;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0.6; } to { transform: translateY(0); opacity: 1; } }
/* Center modal vertically in overlay */
.drawer-overlay { align-items: center; justify-content: center; }
/* For the config drawer specifically, keep it right-aligned */
.drawer-overlay:has(.drawer) { justify-content: flex-end; align-items: stretch; }

.broker-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border-faint);
}
.broker-modal-title { font-size: 15px; font-weight: 700; color: var(--text); }
.broker-modal-body { padding: 20px 22px; }
.broker-modal-lead { font-size: 13px; color: var(--text-muted); margin: 0 0 18px; line-height: 1.55; }

.broker-adapter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.broker-adapter-card {
  padding: 18px 16px; border-radius: 12px; border: 1px solid var(--border);
  background: rgba(8,12,33,0.5); text-align: left; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.broker-adapter-card:hover { border-color: rgba(63,123,255,0.45); background: rgba(63,123,255,0.08); }
.bac-name { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.bac-desc { font-size: 11.5px; color: var(--text-dim); }

.broker-back {
  background: none; border: 0; color: var(--blue); font-size: 12px; font-weight: 700;
  cursor: pointer; padding: 0 0 14px; display: block;
}
.broker-back:hover { color: var(--text); }
.broker-loading { text-align: center; color: var(--text-dim); padding: 24px 0; font-size: 13px; }

.tdr-form { display: flex; flex-direction: column; gap: 10px; }
.tdr-section-label { font-size: 10px; font-weight: 700; color: var(--blue); letter-spacing: 0.08em; text-transform: uppercase; }
.tdr-field { display: flex; flex-direction: column; gap: 4px; }
.tdr-field span { font-size: 11px; font-weight: 600; color: var(--text-dim); }
.tdr-input {
  height: 38px; padding: 0 12px; border-radius: 8px;
  background: rgba(8,12,33,0.7); border: 1px solid var(--border-faint);
  color: var(--text); font-size: 13px; outline: none;
}
.tdr-input:focus { border-color: rgba(63,123,255,0.5); box-shadow: 0 0 0 3px rgba(63,123,255,0.1); }
.tdr-result { padding: 10px 14px; border-radius: 8px; font-size: 12px; font-weight: 600; margin-top: 4px; }
.tdr-result.ok { background: rgba(16,185,129,0.12); color: var(--green-bright); border: 1px solid rgba(16,185,129,0.28); }
.tdr-result.err { background: rgba(239,68,68,0.12); color: var(--red-bright); border: 1px solid rgba(239,68,68,0.28); }
.tdr-actions { display: flex; gap: 8px; margin-top: 6px; }
.tdr-actions .ac-btn { flex: 1; height: 40px; }

/* ════ CONFIG DRAWER — real backend additions ════ */
.cfg-coming-soon {
  text-align: center; padding: 32px 16px;
  color: var(--text-dim); font-size: 13px; line-height: 1.6;
  background: rgba(8,12,33,0.4); border: 1px dashed var(--border-faint);
  border-radius: 10px; margin-bottom: 16px;
}
.cfg-load-err {
  padding: 12px 16px; margin-bottom: 14px;
  background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.25);
  border-radius: 8px; color: var(--red-bright); font-size: 12.5px;
}
.drawer-subcta-active {
  background: rgba(16,185,129,0.07);
  border-color: rgba(16,185,129,0.28);
}

.cfg-control-wrap { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.cfg-save-indicator {
  width: 14px; font-size: 11px; font-weight: 700; text-align: center; flex-shrink: 0;
  transition: color .2s;
}
.cfg-save-indicator.saving { color: var(--text-dim); }
.cfg-save-indicator.saved  { color: var(--green-bright); }
.cfg-save-indicator.error  { color: var(--red-bright); }

.cfg-select {
  height: 32px; padding: 0 28px 0 10px;
  background: rgba(8,12,33,0.6) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2364748b'><path d='M7 10l5 5 5-5z'/></svg>") right 6px center/12px no-repeat;
  border: 1px solid var(--border-faint); border-radius: 7px;
  color: var(--text); font-size: 12px; font-weight: 600; appearance: none; outline: none; cursor: pointer;
}
.cfg-select:disabled { opacity: 0.45; cursor: not-allowed; }

.cfg-text-input {
  height: 32px; padding: 0 10px; width: 120px;
  background: rgba(8,12,33,0.6); border: 1px solid var(--border-faint);
  border-radius: 7px; color: var(--text); font-size: 12px; outline: none;
}
.cfg-text-input:focus { border-color: rgba(63,123,255,0.5); }
.cfg-text-input:disabled { opacity: 0.45; }

.cfg-pause-btn { color: var(--red-bright); border-color: rgba(239,68,68,0.28); }
.cfg-pause-btn:hover { background: rgba(239,68,68,0.10); }

/* ── Loading skeleton (marketplace first paint) ───────────── */
.sk-card { pointer-events: none; }
.sk-card:hover { transform: none; box-shadow: none; }
.sk {
  border-radius: 7px;
  background: linear-gradient(90deg, rgba(63,123,255,0.08) 25%, rgba(63,123,255,0.18) 50%, rgba(63,123,255,0.08) 75%);
  background-size: 200% 100%;
  animation: sk-shimmer 1.4s ease-in-out infinite;
}
.sk-title { height: 18px; width: 55%; margin-bottom: 12px; }
.sk-line  { height: 11px; width: 90%; margin-bottom: 8px; }
.sk-line.short { width: 65%; }
.sk-chart { height: 56px; width: 100%; margin: 14px 0; }
.sk-row   { height: 30px; width: 100%; }
@keyframes sk-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ════ HOW IT WORKS STRIP ════ */
.hiw { position: relative; display: flex; gap: 24px; flex-wrap: wrap; padding: 16px 18px;
  margin-bottom: 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.hiw-step { display: flex; gap: 10px; align-items: flex-start; }
.hiw-n { width: 22px; height: 22px; border-radius: 50%; background: var(--blue-2); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.hiw-t { font-weight: 600; font-size: 13px; color: var(--text); }
.hiw-d { font-size: 12px; color: var(--text-muted); }
.hiw-x { position: absolute; top: 8px; right: 10px; background: none; border: none; color: var(--text-dim); font-size: 18px; cursor: pointer; line-height: 1; }

/* ════ FAQ ════ */
.faq { margin-top: 28px; }
.faq-h { font-size: 14px; color: var(--text-muted); margin-bottom: 10px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 8px; }
.faq-item summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text); }
.faq-item p { font-size: 12px; color: var(--text-muted); margin: 8px 0 0; }

/* ════ STRATEGY LEADERBOARD ════ */
.lb-card { margin-bottom: 14px; }
.lb-list { display: flex; flex-direction: column; }
.lb-row { display: grid; grid-template-columns: 24px 1fr auto auto; gap: 12px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--divider); font-size: 13px; }
.lb-rank { color: var(--text-dim); font-weight: 700; }
.lb-row:first-child .lb-rank { color: var(--amber); }
.lb-name { color: var(--text); font-weight: 600; }
.lb-ret { font-weight: 700; } .lb-ret .dim { font-weight: 500; color: var(--text-dim); font-size: 11px; }
.lb-pre { color: var(--text-dim); font-size: 11px; font-style: italic; }
.lb-wr { color: var(--text-muted); font-size: 12px; }
.lc-house { margin-left: 8px; font-size: 10px; color: var(--text-dim); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; text-transform: uppercase; letter-spacing: .04em; }

