/* ─── Academy Shared Components ───
 * Buttons, Cards, Badges, Stat Grid, Domain Bar, Form Inputs
 */

/* ══════════════════════════════════
   BUTTONS
   ══════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: var(--btn-min-h);
  padding: 0 var(--space-xl);
  border: none;
  border-radius: var(--radius-btn);
  font-size: var(--font-base);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.97); }
.btn:disabled, .btn.btn-disabled {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand-gold);
  color: var(--bg-deep);
}

.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { opacity: 0.8; }

.btn-secondary {
  background: var(--gold-bg);
  color: var(--brand-gold);
  border: 1px solid var(--border-gold);
}

.btn-secondary:hover { background: var(--gold-bg-hover); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover { background: rgba(255,255,255,0.04); }

.btn-danger {
  background: var(--bg-danger);
  color: var(--color-danger);
  border: 1px solid rgba(248,113,113,0.3);
}

.btn-block { width: 100%; }

.btn-sm {
  min-height: var(--btn-min-h-sm);
  padding: 0 var(--space-md);
  font-size: var(--font-sm);
}

.btn-lg {
  min-height: 56px;
  font-size: var(--font-lg);
  border-radius: var(--radius-card);
}

.btn-icon {
  width: 36px;
  height: 36px;
  min-height: auto;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ══════════════════════════════════
   CARDS
   ══════════════════════════════════ */
.card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  transition: border-color var(--transition-fast);
}

.card:active:not(.card-static) {
  border-color: var(--border-gold);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.card-title {
  font-size: var(--font-base);
  font-weight: var(--font-weight-semibold);
}

/* Desktop: gradient cards */
@media (min-width: 768px) {
  .card {
    background: linear-gradient(180deg, rgba(21,27,37,0.92), rgba(21,27,37,0.82));
    box-shadow: var(--shadow-xl);
  }
}

/* Status/highlight card */
.card-status {
  background: linear-gradient(135deg, rgba(201,169,98,0.12), rgba(201,169,98,0.04));
  border-color: var(--border-gold);
}

/* ══════════════════════════════════
   BADGES / PILLS
   ══════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--font-xs);
  font-weight: var(--font-weight-semibold);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.badge-success { background: var(--bg-success); color: var(--color-success); }
.badge-danger  { background: var(--bg-danger);  color: var(--color-danger); }
.badge-warning { background: var(--bg-warning); color: var(--color-warning); }
.badge-caution { background: var(--bg-caution); color: var(--color-caution); }
.badge-info    { background: var(--bg-info);     color: var(--color-info); }
.badge-gold    { background: var(--gold-bg);     color: var(--brand-gold); }
.badge-muted   { background: rgba(127,137,152,0.12); color: #7f8998; }

/* Result badges */
.badge-pass { background: var(--bg-success); color: var(--color-success); }
.badge-fail { background: var(--bg-danger);  color: var(--color-danger); }
.badge-pending { background: var(--bg-caution); color: var(--color-caution); }

/* ══════════════════════════════════
   STAT GRID
   ══════════════════════════════════ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}

.stat-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.stat-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.stat-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.stat-item {
  text-align: center;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-btn);
  padding: 14px var(--space-sm);
}

.stat-value {
  font-size: var(--font-xl);
  font-weight: var(--font-weight-bold);
  color: var(--brand-gold);
  line-height: var(--line-height-tight);
}

.stat-label {
  font-size: var(--font-xs);
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* ══════════════════════════════════
   DOMAIN BAR (progress bar by domain)
   ══════════════════════════════════ */
.domain-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.domain-name {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  min-width: 40px;
  flex-shrink: 0;
}

.domain-track {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}

.domain-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.domain-pct {
  font-size: var(--font-xs);
  color: var(--text-muted);
  min-width: 36px;
  text-align: right;
  flex-shrink: 0;
}

/* ══════════════════════════════════
   PROGRESS BAR (monthly etc.)
   ══════════════════════════════════ */
.progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-gold), var(--gold-soft));
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ══════════════════════════════════
   LEADERBOARD LIST
   ══════════════════════════════════ */
