/* ============================================================
   ExamPrep Quiz — Modern, Beautiful & Responsive UI
   Crisp surfaces, vibrant emerald & indigo accents,
   responsive desktop + mobile navigation, focused quiz player.
   ============================================================ */

:root {
  /* Surfaces & Canvas */
  --bg: #f8fafc;
  --bg-subtle: #f1f5f9;
  --card: #ffffff;
  --card-hover: #ffffff;
  --card-subtle: #f8fafc;
  --card-border: #e2e8f0;
  --card-border-subtle: #edf2f7;

  /* Typography / Inks */
  --ink: #0f172a;
  --ink-secondary: #334155;
  --body: #475569;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e2e8f0;
  --line-light: #f1f5f9;

  /* Primary Emerald */
  --primary: #059669;
  --primary-hover: #047857;
  --primary-deep: #064e3b;
  --primary-soft: #ecfdf5;
  --primary-border: #a7f3d0;
  --primary-glow: rgba(5, 150, 105, 0.2);

  /* Accents */
  --indigo: #4f46e5;
  --indigo-soft: #eef2ff;
  --indigo-border: #c7d2fe;

  --amber: #f59e0b;
  --amber-deep: #d97706;
  --amber-soft: #fffbeb;
  --amber-border: #fde68a;

  --rose: #ef4444;
  --rose-deep: #b91c1c;
  --rose-soft: #fef2f2;
  --rose-border: #fecaca;

  --cyan: #0284c7;
  --cyan-soft: #f0f9ff;

  /* Geometry & Shadows */
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-pill: 9999px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.09), 0 8px 10px -6px rgba(15, 23, 42, 0.04);

  --font: "Plus Jakarta Sans", "Nunito", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --max-w: 1140px;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  color-scheme: light;
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 0.75rem; color: var(--body); }
a { color: var(--primary); text-decoration: none; font-weight: 600; transition: color 0.15s ease; }
a:hover { color: var(--primary-hover); text-decoration: none; }
::selection { background: #a7f3d0; color: #064e3b; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--r-sm); }

.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 200;
  background: var(--ink); color: #fff; padding: 0.6rem 1.2rem;
  border-radius: var(--r); font-weight: 700; transition: top 0.15s;
}
.skip-link:focus { top: 1rem; }

/* ---------- App Shell & Layout ---------- */
.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.screen {
  flex: 1;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.5rem 1.25rem calc(96px + env(safe-area-inset-bottom));
}

@media (min-width: 768px) {
  .screen {
    padding: 2rem 2rem 4rem;
  }
}

/* ---------- Header Navigation ---------- */
.app-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}
@media (min-width: 768px) {
  .header-inner {
    padding: 0.9rem 2rem;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s ease;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand:hover .brand-mark { transform: scale(1.04); }
@media (max-width: 767px) {
  .brand-text { display: none; }
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name {
  font-weight: 800; font-size: 1.25rem; color: var(--ink);
  letter-spacing: -0.03em;
}
.brand-tier {
  font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em;
  color: var(--primary); text-transform: uppercase;
}

/* Desktop Navigation Links */
.desktop-nav {
  display: none;
  align-items: center;
  gap: 0.35rem;
}
@media (min-width: 768px) {
  .desktop-nav {
    display: flex;
  }
}
.desktop-nav a {
  padding: 0.5rem 0.95rem;
  border-radius: var(--r-pill);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
  transition: all 0.15s ease;
}
.desktop-nav a:hover {
  color: var(--ink);
  background: var(--bg-subtle);
  text-decoration: none;
}
.desktop-nav a[aria-current="page"] {
  color: var(--primary);
  background: var(--primary-soft);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--amber-soft);
  color: var(--amber-deep);
  border: 1px solid var(--amber-border);
  font-weight: 800;
  font-size: 0.82rem;
  border-radius: var(--r-pill);
  padding: 0.35rem 0.75rem;
  font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow-xs);
}
.streak-flame { font-size: 0.95rem; }

.btn-header-cta {
  display: none;
}
@media (min-width: 640px) {
  .btn-header-cta {
    display: inline-flex;
  }
}

.avatar-btn {
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  border: 2px solid #fff; background: var(--bg-subtle);
  box-shadow: var(--shadow-sm); font-size: 1.1rem;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.avatar-btn:hover { transform: scale(1.05); box-shadow: var(--shadow-md); }

.auth-area { display: inline-flex; }
.user-chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  border-radius: var(--r-pill); padding: 0.25rem 0.75rem 0.25rem 0.3rem;
  max-width: 170px;
}
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--primary), #10b981);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.82rem;
}
.user-name { font-weight: 700; font-size: 0.82rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Header Menu (Mobile Only) ---------- */
.menu-btn {
  display: none;
  width: 40px; height: 40px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--line); background: #ffffff; color: var(--ink);
  align-items: center; justify-content: center; flex: none;
  box-shadow: var(--shadow-xs);
}
.menu-panel { display: none; }
@media (max-width: 767px) {
  .header-inner { position: relative; }
  .header-right .streak-pill,
  .header-right .btn-header-cta,
  .header-right .auth-area { display: none; }
  .menu-btn { display: inline-flex; }
  .menu-panel.open {
    display: flex; flex-direction: column; gap: 0.75rem;
    position: absolute; top: calc(100% + 8px); right: 1.25rem;
    width: min(19rem, calc(100vw - 2.5rem));
    background: #ffffff; border: 1px solid var(--line);
    border-radius: var(--r-lg); box-shadow: var(--shadow-xl);
    padding: 1rem; z-index: 70;
  }
}
.menu-streak {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--amber-soft); border: 1px solid var(--amber-border);
  color: var(--amber-deep); border-radius: var(--r);
  padding: 0.6rem 0.85rem; font-weight: 800; font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.menu-streak-sub { font-weight: 600; font-size: 0.78rem; color: var(--muted); }
