   STATS VIEW — 2026 editorial data-viz redesign
   The Economist data-viz × Stripe Press editorial × Linear micro-interactions
   核心：朱印紅 vermilion accent / 思源宋大數字 / SVG sparkline + heatmap
        / IntersectionObserver count-up animation / scroll-driven bar fill
═══════════════════════════════════ */
.stats-wrap {
  padding: 16px 20px 80px;
  max-width: 880px;
  margin: 0 auto;
  container-type: inline-size;
  container-name: stats;
}

/* ── HERO（editorial dateline） ───────────────────── */
.stats-hero {
  padding: 32px 0 28px;
  text-align: left;
  border-bottom: 1px solid var(--c-rule, var(--c-border));
  margin-bottom: 32px;
}
.stats-hero-eyebrow {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--c-muted);
  margin-bottom: 14px;
}
.stats-hero-h1 {
  font-family: var(--ff-serif-cn);
  font-size: clamp(32px, 5vw + 8px, 56px);
  line-height: 1.05;
  letter-spacing: -.02em;
  color: var(--c-text);
  font-weight: 700;
  margin-bottom: 14px;
}
.stats-hero-hairline {
  height: 2px;
  width: 56px;
  background: var(--c-vermilion);
  margin: 14px 0 18px;
}
.stats-hero-lead {
  font-family: var(--ff-serif-cn);
  font-size: clamp(15px, 2vw, 17px);
  line-height: 1.7;
  color: var(--c-text);
  max-width: 38em;
  text-wrap: pretty;
}
.stats-hero-lead strong {
  font-family: var(--ff-serif-cn);
  font-weight: 700;
  color: var(--c-vermilion);
  font-feature-settings: 'tnum' 1;
}

/* ── METRICS row（3 大數字） ─────────────────────── */
.stats-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-bottom: 36px;
}
@container stats (min-width: 640px) {
  .stats-metrics { grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
}
.stats-metric {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 14px;
  padding: 24px 22px;
  position: relative;
  overflow: hidden;
}
.stats-metric::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--c-vermilion), color-mix(in oklch, var(--c-vermilion) 50%, transparent));
}
.metric-num {
  font-family: var(--ff-serif-cn);
  font-size: clamp(40px, 6vw, 56px);
  font-weight: 700;
  color: var(--c-text);
  line-height: 1;
  letter-spacing: -.02em;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  margin-bottom: 10px;
}
.metric-label {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--c-muted);
  margin-bottom: 12px;
}
.metric-sub {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-family: var(--ff-sans-cn);
  font-size: 13px;
  color: var(--c-muted);
}
.metric-sub .metric-pos { color: var(--c-success); font-weight: 600; }
.metric-sub .metric-neg { color: var(--c-muted); }
.metric-sub .metric-sep { opacity: .4; }

