/* ===================================================================
   Component: Score Badge
   Conic-gradient donut with expandable 2×2 rubric breakdown.
   Includes badge, breakdown panel, and all tier styles.
   =================================================================== */

/* ─── Score Badge (Donut) ─── */
.score-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: all var(--duration-snappy) var(--ease-snappy);
  z-index: 2;
  /* conic-gradient applied via JS */
  background: rgba(0, 0, 0, 0.08);
}

.score-badge:hover {
  transform: scale(1.15);
}

.score-badge:active {
  transform: scale(0.95);
}

.score-badge-inner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -0.3px;
  position: relative;
  z-index: 1;
}

/* Score color tiers */
.score-badge.score-high .score-badge-inner { color: var(--score-high); }
.score-badge.score-med .score-badge-inner { color: var(--pastel-lavender); }
.score-badge.score-low .score-badge-inner { color: var(--text-tertiary); }

/* Active glow when breakdown is open */
.score-badge.active {
  transform: scale(1.15);
  box-shadow: 0 0 16px rgba(123, 158, 135, 0.35);
}

/* Hero card badge — larger variant */
.hero-score-badge .score-badge {
  width: 44px;
  height: 44px;
}

.hero-score-badge .score-badge-inner {
  width: 34px;
  height: 34px;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.65);
  color: white;
  backdrop-filter: blur(8px);
}

/* ─── Score Breakdown Panel ─── */
.score-breakdown {
  max-height: 0;
  overflow: hidden;
  transition: max-height 400ms var(--ease-smooth), opacity 300ms ease;
  opacity: 0;
}

.score-breakdown.open {
  max-height: 400px;
  opacity: 1;
}

.sb-inner {
  padding: 10px 14px 14px;
  background: rgba(123, 158, 135, 0.05);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* 2×2 Signal Grid */
.sb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.sb-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.04);
  min-width: 0;
}

.sb-cell-accent {
  width: 3px;
  height: 24px;
  border-radius: 2px;
  flex-shrink: 0;
}

.sb-cell-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sb-cell-name {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-cell-grade {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.sb-cell-grade.grade-top { color: var(--score-high); }
.sb-cell-grade.grade-high { color: #72D49A; }
.sb-cell-grade.grade-mid { color: var(--accent-warm); }
.sb-cell-grade.grade-low { color: var(--text-tertiary); }

.sb-cell-contrib {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  text-align: right;
  min-width: 28px;
}

/* Contribution Bar */
.sb-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.sb-bar {
  flex: 1;
  display: flex;
  height: 5px;
  border-radius: 3px;
  overflow: hidden;
  gap: 1px;
}

.sb-bar-seg {
  border-radius: 3px;
  transition: width 400ms var(--ease-smooth);
}

.sb-total-score {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  flex-shrink: 0;
  min-width: 24px;
  text-align: right;
}

/* Template summary line */
.sb-summary {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
  font-style: italic;
}