.menu-link {
  display: block; text-align: center; font-weight: 700; font-size: 0.9rem;
  color: var(--primary); padding: 0.35rem 0;
}
.menu-auth { display: flex; }
.menu-auth .user-chip { max-width: none; flex: 1; }
.menu-auth .user-name { flex: 1; }
.menu-auth .btn { flex: 1; }

/* ---------- Bottom Tab Bar (Mobile Only) ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding: 0.45rem 0.4rem calc(0.55rem + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.05);
}
@media (min-width: 768px) {
  .tabbar {
    display: none;
  }
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--muted); font-size: 0.7rem; font-weight: 700;
  padding: 0.35rem 0; border-radius: var(--r); text-decoration: none;
  transition: all 0.15s ease;
}
.tabbar a:hover { color: var(--ink); }
.tabbar a[aria-current="page"] { color: var(--primary); font-weight: 800; }
.tabbar svg { transition: transform 0.15s ease; }
.tabbar a[aria-current="page"] svg { transform: translateY(-1px); }

/* ---------- Buttons & Interactive Primitives ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font: inherit; font-weight: 700; font-size: 0.92rem;
  padding: 0.7rem 1.35rem; border-radius: var(--r-pill); cursor: pointer; white-space: nowrap;
  border: 1px solid transparent; text-decoration: none;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px) scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #10b981 100%);
  color: #fff !important;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink-secondary);
  box-shadow: var(--shadow-xs);
}
.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.btn-cream {
  background: var(--amber-soft);
  color: var(--amber-deep) !important;
  border: 1px solid var(--amber-border);
}
.btn-cream:hover {
  background: #fff;
  border-color: var(--amber-deep);
}

.btn-sm { padding: 0.42rem 0.95rem; font-size: 0.84rem; border-radius: var(--r-pill); }
.btn-lg { padding: 0.85rem 1.75rem; font-size: 1rem; border-radius: var(--r-pill); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- Cards & Containers ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.4rem;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.card-interactive:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.x-btn {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg-subtle);
  color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  transition: all 0.15s ease;
}
.x-btn:hover { color: var(--ink); background: #fff; border-color: var(--ink); }

/* ---------- Form Controls ---------- */
.field { display: block; margin-bottom: 1.15rem; }
.field-label {
  display: block; font-weight: 700; font-size: 0.86rem; color: var(--ink-secondary);
  margin-bottom: 0.45rem;
}
fieldset.field { border: 0; padding: 0; margin: 0 0 1.15rem; }
fieldset.field legend { padding: 0; margin-bottom: 0.45rem; }

input[type="email"], input[type="text"], input[type="search"], select, textarea {
  font: inherit; font-weight: 600; width: 100%; padding: 0.75rem 1rem;
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  background: #ffffff;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; min-height: 4.5rem; }
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 4px var(--primary-glow);
}
select[disabled] { opacity: 0.55; cursor: not-allowed; }

.link-btn {
  border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--primary); font: inherit; font-weight: 700;
  text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--primary-hover); }

