/* ── SPIDER Benchmark ──────────────────────────────── */
:root {
  --sb-bg:      #ffffff;
  --sb-card:    #f8f9fa;
  --sb-border:  #e2e8f0;
  --sb-text:    #1e293b;
  --sb-muted:   #64748b;
  --sb-accent:  #2563eb;
  --sb-accent2: #7c3aed;
  --sb-bar:     #3b82f6;
  --sb-bar-bg:  #e2e8f0;
  --sb-green:   #22c55e;
  --sb-amber:   #f59e0b;
  --sb-red:     #ef4444;
  --sb-radius:  10px;
}

.spider-benchmark {
  max-width: 900px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--sb-text);
  line-height: 1.5;
}

/* ── Header ──────────────────────────────────────── */
.sb-header {
  text-align: center;
  margin-bottom: 28px;
}
.sb-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 0 4px;
}
.sb-subtitle {
  font-size: 0.95rem;
  color: var(--sb-muted);
  margin: 0;
}

/* ── Filters bar ─────────────────────────────────── */
.sb-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--sb-card);
  border: 1px solid var(--sb-border);
  border-radius: var(--sb-radius);
}
.sb-filter-group {
  flex: 1 1 180px;
  min-width: 160px;
}
.sb-filter-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--sb-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}
.sb-filter-group select {
  width: 100%;
  padding: 8px 32px 8px 10px;
  border: 1px solid var(--sb-border);
  border-radius: 6px;
  font-size: 0.9rem;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") no-repeat right 10px center;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.sb-filter-group select:focus {
  outline: none;
  border-color: var(--sb-accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.sb-badge {
  flex: 0 0 auto;
  padding: 9px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--sb-accent);
  background: #eff6ff;
  border-radius: 6px;
  white-space: nowrap;
  align-self: flex-end;
}

/* ── No-data message ─────────────────────────────── */
.sb-no-data {
  text-align: center;
  padding: 48px 24px;
  color: var(--sb-muted);
  font-size: 1rem;
}

/* ── Grid layout ─────────────────────────────────── */
.sb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.sb-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
@media (max-width: 700px) {
  .sb-grid { grid-template-columns: 1fr; }
}

/* ── Card ────────────────────────────────────────── */
.sb-card {
  background: var(--sb-bg);
  border: 1px solid var(--sb-border);
  border-radius: var(--sb-radius);
  padding: 20px;
}
.sb-card-full {
  grid-column: 1 / -1;
}
.sb-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--sb-muted);
  margin: 0 0 16px;
}

/* ── Big level number ────────────────────────────── */
.sb-big-level {
  text-align: center;
  margin-bottom: 16px;
}
.sb-big-level-num {
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--sb-accent);
  line-height: 1;
}
.sb-big-level-label {
  font-size: 0.85rem;
  color: var(--sb-muted);
  margin-top: 2px;
}

/* ── Criterion breakdown bars ────────────────────── */
.sb-criterion-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}
.sb-criterion-level {
  flex: 0 0 24px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--sb-muted);
  text-align: right;
}
.sb-criterion-bar-wrap {
  flex: 1;
  height: 20px;
  background: var(--sb-bar-bg);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.sb-criterion-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}
.sb-criterion-pct {
  flex: 0 0 48px;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: right;
}
.sb-criterion-detail {
  flex: 0 0 60px;
  font-size: 0.72rem;
  color: var(--sb-muted);
  text-align: right;
}

/* ── Radar canvas ────────────────────────────────── */
.sb-radar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}
.sb-radar-wrap canvas {
  max-width: 100%;
  height: auto;
}

/* ── Dimension detail rows ───────────────────────── */
.sb-dim-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--sb-border);
  font-size: 0.85rem;
}
.sb-dim-row:last-child { border-bottom: none; }
.sb-dim-name {
  flex: 1;
  font-weight: 500;
}
.sb-dim-score {
  flex: 0 0 auto;
  text-align: right;
  font-weight: 700;
  color: var(--sb-accent);
  white-space: nowrap;
}
.sb-dim-scale {
  font-weight: 500;
  color: var(--sb-muted);
  font-size: 0.85em;
}

/* ── Level distribution ──────────────────────────── */
.sb-dist-row {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  gap: 8px;
}
.sb-dist-level {
  flex: 0 0 24px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--sb-muted);
  text-align: right;
}
.sb-dist-bar-wrap {
  flex: 1;
  height: 18px;
  background: var(--sb-bar-bg);
  border-radius: 4px;
  overflow: hidden;
}
.sb-dist-bar {
  height: 100%;
  background: var(--sb-accent2);
  border-radius: 4px;
  transition: width 0.6s ease;
}
.sb-dist-count {
  flex: 0 0 36px;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: right;
}

/* ── CTA section ─────────────────────────────────── */
.sb-cta {
  margin-top: 28px;
  padding: 28px 24px;
  text-align: center;
  background: linear-gradient(135deg, #1e1e2e 0%, #2a2a3e 100%);
  border-radius: var(--sb-radius);
  color: #fff;
}
.sb-cta-text {
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.45;
  color: #fff;
}
.sb-cta-btn {
  display: inline-block;
  padding: 12px 24px;
  background: var(--sb-accent);
  color: #fff !important;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.15s ease, transform 0.15s ease;
}
.sb-cta-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

/* ── Loading ─────────────────────────────────────── */
.sb-loading {
  text-align: center;
  padding: 48px 24px;
  color: var(--sb-muted);
}
