:root {
  color-scheme: dark;
  --bg-main: #0b1220;
  --bg-panel: #0f172a;
  --bg-panel-soft: #111c2e;
  --border-soft: rgba(148, 163, 184, 0.14);
  --border-accent: rgba(20, 230, 201, 0.35);
  --text-main: #f4f8fd;
  --text-muted: #8fa3bf;
  --text-soft: #d3dded;
  --accent: #14e6c9;
  --accent-blue: #38bdf8;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow-soft: 0 18px 50px rgba(0, 0, 0, 0.24);
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  padding: 0;
  background: #0b1220;
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--text-main);
  font-family: Inter, Manrope, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 20% 0%, rgba(20, 230, 201, 0.12), transparent 32%),
    radial-gradient(circle at 80% 20%, rgba(56, 189, 248, 0.08), transparent 28%),
    var(--bg-main);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.inline-icon,
.nav-icon,
.rail-icon,
.metric-icon,
.action-icon,
.coin-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  line-height: 1;
}

.inline-icon svg,
.nav-icon svg,
.rail-icon svg,
.metric-icon svg,
.action-icon svg,
.coin-icon svg {
  width: 1em;
  height: 1em;
  max-width: 28px;
  max-height: 28px;
  display: block;
}

.terminal-shell {
  min-height: 100vh;
}

.terminal-topbar {
  position: relative;
  top: auto;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(30, 41, 59, 0.9);
  background: rgba(6, 12, 23, 0.92);
  backdrop-filter: blur(16px);
}

.terminal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: rgba(20, 230, 201, 0.1);
  border: 1px solid var(--border-accent);
  box-shadow: 0 0 22px rgba(20, 230, 201, 0.12);
}

.brand-icon svg {
  width: 18px;
  height: 18px;
}

.brand-text {
  font-size: 18px;
  font-weight: 800;
}

.brand-text strong {
  color: var(--accent);
}

.terminal-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
}

.terminal-nav__link,
.terminal-logout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: 14px;
  color: var(--text-soft);
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.01);
  transition: all 0.18s ease;
  white-space: nowrap;
  font-size: 16px;
}

.terminal-nav__link svg,
.terminal-logout svg {
  width: 17px;
  height: 17px;
}

.nav-icon {
  width: 18px;
  height: 18px;
}

.terminal-nav__link:hover,
.terminal-logout:hover {
  border-color: rgba(20, 230, 201, 0.24);
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.76);
}

.terminal-nav__link.is-active {
  color: var(--accent);
  background: rgba(20, 230, 201, 0.08);
  border-color: var(--border-accent);
  box-shadow: inset 0 0 0 1px rgba(20, 230, 201, 0.06);
}

.header-actions {
  padding-left: 12px;
}

.terminal-layout {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  min-height: calc(100vh - 64px);
}

.main-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.terminal-rail {
  width: 72px;
  padding: 14px 0;
  position: sticky;
  top: 64px;
  align-self: start;
  height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border-right: 1px solid rgba(30, 41, 59, 0.9);
  background: rgba(2, 6, 23, 0.45);
}

.rail-link {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: all 0.18s ease;
}

.rail-link svg {
  width: 19px;
  height: 19px;
}

.rail-icon {
  width: 22px;
  height: 22px;
}

.rail-link:hover,
.rail-link.is-active {
  color: var(--accent);
  background: rgba(20, 230, 201, 0.14);
  border-color: var(--border-accent);
  box-shadow: 0 0 22px rgba(20, 230, 201, 0.15);
}

.terminal-content {
  min-width: 0;
}

.dashboard-terminal {
  padding: 12px 28px 10px;
  max-width: 1760px;
}

.flash {
  margin: 18px 28px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(20, 230, 201, 0.1);
  border: 1px solid var(--border-accent);
}

.flash.error {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.28);
}

.dashboard-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
  min-height: 76px;
}

.dashboard-hero__copy,
.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.dashboard-eyebrow {
  margin: 0;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.12em;
  font-size: 11px;
  text-transform: uppercase;
}

.dashboard-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.dashboard-title-row h1,
.hero-title {
  margin: 0;
  font-size: 38px;
  line-height: 0.95;
}

.dashboard-env {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.dashboard-env strong {
  color: var(--accent);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--border-accent);
  font-weight: 700;
  font-size: 11px;
  white-space: nowrap;
}

.status-pill--ok {
  color: var(--accent);
  background: rgba(20, 230, 201, 0.12);
}

.status-pill--warn {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 2px;
  flex-wrap: nowrap;
  min-width: 0;
}

.hero-actions form {
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
  font-size: 14px;
  font-weight: 700;
}

.btn .action-icon {
  margin-right: 8px;
  flex-shrink: 0;
}

.btn svg {
  width: 15px;
  height: 15px;
}

.action-icon {
  width: 16px;
  height: 16px;
}