/* Segments (Radio switches) */
.seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem;
  background: var(--bg-subtle); border: 1px solid var(--line);
  border-radius: var(--r); padding: 0.3rem; margin-bottom: 0.75rem;
}
.seg label { position: relative; display: block; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span {
  display: block; text-align: center; font-weight: 700; font-size: 0.88rem;
  color: var(--muted); padding: 0.55rem 0.5rem; border-radius: var(--r-sm);
  transition: all 0.15s ease;
}
.seg input:checked + span {
  background: #ffffff; color: var(--ink);
  box-shadow: var(--shadow-sm); font-weight: 800;
}

/* Count Pills */
.count-pills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.count-pills label { position: relative; cursor: pointer; display: block; }
.count-pills input { position: absolute; opacity: 0; inset: 0; }
.count-pills span {
  display: block; text-align: center; font-weight: 800; font-size: 0.95rem;
  padding: 0.65rem 0.25rem; border-radius: var(--r);
  border: 1.5px solid var(--line); color: var(--muted);
  background: #ffffff; box-shadow: var(--shadow-xs);
  transition: all 0.15s ease;
  font-variant-numeric: tabular-nums;
}
.count-pills small { display: block; font-size: 0.68rem; font-weight: 700; color: var(--faint); }
.count-pills input:checked + span {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-deep);
  box-shadow: 0 0 0 1px var(--primary);
}
.count-pills input:checked + span small { color: var(--primary); }

.crumbs {
  font-size: 0.86rem; color: var(--muted); font-weight: 600;
  margin-bottom: 1.25rem; display: flex; align-items: center; gap: 0.4rem;
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }
.crumbs [aria-current="page"] { color: var(--ink); font-weight: 700; }

.empty {
  background: #fff; border: 2px dashed var(--line); border-radius: var(--r-lg);
  padding: 2.5rem 1.5rem; text-align: center; color: var(--muted); font-weight: 600;
  margin: 1.5rem 0;
}
.spinner {
  width: 40px; height: 40px; margin: 0 auto; border-radius: 50%;
  border: 3.5px solid var(--line); border-top-color: var(--primary);
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- HOME: Modern Hero & Quick Launch ---------- */
.home-hero {
  position: relative;
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
  border: 1px solid var(--primary-border);
  border-radius: var(--r-xl);
  padding: 1.75rem 1.5rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
@media (min-width: 768px) {
  .home-hero {
    padding: 2.5rem 2.5rem;
  }
}
.home-hero::before {
  content: ""; position: absolute; top: -100px; right: -80px; width: 300px; height: 300px;
  border-radius: 50%; background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge-row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: #fff; border: 1px solid var(--primary-border);
  color: var(--primary-deep); font-weight: 800; font-size: 0.72rem; letter-spacing: 0.08em;
  padding: 0.35rem 0.85rem; border-radius: var(--r-pill); box-shadow: var(--shadow-xs);
}
.hero-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.85); } }

.hero-countdown {
  font-size: 0.84rem; font-weight: 700; color: var(--amber-deep);
  background: var(--amber-soft); border: 1px solid var(--amber-border);
  padding: 0.3rem 0.75rem; border-radius: var(--r-pill);
}

.hero-title {
  font-size: 1.85rem; font-weight: 900; margin: 0 0 0.5rem;
  letter-spacing: -0.03em;
}
@media (min-width: 768px) {
  .hero-title { font-size: 2.4rem; }
}
.hero-subtitle {
  font-size: 1rem; color: var(--body); margin: 0 0 1.5rem;
  max-width: 36rem;
}
/* Greeting name: prepend a comma only when signed in (name present). */
#greet-name:not(:empty)::before { content: ", "; }

/* Quick Launcher Box */
.launcher-box {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow-md);
  margin-top: 1.25rem;
}
.launcher-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.launcher-title {
  font-size: 0.88rem; font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--ink); margin: 0;
  display: flex; align-items: center; gap: 0.45rem;
}
.launcher-form {
  display: grid; gap: 1rem;
}
@media (min-width: 640px) {
  .launcher-form {
    grid-template-columns: 1fr auto auto;
    align-items: end;
  }
}
.launcher-field { display: flex; flex-direction: column; gap: 0.35rem; }
.launcher-label { font-size: 0.8rem; font-weight: 700; color: var(--muted); }

