/* ==========================================================================
   SOPAN — design system
   ========================================================================== */

:root {
  --font: "Anek Bangla", "Hind Siliguri", "Noto Sans Bengali", "Nirmala UI", system-ui, sans-serif;
  --font-latin: "Plus Jakarta Sans", "Anek Bangla", system-ui, sans-serif;

  --bg: #05070e;
  --bg-2: #080c16;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --surface-3: rgba(255, 255, 255, 0.11);
  --panel: rgba(11, 16, 29, 0.72);
  --panel-solid: #0b1120;
  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.26);
  --text: #eef3ff;
  --muted: #94a1c0;
  --muted-2: #6d7a9b;

  --brand: #2de2a7;
  --brand-2: #57b9ff;
  --brand-ink: #04130d;
  --violet: #a78bfa;
  --rose: #fb7185;
  --amber: #fbbf24;
  --sky: #38bdf8;
  --ok: #34d399;
  --danger: #fb7185;

  --shadow: 0 30px 70px -32px rgba(0, 0, 0, 0.75);
  --shadow-sm: 0 14px 34px -20px rgba(0, 0, 0, 0.6);
  --glow: 0 0 0 1px rgba(45, 226, 167, 0.22), 0 20px 50px -24px rgba(45, 226, 167, 0.5);

  --sidebar-w: 264px;
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 12px;

  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f2f6fc;
  --bg-2: #eef3fb;
  --surface: #ffffff;
  --surface-2: #eef3fa;
  --surface-3: #e2e9f4;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-solid: #ffffff;
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.16);
  --text: #0c1424;
  --muted: #5a6784;
  --muted-2: #8793ad;

  --brand: #0da97a;
  --brand-2: #2f7df6;
  --brand-ink: #ffffff;

  --shadow: 0 28px 60px -30px rgba(15, 23, 42, 0.25);
  --shadow-sm: 0 12px 26px -16px rgba(15, 23, 42, 0.22);
  --glow: 0 0 0 1px rgba(13, 169, 122, 0.2), 0 18px 40px -22px rgba(13, 169, 122, 0.35);

  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { line-height: 1.32; letter-spacing: -0.012em; font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
::selection { background: rgba(45, 226, 167, 0.28); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 8px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-track { background: transparent; }

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 500;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- ambient background ---------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.blob {
  position: absolute;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.22;
  animation: drift 26s ease-in-out infinite alternate;
}
html[data-theme="light"] .blob { opacity: 0.16; filter: blur(120px); }
.b1 { background: #0fa37f; top: -260px; left: -140px; }
.b2 { background: #4338ca; top: 8%; right: -240px; animation-delay: -8s; }
.b3 { background: #0891b2; bottom: -340px; left: 32%; animation-delay: -16s; }
.grid-glow {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 10%, transparent 75%);
  opacity: 0.5;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(60px, 40px, 0) scale(1.12); }
}

/* ---------- layout ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  max-width: 1560px;
  margin: 0 auto;
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 22px 16px 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(8, 12, 22, 0.92), rgba(5, 8, 15, 0.72));
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  z-index: 40;
}
html[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 251, 255, 0.75));
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 8px;
}
.brand-mark { width: 42px; height: 42px; flex: none; filter: drop-shadow(0 8px 18px rgba(45, 226, 167, 0.3)); }
.brand-mark.sm { width: 34px; height: 34px; }
.brand-mark svg { width: 100%; height: 100%; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text b { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.brand-text small {
  font-family: var(--font-latin);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.32em;
  color: var(--muted-2);
  margin-top: 3px;
}

.nav { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; padding-right: 2px; }
.nav-sep { height: 1px; background: var(--line); margin: 10px 10px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 13px;
  color: var(--muted);
  font-weight: 500;
  text-align: left;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item:active { transform: scale(0.99); }
.nav-ico { width: 20px; height: 20px; display: grid; place-items: center; opacity: 0.9; }
.nav-ico svg { width: 19px; height: 19px; }
.nav-item.active {
  color: var(--text);
  background: linear-gradient(100deg, rgba(45, 226, 167, 0.16), rgba(87, 185, 255, 0.07) 60%, transparent);
  box-shadow: inset 0 0 0 1px rgba(45, 226, 167, 0.18);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 22%;
  bottom: 22%;
  width: 3px;
  border-radius: 99px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  box-shadow: 0 0 14px var(--brand);
}
.nav-item.active .nav-ico { color: var(--brand); }
html[data-theme="light"] .nav-item.active { background: linear-gradient(100deg, rgba(13, 169, 122, 0.12), rgba(47, 125, 246, 0.06)); }
.live-dot {
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.18);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.16); }
  50% { box-shadow: 0 0 0 7px rgba(251, 113, 133, 0.04); }
}

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.pro-card {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border-radius: 18px;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(87, 185, 255, 0.28), transparent 55%),
    linear-gradient(150deg, #0d3b33, #0a1f2c 70%);
  border: 1px solid rgba(45, 226, 167, 0.22);
  color: #eafff8;
}
.pro-orb {
  position: absolute;
  width: 130px;
  height: 130px;
  right: -44px;
  top: -54px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(45, 226, 167, 0.65), transparent 70%);
  filter: blur(6px);
}
.pro-badge { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: rgba(45, 226, 167, 0.16); color: #6ff2c9; margin-bottom: 8px; }
.pro-card b { display: block; font-size: 15px; }
.pro-card p { margin: 5px 0 12px; font-size: 12.5px; line-height: 1.55; color: rgba(234, 255, 248, 0.66); }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.user-chip:hover { border-color: var(--line-strong); background: var(--surface-2); }
.user-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.user-meta b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.user-more { margin-left: auto; color: var(--muted-2); }

.shell { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px clamp(16px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.topbar-title { font-size: 15px; font-weight: 600; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 9px; margin-left: auto; }
.mobile-brand { display: none; align-items: center; gap: 9px; font-size: 18px; font-weight: 700; }
.mobile-brand b { letter-spacing: -0.01em; }

.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 99px;
  border: 1px solid rgba(251, 191, 36, 0.22);
  background: rgba(251, 191, 36, 0.09);
  color: var(--amber);
  font-size: 12.5px;
}
.streak-pill b { font-family: var(--font-latin); font-weight: 700; }
.streak-pill span:last-child { color: var(--muted); }
.flame-ico { animation: flicker 2.6s ease-in-out infinite; }
@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  50% { transform: scale(1.1) rotate(-3deg); opacity: 0.85; }
}

#view {
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px clamp(16px, 3vw, 36px) 64px;
}

/* ---------- shared bits ---------- */
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--font-latin); font-variant-numeric: tabular-nums; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--brand);
  margin-bottom: 6px;
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}
.page-head h1 { font-size: clamp(24px, 2.6vw, 32px); }
.page-head p.desc { color: var(--muted); font-size: 14px; margin-top: 6px; max-width: 62ch; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.032), transparent 40%),
    var(--panel);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}