.lb-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.lb-item:last-child { border-bottom: none; }

.lb-rank {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-sm);
  font-weight: var(--font-weight-bold);
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.lb-rank.top-1 { background: var(--brand-gold); color: var(--bg-deep); }
.lb-rank.top-2 { background: rgba(201,169,98,0.5); color: var(--bg-deep); }
.lb-rank.top-3 { background: rgba(201,169,98,0.3); color: var(--text-primary); }

.lb-name {
  flex: 1;
  font-size: var(--font-base);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-points {
  font-size: var(--font-sm);
  color: var(--brand-gold);
  font-weight: var(--font-weight-semibold);
  flex-shrink: 0;
}

/* ══════════════════════════════════
   FORM INPUTS
   ══════════════════════════════════ */
.input {
  width: 100%;
  min-height: var(--btn-min-h);
  padding: 0 var(--space-lg);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-btn);
  color: var(--text-primary);
  font-size: var(--font-base);
  transition: border-color var(--transition-fast);
}

.input:focus {
  border-color: var(--brand-gold);
  box-shadow: 0 0 0 2px var(--gold-glow);
}

.input::placeholder { color: var(--text-muted); }

.textarea {
  width: 100%;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-btn);
  padding: var(--space-md);
  font-size: var(--font-base);
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
  line-height: var(--line-height-relaxed);
  transition: border-color var(--transition-fast);
}

.textarea:focus {
  border-color: var(--brand-gold);
  box-shadow: 0 0 0 2px var(--gold-glow);
}

.textarea::placeholder { color: var(--text-muted); }

.select {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-panel);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-btn);
  font-size: var(--font-sm);
}

/* ══════════════════════════════════
   FEEDBACK BAR (quiz result)
   ══════════════════════════════════ */
.feedback-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-btn);
  margin-top: var(--space-md);
  font-size: var(--font-sm);
  animation: feedback-in var(--transition-slow) ease-out;
}

@keyframes feedback-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.feedback-correct {
  background: rgba(74,222,128,0.1);
  border: 1px solid rgba(74,222,128,0.3);
  color: var(--color-success);
}

.feedback-wrong {
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.3);
  color: var(--color-danger);
}

.feedback-partial {
  background: rgba(251,146,60,0.1);
  border: 1px solid rgba(251,146,60,0.3);
  color: var(--color-warning);
}

.feedback-icon { font-size: var(--font-xl); flex-shrink: 0; }
.feedback-text { flex: 1; line-height: var(--line-height-normal); }

.explanation-box {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-btn);
  padding: 14px;
  margin-top: var(--space-md);
  font-size: var(--font-sm);
  line-height: var(--line-height-relaxed);
  color: var(--text-secondary);
}

/* ══════════════════════════════════
   NAV GRID (home page icons)
   ══════════════════════════════════ */
.nav-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: 14px var(--space-xs);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--transition-fast);
  border-radius: var(--radius-card);
}

.nav-item:active { transform: scale(0.95); }

.nav-icon-bg {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-base);
}

.nav-item:active .nav-icon-bg { transform: scale(0.92); }

.nav-label {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  font-weight: var(--font-weight-medium);
  text-align: center;
  line-height: var(--line-height-tight);
}

@media (min-width: 768px) {
  .nav-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* ══════════════════════════════════
   SECTION DIVIDER
   ══════════════════════════════════ */
.section-title {
  font-size: var(--font-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  margin-top: var(--space-xl);
}

/* ══════════════════════════════════
   USER HEADER (progress/individual)
   ══════════════════════════════════ */
.user-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-panel);
  border: 2px solid var(--brand-gold);
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 18px; font-weight: var(--font-weight-semibold); }
.user-dept {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ══════════════════════════════════
   TABS (exam center etc.)
   ══════════════════════════════════ */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-lg);
  position: relative;
}