.btn-primary {
  min-width: 166px;
  background: linear-gradient(135deg, #14e6c9, #38bdf8);
  color: #02111c;
  border: none;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(20, 230, 201, 0.18);
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.75);
  color: #e2e8f0;
  border: 1px solid var(--border-soft);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-secondary:hover {
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.12);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi-card,
.panel {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.68));
  border: 1px solid var(--border-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.kpi-card {
  height: 108px;
  min-height: 108px;
  padding: 12px 14px;
  border-radius: 15px;
  overflow: hidden;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0;
}

.kpi-card:hover,
.panel:hover {
  transform: translateY(-2px);
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: var(--shadow-soft);
}

.kpi-icon {
  width: 24px;
  height: 24px;
  border-radius: 9px;
  background: rgba(20, 230, 201, 0.12);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.kpi-icon svg {
  width: 16px;
  height: 16px;
}

.metric-icon {
  width: 24px;
  height: 24px;
  border-radius: 9px;
}

.metric-icon svg {
  width: 13px;
  height: 13px;
}

.kpi-icon--blue {
  color: var(--accent-blue);
  background: rgba(56, 189, 248, 0.12);
}

.kpi-icon--amber {
  color: var(--warning);
  background: rgba(245, 158, 11, 0.12);
}

.kpi-icon--violet {
  color: #8b5cf6;
  background: rgba(139, 92, 246, 0.12);
}

.kpi-icon--green,
.kpi-icon--cyan {
  color: var(--success);
  background: rgba(34, 197, 94, 0.12);
}

.kpi-label {
  color: var(--text-muted);
  font-size: 10px;
  margin-bottom: 8px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.kpi-unit {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  line-height: 1;
  color: #d8e2f0;
}

.kpi-helper {
  margin-top: 6px;
  font-size: 10px;
  line-height: 1;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-helper.positive {
  color: #28d17c;
}

.kpi-helper.negative {
  color: var(--text-muted);
}

.positive,
.value-positive {
  color: var(--success);
}

.negative,
.value-negative {
  color: #f87171;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(430px, 0.95fr);
  gap: 14px;
  margin-bottom: 14px;
  align-items: stretch;
}

.bottom-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.8fr 1.15fr;
  gap: 14px;
  margin-bottom: 6px;
}

.panel {
  border-radius: 16px;
  padding: 16px 18px;
  overflow: hidden;
}

.equity-panel {
  height: 270px;
  min-height: 270px;
}

.signals-panel {
  height: 270px;
  min-height: 270px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.panel-header h2,
.panel-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
  font-weight: 800;
}

.panel-header p,
.panel-subtitle {
  margin: 6px 0 12px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.25;
}

.big-accent-value {
  margin-top: 6px;
  font-size: 21px;
  font-weight: 700;
  color: var(--accent);
}

.big-accent-value,
.equity-value {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.big-accent-value span {
  font-size: 12px;
}

.chart-tabs {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
}

.chart-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: rgba(2, 6, 23, 0.24);
  color: var(--text-muted);
  font-size: 12px;
}

.chart-tab.is-active,
.chart-tab:hover {
  color: var(--accent);
  border-color: var(--border-accent);
  background: rgba(20, 230, 201, 0.1);
}

.chart-wrap,
.chart-container {
  height: 158px;
  padding-top: 2px;
  border-radius: 12px;
  background:
    linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    rgba(2, 6, 23, 0.2);
  background-size: 100% 34px, 72px 100%, auto;
  overflow: hidden;
}

.chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.signals-list {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: hidden;
}

.signal-row {
  display: grid;
  grid-template-columns: 88px minmax(96px, 1fr) 34px minmax(110px, 1fr) 52px 88px;
  align-items: center;
  gap: 10px;
  height: 44px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.28);
  border: 1px solid var(--border-soft);
  overflow: hidden;
}

.signal-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-long {
  color: var(--accent);
  background: rgba(20, 230, 201, 0.12);
  border: 1px solid rgba(20, 230, 201, 0.25);
}

.badge-short {
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-filled {
  color: var(--success);
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.signal-pair {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  min-width: 0;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.signal-time,
.signal-strategy {
  color: var(--text-soft);
  min-width: 0;
}

.signal-strategy {
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.signal-time {
  font-size: 12px;
  line-height: 1;
  min-width: 0;
  white-space: nowrap;
  text-align: center;
}

.coin-badge {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  background: rgba(20, 230, 201, 0.08);
  border: 1px solid rgba(20, 230, 201, 0.22);
  font-size: 9px;
  font-weight: 700;
}

.coin-icon {
  width: 28px;
  height: 28px;
}

.signal-status {
  width: 100%;
  max-width: 100%;
}

.signal-empty {
  border-radius: 12px;
  padding: 16px 12px;
  color: var(--text-muted);
  background: rgba(2, 6, 23, 0.22);
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.runtime-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.runtime-card {
  height: 66px;
  min-height: 66px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.25);
  border: 1px solid var(--border-soft);
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
}

.runtime-label,
.scanner-label {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1;
  margin-bottom: 0;
}

.runtime-value {
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.runtime-value.link {
  color: var(--accent);
}

.strategy-block {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.donut {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  position: relative;
  flex: 0 0 auto;
}

.donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 12px;
  background: var(--bg-panel);
  border-radius: 50%;
}

.donut-center {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.donut-center strong {
  font-size: 18px;
}

.donut-center span {
  color: var(--text-muted);
  font-size: 11px;
}

.strategy-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.legend-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
  font-size: 13px;
}

.legend-row span:nth-child(2),
.strategy-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.15;
}

.strategy-count {
  font-size: 13px;
  font-weight: 800;
  color: #eaf1fb;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.legend-dot--1 { background: var(--accent); }
.legend-dot--2 { background: var(--warning); }
.legend-dot--3 { background: #84cc16; }

.scanner-content {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) 72px;
  gap: 12px;
  align-items: center;
  text-align: left;
  margin-top: 12px;
}

.scanner-metric {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.scanner-number {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.scanner-number--accent,
.scanner-pill {
  color: var(--accent);
}

.scanner-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(20, 230, 201, 0.1);
  border: 1px solid rgba(20, 230, 201, 0.25);
  font-size: 11px;
  font-weight: 800;
  width: fit-content;
}

.scanner-meta {
  color: var(--text-main);
  font-size: 18px;
  line-height: 1;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.radar-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}

.radar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(20, 230, 201, 0.85) 0 6px, transparent 7px),
    repeating-radial-gradient(circle, rgba(20, 230, 201, 0.22) 0 1px, transparent 1px 24px);
}

.status-footer {
  height: 20px;
  margin-top: 2px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  color: var(--text-muted);
  font-size: 12px;
  flex-wrap: wrap;
}

.bottom-grid .panel {
  height: 176px;
  min-height: 176px;
}

.panel > *,
.kpi-card > *,
.signal-row > *,
.runtime-card > *,
.strategy-block > *,
.legend-row > *,
.scanner-content > *,
.scanner-metric > * {
  min-width: 0;
}

.status-footer .ok {
  color: var(--success);
}

@media (max-width: 1439px) {
  .kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .kpi-card:nth-child(5) {
    grid-column: 1;
  }

  .kpi-card:nth-child(6) {
    grid-column: 2;
  }

  .kpi-card:nth-child(7) {
    grid-column: 3;
  }
}

@media (max-width: 1280px) {
  .main-grid,
  .bottom-grid {
    grid-template-columns: 1fr;
  }

  .signals-panel {
    min-height: auto;
  }

  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .kpi-card:nth-child(5),
  .kpi-card:nth-child(6),
  .kpi-card:nth-child(7) {
    grid-column: auto;
  }
}

@media (max-width: 800px) {
  .terminal-topbar {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .terminal-nav {
    justify-content: flex-start;
  }

  .terminal-layout {
    grid-template-columns: 1fr;
  }

  .terminal-rail {
    width: 100%;
    flex-direction: row;
    justify-content: flex-start;
    padding: 12px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(30, 41, 59, 0.9);
  }

  .dashboard-terminal {
    padding: 16px;
  }

  .dashboard-hero {
    flex-direction: column;
  }

  .hero-actions,
  .chart-tabs {
    flex-wrap: wrap;
  }

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

  .signal-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    padding: 10px;
  }

  .runtime-grid,
  .scanner-content {
    grid-template-columns: 1fr;
  }

  .strategy-block {
    grid-template-columns: 1fr;
    justify-items: start;
  }
}

@media (max-width: 640px) {
  .dashboard-title-row h1 {
    font-size: 2.15rem;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

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

  .signal-status {
    justify-self: start;
  }

  .panel-header {
    flex-direction: column;
  }
}

.open-trades-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 14px 28px 16px;
  max-width: 1760px;
}

.open-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(420px, 0.9fr);
  gap: 20px;
  align-items: start;
  background:
    radial-gradient(circle at top right, rgba(20, 230, 201, 0.08), transparent 32%),
    linear-gradient(180deg, rgba(7, 16, 24, 0.94), rgba(11, 22, 33, 0.92));
}

.open-hero__copy {
  min-width: 0;
}

.open-hero__eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.open-hero__title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.open-hero__title-row h1 {
  margin: 0;
  font-size: 38px;
  line-height: 0.95;
  color: #f8fafc;
}

.open-live-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.28);
  color: #22c55e;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.open-live-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: currentColor;
}

.open-hero__subtitle {
  margin: 0;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.45;
  max-width: 720px;
}

.open-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(3, minmax(140px, 1fr)) auto;
  gap: 14px;
  min-width: 0;
}

.open-filter {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  height: 54px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: rgba(10, 19, 30, 0.92);
}

.open-filter input,
.open-filter select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #e5edf8;
  font-size: 14px;
}

.open-filter select {
  appearance: none;
  cursor: pointer;
}

.open-filter--search {
  padding-left: 48px;
}

.open-filter__icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.open-filter__icon svg {
  width: 18px;
  height: 18px;
}

.open-refresh-btn {
  min-width: 132px;
  justify-content: center;
  border-color: rgba(22, 242, 194, 0.45);
  color: #16f2c2;
}

.open-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.open-summary-card {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background:
    linear-gradient(180deg, rgba(16, 28, 40, 0.98), rgba(16, 28, 40, 0.82));
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.open-summary-card__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.open-summary-card__icon svg {
  width: 28px;
  height: 28px;
}

.open-summary-card__icon--blue {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.14);
}

.open-summary-card__icon--green {
  color: #61ea7a;
  background: rgba(34, 197, 94, 0.15);
}

.open-summary-card__icon--red {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
}

.open-summary-card__icon--teal {
  color: #4dd7ff;
  background: rgba(56, 189, 248, 0.12);
}

.open-summary-card__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.open-summary-card__label {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.2;
  margin-bottom: 8px;
}

.open-summary-card__value {
  font-size: 26px;
  line-height: 1;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 8px;
  white-space: nowrap;
}

.open-summary-card__meta {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.25;
}

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

.trade-card-v2 {
  min-width: 0;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background:
    radial-gradient(circle at top right, rgba(22, 242, 194, 0.04), transparent 28%),
    linear-gradient(180deg, rgba(16, 28, 40, 0.98), rgba(16, 28, 40, 0.86));
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.trade-card-v2:hover {
  transform: translateY(-2px);
  border-color: rgba(22, 242, 194, 0.28);
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.28),
    0 0 26px rgba(22, 242, 194, 0.06);
}

.trade-card-v2__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  margin-bottom: 14px;
}