/* Streak metric 特殊樣式：on-fire 時朱印紅漸層底 + 大火焰 */
.stats-metric-streak.on-fire {
  background: linear-gradient(135deg, var(--c-surface) 0%, color-mix(in oklch, var(--c-vermilion, #b23a2b) 8%, var(--c-surface)) 100%);
  border-color: color-mix(in oklch, var(--c-vermilion, #b23a2b) 30%, var(--c-border));
}
.stats-metric-streak.on-fire .metric-num {
  color: var(--c-vermilion);
}
.stats-metric-streak .metric-num {
  display: flex; align-items: baseline; gap: 6px;
}
.stats-metric-streak .streak-flame {
  font-size: .6em;
  line-height: 1;
  filter: drop-shadow(0 1px 2px color-mix(in oklch, var(--c-vermilion, #b23a2b) 40%, transparent));
  animation: flameSwing 3s ease-in-out infinite;
}
@keyframes flameSwing {
  0%, 100% { transform: rotate(-3deg) scale(1); }
  50%      { transform: rotate(3deg) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  .stats-metric-streak .streak-flame { animation: none; }
}

/* Ring metric — SVG progress ring with stroke-dashoffset animation */
.stats-metric-ring {
  display: flex; align-items: center; gap: 18px;
  padding: 22px;
}
.ring-svg {
  width: 96px; height: 96px;
  flex-shrink: 0;
  transform: rotate(-90deg);
  --ring-pct: 0;
}
.ring-track {
  fill: none;
  stroke: var(--c-border);
  stroke-width: 8;
}
.ring-fill {
  fill: none;
  stroke: var(--c-vermilion);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dashoffset: 0;
  transition: stroke-dasharray 1200ms cubic-bezier(.2,.9,.3,1.05);
}
.ring-center { flex: 1; min-width: 0; }
.ring-num {
  font-family: var(--ff-serif-cn);
  font-size: clamp(36px, 5vw, 48px);
  font-weight: 700;
  color: var(--c-vermilion);
  line-height: 1;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.ring-pct {
  font-size: .42em;
  color: var(--c-muted);
  font-weight: 600;
}
.ring-label {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--c-muted);
  margin-top: 8px;
}

/* ── SECTION 通用 ────────────────────────────────── */
.stats-section {
  margin-bottom: 44px;
  view-transition-name: stats-section;
}
.stats-section-head {
  margin-bottom: 22px;
}
.section-eyebrow {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--c-vermilion);
  margin-bottom: 8px;
}
.section-h2 {
  font-family: var(--ff-serif-cn);
  font-size: clamp(24px, 3.5vw, 32px);
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--c-text);
  margin-bottom: 6px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.ach-counter {
  font-family: var(--ff-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--c-muted);
  letter-spacing: .04em;
}
.section-lead {
  font-size: 14px;
  color: var(--c-muted);
  line-height: 1.6;
  max-width: 38em;
}

/* ── ACTIVITY heatmap + sparkline ──────────────── */
.activity-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 14px;
  padding: 22px;
}
@container stats (min-width: 640px) {
  .activity-grid { grid-template-columns: 2fr 1fr; }
}
/* ── Heatmap GitHub-style 7-row column-flow grid ───────
   week 對齊：cells 由上往下、由左往右 (grid-auto-flow: column)
   左側日期軸、上方月份 label、右下 legend */
.heatmap-wrap {
  display: flex; flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.hm-month-row {
  display: grid;
  /* 對齊 heatmap：18px 左 spacer (day-col 14px + gap 4px) + 最多 7 個 14px 週欄 */
  grid-template-columns: 18px repeat(7, 14px);
  column-gap: 4px;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--c-muted);
  height: 12px;
  align-items: end;
  width: fit-content;
}
.hm-corner {}
.hm-month-label {
  /* grid-column 由 inline style 指定（從 JS 算出）*/
  white-space: nowrap;
  font-weight: 600;
}
/* GitHub contribution graph 緊湊密度：每 cell 14px 固定，不隨容器伸縮 */
.hm-body {
  display: flex;
  gap: 4px;
  min-width: 0;
  width: fit-content;          /* 整體寬度由 cells 決定，不撐滿 parent */
  max-width: 100%;
}
.hm-day-col {
  display: grid;
  grid-template-rows: repeat(7, 14px);
  gap: 4px;
  font-family: var(--ff-mono);
  font-size: 9.5px;
  color: var(--c-muted);
  flex-shrink: 0;
  width: 14px;
}
.hm-day-label {
  display: flex;
  align-items: center;
  justify-content: center;
}
.heatmap {
  display: grid;
  grid-template-rows: repeat(7, 14px);
  grid-auto-flow: column;
  grid-auto-columns: 14px;     /* 固定 14px 寬，不再 1fr 撐滿 */
  gap: 4px;
  align-content: start;
  min-width: 0;
}
.heat-cell {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  background: var(--c-border);
  transition: transform 120ms ease, box-shadow 120ms ease;
  position: relative;
  cursor: default;
  /* 14px cell 太小放不下日期文字，靠 hover tooltip 顯示日期 */
}
.heat-cell.heat-empty {
  background: transparent;
  pointer-events: none;
}
.heat-day-num {
  display: none;             /* 14px cell 不放文字 */
}
.heat-cell.heat-1 { background: color-mix(in oklch, var(--c-vermilion) 22%, var(--c-border)); }
.heat-cell.heat-2 { background: color-mix(in oklch, var(--c-vermilion) 45%, var(--c-border)); }
.heat-cell.heat-3 { background: color-mix(in oklch, var(--c-vermilion) 70%, var(--c-border)); }
.heat-cell.heat-4 { background: var(--c-vermilion); }
.heat-cell:hover { transform: scale(1.6); z-index: 2; box-shadow: 0 2px 8px rgba(0,0,0,.20); border-radius: 3px; }
.heat-cell.is-today {
  box-shadow: 0 0 0 1.5px var(--c-text);
  z-index: 1;
}
.heat-cell.is-today::after {
  content: '';
  position: absolute; inset: -3px;
  border-radius: 4px;
  border: 1px dashed var(--c-vermilion);
  pointer-events: none;
}
.hm-legend {
  display: flex; align-items: center; gap: 4px;
  margin-top: 6px;
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--c-muted);
  letter-spacing: .04em;
  justify-content: flex-end;
}
.hm-legend-lbl { padding: 0 4px; }
.hm-legend-cell {
  width: 12px; height: 12px;
  min-height: 12px;
  border-radius: 2px;
  cursor: default;
  flex-shrink: 0;
  aspect-ratio: 1;
}
.hm-legend-cell:hover { transform: none; box-shadow: none; }
@media (max-width: 540px) {
  /* 手機保留同樣 14px cell 即可，已經夠緊湊；只調 month label 字級 */
  .hm-month-row { font-size: 9px; }
}

.activity-meta {
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-top: 1px solid var(--c-border);
  padding-top: 18px;
}
@container stats (min-width: 640px) {
  .activity-meta { border-top: none; border-left: 1px solid var(--c-border); padding-top: 0; padding-left: 22px; }
}
.activity-row {}
.activity-num {
  font-family: var(--ff-serif-cn);
  font-size: clamp(36px, 5vw, 44px);
  font-weight: 700;
  color: var(--c-vermilion);
  line-height: 1;
  font-feature-settings: 'tnum' 1;
  margin-bottom: 4px;
}
.activity-lbl {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--c-muted);
}
.activity-spark-wrap {}
.sparkline {
  width: 100%;
  height: 56px;
  display: block;
  margin-bottom: 4px;
}
.spark-area {
  fill: color-mix(in oklch, var(--c-vermilion) 18%, transparent);
  stroke: none;
}
.spark-line {
  fill: none;
  stroke: var(--c-vermilion);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.activity-spark-cap {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--c-muted);
}

/* ── STRONG ⇄ WEAK 對比卡 ──────────────────────── */
.strong-weak {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 14px;
  padding: 24px;
  align-items: stretch;
}
@container stats (min-width: 540px) {
  .strong-weak { grid-template-columns: 1fr 1px 1fr; }
}
.sw-card {
  text-align: center;
  padding: 8px;
}
.sw-divider {
  background: var(--c-border);
  align-self: stretch;
  display: none;
}
@container stats (min-width: 540px) {
  .sw-divider { display: block; }
}
.sw-tag {
  font-family: var(--ff-mono);
  font-size: 10.5px;
  letter-spacing: .15em;
  color: var(--c-muted);
  margin-bottom: 8px;
}
.sw-card.sw-strong .sw-tag { color: var(--c-success); }
.sw-card.sw-weak .sw-tag { color: var(--c-warning); }
.sw-name {
  font-family: var(--ff-serif-cn);
  font-size: 17px;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 10px;
  line-height: 1.4;
}
.sw-pct {
  font-family: var(--ff-serif-cn);
  font-size: clamp(48px, 8vw, 64px);
  font-weight: 700;
  line-height: 1;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  margin-bottom: 6px;
}
.sw-card.sw-strong .sw-pct { color: var(--c-success); }
.sw-card.sw-weak .sw-pct { color: var(--c-warning); }
.sw-meta {
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--c-muted);
}
.sw-cta {
  margin-top: 14px;
  padding: 9px 18px;
  background: var(--c-vermilion);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: filter .15s, transform .15s;
  touch-action: manipulation;
}
[data-theme="dark"] .sw-cta { color: var(--c-primary-fg); }
.sw-cta:hover { filter: brightness(1.08); }
.sw-cta:active { transform: scale(.97); }

/* ── 分科 horizontal bar chart ──────────────────── */
.subj-bar-list {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 14px;
  padding: 18px 22px;
}
.subj-bar-head, .subj-bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 1.6fr) 3fr 56px 50px;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
}
.subj-bar-head {
  font-family: var(--ff-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  color: var(--c-muted);
  border-bottom: 1px dotted var(--c-border);
  margin-bottom: 6px;
}
.subj-bar-row {
  border-bottom: 1px dotted var(--c-border);
  font-family: var(--ff-sans-cn);
}
.subj-bar-row:last-child { border-bottom: none; }
.subj-bar-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--c-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.subj-bar-track {
  height: 8px;
  background: var(--c-border);
  border-radius: 4px;
  overflow: hidden;
}
.subj-bar-fill {
  height: 100%;
  width: 0;
  background: var(--bar-color, var(--c-vermilion));
  border-radius: 4px;
  animation: subj-bar-fill 1100ms cubic-bezier(.2,.9,.3,1.05) 200ms forwards;
}
@keyframes subj-bar-fill {
  to { width: var(--target-pct, 0%); }
}
.subj-bar-pct {
  font-family: var(--ff-serif-cn);
  font-weight: 700;
  font-size: 16px;
  text-align: right;
  font-feature-settings: 'tnum' 1;
}
.subj-bar-cnt {
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--c-muted);
  text-align: right;
  font-feature-settings: 'tnum' 1;
}
@media (max-width: 540px) {
  .subj-bar-head, .subj-bar-row {
    grid-template-columns: minmax(90px, 1.5fr) 2fr 50px 38px;
    gap: 8px;
  }
  .subj-bar-name { font-size: 13px; }
  .subj-bar-pct { font-size: 14px; }
}

/* ── ACHIEVEMENTS gallery ──────────────────────── */
.ach-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@container stats (min-width: 480px) {
  .ach-gallery { grid-template-columns: 1fr 1fr; }
}
@container stats (min-width: 760px) {
  .ach-gallery { grid-template-columns: 1fr 1fr 1fr; }
}
.ach-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 18px;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  align-items: start;
  transition: border-color .15s, transform .18s, box-shadow .18s;
  position: relative;
  overflow: hidden;
}
.ach-card:hover {
  border-color: var(--c-vermilion);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(178,58,43,.10);
}
.ach-card.is-achieved {
  border-color: color-mix(in oklch, var(--c-success) 50%, var(--c-border));
}
.ach-card.is-achieved::before {
  content: '✓';
  position: absolute; top: 14px; right: 14px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--c-success);
  color: white;
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.ach-icon {
  font-size: 28px;
  line-height: 1;
  filter: grayscale(.6);
  transition: filter .25s;
}
.ach-card.is-achieved .ach-icon { filter: none; }
.ach-body { min-width: 0; }
.ach-label {
  font-family: var(--ff-serif-cn);
  font-size: 16px;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 3px;
}
.ach-desc {
  font-size: 12px;
  color: var(--c-muted);
  line-height: 1.5;
  margin-bottom: 10px;
}
.ach-bar-track {
  height: 4px;
  background: var(--c-border);
  border-radius: 2px;
  margin-bottom: 6px;
  overflow: hidden;
}
.ach-bar-fill {
  height: 100%;
  width: 0;
  background: var(--c-vermilion);
  animation: ach-fill 1000ms cubic-bezier(.2,.9,.3,1.05) 300ms forwards;
}
.ach-card.is-achieved .ach-bar-fill { background: var(--c-success); }
@keyframes ach-fill { to { width: var(--ach-pct, 0%); } }
.ach-meta {
  font-family: var(--ff-mono);
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--c-muted);
}
.ach-meta .ach-done { color: var(--c-success); font-weight: 700; }
.ach-meta .ach-prog {}