/* ---------- Stat Tiles Grid ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}
@media (min-width: 768px) {
  .tiles {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.15rem;
  }
}
.tile {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--r-lg);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.tile-top {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.82rem; font-weight: 700; color: var(--muted);
  margin-bottom: 0.35rem;
}
.tile-top .ico { font-size: 1.15rem; }
.tile-val {
  font-size: 1.65rem; font-weight: 900; line-height: 1.2;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.tile-val.orange { color: var(--amber-deep); }
.tile-val.green { color: var(--primary); }
.tile-sub { font-size: 0.76rem; color: var(--faint); font-weight: 600; margin-top: 0.15rem; }

/* Target Ring Card */
.target-card {
  display: flex; align-items: center; gap: 1.25rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #fff 0%, #fafafa 100%);
}
.ring-wrap { position: relative; width: 72px; height: 72px; flex: none; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-bg { stroke: var(--line); }
.ring-fg { stroke: var(--primary); stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; }
.ring-pct {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 0.85rem; font-variant-numeric: tabular-nums; color: var(--ink);
}
.target-meta { flex: 1; min-width: 0; }
.target-label { font-size: 0.82rem; font-weight: 700; color: var(--muted); margin: 0; }
.target-count { font-size: 1.35rem; font-weight: 900; margin: 0; font-variant-numeric: tabular-nums; }
.target-count small { font-size: 0.85rem; color: var(--muted); font-weight: 600; }

/* In-Progress Drill Banner */
.drill-banner {
  margin-bottom: 1.75rem;
  border-left: 4px solid var(--primary);
  background: #ffffff;
}
.drill-top {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.drill-status { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.75rem; font-weight: 800; }
.pill-green {
  background: var(--primary-soft); color: var(--primary-deep);
  border-radius: var(--r-pill); padding: 0.2rem 0.65rem; font-size: 0.72rem; letter-spacing: 0.04em;
}
.rapid-tag { font-size: 0.8rem; font-weight: 800; color: var(--indigo); display: inline-flex; align-items: center; gap: 0.2rem; }
.drill-subject { font-size: 1.2rem; margin-bottom: 0.15rem; }
.drill-topic { font-size: 0.88rem; color: var(--body); font-weight: 600; margin-bottom: 0.75rem; }
.drill-progress {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.8rem; font-weight: 700; color: var(--muted); margin-bottom: 0.35rem;
  font-variant-numeric: tabular-nums;
}
.drill-progress .pct { color: var(--primary); font-weight: 800; }
.drill-bar {
  height: 8px; background: var(--bg-subtle); border-radius: var(--r-pill);
  overflow: hidden; margin-bottom: 1rem;
}
.drill-bar > div {
  height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), #10b981);
  border-radius: var(--r-pill); transition: width 0.5s ease;
}

/* ---------- Subjects Directory & Filters ---------- */
.section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin: 2rem 0 1rem;
}
.section-head h2 { margin: 0; font-size: 1.35rem; }
.section-link { font-size: 0.86rem; font-weight: 700; color: var(--primary); }

.searchbar {
  display: flex; align-items: center; gap: 0.75rem;
  background: #ffffff; border: 1.5px solid var(--line); border-radius: var(--r-pill);
  padding: 0.75rem 1.25rem; color: var(--muted); margin-bottom: 1.25rem;
  box-shadow: var(--shadow-xs); transition: all 0.15s ease;
}
.searchbar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}
.searchbar input[type="search"] {
  border: 0; background: transparent; outline: none; flex: 1;
  font: inherit; font-weight: 600; color: var(--ink); padding: 0; min-width: 0;
}

.tiers {
  display: flex; gap: 0.55rem; overflow-x: auto; padding-bottom: 0.35rem; margin-bottom: 1.25rem;
  scrollbar-width: none;
}
.tiers::-webkit-scrollbar { display: none; }
.tier {
  display: inline-flex; align-items: center; gap: 0.5rem; flex: none; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 0.88rem;
  border-radius: var(--r-pill); padding: 0.55rem 1.1rem;
  background: #ffffff; border: 1.5px solid var(--line); color: var(--body);
  transition: all 0.15s ease;
}
.tier:hover { border-color: var(--primary); color: var(--ink); }
.tier .tier-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.tier.active {
  background: var(--ink); border-color: var(--ink); color: #fff;
}
.tier.active .tier-dot { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3); }

/* Exam filter: pill buttons on desktop, dropdown on mobile (no sideways scroll). */
.tier-select { display: none; margin-bottom: 1.25rem; }
@media (max-width: 767px) {
  #tier-row { display: none; }
  .tier-select { display: block; }
}

/* Responsive Subjects Grid */
.subj-grid {
  list-style: none; margin: 0 0 1.5rem; padding: 0;
  display: grid; gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .subj-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .subj-grid { grid-template-columns: repeat(3, 1fr); }
}

.subj-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--r-lg);
  padding: 1.2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.subj-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}