.trade-card-v2__asset {
  display: flex;
  gap: 14px;
  min-width: 0;
}

.trade-card-v2__coin {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #f8fafc;
  font-size: 13px;
  font-weight: 800;
}

.trade-card-v2__title-group {
  min-width: 0;
}

.trade-card-v2__symbol-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin-bottom: 8px;
}

.trade-card-v2__symbol {
  margin: 0;
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
  color: #f8fafc;
  white-space: nowrap;
}

.trade-card-v2__side {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.side-long {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.side-short {
  color: #f87171;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.side-neutral {
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.trade-card-v2__meta-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, auto);
  gap: 14px;
  min-width: 0;
}

.trade-card-v2__meta-item {
  min-width: 0;
}

.trade-card-v2__meta-item span,
.trade-metric span,
.trade-card-v2__footer-item span {
  display: block;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.2;
}

.trade-card-v2__meta-item strong,
.trade-card-v2__footer-item strong {
  color: #f8fafc;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copy-id-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-left: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.copy-id-btn svg {
  width: 16px;
  height: 16px;
}

.copy-id-btn.is-copied {
  color: #16f2c2;
}

.trade-card-v2__pnl {
  display: grid;
  justify-items: end;
  gap: 3px;
  min-width: 120px;
}

.trade-card-v2__pnl span {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.2;
}

.trade-card-v2__pnl strong {
  font-size: 18px;
  line-height: 1.1;
  font-weight: 800;
  white-space: nowrap;
}

.trade-card-v2__pnl small {
  font-size: 13px;
  font-weight: 700;
}

.trade-card-v2__sparkline {
  width: 126px;
  height: 30px;
}

.trade-card-v2__sparkline svg {
  display: block;
  width: 100%;
  height: 100%;
}

.pnl-positive {
  color: #22c55e;
}

.pnl-negative {
  color: #ef4444;
}

.pnl-neutral {
  color: #cbd5e1;
}

.trade-metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(10, 18, 28, 0.54);
}

.trade-metric {
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid rgba(148, 163, 184, 0.1);
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.trade-metric:nth-child(5n) {
  border-right: 0;
}

.trade-metric:nth-last-child(-n + 5) {
  border-bottom: 0;
}

.trade-metric strong {
  display: block;
  min-width: 0;
  color: #f8fafc;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trade-metric.stop-loss strong {
  color: #f87171;
}

.trade-metric.take-profit strong {
  color: #22c55e;
}

.value-empty {
  color: #64748b !important;
}

.trade-card-v2__footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-top: 14px;
}

.trade-card-v2__footer-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.trade-card-v2__footer-item {
  min-width: 0;
}

.trade-card-v2__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.btn-details,
.btn-edit,
.btn-close {
  height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid transparent;
  background: rgba(15, 23, 42, 0.7);
}

.btn-details {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
}

.btn-edit {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.1);
}

.btn-close {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
}

.open-state-panel {
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 26px;
}

.open-state-panel h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1;
}

.open-state-panel p {
  margin: 0;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.5;
}

.open-state-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.open-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 2px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
  font-size: 13px;
  flex-wrap: wrap;
}

.open-status-bar__left,
.open-status-bar__right {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.open-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.35);
}

.open-status-connected {
  color: #22c55e;
}

.trade-modal {
  width: min(460px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 20px;
  background: #0f172a;
  color: #f8fafc;
}

.trade-modal::backdrop {
  background: rgba(2, 6, 23, 0.72);
}

.trade-modal__content {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.trade-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.trade-modal__header h3 {
  margin: 0;
  font-size: 22px;
}

.trade-modal__close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.12);
  color: #f8fafc;
  cursor: pointer;
}

.trade-modal__subtitle,
.trade-modal__message {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.45;
}

.trade-modal__field {
  display: grid;
  gap: 8px;
}

.trade-modal__field span {
  color: var(--text-secondary);
  font-size: 13px;
}

.trade-modal__field input {
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(2, 6, 23, 0.45);
  color: #f8fafc;
}

.trade-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 1439px) {
  .open-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1280px) {
  .open-trades-page {
    padding-inline: 16px;
  }

  .open-hero {
    grid-template-columns: 1fr;
  }

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

  .open-summary-grid,
  .trades-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .trade-card-v2__header,
  .trade-card-v2__footer {
    grid-template-columns: 1fr;
  }

  .trade-card-v2__pnl,
  .trade-card-v2__actions {
    justify-items: start;
    justify-content: flex-start;
  }

  .trade-card-v2__meta-line,
  .trade-card-v2__footer-meta {
    grid-template-columns: 1fr;
  }

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

  .trade-metric:nth-child(5n) {
    border-right: 1px solid rgba(148, 163, 184, 0.1);
  }

  .trade-metric:nth-child(2n) {
    border-right: 0;
  }

  .trade-metric:nth-last-child(-n + 5) {
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  }

  .trade-metric:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}

@media (max-width: 720px) {
  .open-filters {
    grid-template-columns: 1fr;
  }

  .open-summary-grid {
    grid-template-columns: 1fr;
  }

  .trade-card-v2 {
    padding: 16px;
  }

  .trade-card-v2__symbol-row {
    flex-wrap: wrap;
  }
}

.closed-trades-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 14px 28px 18px;
  max-width: 1760px;
}

.closed-page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: start;
  padding: 28px 32px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 10% 0%, rgba(22, 242, 194, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(8, 19, 29, 0.96));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.closed-page-kicker,
.closed-section-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #16f2c2;
}

.closed-section-kicker--warning {
  color: #fbbf24;
}

.closed-page-title {
  margin: 8px 0 0;
  font-size: 42px;
  line-height: 1;
  font-weight: 850;
  color: #f8fafc;
}

.closed-page-subtitle {
  margin: 12px 0 0;
  max-width: 720px;
  color: #94a3b8;
  font-size: 15px;
  line-height: 1.45;
}

.closed-page-hero__stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.hero-stat-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
}

.hero-stat-chip strong {
  color: #f8fafc;
  font-size: 14px;
}

.hero-stat-chip span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-stat-chip--warning {
  border-color: rgba(251, 191, 36, 0.26);
  background: rgba(251, 191, 36, 0.08);
  color: #fcd34d;
}

.closed-page-hero__actions {
  display: grid;
  gap: 14px;
  justify-items: end;
}

.closed-page-action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.closed-page-action-row form {
  margin: 0;
}

.closed-page-sync-note {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
  font-size: 13px;
}