.tab {
  flex: 1;
  text-align: center;
  padding: var(--space-md) 0;
  font-size: var(--font-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-base);
  -webkit-tap-highlight-color: transparent;
}

.tab.active {
  color: var(--brand-gold);
  border-bottom-color: var(--brand-gold);
}

/* ══════════════════════════════════
   REPORT LINK / INLINE ACTION
   ══════════════════════════════════ */
.report-link {
  margin-top: var(--space-md);
  font-size: var(--font-sm);
  color: var(--text-muted);
  text-align: right;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.report-link:active { opacity: 1; }

/* ══════════════════════════════════
   STATUS CARD (home page)
   ══════════════════════════════════ */
.status-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.status-cell { text-align: center; flex: 1; }
.status-cell:first-child { text-align: left; }
.status-cell:last-child { text-align: right; }

.status-label {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.status-value {
  font-size: var(--font-xl);
  font-weight: var(--font-weight-bold);
  color: var(--brand-gold);
  line-height: var(--line-height-tight);
}

.streak-flame { font-size: 18px; }

.monthly-section {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
}

.monthly-header {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.milestone-hint {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--font-xs);
  color: var(--color-warning);
  margin-top: var(--space-sm);
  justify-content: center;
}

/* ══════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════ */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: var(--space-xl);
}

.login-logo-wrap {
  position: relative;
  margin-bottom: var(--space-xl);
}

.login-logo-icon {
  width: 80px;
  height: 80px;
  border-radius: 24px;
  background: var(--gold-bg);
  border: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.login-glow {
  position: absolute;
  inset: -12px;
  border-radius: 36px;
  background: radial-gradient(circle, rgba(201,169,98,0.15) 0%, transparent 70%);
  animation: login-glow-pulse 3s ease-in-out infinite;
}

@keyframes login-glow-pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.08); }
}

.login-title {
  font-size: var(--font-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--brand-gold);
  margin-bottom: var(--space-sm);
}

.login-subtitle {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-3xl);
}

.login-error {
  color: var(--color-danger);
  font-size: var(--font-sm);
  margin-bottom: var(--space-lg);
  padding: var(--space-sm) var(--space-lg);
  background: var(--bg-danger);
  border-radius: var(--radius-btn);
}

