/* ══════════════════════════════════════
   TOKENS
══════════════════════════════════════ */
:root {
  --blue:        #2d3fd4;
  --blue-dark:   #1a2db0;
  --blue-deep:   #132490;
  --blue-light:  #eef1fb;
  --orange:      #f47221;
  --orange-dark: #d9610d;
  --yellow:      #f5c400;

  --bg:          #f4f6fb;
  --surface:     #ffffff;
  --surface-2:   #eef1f8;
  --border:      #dde3f0;
  --border-h:    #b8c4df;

  --text:        #0d1b3e;
  --muted:       #5a6a8a;
  --light:       #8fa0bf;

  --success:     #059669;
  --success-bg:  #ecfdf5;
  --success-bd:  #6ee7b7;
  --error:       #dc2626;
  --error-bg:    #fef2f2;
  --warning:     #b45309;
  --warning-bg:  #fffbeb;
  --warning-bd:  #fde68a;

  --physics:     #0891b2;
  --physics-bg:  #ecfeff;
  --chemistry:   #7c3aed;
  --chemistry-bg:#f5f3ff;
  --chemistry-bd:#ddd6fe;
  --biology:     #059669;
  --biology-bg:  #ecfdf5;
  --biology-bd:  #6ee7b7;

  --r-xs: 4px;
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --nav-h: 66px;
}

/* ══════════════════════════════════════
   RESET & BASE
══════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.6;
  min-height: 100vh; display: flex; flex-direction: column;
  overflow-x: hidden;
}
main { flex: 1; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ══════════════════════════════════════
   NAV
══════════════════════════════════════ */
.nav {
  position: sticky; top: 0; z-index: 200;
  background: var(--surface); border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2.5rem;
  box-shadow: 0 1px 4px rgba(45,63,212,.06);
}
.nav__logo { font-size: 1.25rem; font-weight: 900; color: var(--blue); letter-spacing: -0.03em; }
.nav__links { display: flex; gap: 0.2rem; list-style: none; align-items: center; }
.nav__links a {
  color: var(--muted); font-size: 0.8rem; font-weight: 500;
  padding: 0.45rem 0.9rem; border-radius: var(--r-sm);
  transition: color .15s, background .15s; white-space: nowrap;
}
.nav__links a:hover  { color: var(--blue); background: var(--blue-light); text-decoration: none; }
.nav__links a.active { color: var(--blue); background: var(--blue-light); font-weight: 700; }
.nav__cta {
  background: var(--orange) !important; color: #fff !important;
  font-weight: 700 !important; font-size: 0.8rem !important;
  padding: 0.5rem 1.25rem !important; border-radius: var(--r-sm) !important;
  box-shadow: 0 3px 10px rgba(244,114,33,.3);
}
.nav__cta:hover { background: var(--orange-dark) !important; transform: translateY(-1px); text-decoration: none !important; }
.nav__hamburger {
  display: none; flex-direction: column; gap: 5px;
  width: 36px; height: 36px; background: none;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  cursor: pointer; padding: 7px 8px;
}
.nav__hamburger span { display: block; height: 2px; background: var(--text); border-radius: 2px; transition: all .25s; }
.nav__hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__hamburger.open span:nth-child(2) { opacity: 0; }
.nav__hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-menu {
  display: none; position: fixed; top: var(--nav-h); left: 0; right: 0;
  background: var(--surface); border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(13,27,62,.1); z-index: 199;
  padding: 1rem 1.5rem 1.5rem; flex-direction: column; gap: 0.25rem;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  display: block; color: var(--muted); font-size: 0.9rem; font-weight: 500;
  padding: 0.65rem 0.75rem; border-radius: var(--r-sm); transition: all .15s;
}
.mobile-menu a:hover  { background: var(--surface-2); color: var(--blue); text-decoration: none; }
.mobile-menu a.active { background: var(--blue-light); color: var(--blue); font-weight: 700; }
.mobile-menu .mob-cta {
  text-align: center; background: var(--orange) !important; color: #fff !important;
  font-weight: 700 !important; border-radius: var(--r-sm) !important;
  padding: 0.75rem !important; margin-top: 0.5rem;
}