.closed-page-sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
}

.closed-warning-banner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  padding: 18px 20px;
  border: 1px solid rgba(251, 191, 36, 0.24);
  background:
    radial-gradient(circle at 0% 0%, rgba(251, 191, 36, 0.10), transparent 30%),
    rgba(15, 23, 42, 0.8);
}

.closed-warning-banner__icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.10);
}

.closed-warning-banner__icon svg {
  width: 20px;
  height: 20px;
}

.closed-warning-banner strong {
  display: block;
  color: #f8fafc;
  font-size: 15px;
}

.closed-warning-banner p {
  margin: 6px 0 0;
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.45;
}

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

.closed-summary-card {
  min-width: 0;
  min-height: 132px;
  padding: 18px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012)),
    #101c28;
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.closed-summary-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.closed-summary-card__icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.closed-summary-card__icon svg {
  width: 18px;
  height: 18px;
}

.closed-summary-card__icon--slate {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.14);
}

.closed-summary-card__icon--green {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.14);
}

.closed-summary-card__icon--violet {
  color: #c084fc;
  background: rgba(192, 132, 252, 0.14);
}

.closed-summary-card__icon--amber {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
}

.closed-summary-card__icon--teal {
  color: #2dd4bf;
  background: rgba(45, 212, 191, 0.14);
}

.closed-summary-card__icon--warning {
  color: #fb923c;
  background: rgba(251, 146, 60, 0.14);
}

.closed-summary-card__label {
  font-size: 13px;
  color: #94a3b8;
  min-width: 0;
}

.closed-summary-card__value {
  display: block;
  margin-top: 14px;
  font-size: 28px;
  font-weight: 850;
  color: #f8fafc;
  white-space: nowrap;
}

.closed-summary-card__value--fees {
  color: #fbbf24;
}

.closed-summary-card__note {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: #64748b;
}

.closed-summary-card__progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.closed-summary-ring {
  --progress: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #101c28 56%, transparent 58%),
    conic-gradient(#22c55e calc(var(--progress) * 1%), rgba(148,163,184,0.15) 0);
}

.closed-analytics-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: stretch;
}

.closed-analytics-band__title {
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 800;
  color: #f8fafc;
}

.closed-strategy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.closed-strategy-card,
.closed-edge-card {
  position: relative;
  min-width: 0;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(255,255,255,0.02);
}

.closed-strategy-card__accent {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  border-radius: 16px 16px 0 0;
  background: rgba(148, 163, 184, 0.24);
}

.closed-strategy-card__accent--positive {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.9), rgba(45, 212, 191, 0.7));
}

.closed-strategy-card__accent--negative {
  background: linear-gradient(90deg, rgba(248, 113, 113, 0.88), rgba(251, 146, 60, 0.72));
}

.closed-strategy-card__accent--neutral {
  background: rgba(148, 163, 184, 0.3);
}

.closed-strategy-card h3,
.closed-edge-card h3 {
  margin: 0 0 14px;
  font-size: 16px;
}

.closed-strategy-card__meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.closed-strategy-card__meta-grid span,
.closed-edge-card small,
.local-trade-card__meta span,
.local-trade-card__status-row span,
.closed-trade-card__grid span {
  display: block;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.2;
}

.closed-strategy-card__meta-grid strong,
.closed-edge-card strong,
.local-trade-card__meta strong,
.closed-trade-card__grid strong {
  display: block;
  margin-top: 4px;
  color: #f8fafc;
  font-size: 14px;
  line-height: 1.3;
}

.closed-best-worst {
  display: grid;
  gap: 12px;
}

.closed-edge-card--best {
  border-color: rgba(34, 197, 94, 0.18);
}

.closed-edge-card--worst {
  border-color: rgba(239, 68, 68, 0.18);
}

.closed-edge-card--alert {
  border-color: rgba(251, 191, 36, 0.22);
}

.closed-audit-panel {
  padding: 18px;
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.closed-audit-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.closed-audit-panel__title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #f8fafc;
}

.closed-audit-panel__subtitle {
  margin: 6px 0 0;
  color: #94a3b8;
  font-size: 13px;
}

.closed-audit-panel__aside {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: #94a3b8;
  font-size: 12px;
}

.closed-audit-panel__aside span {
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.03);
}

.closed-filters-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.closed-filter-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.closed-filter-field span {
  color: #cbd5e1;
  font-size: 12px;
}

.filter-control {
  height: 44px;
  width: 100%;
  padding: 0 14px;
  border-radius: 12px;
  background: #0b1621;
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #f8fafc;
  outline: none;
}

.filter-control:focus {
  border-color: rgba(22, 242, 194, 0.55);
  box-shadow: 0 0 0 3px rgba(22, 242, 194, 0.10);
}

.closed-filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.closed-confirmed-section,
.local-unsynced-section {
  overflow: hidden;
}

.closed-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.closed-section-header h2 {
  margin: 6px 0 0;
  font-size: 18px;
  line-height: 1.2;
}

.closed-section-copy {
  margin: 10px 0 0;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.45;
}

.closed-section-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  color: #cbd5e1;
  font-size: 13px;
}

.closed-view-toggle {
  display: inline-flex;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(2, 6, 23, 0.45);
}

.closed-view-toggle button {
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #cbd5e1;
  cursor: pointer;
}

.closed-view-toggle button.is-active {
  background: rgba(22, 242, 194, 0.14);
  color: #16f2c2;
}

.closed-table-shell {
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(8, 19, 29, 0.64);
}

.closed-table-scroll {
  overflow: auto;
}

.closed-trades-table {
  width: 100%;
  min-width: 1360px;
  border-collapse: collapse;
}

.closed-trades-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 14px 12px;
  background: rgba(9, 18, 28, 0.96);
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.closed-trades-table tbody td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  vertical-align: middle;
  color: #d8e2f0;
  font-size: 13px;
}

.closed-trade-row:hover {
  background: rgba(20, 230, 201, 0.04);
}

.closed-trade-row {
  cursor: pointer;
}

.closed-trade-row:focus,
.closed-trade-card:focus {
  outline: 2px solid rgba(22, 242, 194, 0.44);
  outline-offset: -2px;
}

.cell-date strong {
  display: block;
  color: #f8fafc;
  font-size: 13px;
}

.cell-date span {
  display: block;
  color: #94a3b8;
  font-size: 12px;
}

.pair-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.coin-badge {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.22);
  color: #38bdf8;
  font-weight: 800;
  flex: 0 0 auto;
}

.side-badge,
.status-pill-closed,
.tf-badge,
.confidence-badge,
.status-pill-local {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  white-space: nowrap;
}

.side-long {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.13);
  border: 1px solid rgba(34, 197, 94, 0.32);
}

.side-short {
  color: #f87171;
  background: rgba(239, 68, 68, 0.13);
  border: 1px solid rgba(239, 68, 68, 0.32);
}

.side-neutral {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.status-pill-closed--exchange {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.26);
}

.status-pill-closed--tp {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.28);
}

.status-pill-closed--sl {
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.status-pill-closed--neutral {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.10);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.pnl-cell {
  font-size: 15px;
  font-weight: 850;
  white-space: nowrap;
}

.fee-cell {
  color: #fbbf24;
  white-space: nowrap;
}

.strategy-undefined {
  color: #64748b !important;
}

.tf-badge {
  min-width: 34px;
  background: rgba(148, 163, 184, 0.10);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: #e2e8f0;
}

.confidence-badge--high {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.26);
}

.confidence-badge--medium {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.26);
}

.confidence-badge--low {
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.26);
}