.login-status {
  color: var(--text-muted);
  font-size: var(--font-sm);
  margin-bottom: var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* ══════════════════════════════════
   QUIZ NAV ROW
   ══════════════════════════════════ */
.quiz-nav-row {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.quiz-nav-btn { flex: 1; }
.quiz-nav-skip { opacity: 0.5; }

/* ══════════════════════════════════
   QUIZ Q-HEADER TAGS
   ══════════════════════════════════ */
.quiz-q-tags {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ══════════════════════════════════
   FEEDBACK GOLD (exam mode recorded)
   ══════════════════════════════════ */
.feedback-gold {
  background: rgba(201,169,98,0.08);
  border: 1px solid var(--border-gold);
  color: var(--brand-gold);
}

/* ══════════════════════════════════
   EXPLANATION COLLAPSIBLE
   ══════════════════════════════════ */
.explanation-collapsible { cursor: pointer; }
.explanation-summary {
  font-weight: var(--font-weight-semibold);
  margin-bottom: 6px;
}
.explanation-content {
  margin-top: 6px;
  line-height: var(--line-height-relaxed);
}

/* Short answer containers */
.short-answer-input { margin-top: var(--space-sm); }
.short-answer-review { margin-top: var(--space-sm); }
.sa-submit-btn { margin-top: var(--space-md); }

/* Result answers card */
.result-answers-card { margin-top: var(--space-lg); }

/* Guide page wrapper */
.guide-page { }

/* Multi submit spacing */
.multi-submit-btn { margin-top: 14px; }

/* ══════════════════════════════════
   CARD HEADER META (secondary text)
   ══════════════════════════════════ */
.card-header-meta {
  font-size: var(--font-sm);
  color: var(--text-muted);
}

/* ══════════════════════════════════
   USER AVATAR PLACEHOLDER
   ══════════════════════════════════ */
.user-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

/* ══════════════════════════════════
   ANSWER REVIEW ITEMS (quiz result)
   ══════════════════════════════════ */
.answer-review-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.answer-review-item:last-child { border-bottom: none; }

.answer-review-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: 4px;
}

.answer-review-score {
  font-weight: var(--font-weight-bold);
  font-size: var(--font-sm);
}

.answer-score-good   { color: var(--color-success); }
.answer-score-partial { color: var(--color-warning); }
.answer-score-bad    { color: var(--color-danger); }

.answer-review-icon {
  font-weight: var(--font-weight-bold);
}

.answer-correct { color: var(--color-success); }
.answer-wrong   { color: var(--color-danger); }

.answer-review-qid {
  font-size: var(--font-sm);
  color: var(--text-muted);
}

.answer-review-question {
  font-size: var(--font-base);
  margin-bottom: 4px;
}

.answer-review-given {
  font-size: var(--font-sm);
  color: var(--text-secondary);
}

/* ══════════════════════════════════
   SUGGESTION ITEMS (weak domain)
   ══════════════════════════════════ */
.suggestion-item {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.suggestion-item:last-child { border-bottom: none; }

.suggestion-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: 4px;
}

.suggestion-accuracy {
  font-size: var(--font-sm);
  color: var(--color-warning);
}

.suggestion-count {
  font-size: var(--font-xs);
  color: var(--text-muted);
}

.suggestion-docs { padding-left: 4px; }
.suggestion-doc {
  font-size: var(--font-sm);
  color: var(--color-info);
  padding: 2px 0;
}

/* ══════════════════════════════════
   DOMAIN PCT WEAK HIGHLIGHT
   ══════════════════════════════════ */
.domain-pct-weak { color: var(--color-warning); }

/* ══════════════════════════════════
   TREND ROW (recent sessions)
   ══════════════════════════════════ */
.trend-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 0;
  font-size: var(--font-sm);
}

.trend-date {
  width: 50px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.trend-track { flex: 1; }

.trend-pct {
  width: 36px;
  text-align: right;
}

.trend-excellent, .trend-excellent { color: var(--color-success); }
.trend-good    { color: var(--brand-gold); }
.trend-fair    { color: var(--color-warning); }
.trend-poor    { color: var(--color-danger); }

/* Fill color classes for trend bars */
.domain-fill.trend-excellent { background: var(--color-success); }
.domain-fill.trend-good      { background: var(--brand-gold); }
.domain-fill.trend-fair      { background: var(--color-warning); }
.domain-fill.trend-poor      { background: var(--color-danger); }

/* ══════════════════════════════════
   HISTORY CARD
   ══════════════════════════════════ */
.history-card { cursor: pointer; }

.history-detail {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-base);
}

.history-passed  { color: var(--color-success); }
.history-failed  { color: var(--color-danger); }
.history-pending { color: var(--color-caution); }

.history-summary {
  color: var(--text-secondary);
}

/* ══════════════════════════════════
   LEADERBOARD ME HIGHLIGHT
   ══════════════════════════════════ */
.lb-item-me {
  background: rgba(201,169,98,0.05);
}

/* ══════════════════════════════════
   PROGRESS LINKS
   ══════════════════════════════════ */
.progress-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

/* ══════════════════════════════════
   STREAK FIRE
   ══════════════════════════════════ */
.streak-fire { color: var(--color-warning); }

/* ══════════════════════════════════
   QUIZ DESKTOP LAYOUT (exam mode)
   ══════════════════════════════════ */
@media (min-width: 768px) {
  .quiz-desktop-layout {
    display: flex;
    gap: var(--space-xl);
    align-items: flex-start;
  }
  .quiz-main { flex: 1; min-width: 0; }
  .quiz-sidebar { width: 240px; flex-shrink: 0; position: sticky; top: calc(var(--header-h) + 44px + var(--space-lg)); }
}

/* ══════════════════════════════════
   OPTION LOADING STATE
   ══════════════════════════════════ */
.option-btn--loading {
  opacity: 0.6;
  pointer-events: none;
}

/* ══════════════════════════════════
   RESULT SCORE RING
   ══════════════════════════════════ */
.result-ring { position: relative; width: 120px; height: 120px; margin: 0 auto 16px; }
.result-ring-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.result-ring-bg { fill: none; stroke: rgba(255,255,255,0.06); stroke-width: 8; }
.result-ring-fill { fill: none; stroke: var(--brand-gold); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 0.8s ease-out; }
.result-ring-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: var(--font-2xl); font-weight: var(--font-weight-black); color: var(--brand-gold); }