/* ── 最近錯題 list ──────────────────────────────── */
.wrong-2026-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--c-border);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  overflow: hidden;
}
.wrong-item-2026 {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  background: var(--c-surface);
  padding: 16px 18px;
  cursor: pointer;
  transition: background-color .12s;
  align-items: start;
}
.wrong-item-2026:hover {
  background: color-mix(in oklch, var(--c-vermilion) 5%, var(--c-surface));
}
.wrong-idx {
  font-family: var(--ff-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--c-vermilion);
  letter-spacing: .04em;
  padding-top: 2px;
}
.wrong-body { min-width: 0; }
.wrong-text {
  font-family: var(--ff-serif-cn);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--c-text);
  margin-bottom: 8px;
  text-wrap: pretty;
}
.wrong-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-family: var(--ff-sans-cn);
  font-size: 12px;
  color: var(--c-muted);
}
.wrong-subj {}
.wrong-count {
  background: var(--c-vermilion-10, rgba(178,58,43,.12));
  color: var(--c-vermilion);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}
.wrong-law-link {
  background: transparent;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 11px;
  color: var(--c-vermilion);
  cursor: pointer;
  font-family: var(--ff-mono);
  letter-spacing: .04em;
  transition: all .12s;
}
.wrong-law-link:hover {
  background: var(--c-vermilion);
  color: white;
  border-color: var(--c-vermilion);
}
[data-theme="dark"] .wrong-law-link:hover { color: var(--c-primary-fg); }
.see-all-btn {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  background: transparent;
  border: 1px dashed var(--c-border);
  border-radius: 10px;
  font-family: var(--ff-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--c-muted);
  cursor: pointer;
  transition: all .15s;
}
.see-all-btn:hover {
  border-color: var(--c-vermilion);
  color: var(--c-vermilion);
}