.confidence-badge--n-a,
.confidence-badge--n-a- {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.10);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.order-cell {
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.closed-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.closed-trade-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(255,255,255,0.02);
  cursor: pointer;
}

.closed-trade-card__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.closed-trade-card__sub {
  margin-top: 8px;
  color: #94a3b8;
  font-size: 13px;
}

.closed-trade-card__pnl {
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
}

.closed-trade-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.closed-trade-card__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.local-unsynced-section {
  padding: 22px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 0% 0%, rgba(251, 191, 36, 0.11), transparent 34%),
    #101c28;
  border: 1px solid rgba(251, 191, 36, 0.26);
}

.btn-warning {
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
}

.btn-warning.is-active {
  background: rgba(251, 191, 36, 0.14);
}

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

.local-trade-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(251, 191, 36, 0.18);
  background: rgba(8, 19, 29, 0.52);
}

.local-trade-card__pair-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.local-trade-card__pair-row strong {
  font-size: 22px;
  line-height: 1;
}

.local-trade-card__strategy {
  margin-top: 10px;
  color: #cbd5e1;
  font-size: 14px;
}

.local-trade-card__status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.status-awaiting {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.28);
}

.status-unsynced {
  color: #fb923c;
  background: rgba(251, 146, 60, 0.12);
  border: 1px solid rgba(251, 146, 60, 0.30);
}

.status-sl {
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.28);
}

.status-tp {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.28);
}

.local-trade-card__meta {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.local-trade-card__actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.closed-state-panel {
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 24px;
  border-radius: 18px;
}

.closed-state-panel h2 {
  margin: 0;
  font-size: 26px;
}

.closed-state-panel p {
  margin: 0;
  color: #94a3b8;
  font-size: 15px;
  line-height: 1.5;
}

.closed-state-panel__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.closed-state-panel--subtle {
  padding: 8px 0 0;
}

.trade-detail-drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

.trade-detail-drawer.is-open {
  pointer-events: auto;
}

.trade-detail-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.66);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.trade-detail-drawer.is-open .trade-detail-drawer__backdrop {
  opacity: 1;
}

.trade-detail-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(460px, 100%);
  height: 100%;
  padding: 22px;
  background:
    radial-gradient(circle at 100% 0%, rgba(22, 242, 194, 0.08), transparent 32%),
    #08131d;
  border-left: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: -20px 0 50px rgba(0, 0, 0, 0.36);
  transform: translateX(100%);
  transition: transform 0.22s ease;
  overflow: auto;
}

.trade-detail-drawer.is-open .trade-detail-drawer__panel {
  transform: translateX(0);
}

.trade-detail-drawer__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.trade-detail-drawer__eyebrow {
  margin: 0;
  color: #16f2c2;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.trade-detail-drawer__header h2 {
  margin: 8px 0 0;
  color: #f8fafc;
}

.trade-detail-drawer__close {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: #cbd5e1;
  cursor: pointer;
}

.trade-detail-drawer__close svg {
  width: 18px;
  height: 18px;
}

.trade-detail-drawer__hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.trade-detail-drawer__hero strong {
  color: #f8fafc;
  font-size: 28px;
  line-height: 1;
}

.trade-detail-drawer__hero span {
  font-size: 18px;
  font-weight: 800;
}

.trade-detail-drawer__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.trade-detail-drawer__grid div {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(255, 255, 255, 0.02);
}

.trade-detail-drawer__grid span {
  display: block;
  color: #94a3b8;
  font-size: 12px;
}

.trade-detail-drawer__grid strong {
  display: block;
  margin-top: 6px;
  color: #f8fafc;
  line-height: 1.4;
  word-break: break-word;
}

.trade-detail-drawer__grid-span {
  grid-column: 1 / -1;
}

body.drawer-open {
  overflow: hidden;
}

.strategies-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 14px 28px 18px;
  max-width: 1760px;
  width: 100%;
  overflow-x: hidden;
}

.strategies-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  padding: 28px 32px;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background:
    radial-gradient(circle at 12% 0%, rgba(22, 242, 194, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(8, 19, 29, 0.96));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  min-height: auto;
  height: auto;
  overflow: hidden;
}

.strategies-hero__status {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.strategies-status-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(22, 242, 194, 0.28);
  background: rgba(22, 242, 194, 0.08);
  color: #d9fffa;
}

.strategies-status-chip strong {
  color: #f8fafc;
  font-size: 14px;
}

.strategies-status-chip span {
  color: #9bded0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.strategies-status-chip--muted {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(148, 163, 184, 0.08);
}

.strategies-status-chip--muted span {
  color: #94a3b8;
}

.strategy-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr 2fr;
  gap: 14px;
}

.strategy-summary-card,
.leaders-card {
  min-width: 0;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 18px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012)),
    #101c28;
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.summary-card-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  margin-bottom: 14px;
}

.summary-card-icon svg {
  width: 22px;
  height: 22px;
}

.summary-card-content {
  display: grid;
  gap: 0;
  min-width: 0;
}

.summary-card-icon--blue {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.14);
}

.summary-card-icon--accent {
  color: #16f2c2;
  background: rgba(22, 242, 194, 0.14);
}

.summary-card-icon--warning {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.14);
}

.summary-card-icon--danger {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.14);
}

.summary-card-icon--purple {
  color: #c084fc;
  background: rgba(168, 85, 247, 0.14);
}

.summary-card-label {
  color: #cbd5e1;
  font-size: 14px;
}

.summary-card-value {
  display: block;
  margin-top: 8px;
  color: #f8fafc;
  font-size: 30px;
  font-weight: 850;
}

.summary-card-note {
  display: block;
  margin-top: 6px;
  color: #94a3b8;
  font-size: 12px;
}

.leaders-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.leaders-card__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.leaders-card__row:last-child {
  border-bottom: 0;
}

.leader-label {
  color: #94a3b8;
  font-size: 13px;
}

.leader-value {
  font-size: 15px;
  font-weight: 850;
  text-align: right;
}

.leader-value.good {
  color: #16f2c2;
}

.leader-value.bad {
  color: #ef4444;
}

.strategy-main-grid {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 16px;
  margin-top: 18px;
  align-items: start;
  min-width: 0;
}

.distribution-card,
.strategy-profiles-section,
.unallocated-section {
  padding: 22px;
  border-radius: 22px;
  background: #101c28;
  border: 1px solid rgba(148, 163, 184, 0.16);
  overflow: hidden;
  min-width: 0;
}

.strategies-section-heading h2 {
  margin: 6px 0 0;
  font-size: 22px;
  color: #f8fafc;
}

.section-kicker {
  color: #16f2c2;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.distribution-content {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  margin-top: 20px;
  min-width: 0;
}

.distribution-donut {
  --donut: conic-gradient(#16f2c2 0 50%, #3b82f6 50% 100%);
  position: relative;
  width: 180px !important;
  height: 180px !important;
  min-width: 180px;
  min-height: 180px;
  max-width: 180px !important;
  max-height: 180px !important;
  border-radius: 50%;
  background: var(--donut);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  isolation: isolate;
}

.distribution-donut::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: #08131d;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.08);
}

.distribution-donut--empty {
  background: conic-gradient(rgba(148, 163, 184, 0.16) 0 100%);
}

.distribution-donut__center {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  text-align: center;
  width: 100%;
  height: 100%;
  align-content: center;
  overflow: hidden;
}

.distribution-donut__center strong {
  color: #f8fafc;
  font-size: 40px !important;
  line-height: 1;
  max-width: 100%;
  white-space: nowrap;
}

.distribution-donut__center span {
  margin-top: 6px;
  color: #94a3b8;
  font-size: 12px;
  max-width: 100%;
}