/* ══════════════════════════════════════
   BREADCRUMB
══════════════════════════════════════ */
.breadcrumb {
  max-width: 1120px; margin: 0 auto;
  padding: 1rem 1.75rem 0;
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.75rem; color: var(--light); flex-wrap: wrap;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb strong { color: var(--text); font-weight: 700; }

/* ══════════════════════════════════════
   PAGE SHELL
══════════════════════════════════════ */
.page { max-width: 1120px; margin: 0 auto; padding: 1.25rem 1.75rem 5rem; }

/* ══════════════════════════════════════
   HERO
══════════════════════════════════════ */
.hero {
  background: linear-gradient(135deg, #3b1fa8 0%, var(--chemistry) 55%, #9333ea 100%);
  border-radius: var(--r-lg); padding: 2rem 2.5rem;
  margin-bottom: 1.5rem; position: relative; overflow: hidden;
  animation: fadeUp .45s ease both;
}
.hero::before, .hero::after {
  content: ''; position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.05); pointer-events: none;
}
.hero::before { width: 340px; height: 340px; top: -90px; right: -60px; }
.hero::after  { width: 160px; height: 160px; bottom: -50px; right: 220px; }
.hero__inner {
  position: relative; z-index: 1;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
}
.hero__left { flex: 1; min-width: 0; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.22);
  color: rgba(255,255,255,.9); font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.25rem 0.8rem; border-radius: 20px; margin-bottom: 0.65rem;
}
.hero__title {
  font-size: 1.9rem; font-weight: 900; color: #fff;
  letter-spacing: -0.04em; line-height: 1.1;
}
.hero__title span { color: var(--yellow); }
.hero__sub { color: rgba(255,255,255,.72); font-size: 0.85rem; margin-top: 0.45rem; line-height: 1.6; max-width: 500px; }
.hero__stats { display: flex; gap: 0.65rem; margin-top: 1.3rem; flex-wrap: wrap; }
.hero__stat {
  background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--r-sm); padding: 0.55rem 1rem;
  display: flex; flex-direction: column; gap: 0.1rem;
}
.hero__stat-val { font-size: 1.15rem; font-weight: 900; color: #fff; line-height: 1; }
.hero__stat-val--good { color: #6ee7b7; }
.hero__stat-val--warn { color: var(--yellow); }
.hero__stat-lbl { font-size: 0.6rem; color: rgba(255,255,255,.6); font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; }
.hero__actions { display: flex; flex-direction: column; gap: 0.6rem; align-items: flex-end; flex-shrink: 0; }
.btn-ghost-white {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: rgba(255,255,255,.85) !important; font-weight: 600; font-size: 0.8rem;
  padding: 0.6rem 1.2rem; border-radius: var(--r-sm);
  border: 1px solid rgba(255,255,255,.3); transition: background .15s, color .15s; white-space: nowrap;
}
.btn-ghost-white:hover { background: rgba(255,255,255,.1); color: #fff !important; text-decoration: none !important; }

/* sample data badge */
.sample-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(245,196,0,.18); border: 1px solid rgba(245,196,0,.35);
  color: var(--yellow); font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 0.22rem 0.7rem; border-radius: 20px; margin-top: 0.85rem;
}

/* ══════════════════════════════════════
   SUBJECT SWITCHER TABS
══════════════════════════════════════ */
.subject-tabs {
  display: flex; gap: 0.5rem; margin-bottom: 1.5rem; flex-wrap: wrap;
  animation: fadeUp .45s .06s ease both;
}
.subject-tab {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 1.1rem; border-radius: var(--r-sm);
  border: 1.5px solid var(--border); background: var(--surface);
  font-size: 0.8rem; font-weight: 700; color: var(--muted);
  transition: all .15s; text-decoration: none;
}
.subject-tab:hover { text-decoration: none; }
.subject-tab--physics:hover   { border-color: var(--physics);   color: var(--physics);   background: var(--physics-bg); }
.subject-tab--chemistry.active { background: var(--chemistry-bg); border-color: var(--chemistry); color: var(--chemistry); }
.subject-tab--chemistry:hover { border-color: var(--chemistry); color: var(--chemistry); background: var(--chemistry-bg); }
.subject-tab--biology:hover   { border-color: var(--biology);   color: var(--biology);   background: var(--biology-bg); }
.subject-tab__count {
  background: rgba(0,0,0,.07); border-radius: 20px;
  padding: 0.1rem 0.5rem; font-size: 0.65rem; font-weight: 800;
}

/* ══════════════════════════════════════
   LAYOUT
══════════════════════════════════════ */
.layout { display: grid; grid-template-columns: 240px 1fr; gap: 1.5rem; align-items: start; }

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */
.sidebar {
  position: sticky; top: calc(var(--nav-h) + 1rem);
  display: flex; flex-direction: column; gap: 1rem;
  animation: fadeUp .45s .1s ease both;
}
.scard {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: 0 2px 8px rgba(45,63,212,.04);
}
.scard__head {
  padding: 0.7rem 1rem;
  background: linear-gradient(90deg, #3b1fa8, var(--chemistry));
  font-size: 0.68rem; font-weight: 800; color: rgba(255,255,255,.9);
  letter-spacing: 0.08em; text-transform: uppercase;
  display: flex; align-items: center; justify-content: space-between;
}
.scard__head span {
  background: rgba(255,255,255,.15); border-radius: 20px;
  padding: 0.12rem 0.55rem; font-size: 0.62rem;
}

/* accuracy ring */
.acc-ring-wrap {
  padding: 1.1rem; display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
}
.acc-ring { position: relative; width: 90px; height: 90px; }
.acc-ring svg { width: 90px; height: 90px; transform: rotate(-90deg); }
.acc-ring__bg   { fill: none; stroke: var(--surface-2); stroke-width: 8; }
.acc-ring__fill { fill: none; stroke: var(--chemistry); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.acc-ring__label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.acc-ring__pct  { font-size: 1.05rem; font-weight: 900; color: var(--chemistry); line-height: 1; }
.acc-ring__sub  { font-size: 0.58rem; font-weight: 700; color: var(--light); text-transform: uppercase; letter-spacing: 0.04em; }
.acc-ring-cap   { font-size: 0.72rem; font-weight: 600; color: var(--muted); text-align: center; }

/* sidebar stat rows */
.s-stat {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem; border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}
.s-stat:last-child { border-bottom: none; }
.s-stat__lbl { color: var(--muted); font-weight: 500; }
.s-stat__val { font-weight: 900; color: var(--text); }
.s-stat__val--good { color: var(--success); }
.s-stat__val--bad  { color: var(--error); }
.s-stat__val--chem { color: var(--chemistry); }

/* topic quick-jump */
.topic-jump { max-height: 340px; overflow-y: auto; padding: 0.4rem 0; }
.topic-jump::-webkit-scrollbar { width: 4px; }
.topic-jump::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.tj-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.38rem 1rem; font-size: 0.76rem; color: var(--muted);
  cursor: pointer; transition: background .12s, color .12s;
}
.tj-item:hover { background: var(--chemistry-bg); color: var(--chemistry); }
.tj-item__num {
  width: 20px; height: 20px; border-radius: 5px; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem; font-weight: 800; color: var(--light); transition: all .12s;
}
.tj-item:hover .tj-item__num { background: var(--chemistry); border-color: var(--chemistry); color: #fff; }
.tj-item__name { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tj-item__acc {
  font-size: 0.62rem; font-weight: 800;
  border-radius: 20px; padding: 0.08rem 0.4rem; flex-shrink: 0;
}
.tj-item__acc--good { color: var(--success); background: var(--success-bg); border: 1px solid var(--success-bd); }
.tj-item__acc--warn { color: var(--warning); background: var(--warning-bg); border: 1px solid var(--warning-bd); }
.tj-item__acc--bad  { color: var(--error);   background: var(--error-bg);   border: 1px solid #fca5a5; }

/* ══════════════════════════════════════
   TOOLBAR
══════════════════════════════════════ */
.toolbar {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 1rem; flex-wrap: wrap;
  animation: fadeUp .45s .12s ease both;
}
.toolbar__count { font-size: 0.78rem; color: var(--muted); font-weight: 600; flex: 1; }
.toolbar__search {
  position: relative; flex: 1; min-width: 180px;
}
.toolbar__search input {
  width: 100%; height: 38px; padding: 0 0.85rem 0 2.25rem;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--r-sm); font-family: inherit; font-size: 0.8rem;
  color: var(--text); outline: none; transition: border-color .15s;
}
.toolbar__search input:focus { border-color: var(--chemistry); box-shadow: 0 0 0 3px rgba(124,58,237,.1); }
.toolbar__search input::placeholder { color: var(--light); }
.toolbar__search-icon {
  position: absolute; left: 0.65rem; top: 50%; transform: translateY(-50%);
  color: var(--light); font-size: 0.85rem; pointer-events: none;
}
.toolbar__sort select {
  font-family: inherit; font-size: 0.78rem; font-weight: 600;
  color: var(--text); background: var(--surface);
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  padding: 0.35rem 0.65rem; outline: none; cursor: pointer;
}
.toolbar__sort select:focus { border-color: var(--chemistry); }

/* ══════════════════════════════════════
   TOPIC PERFORMANCE TABLE CARDS
══════════════════════════════════════ */
.topic-list { display: flex; flex-direction: column; gap: 0.75rem; animation: fadeUp .45s .14s ease both; }

.topic-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: 0 2px 8px rgba(45,63,212,.03);
  transition: box-shadow .15s, border-color .15s;
  scroll-margin-top: calc(var(--nav-h) + 1rem);
}
.topic-card:hover { box-shadow: 0 4px 18px rgba(124,58,237,.09); border-color: var(--chemistry-bd); }
.topic-card--oos  { border-left: 3px solid #f97316; }
.topic-card--good { border-left: 3px solid var(--success); }
.topic-card--warn { border-left: 3px solid var(--yellow); }
.topic-card--bad  { border-left: 3px solid var(--error); }

/* card header */
.tc-head {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.tc-num {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 900; color: #fff;
  background: linear-gradient(135deg, #3b1fa8, var(--chemistry));
}
.topic-card--oos .tc-num { background: linear-gradient(135deg, #ea580c, #f97316); }

.tc-name {
  flex: 1; font-size: 0.875rem; font-weight: 800; color: var(--text);
  min-width: 0; white-space: normal; word-break: break-word; line-height: 1.3;
}
.topic-card--oos .tc-name { color: #ea580c; }

.tc-head-right { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

/* accuracy chip in header */
.acc-chip {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em;
  padding: 0.2rem 0.65rem; border-radius: 20px;
}
.acc-chip--good { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-bd); }
.acc-chip--warn { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-bd); }
.acc-chip--bad  { background: var(--error-bg);   color: var(--error);   border: 1px solid #fca5a5; }

/* card body: stat grid */
.tc-stats {
  display: grid; grid-template-columns: repeat(5, 1fr);
  border-bottom: 1px solid var(--border);
}
.tc-stat {
  padding: 0.85rem 1rem; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 0.15rem;
}
.tc-stat:last-child { border-right: none; }
.tc-stat__val { font-size: 1.15rem; font-weight: 900; letter-spacing: -0.04em; line-height: 1; color: var(--text); }
.tc-stat__val--good { color: var(--success); }
.tc-stat__val--bad  { color: var(--error); }
.tc-stat__val--chem { color: var(--chemistry); }
.tc-stat__lbl { font-size: 0.62rem; font-weight: 700; color: var(--light); text-transform: uppercase; letter-spacing: 0.06em; }

/* accuracy progress bar */
.tc-acc-row {
  padding: 0.6rem 1.25rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.tc-acc-bar { flex: 1; height: 5px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.tc-acc-fill { height: 100%; border-radius: 4px; transition: width .8s ease; }
.tc-acc-fill--good { background: linear-gradient(90deg, var(--success), #34d399); }
.tc-acc-fill--warn { background: linear-gradient(90deg, var(--yellow), #fcd34d); }
.tc-acc-fill--bad  { background: linear-gradient(90deg, var(--error), #f87171); }
.tc-acc-label { font-size: 0.7rem; font-weight: 700; color: var(--muted); white-space: nowrap; }

/* card footer */
.tc-foot {
  padding: 0.7rem 1.25rem;
  background: #faf8ff;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
}
.tc-foot__hint { font-size: 0.72rem; color: var(--light); }
.btn-qperf {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--chemistry); color: #fff !important;
  font-size: 0.75rem; font-weight: 800;
  padding: 0.42rem 1rem; border-radius: 20px;
  box-shadow: 0 3px 10px rgba(124,58,237,.3);
  transition: background .15s, transform .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn-qperf:hover { background: #6d28d9; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(124,58,237,.4); text-decoration: none !important; }
.topic-card--oos .btn-qperf { background: #ea580c; box-shadow: 0 3px 10px rgba(234,88,12,.3); }
.topic-card--oos .btn-qperf:hover { background: #c2410c; }

/* ══════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════ */
.empty-state {
  display: none; text-align: center; padding: 3rem 1rem;
  color: var(--light);
}
.empty-state__icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-state__msg  { font-size: 0.9rem; font-weight: 600; color: var(--muted); }

/* ══════════════════════════════════════
   FOOTER
══════════════════════════════════════ */
.footer {
  border-top: 1px solid var(--border); background: var(--surface); padding: 1.5rem 2.5rem;
}
.footer__inner {
  max-width: 1120px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap; font-size: 0.775rem; color: var(--muted);
}
.footer__inner strong { color: var(--blue); font-weight: 800; }

/* ══════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity:0; transform:translateY(12px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 920px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
}

@media (max-width: 680px) {
  .nav { padding: 0 1rem; }
  .nav__links { display: none; }
  .nav__hamburger { display: flex; }
  .page { padding: 1rem 1rem 4rem; }
  .breadcrumb { padding: 0.75rem 1rem 0; }
  .sidebar { grid-template-columns: 1fr; }
  .footer { padding: 1.25rem 1rem; }

  /* ── Hero ── */
  .hero { padding: 1.4rem 1.1rem; }
  .hero__inner { flex-direction: column; gap: 1rem; }
  .hero__left { width: 100%; }
  .hero__title { font-size: 1.45rem; }
  .hero__sub { font-size: 0.82rem; max-width: 100%; }
  .hero__actions { align-items: flex-start; flex-direction: row; flex-wrap: wrap; gap: 0.5rem; }
  .btn-ghost-white { font-size: 0.72rem; padding: 0.45rem 0.85rem; }

  /* Hero stats — 3 per row */
  .hero__stats { gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap; }
  .hero__stat {
    flex: 1 1 calc(33% - 0.5rem);
    min-width: 76px; padding: 0.45rem 0.55rem; text-align: center;
    align-items: center;
  }
  .hero__stat-val { font-size: 1rem; }
  .hero__stat-lbl { font-size: 0.53rem; }

  /* ── Subject tabs ── */
  .subject-tabs { gap: 0.35rem; }
  .subject-tab { padding: 0.45rem 0.75rem; font-size: 0.75rem; }
  .subject-tab__count { display: none; }

  /* ── Toolbar ── */
  .toolbar { flex-direction: column; align-items: stretch; gap: 0.5rem; }
  .toolbar__search { min-width: unset; }
  .toolbar__count { font-size: 0.72rem; }

  /* ── Topic card header ── */
  .tc-head {
    padding: 0.75rem 1rem;
    gap: 0.6rem;
    flex-wrap: wrap;          /* allow chip to wrap below name if needed */
    align-items: flex-start;
  }
  .tc-num {
    width: 26px; height: 26px; font-size: 0.62rem; border-radius: 6px;
    flex-shrink: 0; margin-top: 2px;
  }
  .tc-name { font-size: 0.82rem; }
  .tc-head-right { flex-shrink: 0; }
  .acc-chip { font-size: 0.62rem; padding: 0.15rem 0.5rem; }

  /* ── Stat grid: 2 columns (was 5 → 3 → now 2) ── */
  .tc-stats { grid-template-columns: repeat(2, 1fr); }
  .tc-stat { padding: 0.7rem 0.85rem; }
  .tc-stat:nth-child(2)  { border-right: none; }
  .tc-stat:nth-child(3)  { border-top: 1px solid var(--border); border-right: 1px solid var(--border); }
  .tc-stat:nth-child(4)  { border-top: 1px solid var(--border); border-right: none; }
  .tc-stat:nth-child(5)  { border-top: 1px solid var(--border); grid-column: 1 / -1; border-right: none; }
  .tc-stat__val { font-size: 1rem; }
  .tc-stat__lbl { font-size: 0.58rem; }

  /* ── Accuracy bar row ── */
  .tc-acc-row { padding: 0.5rem 1rem; gap: 0.5rem; }
  .tc-acc-label { font-size: 0.65rem; }

  /* ── Card footer: stack hint + button vertically ── */
  .tc-foot {
    padding: 0.65rem 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .tc-foot__hint { font-size: 0.68rem; }
  .btn-qperf { width: 100%; justify-content: center; }
}

/* Very small phones */
@media (max-width: 380px) {
  .hero__stat { flex: 1 1 calc(50% - 0.5rem); }
  .tc-stats { grid-template-columns: repeat(2, 1fr); }
  .hero__title { font-size: 1.3rem; }
}