.subj-card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}
.subj-icon {
  --h: 150;
  width: 48px; height: 48px; border-radius: 14px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.25rem;
  background: hsl(var(--h) 80% 95%);
  color: hsl(var(--h) 80% 30%);
  border: 1px solid hsl(var(--h) 60% 88%);
}
.subj-info { flex: 1; min-width: 0; }
.subj-name {
  font-weight: 800; font-size: 1.05rem; color: var(--ink);
  margin-bottom: 0.2rem;
  display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
}
.subj-name a { color: var(--ink); }
.subj-name a:hover { color: var(--primary); }
.subj-meta {
  font-size: 0.82rem; color: var(--muted); font-weight: 600;
}
.tag {
  display: inline-block; font-size: 0.65rem; font-weight: 800;
  background: var(--bg-subtle); border: 1px solid var(--line);
  color: var(--body); border-radius: 6px; padding: 0.12rem 0.45rem;
  letter-spacing: 0.03em;
}
.tag-hot {
  background: var(--primary-soft); border-color: var(--primary-border);
  color: var(--primary-deep);
}
.subj-card-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding-top: 0.75rem; border-top: 1px solid var(--line-light);
}
.mastery-pill {
  font-size: 0.78rem; font-weight: 700; color: var(--muted);
  display: flex; align-items: center; gap: 0.35rem;
}
.mastery-val { font-weight: 900; color: var(--primary); }

/* ---------- QUIZ PLAYER (Focused Distraction-Free Experience) ---------- */
.quiz-container {
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}
.quiz-wrap { max-width: 100%; }

.quiz-loading {
  text-align: center; padding: 3.5rem 1.5rem;
  background: #ffffff; border-radius: var(--r-xl);
}
.quiz-loading h2 { margin: 1.25rem 0 0.5rem; font-size: 1.4rem; }
.quiz-loading p { color: var(--muted); font-size: 0.95rem; }

.q-run { display: grid; gap: 1rem; }

/* Quiz Top Bar */
.q-top {
  padding: 1.2rem 1.35rem;
  display: grid; gap: 0.85rem;
  background: #ffffff;
}
.q-top-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.q-kicker {
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--primary); margin: 0;
}
.q-count {
  margin: 0.1rem 0 0; font-size: 0.92rem; color: var(--ink); font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.q-side { display: flex; align-items: center; gap: 0.65rem; }
.q-timer {
  margin: 0; font-variant-numeric: tabular-nums; font-weight: 800; font-size: 0.88rem;
  background: var(--bg-subtle); border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 0.4rem 0.85rem; color: var(--ink-secondary);
  display: inline-flex; align-items: center; gap: 0.35rem;
}
.q-timer.live {
  border-color: var(--primary-border); background: var(--primary-soft); color: var(--primary-deep);
}

.track {
  height: 8px; background: var(--bg-subtle); border-radius: var(--r-pill);
  overflow: hidden;
}
.track > div {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--primary) 0%, #10b981 100%);
  border-radius: var(--r-pill); transition: width 0.35s ease;
}

/* Question Navigator Dots / Numbers */
.q-dots {
  display: flex; gap: 0.4rem; flex-wrap: wrap; padding-top: 0.25rem;
}
.q-dot {
  min-width: 32px; height: 32px; padding: 0 0.35rem;
  border-radius: 10px; border: 1.5px solid var(--line);
  background: #ffffff; color: var(--muted); font: inherit;
  font-size: 0.8rem; font-weight: 800; cursor: pointer;
  font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s ease;
}
.q-dot:hover { border-color: var(--primary); color: var(--ink); }
.q-dot.done {
  background: var(--primary-soft); border-color: var(--primary); color: var(--primary-deep);
}
.q-dot.now {
  background: var(--ink); border-color: var(--ink); color: #ffffff;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.15);
}

/* Main Question Card */
.q-card {
  padding: 1.75rem 1.6rem;
  background: #ffffff;
  border-radius: var(--r-xl);
}
.q-topic {
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--indigo); margin: 0 0 0.75rem;
  background: var(--indigo-soft); border: 1px solid var(--indigo-border);
  display: inline-block; padding: 0.2rem 0.65rem; border-radius: var(--r-pill);
}
.q-title {
  font-size: 1.25rem; font-weight: 800; line-height: 1.5;
  margin: 0 0 1.5rem; color: var(--ink);
}