.distribution-list {
  display: grid;
  gap: 2px;
}

.distribution-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.10);
}

.distribution-row:last-child {
  border-bottom: 0;
}

.distribution-name-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.strategy-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.distribution-name {
  color: #cbd5e1;
  font-size: 13px;
}

.distribution-count {
  color: #f8fafc;
  font-weight: 800;
}

.distribution-percent {
  color: #94a3b8;
  font-size: 12px;
}

.strategy-profiles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
  min-width: 0;
}

.strategy-profile-card {
  min-width: 0;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background:
    radial-gradient(circle at 0% 0%, rgba(22, 242, 194, 0.06), transparent 32%),
    rgba(8, 19, 29, 0.58);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
  overflow: hidden;
}

.strategy-profile-card--negative {
  background:
    radial-gradient(circle at 0% 0%, rgba(239, 68, 68, 0.08), transparent 32%),
    rgba(8, 19, 29, 0.58);
}

.strategy-profile-card--no-data {
  background:
    radial-gradient(circle at 0% 0%, rgba(245, 158, 11, 0.08), transparent 32%),
    rgba(8, 19, 29, 0.58);
}

.strategy-profile-card__head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.strategy-profile-card__head h3 {
  margin: 0;
  color: #f8fafc;
  font-size: 18px;
  line-height: 1.2;
}

.strategy-profile-status {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  margin-top: 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  font-size: 12px;
  font-weight: 800;
}

.strategy-profile-status--positive {
  color: #16f2c2;
  background: rgba(22, 242, 194, 0.08);
  border-color: rgba(22, 242, 194, 0.26);
}

.strategy-profile-status--negative {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.22);
}

.strategy-profile-status--neutral {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.22);
}

.strategy-profile-status--no-data {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.22);
}

.strategy-profile-badge {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid rgba(148, 163, 184, 0.18);
}

.strategy-profile-badge--positive {
  border-color: rgba(22, 242, 194, 0.75);
  box-shadow: 0 0 0 4px rgba(22, 242, 194, 0.08);
}

.strategy-profile-badge--negative {
  border-color: rgba(239, 68, 68, 0.75);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.08);
}

.strategy-profile-badge--neutral {
  border-color: rgba(59, 130, 246, 0.72);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.08);
}

.strategy-profile-badge--no-data {
  border-color: rgba(148, 163, 184, 0.4);
}

.strategy-profile-card__metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-top: 16px;
  min-width: 0;
}

.strategy-profile-card__metrics > div {
  padding: 14px 10px 14px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.10);
}

.strategy-profile-card__metrics--top {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.strategy-profile-card__metrics span {
  display: block;
  color: #94a3b8;
  font-size: 12px;
}

.strategy-profile-card__metrics strong {
  display: block;
  margin-top: 6px;
  color: #f8fafc;
  font-size: 15px;
  line-height: 1.35;
}

.unallocated-section {
  background:
    radial-gradient(circle at 0% 0%, rgba(245, 158, 11, 0.10), transparent 34%),
    #101c28;
  border: 1px solid rgba(245, 158, 11, 0.26);
}

.unallocated-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.unallocated-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f8fafc;
  font-size: 20px;
  font-weight: 850;
}

.unallocated-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
}

.unallocated-icon svg {
  width: 18px;
  height: 18px;
}

.unallocated-count {
  display: inline-flex;
  height: 24px;
  min-width: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.13);
  border: 1px solid rgba(245, 158, 11, 0.28);
  font-size: 12px;
  font-weight: 850;
}

.unallocated-meta {
  color: #cbd5e1;
  font-size: 13px;
}

.unallocated-table-wrap {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.10);
}

.unallocated-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.unallocated-table th {
  padding: 12px 14px;
  text-align: left;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
  border-bottom: 1px solid rgba(148, 163, 184, 0.10);
  background: rgba(15, 23, 42, 0.72);
}

.unallocated-table td {
  padding: 14px;
  color: #cbd5e1;
  font-size: 13px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.10);
}

.unallocated-table tr:hover {
  background: rgba(245, 158, 11, 0.045);
}

.unallocated-status {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.28);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.unallocated-cards {
  display: none;
  gap: 12px;
  margin-top: 14px;
}

.strategies-page svg {
  max-width: 220px;
  max-height: 220px;
}

.strategies-page canvas {
  max-width: 220px;
  max-height: 220px;
}

.distribution-donut svg,
.distribution-donut canvas {
  width: 180px !important;
  height: 180px !important;
  min-width: 180px !important;
  min-height: 180px !important;
  max-width: 180px !important;
  max-height: 180px !important;
  display: block;
  flex-shrink: 0;
}

.unallocated-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(245, 158, 11, 0.18);
  background: rgba(8, 19, 29, 0.52);
}

.unallocated-card strong {
  color: #f8fafc;
  font-size: 18px;
}

.unallocated-card__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.unallocated-card__grid span {
  display: block;
  color: #94a3b8;
  font-size: 12px;
}

.unallocated-card__grid b {
  display: block;
  margin-top: 6px;
  color: #f8fafc;
  line-height: 1.35;
}

.strategies-state-panel {
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 24px;
  border-radius: 18px;
}

.strategies-state-panel h2 {
  margin: 0;
  color: #f8fafc;
  font-size: 28px;
}

.strategies-state-panel p {
  margin: 0;
  color: #94a3b8;
  font-size: 15px;
  line-height: 1.5;
}

.strategies-state-panel__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.strategies-state-panel--subtle {
  padding: 8px 0 0;
}

.value-positive {
  color: #16f2c2 !important;
}

.value-negative {
  color: #ef4444 !important;
}

.value-warning {
  color: #f59e0b !important;
}

.value-neutral {
  color: #60a5fa !important;
}

.empty-value {
  color: #64748b !important;
}