/* ── EMPTY state ───────────────────────────────── */
.stats-empty {
  text-align: center;
  padding: 48px 24px;
  border: 1px dashed var(--c-border);
  border-radius: 16px;
}
.stats-empty-eyebrow {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--c-muted);
  margin-bottom: 12px;
}
.stats-empty-h2 {
  font-family: var(--ff-serif-cn);
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 12px;
  max-width: 30em;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.4;
}
.stats-empty-lead {
  font-size: 14px;
  color: var(--c-muted);
  line-height: 1.7;
  max-width: 32em;
  margin: 0 auto 24px;
}
.stats-empty-cta {
  padding: 14px 30px;
  background: var(--c-vermilion);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: filter .15s, transform .15s;
  touch-action: manipulation;
}
[data-theme="dark"] .stats-empty-cta { color: var(--c-primary-fg); }
.stats-empty-cta:hover { filter: brightness(1.08); }

/* ── footer 清除連結 ───────────────────────────── */
.stats-foot {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--c-border);
  text-align: center;
}
.stats-clear-link {
  background: transparent;
  border: none;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--c-muted);
  text-decoration: underline;
  cursor: pointer;
  padding: 8px 16px;
}
.stats-clear-link:hover { color: var(--c-danger); }

/* ── Reduced motion fallback ──────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ring-fill, .subj-bar-fill, .ach-bar-fill {
    animation: none !important;
    transition: none !important;
  }
  .subj-bar-fill { width: var(--target-pct, 0%); }
  .ach-bar-fill { width: var(--ach-pct, 0%); }
  .ach-card { transform: none !important; }
}

/* === LEGACY stats CSS（舊版 .stats-kpi-row 等）保留供回退 === */
.stats-kpi-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.kpi-card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r-lg); padding: 18px 14px;
  text-align: center; box-shadow: var(--shadow-sm);
}
.kpi-icon { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; }
.kpi-icon svg { width: 22px; height: 22px; }
.kpi-val   { font-size: 1.5rem; font-weight: 700; line-height: 1.1; margin-bottom: 4px; }
.kpi-label { font-size: .72rem; color: var(--c-muted); }
.ring-wrap  { text-align: center; }
.progress-ring-track { fill: none; stroke: var(--c-surface2); stroke-width: 9; }
.progress-ring-fill  { fill: none; stroke: var(--c-primary); stroke-width: 9; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .7s; }
.ring-val   { font-size: 1.4rem; font-weight: 700; color: var(--c-primary); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.ring-outer { position: relative; display: inline-block; margin-bottom: 8px; }

.streak-card {
  background: linear-gradient(135deg, var(--c-primary-10), var(--c-primary-20));
  border: 1px solid var(--c-primary-20); border-radius: var(--r-lg);
  padding: 16px; display: flex; align-items: center; gap: 16px;
  margin-bottom: 12px;
}
.streak-num  { font-size: 2.8rem; font-weight: 800; color: var(--c-primary); line-height: 1; }
.streak-info strong { font-size: .95rem; display: block; }
.streak-info p { font-size: .82rem; color: var(--c-muted); margin-top: 2px; }

.subj-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-bottom: 1px solid var(--c-border); font-size: .85rem;
}
.subj-row:last-child { border-bottom: none; }
.subj-row .sn  { flex: 1; }
.subj-row .sp  { font-weight: 700; color: var(--c-primary); min-width: 44px; text-align: right; }
.subj-row .sc  { font-size: .75rem; color: var(--c-muted); min-width: 60px; text-align: right; }

.wrong-item { padding: 10px 16px; border-bottom: 1px solid var(--c-border); }
.wrong-item:last-child { border-bottom: none; }
.wrong-text { font-size: .85rem; line-height: 1.5; margin-bottom: 4px; }
.wrong-meta { font-size: .75rem; color: var(--c-muted); }

.achievements { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
.ach {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 20px; border: 1.5px solid var(--c-border);
  background: var(--c-surface2); font-size: .8rem; color: var(--c-muted);
  opacity: .5;
}
.ach.earned { opacity: 1; border-color: var(--c-primary); background: var(--c-primary-10); color: var(--c-text); }
.ach-icon { font-size: .9rem; }

/* Weak subjects tags in stats */
.weak-subjs { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
.weak-subj-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 20px;
  background: rgba(220,38,38,.08); border: 1.5px solid rgba(220,38,38,.25);
  font-size: .8rem;
}
.weak-subj-name { font-weight: 600; color: var(--c-text); }
.weak-subj-pct { color: var(--c-danger); font-weight: 700; }

/* ═══════════════════════════════════