/* Question Options */
.opts { display: grid; gap: 0.75rem; }
.opt {
  display: flex; align-items: center; gap: 1rem; width: 100%; text-align: left;
  font: inherit; background: #ffffff; border: 2px solid var(--line); border-radius: var(--r);
  padding: 1rem 1.15rem; cursor: pointer; color: var(--ink); line-height: 1.45; font-weight: 700;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-xs);
}
.opt:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-1px);
}
.opt[aria-checked="true"] {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px var(--primary-glow);
  color: var(--primary-deep);
}
.opt-key {
  flex: none; width: 2.1rem; height: 2.1rem; border-radius: 10px;
  background: var(--bg-subtle); border: 1.5px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 900; color: var(--muted);
  transition: all 0.15s ease;
}
.opt:hover .opt-key {
  border-color: var(--primary); color: var(--primary);
}
.opt[aria-checked="true"] .opt-key {
  background: var(--primary); border-color: var(--primary); color: #ffffff;
}

.q-tip {
  margin: 1.25rem 0 0; font-size: 0.82rem; color: var(--faint); font-weight: 600;
}
.kbd {
  font: inherit; font-size: 0.72rem; font-weight: 800;
  background: var(--bg-subtle); border: 1px solid var(--line);
  border-bottom-width: 2px; border-radius: 6px; padding: 0.1rem 0.4rem;
  color: var(--body);
}

.q-nav {
  display: flex; justify-content: space-between; align-items: center; gap: 0.75rem;
  margin-top: 0.5rem;
}
.q-nav-right { display: flex; gap: 0.75rem; }

/* ---------- Narrow-screen overflow guards ----------
   Quiz rows wrap instead of forcing horizontal scroll on phones.
   Single-column grids need minmax(0,1fr): an `auto` track sizes to the
   longest unbroken string and blows every nested card past the viewport.
   No-op on wide screens where everything fits on one line. */
.quiz-container { overflow-wrap: break-word; }
.crumbs { flex-wrap: wrap; }
.crumbs > *, .q-top-row > *, .opt > *, .review-item summary > * { min-width: 0; }
.q-top-row, .q-side, .q-nav, .q-nav-right { flex-wrap: wrap; }
.opts, .q-run, .q-top, .review, .review-detail { grid-template-columns: minmax(0, 1fr); }
.screen, .quiz-container, .opt { min-width: 0; }

/* ---------- Results & Review Screen ---------- */
.verdict-hero {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: linear-gradient(145deg, #064e3b 0%, #065f46 60%, #047857 100%);
  border-radius: var(--r-xl);
  color: #ffffff;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.verdict-hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.25), transparent 70%);
  pointer-events: none;
}
.verdict-eyebrow {
  color: #a7f3d0; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.12em;
  text-transform: uppercase; margin: 0 0 0.75rem;
}
.verdict-hero h2 { color: #ffffff; font-size: 1.75rem; margin-bottom: 0.4rem; }
.verdict-grade {
  display: inline-block; font-size: 0.82rem; font-weight: 800; letter-spacing: 0.05em;
  text-transform: uppercase; background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3); border-radius: var(--r-pill);
  padding: 0.35rem 1rem; margin-bottom: 0.75rem; color: #fef08a;
}
.verdict-sub { color: rgba(255, 255, 255, 0.85); font-weight: 600; font-size: 0.95rem; }

.verdict-ring {
  width: 140px; height: 140px; border-radius: 50%; margin: 0 auto 1.25rem;
  display: flex; align-items: center; justify-content: center; position: relative;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}
.verdict-ring::before {
  content: ""; position: absolute; inset: 12px; border-radius: 50%;
  background: #064e3b; border: 1px solid rgba(255, 255, 255, 0.18);
}
.verdict-ring span {
  position: relative; font-size: 2rem; font-weight: 900; color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.verdict-actions {
  display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center;
  margin-top: 1.5rem;
}
.verdict-hero .btn-ghost {
  background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.3); color: #ffffff;
}
.verdict-hero .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.25); border-color: #ffffff; color: #ffffff;
}

.saved-note {
  color: #a7f3d0; font-weight: 800; font-size: 0.92rem; margin: 1rem 0 0;
}
.saved-note a { color: #ffffff; text-decoration: underline; }

.review-section { margin-top: 2rem; }
.review-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 1rem;
}
.review-head h3 { margin: 0; font-size: 1.25rem; }
.review-head p { color: var(--muted); font-size: 0.88rem; margin: 0; font-weight: 600; }