@media (max-width: 1400px) {
  .strategy-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .leaders-card {
    grid-column: span 3;
  }

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

@media (max-width: 1180px) {
  .strategies-page {
    padding-inline: 16px;
  }

  .strategies-hero,
  .strategy-main-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .strategy-summary-grid,
  .strategy-profiles-grid,
  .strategy-profile-card__metrics,
  .strategy-profile-card__metrics--top,
  .distribution-content,
  .unallocated-card__grid {
    grid-template-columns: 1fr;
  }

  .leaders-card {
    grid-column: auto;
  }

  .hero-actions,
  .unallocated-header,
  .unallocated-title {
    flex-direction: column;
    align-items: flex-start;
  }

  .distribution-donut {
    margin-inline: auto;
  }

  .unallocated-table-wrap {
    display: none;
  }

  .unallocated-cards {
    display: grid;
  }
}

/* =========================================================
   STRATEGIES PAGE FIX - STOP GIANT SVG/ICON BUG
   ========================================================= */

.strategies-page {
  max-width: 100%;
  overflow-x: hidden;
}

.strategies-page * {
  box-sizing: border-box;
}

.strategies-page svg {
  flex-shrink: 0;
}

.strategies-page .strategy-summary-card svg,
.strategies-page .leaders-card svg,
.strategies-page .strategy-profile-card svg,
.strategies-page .unallocated-section svg,
.strategies-page .btn svg,
.strategies-page .strategies-section-heading svg,
.strategies-page .unallocated-header svg {
  width: 20px !important;
  height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  display: inline-block !important;
}

.strategies-page .summary-card-icon {
  width: 44px !important;
  height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  border-radius: 14px;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
}

.strategies-page .summary-card-icon svg {
  width: 24px !important;
  height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
}

.strategies-page .distribution-donut,
.strategies-page .donut-chart,
.strategies-page .distribution-chart {
  width: 180px !important;
  height: 180px !important;
  max-width: 180px !important;
  max-height: 180px !important;
  min-width: 180px !important;
  min-height: 180px !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
}

.strategies-page .distribution-donut svg,
.strategies-page .distribution-chart svg,
.strategies-page .donut-chart svg,
.strategies-page .distribution-donut canvas,
.strategies-page .distribution-chart canvas,
.strategies-page .donut-chart canvas {
  width: 180px !important;
  height: 180px !important;
  max-width: 180px !important;
  max-height: 180px !important;
}

.strategies-page .strategy-summary-grid,
.strategies-page .strategy-main-grid,
.strategies-page .strategy-profiles-section,
.strategies-page .strategy-profiles-grid,
.strategies-page .distribution-card,
.strategies-page .strategy-summary-card {
  min-width: 0;
  overflow: hidden;
}

.strategies-page .strategy-summary-grid > svg,
.strategies-page .strategy-summary-grid > [data-lucide],
.strategies-page .strategy-summary-grid > .lucide,
.strategies-page .strategy-main-grid > svg,
.strategies-page .strategy-main-grid > [data-lucide],
.strategies-page .strategy-main-grid > .lucide {
  display: none !important;
}

/* ===== STRATEGIES REBUILD V2 / STX ===== */

.stx-page {
  padding: 24px;
  max-width: 100%;
  overflow-x: hidden;
}

.stx-page,
.stx-page * {
  box-sizing: border-box;
}

.stx-page svg {
  width: 20px;
  height: 20px;
  max-width: 20px;
  max-height: 20px;
  flex-shrink: 0;
}

.stx-hero {
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background:
    radial-gradient(circle at 10% 0%, rgba(22, 242, 194, 0.10), transparent 32%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(8, 19, 29, 0.98));
  padding: 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.stx-kicker,
.stx-section-label {
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #16f2c2;
}

.stx-title {
  margin: 14px 0 0;
  color: #f8fafc;
  font-size: 44px;
  line-height: 1;
  font-weight: 850;
}

.stx-description {
  margin: 18px 0 0;
  max-width: 1180px;
  color: #cbd5e1;
  font-size: 16px;
  line-height: 1.55;
}

.stx-updated {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  color: #cbd5e1;
  font-size: 15px;
}

.stx-updated strong {
  color: #f8fafc;
}

.stx-actions {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.stx-inline-form {
  margin: 0;
}

.stx-btn {
  height: 44px;
  padding: 0 18px;
  border-radius: 13px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
  font-weight: 850;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.stx-btn-primary {
  color: #031018;
  background: linear-gradient(180deg, #80e7ff, #5fd2e8);
  border-color: rgba(128, 231, 255, 0.65);
}

.stx-btn-secondary:hover,
.stx-btn-primary:hover {
  filter: brightness(1.04);
}

.stx-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(280px, 1.5fr);
  gap: 14px;
  margin-top: 18px;
}

.stx-summary-card,
.stx-leaders-card,
.stx-panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012)),
    #101c28;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 20px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  min-width: 0;
}

.stx-summary-card,
.stx-leaders-card {
  min-height: 132px;
  padding: 18px;
}

.stx-card-label {
  color: #cbd5e1;
  font-size: 14px;
}

.stx-card-value {
  margin-top: 12px;
  color: #f8fafc;
  font-size: 32px;
  line-height: 1;
  font-weight: 900;
}

.stx-card-note {
  margin-top: 10px;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.35;
}

.stx-good {
  color: #22c55e !important;
}

.stx-bad {
  color: #ef4444 !important;
}

.stx-warning {
  color: #f59e0b !important;
}

.stx-muted-value {
  color: #cbd5e1 !important;
}

.stx-leader-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.10);
}

.stx-leader-row:last-child {
  border-bottom: 0;
}

.stx-leader-row span {
  color: #94a3b8;
  font-size: 13px;
}

.stx-leader-row strong {
  font-size: 14px;
  text-align: right;
}

.stx-main-grid {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 16px;
  margin-top: 18px;
  align-items: start;
}

.stx-panel {
  padding: 22px;
}

.stx-section-title {
  margin: 8px 0 0;
  color: #f8fafc;
  font-size: 20px;
  font-weight: 850;
}

.stx-section-subtitle {
  color: #94a3b8;
  margin: 8px 0 0;
  font-size: 13px;
}

.stx-total-box {
  width: 160px;
  height: 160px;
  border-radius: 999px;
  margin: 22px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle, #101c28 54%, transparent 55%),
    conic-gradient(#16f2c2 0 20%, #3b82f6 20% 96.36%, #f59e0b 96.36% 100%);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.stx-total-box strong {
  color: #f8fafc;
  font-size: 34px;
  font-weight: 900;
}

.stx-total-box span {
  color: #94a3b8;
  font-size: 12px;
}

.stx-dist-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stx-dist-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #cbd5e1;
  font-size: 13px;
}

.stx-dist-top strong {
  color: #f8fafc;
  white-space: nowrap;
}

.stx-progress {
  height: 8px;
  margin-top: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.12);
}

.stx-progress div {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #16f2c2, #3b82f6);
}

.stx-progress-warning div {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.stx-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.stx-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(340px, 1fr));
  gap: 16px;
  margin-top: 18px;
  align-items: start;
}

.stx-profile-card {
  padding: 18px;
  border-radius: 18px;
  background: #0b1621;
  border: 1px solid rgba(148, 163, 184, 0.14);
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.stx-profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.stx-profile-title {
  color: #f8fafc;
  font-size: 17px;
  font-weight: 850;
  min-width: 0;
}

.stx-profile-purpose {
  margin: 8px 0 0;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.55;
  max-width: 56ch;
  min-width: 0;
  word-break: normal;
  overflow-wrap: normal;
}

.stx-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.stx-rule-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.22);
  background: rgba(34, 211, 238, 0.10);
  color: #67e8f9;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
}

.stx-status {
  display: inline-flex;
  height: 26px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.stx-status-positive {
  color: #16f2c2;
  background: rgba(22, 242, 194, 0.12);
  border: 1px solid rgba(22, 242, 194, 0.35);
}

.stx-status-negative {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.stx-status-neutral {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.stx-status-nodata {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.stx-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.10);
  border-left: 1px solid rgba(148, 163, 184, 0.10);
}

.stx-metric {
  padding: 11px;
  border-right: 1px solid rgba(148, 163, 184, 0.10);
  border-bottom: 1px solid rgba(148, 163, 184, 0.10);
  min-width: 0;
}

.stx-metric span {
  display: block;
  color: #94a3b8;
  font-size: 11px;
  margin-bottom: 5px;
}

.stx-metric strong {
  color: #f8fafc;
  font-size: 14px;
  font-weight: 850;
  word-break: break-word;
}

.stx-setup-accordion {
  margin-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.10);
  padding-top: 14px;
}

.stx-setup-accordion summary {
  list-style: none;
}

.stx-setup-accordion summary::-webkit-details-marker {
  display: none;
}

.stx-setup-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  min-width: 0;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.012));
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.stx-setup-toggle-main {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  white-space: nowrap;
}

.stx-label-short {
  display: none;
}

.stx-setup-toggle:hover {
  border-color: rgba(34, 211, 238, 0.28);
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.08), rgba(255,255,255,0.02));
}

.stx-setup-accordion[open] .stx-setup-toggle {
  border-color: rgba(34, 211, 238, 0.26);
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.10), rgba(255,255,255,0.02));
}

.stx-setup-hint {
  color: #67e8f9;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
  min-width: 0;
  flex: 0 0 auto;
}

