.swarm-module {
  display: grid;
  gap: 14px;
}

.swarm-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.swarm-head h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.swarm-head small {
  color: var(--text-muted);
  font-size: 12px;
}

.swarm-meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--text-mono);
  text-align: right;
}

.swarm-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.swarm-metric {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: 10px;
  padding: 14px;
}

.swarm-metric .label {
  font-size: 11px;
  color: var(--text-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: "JetBrains Mono", monospace;
}

.swarm-metric .value {
  font-size: 22px;
  font-weight: 600;
  margin-top: 6px;
}

.swarm-metric .detail {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.swarm-trend-up { color: var(--ok); }
.swarm-trend-down { color: #c49a9a; }
.swarm-trend-flat { color: var(--text-muted); }

.swarm-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
}

.swarm-panel {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #0c0d0f 0%, #090a0b 100%);
  border-radius: 10px;
  padding: 16px;
}

.swarm-panel h3 {
  font-size: 13px;
  margin: 0 0 12px;
  color: var(--text-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: "JetBrains Mono", monospace;
}

.swarm-agent {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 10px 0;
  border-bottom: 1px solid #17181b;
  font-size: 13px;
}

.swarm-agent:last-child { border-bottom: 0; }

.swarm-status {
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
}

.swarm-status.active { color: var(--ok); }
.swarm-status.idle { color: var(--text-muted); }
.swarm-status.ready { color: #8a9bb5; }
.swarm-status.error { color: #c49a9a; }

.swarm-swarm-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.swarm-swarm-card:last-child { margin-bottom: 0; }

.swarm-progress {
  height: 6px;
  background: #1c1d1f;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.swarm-progress > span {
  display: block;
  height: 100%;
  background: var(--ok);
  border-radius: 4px;
}

.swarm-events {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.swarm-event {
  font-size: 12px;
  color: var(--text-muted);
  border-left: 2px solid var(--border);
  padding-left: 10px;
}

.swarm-event time {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--text-mono);
  display: block;
  margin-bottom: 2px;
}

.swarm-blackboard {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  white-space: pre-wrap;
}

.swarm-empty {
  color: var(--text-muted);
  font-size: 13px;
}

.swarm-metrics-hero {
  grid-template-columns: repeat(4, 1fr);
}

.swarm-metric-hero .value {
  font-size: 32px;
}

.swarm-infographic {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  padding: 14px;
  margin-bottom: 14px;
}

.swarm-infographic h3 {
  font-size: 12px;
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-mono);
  margin-bottom: 10px;
}

.swarm-iframe {
  width: 100%;
  min-height: 520px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #08090a;
}

.swarm-learning {
  padding: 10px 0;
  border-bottom: 1px solid #17181b;
  font-size: 13px;
}

.swarm-learning:last-child { border-bottom: 0; }

.swarm-learning-head {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.swarm-learning-cycle {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: #8a9bb5;
}

.swarm-learning-area {
  font-size: 11px;
  color: var(--text-muted);
}

.swarm-learning-status {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  margin-left: auto;
}

.swarm-learning-status.applied { color: var(--ok); }
.swarm-learning-status.pending { color: #b5ac8f; }

.swarm-skill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #17181b;
  font-size: 13px;
}

.swarm-skill:last-child { border-bottom: 0; }

.swarm-skill-badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--ok);
  border: 1px solid rgba(159, 177, 163, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
}

@media (max-width: 1100px) {
  .swarm-metrics,
  .swarm-metrics-hero { grid-template-columns: repeat(2, 1fr); }
  .swarm-grid { grid-template-columns: 1fr; }
  .swarm-iframe { min-height: 420px; }
}