.review { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.review-item {
  background: #ffffff; border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; box-shadow: var(--shadow-xs);
}
.review-item summary {
  cursor: pointer; padding: 1rem 1.25rem; display: flex; gap: 0.85rem;
  align-items: flex-start; list-style: none;
}
.review-item summary::-webkit-details-marker { display: none; }
.badge {
  flex: none; font-size: 0.72rem; font-weight: 800; border-radius: var(--r-pill);
  padding: 0.2rem 0.7rem; margin-top: 0.15rem;
}
.badge.ok { background: var(--primary-soft); color: var(--primary-deep); }
.badge.miss { background: var(--rose-soft); color: var(--rose-deep); }

.review-q { font-weight: 800; font-size: 0.95rem; color: var(--ink); line-height: 1.45; }
.review-detail {
  border-top: 1px solid var(--line-light); padding: 1rem 1.25rem;
  display: grid; gap: 0.5rem; font-size: 0.9rem; background: var(--bg-subtle);
  font-weight: 600;
}
.review-opt {
  padding: 0.65rem 0.95rem; border-radius: var(--r); border: 1.5px solid var(--line);
  color: var(--body); background: #ffffff;
}
.review-opt.is-correct {
  border-color: var(--primary); background: var(--primary-soft); color: var(--primary-deep); font-weight: 800;
}
.review-opt.is-picked:not(.is-correct) {
  border-color: var(--rose); background: var(--rose-soft); color: var(--rose-deep); font-weight: 800;
}

/* Confetti Canvas */
#confetti-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 150;
}

/* ---------- Subject Detail Page ---------- */
.sub-hero {
  display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1.5rem;
  background: #ffffff;
}
.sub-hero .subj-icon { width: 64px; height: 64px; font-size: 1.6rem; border-radius: var(--r-lg); }
.sub-hero h1 { font-size: 1.75rem; margin-bottom: 0.2rem; }
.sub-hero p { margin: 0; color: var(--muted); font-weight: 600; font-size: 0.95rem; }
.meta-chips { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.6rem; }
.meta-chips .tag { font-size: 0.75rem; padding: 0.25rem 0.75rem; border-radius: var(--r-pill); }

.builder { margin-bottom: 1.5rem; border-top: 4px solid var(--primary); }
.builder-note { text-align: center; color: var(--faint); font-size: 0.82rem; font-weight: 600; margin: 0.75rem 0 0; }