/* ══════════════════════════════════
   LEADERBOARD PODIUM
   ══════════════════════════════════ */
.podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: var(--space-md);
  margin: var(--space-lg) 0 var(--space-xl);
  padding: 0 var(--space-sm);
}

.podium-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: 1;
  max-width: 120px;
  padding: var(--space-md) var(--space-sm);
  border-radius: var(--radius-card);
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  transition: border-color var(--transition-fast);
}

.podium-medal {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-lg);
  font-weight: var(--font-weight-black);
  margin-bottom: var(--space-sm);
  flex-shrink: 0;
}

.podium-name {
  font-size: var(--font-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.podium-dept {
  font-size: var(--font-xs);
  color: var(--text-muted);
  margin-top: 2px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.podium-points {
  font-size: var(--font-sm);
  font-weight: var(--font-weight-bold);
  color: var(--brand-gold);
  margin-top: var(--space-xs);
}

/* Gold — #1 center, tallest */
.podium-gold {
  order: 0;
  padding-top: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-color: var(--border-gold);
  background: linear-gradient(180deg, rgba(201,169,98,0.08), var(--bg-panel));
}

.podium-gold .podium-medal {
  width: 52px;
  height: 52px;
  font-size: var(--font-xl);
  background: var(--brand-gold);
  color: var(--bg-deep);
  box-shadow: 0 0 16px rgba(201,169,98,0.3);
}

.podium-gold .podium-name {
  font-size: var(--font-base);
}

/* Silver — #2 left */
.podium-silver {
  order: -1;
}

.podium-silver .podium-medal {
  background: rgba(192,192,210,0.25);
  color: var(--text-primary);
  border: 2px solid rgba(192,192,210,0.4);
}

/* Bronze — #3 right */
.podium-bronze {
  order: 1;
}

.podium-bronze .podium-medal {
  background: rgba(205,127,50,0.2);
  color: var(--text-primary);
  border: 2px solid rgba(205,127,50,0.35);
}

/* ── Leaderboard inline bar (rank 4+) ── */
.lb-bar {
  width: 80px;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}

.lb-bar-fill {
  height: 100%;
  background: var(--brand-gold);
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ── Answer inline icon/color classes (dashboard detail) ── */
.answer-icon { font-weight: var(--font-weight-bold); }
.answer-icon--gold { color: var(--brand-gold); }
.answer-icon--success { color: var(--color-success); }
.answer-icon--danger { color: var(--color-danger); }

.answer-preview {
  font-size: var(--font-sm);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.answer-option--selected { color: var(--brand-gold); }
.answer-option--correct { color: var(--color-success); }
.answer-option--wrong { color: var(--color-danger); }

/* ── Session pct color classes ── */
.session-pct--success { color: var(--color-success); }
.session-pct--gold { color: var(--brand-gold); }
.session-pct--warning { color: var(--color-warning); }
.session-pct--danger { color: var(--color-danger); }

/* ── User progress color classes ── */
.user-progress--warning { color: var(--color-warning); }
.user-progress--success { color: var(--color-success); }
.user-progress--gold { color: var(--brand-gold); }

/* ── QD error rate color classes ── */
.qd-err--danger { color: var(--color-danger); }
.qd-err--warning { color: var(--color-warning); }