html[data-theme="light"] .card { background: var(--surface); }

.section { margin-top: 28px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}
.section-head h2 { font-size: 18.5px; }
.section-head .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.link-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  padding: 7px 11px;
  border-radius: 10px;
  transition: background 0.2s ease, gap 0.2s ease;
}
.link-more:hover { background: var(--surface); gap: 9px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 19px;
  border-radius: 13px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.975); }
.btn svg { width: 17px; height: 17px; }
.btn-primary {
  background: linear-gradient(120deg, #2de2a7, #57b9ff);
  color: #04130d;
  box-shadow: 0 14px 32px -16px rgba(45, 226, 167, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-primary:hover { box-shadow: 0 18px 40px -14px rgba(45, 226, 167, 0.75); transform: translateY(-1px); }
html[data-theme="light"] .btn-primary { color: #fff; }
.btn-ghost { border-color: var(--line-strong); background: var(--surface); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn-soft { background: rgba(45, 226, 167, 0.12); color: var(--brand); border-color: rgba(45, 226, 167, 0.18); }
.btn-soft:hover { background: rgba(45, 226, 167, 0.18); }
.btn-light { background: #eafff8; color: #06231c; }
.btn-light:hover { background: #fff; }
.btn-danger { background: rgba(251, 113, 133, 0.14); color: #ff9aa8; border-color: rgba(251, 113, 133, 0.3); }
.btn-danger:hover { background: rgba(251, 113, 133, 0.2); }
.btn-sm { padding: 8px 13px; font-size: 12.5px; border-radius: 10px; }
.btn-lg { padding: 14px 24px; font-size: 15px; border-radius: 15px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }
.icon-btn svg { width: 18px; height: 18px; }

.avatar {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #2de2a7, #57b9ff);
  color: #fff;
  text-shadow: 0 1px 2px rgba(5, 20, 15, 0.35);
  font-weight: 700;
  font-family: var(--font-latin);
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.avatar-sm { width: 34px; height: 34px; font-size: 13px; }
.avatar-md { width: 38px; height: 38px; font-size: 14px; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.avatar-xl { width: 88px; height: 88px; font-size: 30px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.chip i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-live { color: var(--rose); border-color: rgba(251, 113, 133, 0.28); background: rgba(251, 113, 133, 0.1); }
.chip-brand { color: var(--brand); border-color: rgba(45, 226, 167, 0.24); background: rgba(45, 226, 167, 0.09); }
.chip-amber { color: var(--amber); border-color: rgba(251, 191, 36, 0.24); background: rgba(251, 191, 36, 0.09); }
.chip-violet { color: var(--violet); border-color: rgba(167, 139, 250, 0.26); background: rgba(167, 139, 250, 0.1); }
.chip-subject { color: var(--s, var(--brand)); border-color: color-mix(in srgb, var(--s, var(--brand)) 30%, transparent); background: color-mix(in srgb, var(--s, var(--brand)) 10%, transparent); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 99px;
  background: var(--surface-2);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
}
.pill .live-beat { width: 7px; height: 7px; border-radius: 50%; background: var(--rose); animation: pulse 1.8s infinite; }

.divider { height: 1px; background: var(--line); margin: 16px 0; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.analytics-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }

.ring-svg { transform: rotate(-90deg); }
.ring-track { stroke: var(--surface-3); }
.ring-bar { transition: stroke-dashoffset 1s cubic-bezier(0.22, 1, 0.36, 1); }
.ring-wrap { position: relative; display: grid; place-items: center; flex: none; }
.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  text-align: center;
  line-height: 1.1;
}
.ring-center b { font-family: var(--font-latin); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.ring-center small { font-size: 10.5px; color: var(--muted-2); }

.reveal {
  animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ---------- home hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 26px;
  padding: clamp(22px, 3vw, 34px);
  border-radius: 28px;
  border: 1px solid rgba(45, 226, 167, 0.18);
  background:
    radial-gradient(90% 130% at 0% 0%, rgba(45, 226, 167, 0.2), transparent 55%),
    radial-gradient(80% 120% at 100% 20%, rgba(87, 185, 255, 0.16), transparent 55%),
    linear-gradient(150deg, #0a1a1a, #0a1222 60%, #0a1020);
  box-shadow: 0 40px 80px -50px rgba(45, 226, 167, 0.5);
}
html[data-theme="light"] .hero {
  background:
    radial-gradient(90% 130% at 0% 0%, rgba(13, 169, 122, 0.18), transparent 55%),
    radial-gradient(80% 120% at 100% 20%, rgba(47, 125, 246, 0.14), transparent 55%),
    linear-gradient(150deg, #e6fbf4, #eef4ff 60%, #f7faff);
  box-shadow: 0 34px 70px -50px rgba(13, 169, 122, 0.45);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse at 20% 0%, black, transparent 65%);
  -webkit-mask-image: radial-gradient(ellipse at 20% 0%, black, transparent 65%);
  pointer-events: none;
  opacity: 0.6;
}
html[data-theme="light"] .hero::after { opacity: 0.35; }
.hero-copy { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.hero-copy h2 {
  font-size: clamp(25px, 3.1vw, 37px);
  line-height: 1.24;
  letter-spacing: -0.02em;
  color: #fff;
  max-width: 20ch;
}
html[data-theme="light"] .hero-copy h2 { color: #07231d; }
.hero-copy h2 .grad {
  background: linear-gradient(100deg, #6ff2c9, #7cc9ff 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html[data-theme="light"] .hero-copy h2 .grad { background: linear-gradient(100deg, #0a9a70, #2563eb); -webkit-background-clip: text; background-clip: text; }
.hero-copy p.lead { color: rgba(224, 240, 255, 0.66); font-size: 13.5px; max-width: 48ch; }
html[data-theme="light"] .hero-copy p.lead { color: #4a6070; }
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 99px;
  background: rgba(251, 113, 133, 0.14);
  border: 1px solid rgba(251, 113, 133, 0.3);
  color: #ff9aa8;
  font-size: 11.5px;
  font-weight: 700;
}
.live-badge .live-beat { width: 7px; height: 7px; border-radius: 50%; background: #fb7185; box-shadow: 0 0 0 0 rgba(251,113,133,.6); animation: beat 1.8s infinite; }
@keyframes beat {
  0% { box-shadow: 0 0 0 0 rgba(251, 113, 133, 0.5); }
  70% { box-shadow: 0 0 0 9px rgba(251, 113, 133, 0); }
  100% { box-shadow: 0 0 0 0 rgba(251, 113, 133, 0); }
}
.countdown { display: flex; align-items: center; gap: 8px; margin: 2px 0 2px; }
.cd-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 52px;
  padding: 7px 8px 5px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(6, 12, 22, 0.45);
  backdrop-filter: blur(6px);
}
html[data-theme="light"] .cd-cell { border-color: rgba(15, 23, 42, 0.08); background: rgba(255, 255, 255, 0.65); }
.cd-cell b {
  font-family: var(--font-latin);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
html[data-theme="light"] .cd-cell b { color: #07231d; }
.cd-cell span { font-size: 9.5px; color: var(--muted); letter-spacing: 0.03em; }
.cd-sep { color: rgba(255, 255, 255, 0.3); font-weight: 700; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hero-people { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { width: 28px; height: 28px; font-size: 10.5px; margin-left: -7px; border: 2px solid #0a1420; }
html[data-theme="light"] .avatar-stack .avatar { border-color: #eef4ff; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-stack .avatar.more { background: var(--surface-3); color: var(--text); font-size: 9.5px; }
.hero-people small { color: var(--muted); font-size: 11.5px; }

.hero-visual { position: relative; z-index: 2; min-height: 250px; display: grid; place-items: center; }
.hv-ring {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  border: 1px dashed rgba(45, 226, 167, 0.25);
  animation: spin 40s linear infinite;
}
.hv-ring::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 50%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 16px var(--brand);
}
@keyframes spin { to { transform: rotate(360deg); } }
.hv-card {
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(9, 17, 30, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: 0 30px 60px -28px rgba(0, 0, 0, 0.8);
  padding: 16px;
}
html[data-theme="light"] .hv-card { background: rgba(255, 255, 255, 0.8); border-color: rgba(15, 23, 42, 0.08); }
.hv-back {
  position: absolute;
  width: 210px;
  height: 150px;
  transform: translate(38px, -46px) rotate(9deg);
  opacity: 0.55;
  padding: 14px;
}
.hv-back .bar-line { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); margin-bottom: 7px; }
.hv-back .bar-line:nth-child(2) { width: 70%; }
.hv-back .bar-line:nth-child(3) { width: 84%; }
.hv-back .mini-dots { display: flex; gap: 5px; margin-top: 12px; flex-wrap: wrap; }
.hv-back .mini-dots i { width: 16px; height: 16px; border-radius: 5px; background: rgba(255, 255, 255, 0.1); }
.hv-back .mini-dots i.on { background: rgba(45, 226, 167, 0.55); }
.hv-front { position: relative; width: min(290px, 100%); animation: floaty 7s ease-in-out infinite; }
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}
.hv-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.hv-top .pill { background: rgba(251, 113, 133, 0.14); color: #ff9aa8; }
.hv-top .t { font-size: 10.5px; color: var(--muted); }
.hv-q { font-size: 13.5px; font-weight: 600; line-height: 1.55; margin-bottom: 11px; color: #fff; }
html[data-theme="light"] .hv-q { color: #0c1424; }
.hv-opts { display: flex; flex-direction: column; gap: 6px; }
.hv-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 10.5px;
  color: rgba(224, 240, 255, 0.66);
}
html[data-theme="light"] .hv-opt { border-color: rgba(15, 23, 42, 0.07); color: #4a6070; }
.hv-opt i {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
}
.hv-opt.right { border-color: rgba(45, 226, 167, 0.45); background: rgba(45, 226, 167, 0.1); color: #a9ffe4; }
html[data-theme="light"] .hv-opt.right { color: #067a58; }
.hv-opt.right i { background: var(--brand); color: #04130d; }
.hv-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 11px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
html[data-theme="light"] .hv-foot { border-color: rgba(15, 23, 42, 0.06); }
.hv-foot small { font-size: 10px; color: var(--muted); }

/* ---------- stats ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-top: 16px; }
.stat-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: transform 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  right: -34px;
  top: -40px;
  border-radius: 50%;
  background: var(--s, var(--brand));
  opacity: 0.14;
  filter: blur(10px);
}
.stat-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.stat-ico {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--s, var(--brand));
  background: color-mix(in srgb, var(--s, var(--brand)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--s, var(--brand)) 22%, transparent);
}
.stat-ico svg { width: 20px; height: 20px; }
.stat-label { font-size: 11.5px; color: var(--muted-2); }
.stat-value { font-family: var(--font-latin); font-size: 21px; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
.stat-value small { font-family: var(--font); font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.stat-sub { font-size: 10.5px; color: var(--muted-2); }

/* ---------- goal / charts ---------- */
.goal-card { display: flex; gap: 18px; align-items: center; }
.goal-copy { min-width: 0; }
.goal-copy h3 { font-size: 16px; }
.goal-copy p { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.goal-list { display: flex; gap: 16px; margin-top: 14px; }
.goal-list div { display: flex; flex-direction: column; }
.goal-list b { font-family: var(--font-latin); font-size: 16px; }
.goal-list span { font-size: 10.5px; color: var(--muted-2); }

.chart-card { display: flex; flex-direction: column; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.chart-head h3 { font-size: 15.5px; }
.chart-head p { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }
.chart-total { font-family: var(--font-latin); font-size: 22px; font-weight: 700; }
.chart-total small { font-family: var(--font); font-size: 10.5px; color: var(--muted-2); font-weight: 500; }

.bars { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; height: 132px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-val { font-family: var(--font-latin); font-size: 9.5px; color: var(--muted-2); height: 12px; }
.bar-track {
  width: 100%;
  max-width: 30px;
  flex: 1;
  display: flex;
  align-items: flex-end;
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}
.bar-track span {
  display: block;
  width: 100%;
  border-radius: 8px;
  background: linear-gradient(180deg, #57b9ff, #2de2a7);
  animation: growBar 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
  min-height: 3px;
}
.bar-col.is-today .bar-track span { background: linear-gradient(180deg, #6ff2c9, #2de2a7); box-shadow: 0 0 16px rgba(45, 226, 167, 0.5); }
.bar-col.is-today .bar-val { color: var(--brand); font-weight: 700; }
.bar-day { font-size: 10px; color: var(--muted-2); }
.bar-col.is-today .bar-day { color: var(--brand); font-weight: 600; }
@keyframes growBar { from { height: 0 !important; } }

/* ---------- subjects ---------- */
.subjects-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.subject-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  text-align: left;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}
.subject-card::after {
  content: "";
  position: absolute;
  width: 110px;
  height: 110px;
  right: -46px;
  bottom: -58px;
  border-radius: 50%;
  background: var(--s, var(--brand));
  opacity: 0.12;
  filter: blur(4px);
  transition: opacity 0.2s ease;
}
.subject-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--s, var(--brand)) 35%, transparent); box-shadow: 0 18px 40px -28px var(--s, var(--brand)); }
.subject-card:hover::after { opacity: 0.2; }
.subj-top { display: flex; align-items: center; justify-content: space-between; }
.subj-ico {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--s, var(--brand));
  background: color-mix(in srgb, var(--s, var(--brand)) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--s, var(--brand)) 22%, transparent);
}
.subj-ico svg { width: 19px; height: 19px; }
.subj-go { color: var(--muted-2); transition: transform 0.2s ease, color 0.2s ease; }
.subject-card:hover .subj-go { transform: translateX(2px); color: var(--s, var(--brand)); }
.subj-name { font-size: 14.5px; font-weight: 600; }
.subj-en { font-family: var(--font-latin); font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); margin-top: 1px; }
.subj-foot { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted-2); margin-top: 6px; }
.mini-bar { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.mini-bar span { display: block; height: 100%; border-radius: 99px; background: var(--s, var(--brand)); animation: growWidth 0.9s cubic-bezier(0.22,1,0.36,1) both; }
@keyframes growWidth { from { width: 0; } }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; }
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 6px;
  border-radius: 12px;
  transition: background 0.18s ease;
}
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-row:hover { background: var(--surface); }
.list-rank {
  width: 24px;
  flex: none;
  text-align: center;
  font-family: var(--font-latin);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted-2);
}
.list-name { font-size: 13px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-sub { font-size: 10.5px; color: var(--muted-2); }
.list-val { margin-left: auto; font-family: var(--font-latin); font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.list-val b { color: var(--text); }

.exam-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 0.2s ease, transform 0.2s ease;
  text-align: left;
  width: 100%;
}
.exam-mini:hover { border-color: var(--line-strong); transform: translateX(2px); }
.exam-mini + .exam-mini { margin-top: 8px; }
.em-date {
  width: 46px;
  flex: none;
  text-align: center;
  border-radius: 12px;
  padding: 5px 0;
  background: rgba(45, 226, 167, 0.1);
  border: 1px solid rgba(45, 226, 167, 0.18);
}
.em-date b { display: block; font-family: var(--font-latin); font-size: 16px; line-height: 1.15; color: var(--brand); }
.em-date span { font-size: 9px; color: var(--muted-2); }
.em-body { min-width: 0; }
.em-body b { display: block; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-body small { font-size: 10.5px; color: var(--muted-2); }

.mini-leader { display: flex; flex-direction: column; gap: 2px; }

/* ---------- practice ---------- */
.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  flex-wrap: wrap;
}
.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  transition: background 0.2s ease, color 0.2s ease;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--panel-solid); color: var(--text); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.seg-btn .count { font-family: var(--font-latin); font-size: 10px; padding: 1px 6px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.seg-btn.active .count { background: rgba(45, 226, 167, 0.15); color: var(--brand); }

.practice-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid rgba(167, 139, 250, 0.2);
  background:
    radial-gradient(90% 130% at 0% 0%, rgba(167, 139, 250, 0.18), transparent 60%),
    linear-gradient(130deg, #151033, #0c1222 70%);
  color: #f2edff;
  margin-bottom: 18px;
  overflow: hidden;
  position: relative;
}
html[data-theme="light"] .practice-cta {
  background: radial-gradient(90% 130% at 0% 0%, rgba(167,139,250,.22), transparent 60%), linear-gradient(130deg, #f0ecff, #f7faff);
  color: var(--text);
  border-color: rgba(124, 58, 237, 0.16);
}
.practice-cta b { font-size: 16px; display: block; }
.practice-cta p { font-size: 12.5px; opacity: 0.68; margin-top: 3px; }
.practice-cta .pc-left { display: flex; align-items: center; gap: 14px; }
.pc-ico {
  width: 46px;
  height: 46px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(167, 139, 250, 0.16);
  color: #c4b1ff;
  border: 1px solid rgba(167, 139, 250, 0.26);
}
html[data-theme="light"] .pc-ico { color: #7c3aed; background: rgba(124, 58, 237, 0.1); }

.practice-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.practice-head h2 { font-size: 18px; }
.progress-line { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress-line span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width 0.3s ease; }

.q-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.q-card { padding: clamp(18px, 2.6vw, 28px); }
.q-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.q-top .q-count { margin-left: auto; font-family: var(--font-latin); font-size: 11.5px; color: var(--muted-2); }
.q-text { font-size: clamp(17px, 1.8vw, 21px); line-height: 1.75; font-weight: 600; margin-bottom: 20px; letter-spacing: -0.005em; }
.options { display: flex; flex-direction: column; gap: 9px; }
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.12s ease;
  font-size: 14.5px;
}
.option:hover { border-color: var(--line-strong); background: var(--surface-2); }
.option:active { transform: scale(0.995); }
.opt-letter {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-family: var(--font-latin);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  transition: all 0.18s ease;
}
.option.is-selected { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, transparent); }
.option.is-selected .opt-letter { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.option.is-correct { border-color: rgba(52, 211, 153, 0.6); background: rgba(52, 211, 153, 0.1); }
.option.is-correct .opt-letter { background: var(--ok); color: #04130d; border-color: var(--ok); }
.option.is-wrong { border-color: rgba(251, 113, 133, 0.6); background: rgba(251, 113, 133, 0.1); }
.option.is-wrong .opt-letter { background: var(--danger); color: #1a0509; border-color: var(--danger); }
.option.is-dim { opacity: 0.5; }
.option[disabled] { cursor: default; }
.opt-mark { margin-left: auto; flex: none; display: grid; place-items: center; }
.opt-mark svg { width: 18px; height: 18px; }
.opt-mark.ok { color: var(--ok); }
.opt-mark.bad { color: var(--danger); }

.q-actions { display: flex; align-items: center; gap: 9px; margin-top: 20px; flex-wrap: wrap; }
.q-actions .spacer { flex: 1; }

.explain {
  margin-top: 18px;
  padding: 15px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  animation: fadeUp 0.35s ease both;
}
.explain.bad { border-left-color: var(--danger); }
.explain-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--brand); margin-bottom: 5px; }
.explain.bad .explain-head { color: #ff9aa8; }
.explain p { font-size: 13px; color: var(--muted); line-height: 1.7; }
.explain .ans { color: var(--text); font-weight: 600; }

.side-card { padding: 16px; }
.side-card h3 { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.side-note { font-size: 11.5px; color: var(--muted-2); line-height: 1.6; }
.kbd {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  background: var(--surface-2);
  font-family: var(--font-latin);
  font-size: 10px;
  color: var(--muted);
}

.session-summary { max-width: 560px; margin: 30px auto; text-align: center; padding: 30px; }
.session-summary .ring-wrap { margin: 0 auto 16px; }
.session-summary h2 { font-size: 24px; }
.session-summary p { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.summary-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0; }
.summary-stats div { padding: 12px 8px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.summary-stats b { display: block; font-family: var(--font-latin); font-size: 20px; }
.summary-stats span { font-size: 10.5px; color: var(--muted-2); }
.summary-actions { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 46px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 20px;
  color: var(--muted);
  background: var(--surface);
}
.empty-ico {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--surface-2);
  color: var(--muted-2);
}
.empty-ico svg { width: 26px; height: 26px; }
.empty b { color: var(--text); font-size: 15px; }
.empty p { font-size: 12.5px; max-width: 42ch; }

/* ---------- exams ---------- */
.exam-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.exam-card { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.exam-card .ec-top { display: flex; align-items: flex-start; gap: 12px; }
.exam-ico {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(87, 185, 255, 0.12);
  color: var(--brand-2);
  border: 1px solid rgba(87, 185, 255, 0.2);
}
.exam-ico svg { width: 21px; height: 21px; }
.exam-card h3 { font-size: 15.5px; line-height: 1.4; }
.exam-card .ec-sub { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }
.exam-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.exam-desc { font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.exam-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 4px; }
.exam-foot small { font-size: 10.5px; color: var(--muted-2); }

.exam-lobby { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.lobby-card { padding: clamp(20px, 3vw, 30px); }
.lobby-card h1 { font-size: clamp(22px, 2.6vw, 30px); margin: 10px 0 8px; }
.lobby-card .lead { color: var(--muted); font-size: 13.5px; max-width: 60ch; }
.rules { display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }
.rule { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.rule .r-ico {
  width: 26px; height: 26px; flex: none; display: grid; place-items: center;
  border-radius: 8px; background: var(--surface-2); color: var(--brand);
}
.rule .r-ico svg { width: 14px; height: 14px; }
.dist-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.lobby-side { display: flex; flex-direction: column; gap: 14px; }
.big-time { display: flex; gap: 7px; margin-top: 8px; }
.big-time div { flex: 1; text-align: center; padding: 9px 4px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); }
.big-time b { display: block; font-family: var(--font-latin); font-size: 18px; }
.big-time span { font-size: 9.5px; color: var(--muted-2); }

/* ---------- exam runner ---------- */
.exam-layout { display: grid; grid-template-columns: minmax(0, 1fr) 296px; gap: 16px; align-items: start; }
.exam-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  margin-bottom: 14px;
  position: sticky;
  top: 66px;
  z-index: 20;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.exam-bar .eb-title { min-width: 0; }
.exam-bar .eb-title b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exam-bar .eb-title small { font-size: 10.5px; color: var(--muted-2); }
.timer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 5px 12px 5px 6px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-variant-numeric: tabular-nums;
}
.timer b { font-family: var(--font-latin); font-size: 16px; letter-spacing: 0.02em; }
.timer.is-urgent { border-color: rgba(251, 113, 133, 0.4); background: rgba(251, 113, 133, 0.1); color: #ff9aa8; animation: pulse 1.6s infinite; }
.timer-ring { width: 38px; height: 38px; }

.palette-card { padding: 15px; }
.palette-card h3 { font-size: 13px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.palette-card h3 span { font-family: var(--font-latin); font-size: 11px; color: var(--muted-2); font-weight: 500; }
.palette { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.pal-btn {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: var(--font-latin);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.15s ease;
}
.pal-btn:hover { border-color: var(--line-strong); color: var(--text); }
.pal-btn.is-answered { background: rgba(45, 226, 167, 0.16); border-color: rgba(45, 226, 167, 0.4); color: var(--brand); }
.pal-btn.is-marked { border-color: rgba(251, 191, 36, 0.55); color: var(--amber); border-style: dashed; }
.pal-btn.is-marked.is-answered { background: rgba(251, 191, 36, 0.14); color: var(--amber); }
.pal-btn.is-current { box-shadow: 0 0 0 2px var(--brand); border-color: var(--brand); color: var(--text); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--muted-2); }
.legend-item i { width: 10px; height: 10px; border-radius: 3px; border: 1px solid var(--line-strong); }
.legend-item i.a { background: rgba(45, 226, 167, 0.4); border-color: rgba(45, 226, 167, 0.5); }
.legend-item i.m { border-color: var(--amber); border-style: dashed; }
.legend-item i.n { background: var(--surface); }
.exam-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 66px; }

/* ---------- result ---------- */
.result-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(20px, 4vw, 40px);
  align-items: center;
  padding: clamp(22px, 3vw, 32px);
  border-radius: 26px;
  border: 1px solid var(--line);
  background:
    radial-gradient(80% 120% at 0% 0%, rgba(45, 226, 167, 0.14), transparent 55%),
    var(--panel);
}
.result-hero .score-center b { font-size: 34px; }
.result-hero .score-center small { font-size: 11.5px; }
.result-title h1 { font-size: clamp(22px, 2.6vw, 29px); margin: 4px 0 4px; }
.result-title .meta { color: var(--muted); font-size: 12.5px; }
.score-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-top: 16px; }
.score-cell { padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.score-cell b { display: block; font-family: var(--font-latin); font-size: 17px; }
.score-cell span { font-size: 10px; color: var(--muted-2); }
.score-cell.ok b { color: var(--ok); }
.score-cell.bad b { color: #ff9aa8; }
.percentile-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 5px 11px;
  border-radius: 99px;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.28);
  color: var(--violet);
  font-size: 11px;
  font-weight: 600;
}
.result-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 16px; }

.subject-breakdown { display: flex; flex-direction: column; gap: 10px; }
.sb-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.sb-name { width: 118px; flex: none; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-track { flex: 1; height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.sb-track span { display: block; height: 100%; border-radius: 99px; background: var(--s, var(--brand)); animation: growWidth 0.8s ease both; }
.sb-val { width: 52px; text-align: right; font-family: var(--font-latin); font-size: 11px; color: var(--muted); }

.review { display: flex; flex-direction: column; gap: 9px; }
.rev-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  overflow: hidden;
}
.rev-item summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  font-size: 12.5px;
}
.rev-item summary::-webkit-details-marker { display: none; }
.rev-item summary .q-mini { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rev-no {
  width: 22px; height: 22px; flex: none; display: grid; place-items: center;
  border-radius: 7px; background: var(--surface-2);
  font-family: var(--font-latin); font-size: 10px; color: var(--muted);
}
.rev-no.ok { background: rgba(52, 211, 153, 0.16); color: var(--ok); }
.rev-no.bad { background: rgba(251, 113, 133, 0.16); color: #ff9aa8; }
.rev-no.skip { background: var(--surface-2); color: var(--muted-2); }
.rev-item[open] summary { border-bottom: 1px solid var(--line); }
.rev-body { padding: 14px; }
.rev-q { font-size: 14px; font-weight: 600; line-height: 1.7; margin-bottom: 10px; }
.rev-opts { display: flex; flex-direction: column; gap: 6px; margin-bottom: 11px; }
.rev-opt {
  display: flex;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.rev-opt b { font-family: var(--font-latin); font-size: 10px; width: 13px; flex: none; color: var(--muted-2); }
.rev-opt.right { border-color: rgba(52, 211, 153, 0.45); background: rgba(52, 211, 153, 0.08); color: var(--text); }
.rev-opt.wrong { border-color: rgba(251, 113, 133, 0.45); background: rgba(251, 113, 133, 0.07); color: var(--text); }
.rev-opt .tag { margin-left: auto; font-size: 9.5px; white-space: nowrap; }
.rev-opt.right .tag { color: var(--ok); }
.rev-opt.wrong .tag { color: #ff9aa8; }

/* ---------- analytics ---------- */
.radar-wrap { display: grid; place-items: center; padding: 6px 0; }
.radar-labels text { font-family: var(--font); }
.heatmap-wrap { overflow-x: auto; padding-bottom: 4px; }
.heatmap {
  display: grid;
  grid-template-rows: repeat(7, 12px);
  grid-auto-flow: column;
  grid-auto-columns: 12px;
  gap: 4px;
  width: max-content;
}
.heat-cell { width: 12px; height: 12px; border-radius: 3px; background: var(--surface-2); }
.heat-cell.l1 { background: rgba(45, 226, 167, 0.25); }
.heat-cell.l2 { background: rgba(45, 226, 167, 0.45); }
.heat-cell.l3 { background: rgba(45, 226, 167, 0.7); }
.heat-cell.l4 { background: #2de2a7; }
html[data-theme="light"] .heat-cell.l1 { background: rgba(13, 169, 122, 0.25); }
html[data-theme="light"] .heat-cell.l2 { background: rgba(13, 169, 122, 0.45); }
html[data-theme="light"] .heat-cell.l3 { background: rgba(13, 169, 122, 0.7); }
html[data-theme="light"] .heat-cell.l4 { background: #0da97a; }
.heat-legend { display: flex; align-items: center; gap: 5px; margin-top: 10px; font-size: 10px; color: var(--muted-2); }
.heat-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.mastery-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.mastery-row + .mastery-row { border-top: 1px solid var(--line); }
.mastery-dot { width: 26px; height: 26px; flex: none; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--s) 13%, transparent); color: var(--s); }
.mastery-dot svg { width: 13px; height: 13px; }
.mastery-name { width: 110px; flex: none; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mastery-bar { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.mastery-bar span { display: block; height: 100%; border-radius: 99px; background: var(--s); animation: growWidth 0.9s ease both; }
.mastery-pct { width: 42px; flex: none; text-align: right; font-family: var(--font-latin); font-size: 11px; color: var(--muted); }
.topic-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.result-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.result-table th { text-align: left; font-size: 10px; font-weight: 600; color: var(--muted-2); padding: 0 8px 8px; border-bottom: 1px solid var(--line); }
.result-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); color: var(--muted); }
.result-table tr:last-child td { border-bottom: 0; }
.result-table td b { color: var(--text); font-weight: 600; }
.result-table .score { font-family: var(--font-latin); color: var(--brand); font-weight: 700; }

/* ---------- leaderboard ---------- */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: end; margin: 8px 0 20px; }
.podium-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 12px 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel);
  text-align: center;
  overflow: hidden;
}
.podium-card.first {
  padding-top: 26px;
  border-color: rgba(251, 191, 36, 0.35);
  background:
    radial-gradient(90% 90% at 50% 0%, rgba(251, 191, 36, 0.18), transparent 65%),
    var(--panel);
  box-shadow: 0 24px 50px -30px rgba(251, 191, 36, 0.45);
}
.podium-card .crown { position: absolute; top: 6px; color: var(--amber); }
.podium-medal {
  position: absolute;
  top: 10px;
  right: 12px;
  font-family: var(--font-latin);
  font-size: 10px;
  font-weight: 800;
  color: var(--muted-2);
}
.podium-card .avatar { margin-top: 6px; }
.podium-name { font-size: 12.5px; font-weight: 600; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.podium-xp { font-family: var(--font-latin); font-size: 12px; color: var(--brand); font-weight: 700; }
.podium-xp small { font-family: var(--font); font-size: 9.5px; color: var(--muted-2); font-weight: 500; }
.rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 13px;
  border: 1px solid transparent;
  transition: background 0.18s ease;
}
.rank-row + .rank-row { margin-top: 3px; }
.rank-row:hover { background: var(--surface); }
.rank-row.me { border-color: rgba(45, 226, 167, 0.28); background: rgba(45, 226, 167, 0.07); }
.rank-num { width: 26px; flex: none; text-align: center; font-family: var(--font-latin); font-size: 12px; font-weight: 700; color: var(--muted-2); }
.rank-name { font-size: 13px; font-weight: 500; }
.rank-name small { display: block; font-size: 10px; color: var(--muted-2); font-weight: 400; }
.rank-xp { margin-left: auto; text-align: right; }
.rank-xp b { display: block; font-family: var(--font-latin); font-size: 13px; }
.rank-xp span { font-size: 9.5px; color: var(--muted-2); }
.rank-change { width: 34px; text-align: right; font-size: 10px; font-family: var(--font-latin); }
.rank-change.up { color: var(--ok); }
.rank-change.down { color: #ff9aa8; }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 16px; align-items: start; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(45, 226, 167, 0.12); }
.goal-opts, .theme-opts { display: flex; gap: 7px; flex-wrap: wrap; }
.goal-opt, .theme-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--muted);
  transition: all 0.18s ease;
}
.goal-opt:hover, .theme-opt:hover { border-color: var(--line-strong); color: var(--text); }
.goal-opt.active, .theme-opt.active { border-color: var(--brand); background: rgba(45, 226, 167, 0.1); color: var(--brand); font-weight: 600; }
.theme-opt svg { width: 15px; height: 15px; }
.profile-row { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.profile-row b { display: block; font-size: 17px; }
.profile-row span { font-size: 12px; color: var(--muted); }
.danger-zone { border-color: rgba(251, 113, 133, 0.22); }
.danger-zone h3 { color: #ff9aa8; }
.danger-zone p { font-size: 12px; color: var(--muted); margin: 5px 0 12px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.setting-row:last-child { border-bottom: 0; }
.setting-row span { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.setting-row b { font-weight: 600; color: var(--text); }

/* ---------- bottom nav ---------- */
.bottom-nav {
  display: none;
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 560px;
  z-index: 60;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.bn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px 0;
  color: var(--muted-2);
  position: relative;
}
.bn-item svg { width: 20px; height: 20px; }
.bn-item small { font-size: 9.5px; }
.bn-item.active { color: var(--brand); }
.bn-item.active::after {
  content: "";
  position: absolute;
  top: -9px;
  width: 18px;
  height: 3px;
  border-radius: 99px;
  background: var(--brand);
  box-shadow: 0 0 12px var(--brand);
}
.bn-center { flex: 1.15; }
.bn-fab {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-top: -22px;
  border-radius: 16px;
  background: linear-gradient(135deg, #2de2a7, #57b9ff);
  color: #04130d;
  box-shadow: 0 12px 26px -10px rgba(45, 226, 167, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  border: 3px solid var(--bg);
}
.bn-fab svg { width: 20px; height: 20px; margin-left: 2px; }
.bn-center small { margin-top: 0; }
.bn-center.active::after { display: none; }

/* ---------- toast / modal ---------- */
#toast-root {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 15px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  font-size: 12.5px;
  color: var(--text);
  animation: toastIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
  max-width: 320px;
}
.toast .t-ico { color: var(--brand); flex: none; display: grid; place-items: center; }
.toast .t-ico svg { width: 17px; height: 17px; }
.toast.err .t-ico { color: #ff9aa8; }
.toast.leaving { animation: toastOut 0.25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px) scale(0.97); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-6px); } }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 6, 12, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.2s ease both;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: 100%;
  max-width: 430px;
  padding: 22px;
  border-radius: 22px;
  border: 1px solid var(--line-strong);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  animation: pop 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.modal h3 { font-size: 18px; margin-bottom: 7px; }
.modal p { font-size: 13px; color: var(--muted); line-height: 1.65; }
.modal-actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.modal-close { position: absolute; top: 12px; right: 12px; }
.modal .icon-btn { position: absolute; top: 12px; right: 12px; }
.modal { position: relative; }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 350; }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .subjects-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .bottom-nav { display: flex; }
  body.focus-mode .bottom-nav { display: none; }
  body.focus-mode #view { padding-bottom: 32px; }
  .mobile-brand { display: flex; }
  .topbar { top: 0; }
  .shell { padding-bottom: 0; }
  #view { padding-bottom: 108px; }
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr); }
  .hero-visual { min-height: 220px; }
  .exam-bar { top: 62px; }
}

@media (max-width: 900px) {
  .hero-visual { display: none; }
  .hero { grid-template-columns: 1fr; }
  .q-layout { grid-template-columns: 1fr; }
  .exam-lobby { grid-template-columns: 1fr; }
  .exam-layout { grid-template-columns: 1fr; }
  .exam-side { position: static; }
  .settings-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exam-grid { grid-template-columns: 1fr; }
  .podium { gap: 8px; }
  .podium-card { padding: 16px 8px; }
  .podium-card .avatar { width: 48px; height: 48px; font-size: 17px; }
}

@media (max-width: 760px) {
  #view { padding: 18px 14px 112px; }
  .page-head { margin-bottom: 16px; }
  .page-head h1 { font-size: 23px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .subjects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .goal-card { flex-direction: column; align-items: flex-start; }
  .goal-card .ring-wrap { align-self: center; }
  .topbar-title { display: none; }
  .topbar { padding: 10px 14px; }
  .streak-pill span:last-child { display: none; }
  .hero-copy h2 { font-size: 24px; }
  .cd-cell { min-width: 46px; }
  .score-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-hero { grid-template-columns: 1fr; text-align: center; }
  .result-hero .ring-wrap { margin: 0 auto; }
  .result-title { text-align: center; }
  .result-actions { justify-content: center; }
  .exam-bar { top: 58px; padding: 10px; gap: 8px; }
  .exam-bar .btn span { display: none; }
  .timer { padding-right: 8px; }
  .timer b { font-size: 14px; }
  .palette { grid-template-columns: repeat(8, 1fr); }
  .podium-name { font-size: 11px; }
  .podium-xp { font-size: 10.5px; }
  .cards-2 { grid-template-columns: 1fr; }
  .analytics-2 { grid-template-columns: 1fr; }
  .session-summary { padding: 22px 16px; margin: 16px auto; }
  .summary-stats { gap: 7px; }
  .summary-stats b { font-size: 17px; }
  .subject-breakdown .sb-name { width: 92px; }
  .analytics-2 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { gap: 9px; }
  .stat-card { padding: 12px; gap: 10px; }
  .stat-ico { width: 36px; height: 36px; border-radius: 11px; }
  .stat-value { font-size: 18px; }
  .stat-sub { font-size: 9.5px; }
  .hero-actions .btn { flex: 1; }
  .cd-cell { flex: 1; min-width: 0; }
  .countdown { width: 100%; }
  .q-text { font-size: 16.5px; }
  .rev-item summary .q-mini { font-size: 11.5px; }
  .palette { grid-template-columns: repeat(6, 1fr); }
  .avatar-lg { width: 56px; height: 56px; font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .hv-ring, .hv-front, .blob { animation: none !important; }
}