.topics { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.trow {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: #ffffff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 1rem 1.25rem; box-shadow: var(--shadow-xs);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.trow:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.trow-hero { background: var(--primary-soft); border-color: var(--primary-border); }
.trow-main { min-width: 0; }
.trow-name { font-weight: 800; font-size: 1rem; color: var(--ink); }
.trow-meta { font-size: 0.82rem; color: var(--muted); font-weight: 600; margin-top: 0.15rem; }

/* ---------- Leaderboard ---------- */
.board-row .trow-main { flex: 1; }
.board-rank { font-weight: 900; font-size: 0.95rem; min-width: 2.6rem; font-variant-numeric: tabular-nums; }
.board-points { font-weight: 900; font-size: 1.05rem; color: var(--primary-deep); font-variant-numeric: tabular-nums; white-space: nowrap; }
.you-pill { display: inline-block; font-size: 0.65rem; font-weight: 800; background: var(--primary); color: #fff; border-radius: var(--r-pill); padding: 0.1rem 0.5rem; margin-left: 0.4rem; vertical-align: 0.1rem; }

/* ---------- Analytics & Stats Page ---------- */
.week-card { margin-bottom: 1.5rem; }
.week-bars {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.6rem;
  align-items: end; margin-top: 1rem;
}
.week-col { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.week-track {
  height: 100px; width: 100%; background: var(--bg-subtle);
  border: 1px solid var(--line); border-radius: var(--r);
  display: flex; align-items: flex-end; overflow: hidden;
}
.week-fill {
  width: 100%; background: linear-gradient(180deg, #34d399, var(--primary));
  border-radius: 0; min-height: 0; transition: height 0.6s ease;
}
.week-day { font-size: 0.72rem; font-weight: 800; color: var(--muted); }
.week-val { font-size: 0.75rem; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }

.mastery-row { display: grid; gap: 0.75rem; }
.mrow {
  background: #ffffff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 0.9rem 1.15rem; box-shadow: var(--shadow-xs);
}
.mrow-top {
  display: flex; justify-content: space-between; gap: 0.75rem; font-weight: 800;
  font-size: 0.95rem; margin-bottom: 0.45rem; font-variant-numeric: tabular-nums;
}
.mrow-top .pct { color: var(--primary); }
.mtrack { height: 8px; background: var(--bg-subtle); border-radius: var(--r-pill); overflow: hidden; }
.mtrack > div { height: 100%; background: linear-gradient(90deg, var(--primary), #10b981); border-radius: var(--r-pill); }

/* ---------- Auth Modal Dialog ---------- */
.modal {
  border: 0; padding: 0; background: transparent;
  max-width: 440px; width: calc(100vw - 2.5rem);
  border-radius: var(--r-xl);
}
.modal::backdrop {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal-card {
  border-radius: var(--r-xl); overflow: hidden;
  background: #ffffff;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--line);
}
.modal-head {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 1.5rem 1.5rem 1.25rem;
  background: var(--primary-soft);
  border-bottom: 1px solid var(--primary-border);
}
.modal-badge {
  width: 44px; height: 44px; border-radius: 14px; flex: none;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.modal-head h2 { margin: 0 0 0.15rem; font-size: 1.35rem; }
.modal-sub { color: var(--muted); font-size: 0.9rem; font-weight: 600; margin: 0; }
.modal-head .x-btn { margin-left: auto; }
.modal-body { padding: 1.5rem; }
.alert-err {
  background: var(--rose-soft); border: 1px solid var(--rose-border);
  color: var(--rose-deep); border-radius: var(--r); padding: 0.75rem 1rem;
  font-size: 0.88rem; font-weight: 700; margin-bottom: 1.25rem;
}
.auth-fineprint { text-align: center; color: var(--faint); font-size: 0.82rem; font-weight: 600; margin: 0.85rem 0 0; }
.auth-sent-to { font-size: 0.9rem; color: var(--muted); margin: 0 0 1rem; font-weight: 600; }
.auth-sent-to strong { color: var(--ink); }
.otp-group { display: flex; gap: 0.5rem; justify-content: space-between; margin-bottom: 1.25rem; }
.otp-box {
  width: 3.2rem; height: 3.6rem; text-align: center; flex: 1; min-width: 0;
  font: inherit; font-size: 1.5rem; font-weight: 900; font-variant-numeric: tabular-nums;
  border: 1.5px solid var(--line); border-radius: var(--r);
  background: var(--bg-subtle); color: var(--ink); caret-color: var(--primary);
  padding: 0; transition: all 0.15s ease;
}
.otp-box:focus {
  border-color: var(--primary); outline: none; background: #ffffff;
  box-shadow: 0 0 0 4px var(--primary-glow);
}
.otp-box.filled {
  border-color: var(--primary); background: var(--primary-soft); color: var(--primary-deep);
}
.auth-resend-row { text-align: center; font-size: 0.88rem; color: var(--muted); margin: 0.85rem 0 0; font-weight: 600; }
.auth-dev-hint {
  margin: 1rem 0 0; font-size: 0.82rem; font-weight: 600;
  color: var(--amber-deep); background: var(--amber-soft);
  border: 1px solid var(--amber-border); border-radius: var(--r); padding: 0.65rem 0.85rem;
}

/* ---------- Toasts ---------- */
.toast-root {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 120;
  display: grid; gap: 0.65rem; pointer-events: none;
}
@media (max-width: 767px) {
  .toast-root {
    bottom: calc(76px + env(safe-area-inset-bottom));
    left: 1rem; right: 1rem;
  }
}
.toast {
  pointer-events: auto;
  background: var(--ink); color: #ffffff; border-radius: var(--r);
  padding: 0.85rem 1.25rem; font-size: 0.9rem; font-weight: 700;
  box-shadow: var(--shadow-xl); border-left: 4px solid var(--primary);
  animation: toast-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.success { border-left-color: #10b981; }
.toast.error { border-left-color: var(--rose); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.96); } }

/* ---------- Admin ---------- */
.admin-tools { display: flex; gap: 0.75rem; margin-bottom: 0.75rem; }
.admin-tools input { flex: 1; min-width: 0; }
.admin-tools .btn { flex: none; }
.admin-list {
  list-style: none; margin: 0; padding: 0.75rem; display: grid; gap: 0.5rem;
  max-height: 22rem; overflow-y: auto;
  border: 1.5px solid var(--line); border-radius: var(--r);
  background: var(--bg-subtle);
}
.admin-row {
  display: flex; align-items: center; gap: 0.75rem;
  background: #ffffff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 0.6rem 0.9rem; cursor: pointer;
}
.admin-row.off { opacity: 0.6; cursor: default; }
.admin-row input[type="checkbox"] {
  width: 1.1rem; height: 1.1rem; flex: none; accent-color: var(--primary);
}
.admin-row-main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.admin-row-name { font-weight: 800; font-size: 0.95rem; color: var(--ink); }
.admin-row-meta {
  font-size: 0.78rem; color: var(--muted); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.admin-empty { color: var(--muted); font-weight: 600; font-size: 0.88rem; margin: 0.5rem 0 0; }
.admin-result {
  margin: 1rem 0 0; font-weight: 700; font-size: 0.9rem; color: var(--primary-deep);
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