.stx-setup-body {
  margin-top: 14px;
  min-width: 0;
  overflow: hidden;
}

.stx-setup-intro {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 12px;
}

.stx-setup-note,
.stx-setup-panel,
.stx-setup-meta {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.48);
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.stx-setup-note-label {
  display: block;
  color: #67e8f9;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stx-setup-note p,
.stx-setup-meta p {
  margin: 10px 0 0;
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.6;
  min-width: 0;
  word-break: normal;
  overflow-wrap: normal;
}

.stx-chip-row,
.stx-rule-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  min-width: 0;
}

.stx-rule-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: #dbe7f3;
  font-size: 11px;
  line-height: 1.15;
  max-width: 100%;
  min-width: 0;
  word-break: normal;
  overflow-wrap: normal;
  white-space: normal;
  box-sizing: border-box;
}

.stx-rule-chip-warning {
  border-color: rgba(245, 158, 11, 0.24);
  background: rgba(245, 158, 11, 0.10);
  color: #fbbf24;
  max-width: 140px;
  justify-content: center;
  text-align: center;
}

.stx-setup-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
  min-width: 0;
}

.stx-setup-columns > .stx-setup-panel:first-child {
  grid-column: 1 / -1;
}

.stx-setup-panel-title {
  color: #f8fafc;
  font-size: 14px;
  font-weight: 850;
  min-width: 0;
}

.stx-rule-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
  min-width: 0;
}

.stx-rule-heading {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-width: 0;
}

.stx-setup-footer {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
  min-width: 0;
}

.stx-analytics-accordion {
  margin-top: 12px;
}

.stx-analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.stx-analytics-grid-secondary {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  margin-top: 12px;
}

.stx-mini-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.stx-mini-stat {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.10);
  background: rgba(2, 8, 23, 0.28);
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.stx-mini-stat span,
.stx-config-item span {
  display: block;
  color: #94a3b8;
  font-size: 11px;
  margin-bottom: 6px;
}

.stx-mini-stat strong,
.stx-config-item strong {
  color: #f8fafc;
  font-size: 14px;
  font-weight: 850;
  word-break: normal;
  overflow-wrap: anywhere;
}

.stx-compat-list {
  margin-top: 12px;
}

.stx-compat-row + .stx-compat-row {
  margin-top: 12px;
}

.stx-compat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #cbd5e1;
  font-size: 12px;
}

.stx-compat-head strong {
  color: #67e8f9;
  font-size: 12px;
}

.stx-compat-bar {
  height: 8px;
  margin-top: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  overflow: hidden;
}

.stx-compat-bar div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0ea5e9, #16f2c2);
}

.stx-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.stx-config-item {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.10);
  background: rgba(2, 8, 23, 0.28);
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.stx-table-wrap-compact {
  margin-top: 12px;
}

.stx-table-compact {
  min-width: 0;
}

.stx-table-compact th,
.stx-table-compact td {
  padding: 10px 12px;
  font-size: 12px;
}

.stx-mini-chart {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  min-height: 170px;
  margin-top: 12px;
}

.stx-mini-chart-col {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.stx-mini-chart-col span {
  color: #94a3b8;
  font-size: 11px;
}

.stx-mini-chart-value {
  color: #cbd5e1;
  font-size: 11px;
  text-align: center;
}

.stx-mini-chart-value.is-positive {
  color: #16f2c2;
}

.stx-mini-chart-value.is-negative {
  color: #f87171;
}

.stx-mini-chart-bar {
  display: flex;
  align-items: end;
  justify-content: center;
  width: 100%;
  height: 108px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(2, 8, 23, 0.30);
  border: 1px solid rgba(148, 163, 184, 0.10);
}

.stx-mini-chart-bar div {
  width: 100%;
  border-radius: 999px;
  min-height: 6px;
}

.stx-mini-chart-bar.is-positive div {
  background: linear-gradient(180deg, #16f2c2, #0ea5e9);
}

.stx-mini-chart-bar.is-negative div {
  background: linear-gradient(180deg, #fb7185, #ef4444);
}

.stx-mini-chart-bar.is-empty div {
  background: rgba(148, 163, 184, 0.32);
}

.stx-analytics-copy {
  margin: 12px 0 0;
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.65;
  min-width: 0;
  word-break: normal;
  overflow-wrap: normal;
}

.stx-unallocated {
  margin-top: 18px;
  border-color: rgba(245, 158, 11, 0.26);
  background:
    radial-gradient(circle at 0% 0%, rgba(245, 158, 11, 0.10), transparent 34%),
    #101c28;
}

.stx-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  font-size: 12px;
  vertical-align: middle;
}

.stx-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 16px;
}

.stx-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.stx-table th,
.stx-table td {
  padding: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.09);
  text-align: left;
}

.stx-table th {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 850;
  background: rgba(15, 23, 42, 0.58);
}

.stx-table td {
  color: #cbd5e1;
  font-size: 13px;
}

.stx-status-warning {
  color: #f59e0b;
  font-weight: 850;
}

.stx-state {
  margin-top: 18px;
}

.stx-empty,
.stx-empty-row {
  color: #94a3b8;
  font-size: 13px;
}

@media (max-width: 1400px) {
  .stx-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stx-leaders-card {
    grid-column: span 3;
  }

  .stx-main-grid {
    grid-template-columns: 1fr;
  }

  .stx-profile-grid {
    grid-template-columns: repeat(2, minmax(320px, 1fr));
  }

  .stx-analytics-grid,
  .stx-setup-columns,
  .stx-setup-footer {
    grid-template-columns: 1fr;
  }

  .stx-analytics-grid-secondary,
  .stx-config-grid {
    grid-template-columns: 1fr;
  }

  .stx-rule-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .stx-page {
    padding: 14px;
  }

  .stx-hero {
    padding: 22px;
  }

  .stx-title {
    font-size: 34px;
  }

  .stx-summary-grid,
  .stx-profile-grid {
    grid-template-columns: 1fr;
  }

  .stx-leaders-card {
    grid-column: auto;
  }

  .stx-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .stx-btn {
    width: 100%;
  }

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

  .stx-setup-toggle {
    padding: 12px 14px;
  }

  .stx-label-long {
    display: none;
  }

  .stx-label-short {
    display: inline;
  }

  .stx-setup-toggle-main {
    white-space: nowrap;
  }

  .stx-mini-stats,
  .stx-mini-chart {
    grid-template-columns: 1fr;
  }

  .stx-mini-chart {
    min-height: 0;
  }

  .stx-mini-chart-bar {
    height: 72px;
  }

  .stx-config-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1400px) {
  .closed-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .closed-strategy-grid,
  .local-trades-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .closed-trades-page {
    padding-inline: 16px;
  }

  .closed-page-hero,
  .closed-analytics-band {
    grid-template-columns: 1fr;
  }

  .closed-page-hero__actions {
    justify-items: start;
  }

  .closed-audit-panel__header {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .closed-cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .closed-summary-grid,
  .closed-strategy-grid,
  .local-trades-grid,
  .closed-filters-grid,
  .closed-trade-card__grid {
    grid-template-columns: 1fr;
  }

  .closed-page-action-row,
  .closed-section-header,
  .closed-section-meta,
  .closed-filter-actions,
  .local-trade-card__pair-row,
  .local-trade-card__status-row,
  .closed-trade-card__top,
  .trade-detail-drawer__hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .closed-warning-banner,
  .trade-detail-drawer__grid {
    grid-template-columns: 1fr;
  }

  .closed-table-shell {
    display: none;
  }

  .closed-cards-grid {
    display: grid !important;
  }
}
