:root {
  --emerald-900: #064e3b;
  --emerald-700: #047857;
  --emerald-600: #059669;
  --emerald-500: #10b981;
  --emerald-100: rgba(16, 185, 129, 0.14);
  --emerald-50: rgba(16, 185, 129, 0.08);
  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-300: rgba(148, 163, 184, 0.4);
  --slate-200: rgba(255, 255, 255, 0.62);
  --slate-100: rgba(241, 245, 249, 0.72);
  --red-600: #dc2626;
  --red-100: rgba(239, 68, 68, 0.14);
  --red-50: rgba(239, 68, 68, 0.08);
  --amber-600: #d97706;
  --amber-100: rgba(245, 158, 11, 0.16);
  --glass-bg: rgba(255, 255, 255, 0.68);
  --glass-bg-strong: rgba(255, 255, 255, 0.82);
  --glass-border: rgba(255, 255, 255, 0.78);
  --glass-shadow:
    0 12px 36px rgba(15, 23, 42, 0.07),
    0 2px 8px rgba(15, 23, 42, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --spring: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Plus Jakarta Sans", sans-serif;
  color: #1D1D1F;
  line-height: 1.55;
  min-height: 100vh;
  background-color: #f5f7fb;
  background-image:
    radial-gradient(at 20% 0%, rgba(37, 99, 235, 0.08) 0px, transparent 50%),
    radial-gradient(at 80% 10%, rgba(56, 189, 248, 0.08) 0px, transparent 48%),
    radial-gradient(at 50% 90%, rgba(16, 185, 129, 0.07) 0px, transparent 52%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.muted { color: var(--slate-500); font-size: 0.9rem; }
.error-text { color: var(--red-600); font-size: 0.9rem; margin-top: 12px; }

.container {
  max-width: 1220px;
  margin: 0 auto;
  padding: 20px 18px 40px;
}

.center-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.spinner {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(5, 150, 105, 0.18);
  border-top-color: var(--emerald-600);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--spring), background 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.48; cursor: not-allowed; }
.btn-sm { padding: 7px 14px; font-size: 0.82rem; }
.btn-full { width: 100%; }

.btn-primary {
  background: linear-gradient(135deg, #059669, #047857);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(4, 120, 87, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #047857, #064e3b);
  box-shadow: 0 8px 22px rgba(4, 120, 87, 0.3);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: var(--slate-700);
}
.btn-outline:hover:not(:disabled) { background: rgba(255, 255, 255, 0.92); }

.btn-ghost { background: transparent; color: var(--slate-600); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.58); color: var(--slate-900); }

/* Login */
.login-card {
  width: 100%;
  max-width: 470px;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(30px) saturate(190%);
  -webkit-backdrop-filter: blur(30px) saturate(190%);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  padding: 34px 30px;
  box-shadow: var(--glass-shadow);
  text-align: center;
}
.brand-pill {
  display: inline-block;
  background: rgba(16, 185, 129, 0.12);
  color: var(--emerald-900);
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.login-card h1 { margin: 0 0 10px; font-size: 1.65rem; letter-spacing: -0.02em; }
.subtitle { color: var(--slate-600); font-size: 0.92rem; margin: 0 0 20px; }
.feature-list {
  text-align: left;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 22px;
  display: grid;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--slate-700);
}
.feature-item span { color: var(--emerald-600); font-weight: 800; margin-right: 6px; }
.google-wrap { display: flex; justify-content: center; margin-top: 8px; }

.demo-form {
  text-align: left;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  padding-top: 18px;
  display: grid;
  gap: 12px;
}
.demo-badge {
  background: var(--amber-100);
  color: var(--amber-600);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 10px;
  text-align: center;
}
.field { display: grid; gap: 5px; font-size: 0.84rem; font-weight: 600; color: var(--slate-700); }
.field input {
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.92rem;
}
.field input:focus { outline: 2px solid var(--emerald-500); border-color: transparent; background: #ffffff; }

/* Floating Liquid Glass Topbar */
.topbar {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(24px) saturate(185%);
  -webkit-backdrop-filter: blur(24px) saturate(185%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.04);
}
.sticky-bar { position: sticky; top: 0; z-index: 30; }
.topbar-inner {
  max-width: 1220px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand-row { display: flex; align-items: center; gap: 11px; }
.logo-img {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.14);
}
.logo-mark {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #10b981, #047857);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: -0.02em;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 14px rgba(4, 120, 87, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn-blue {
  background: #1D63ED;
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(29, 99, 237, 0.25);
}
.btn-blue:hover:not(:disabled) {
  background: #1550C8;
  box-shadow: 0 8px 22px rgba(29, 99, 237, 0.34);
}
.btn-white {
  background: #FFFFFF;
  color: #1D1D1F;
  text-decoration: none;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}
.btn-white:hover { background: #F8FAFC; }

/* Floating Pill Navbar (cikguhafreez.my style) */
.floating-nav-wrap {
  padding: 14px 16px 6px;
}
.floating-nav {
  max-width: 1120px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  padding: 8px 10px 8px 16px;
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
}
.nav-link {
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
  transition: color 0.16s ease;
}
.nav-link:hover { color: #1D63ED; }

.brand-title {
  font-weight: 800;
  font-size: 1.42rem;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: #1D1D1F;
}
.brand-sub {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #64748B;
}

/* Centered Hero Section */
.hero-section {
  text-align: center;
  padding: 36px 12px 42px;
  max-width: 860px;
  margin: 0 auto;
}
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 20px;
}
.hero-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2563EB;
}
.hero-title {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #1D1D1F;
}
.hero-accent { color: #2563EB; }
.hero-desc {
  margin: 0 auto 24px;
  max-width: 650px;
  font-size: 1rem;
  color: #52525B;
  line-height: 1.6;
}
.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}
.trust-strip {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 22px;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
  border-radius: 20px;
  padding: 16px 28px;
}
.trust-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: left;
  min-width: 0;
}
.trust-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  font-weight: 700;
}
.trust-green { background: #ECFDF5; color: #059669; }
.trust-blue { background: #EFF6FF; color: #2563EB; }
.trust-amber { background: #FFFBEB; color: #D97706; }
.trust-title { font-size: 0.86rem; font-weight: 700; color: #1D1D1F; }
.trust-sub { font-size: 0.74rem; color: #64748B; }
.trust-divider {
  width: 1px;
  height: 28px;
  background: rgba(15, 23, 42, 0.08);
}
.user-bar { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.user-bar .btn { white-space: nowrap; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  background: #F8FAFC;
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 5px 12px;
  border-radius: 999px;
  max-width: 230px;
  min-width: 0;
}
.user-chip > div { min-width: 0; }
.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.user-name { font-weight: 600; font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 0.72rem; color: var(--slate-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Dashboard Pastel Card Carousels */
.section-head { margin-bottom: 24px; }
.intro-banner {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 20px;
  padding: 18px 22px;
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.04);
}
.intro-banner h2 {
  margin: 0 0 6px;
  font-size: 1.38rem;
  font-weight: 700;
  color: #1D1D1F;
  letter-spacing: -0.02em;
}
.intro-desc {
  margin: 0;
  font-size: 0.92rem;
  color: #52525B;
  max-width: 860px;
  line-height: 1.55;
}
.chapters-sections { display: grid; gap: 30px; min-width: 0; }

.form-section {
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

.section-headline {
  margin-bottom: 18px;
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 700;
}
.headline-primary { color: #1D1D1F; margin-right: 6px; }
.headline-secondary { color: #6E6E73; font-weight: 600; }

.carousel-track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 6px 2px 14px;
  scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }

.carousel-footer-nav {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}
.carousel-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #E8E8ED;
  color: #1D1D1F;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.2s ease;
}
.carousel-arrow:hover { background: #D2D2D7; transform: scale(1.05); }

.chapter-card {
  position: relative;
  flex: 0 0 300px;
  height: 365px;
  scroll-snap-align: start;
  border-radius: 22px;
  padding: 22px 22px 18px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.chapter-card.is-active { cursor: pointer; }
.chapter-card:hover {
  transform: scale(1.015);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.1);
}
.chapter-card.disabled { opacity: 0.78; }

.pastel-sky { background: linear-gradient(180deg, #E3F0FA 0%, #C2DDF4 100%); }
.pastel-lavender { background: linear-gradient(180deg, #EDE7F6 0%, #D1C4E9 100%); }
.pastel-butter { background: linear-gradient(180deg, #FFF8E1 0%, #FFE082 100%); }
.pastel-blush { background: linear-gradient(180deg, #FCE4EC 0%, #F8BBD0 100%); }

.card-top-meta { text-align: left; }
.card-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #52525B;
}
.card-title {
  margin: 5px 0 0;
  font-size: 1.24rem;
  line-height: 1.25;
  font-weight: 700;
  color: #1D1D1F;
  letter-spacing: -0.02em;
  min-height: 2.5em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-subtitle {
  margin: 4px 0 0;
  font-size: 0.82rem;
  line-height: 1.35;
  color: #404040;
  font-style: italic;
  min-height: 2.7em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-visual-area {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-top: 10px;
  padding-bottom: 36px;
}
.card-visual-box {
  width: 100%;
  min-height: 158px;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}
.visual-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 0.76rem;
  color: #1D1D1F;
}
.card-cta-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #047857;
}
.card-visual-placeholder {
  width: 100%;
  height: 112px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.44);
  border: 1px dashed rgba(29, 29, 31, 0.16);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #52525B;
  font-size: 0.8rem;
  font-weight: 600;
}
.card-flask-icon { width: 30px; height: 30px; opacity: 0.65; }

.card-fab {
  position: absolute;
  bottom: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #FFFFFF;
  color: #1D1D1F;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.chapter-card:hover .card-fab {
  transform: scale(1.06);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
.mini-bar {
  height: 7px;
  background: rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  overflow: hidden;
}
.mini-bar > div {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #047857);
  border-radius: 999px;
  transition: width 0.3s var(--spring);
}
.subtopic-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.subtopic-pill {
  font-size: 0.73rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: var(--slate-700);
  padding: 3px 8px;
  border-radius: 999px;
}

/* Quiz Workspace */
.quiz-topbar { flex-wrap: wrap; }
.quiz-left { display: flex; align-items: center; gap: 10px; }
.quiz-code { font-size: 0.73rem; font-weight: 700; color: var(--emerald-700); text-transform: uppercase; letter-spacing: 0.04em; }
.quiz-title { font-size: 0.95rem; font-weight: 700; }
.quiz-status-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.score-pill {
  background: rgba(16, 185, 129, 0.14);
  color: var(--emerald-900);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}
.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--slate-700);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.85);
  padding: 6px 12px;
  border-radius: 999px;
}
.sync-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald-500); }
.sync-pill.saving .dot { background: var(--amber-600); }
.sync-pill.error .dot { background: var(--red-600); }
.progress-track { height: 4px; background: rgba(148, 163, 184, 0.2); }
.progress-fill { height: 100%; background: linear-gradient(90deg, #10b981, #047857); transition: width 0.28s var(--spring); }

.quiz-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 20px;
  align-items: start;
}

.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: 0 0 auto;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(14px);
  color: var(--slate-700);
  cursor: pointer;
  transition: all 0.16s ease;
}
.filter-chip:hover { background: rgba(255, 255, 255, 0.92); }
.filter-chip.active {
  background: linear-gradient(135deg, #059669, #047857);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(4, 120, 87, 0.24);
}

.question-card {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(26px) saturate(185%);
  -webkit-backdrop-filter: blur(26px) saturate(185%);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--glass-shadow);
}
.q-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}
.q-badges { display: flex; align-items: center; gap: 8px; }
.q-number { font-weight: 800; color: var(--emerald-700); font-size: 1.02rem; }
.q-subtopic {
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.12);
  color: var(--emerald-900);
  padding: 4px 10px;
  border-radius: 999px;
}
.q-source {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--slate-500);
}

.q-stem { font-size: 0.98rem; display: grid; gap: 6px; margin-bottom: 18px; }
.stem-bm { color: var(--slate-900); }
.stem-en { color: var(--slate-600); font-style: italic; }
.stem-roman, .stem-bullet { padding-left: 16px; }
.stem-eq {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  text-align: center;
  margin: 4px 0;
}

.q-diagram-wrap {
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.92);
  text-align: center;
  margin-bottom: 18px;
  cursor: zoom-in;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}
.q-diagram-wrap img { max-width: 100%; max-height: 320px; object-fit: contain; }
.zoom-hint { display: block; font-size: 0.74rem; color: var(--slate-500); margin-top: 6px; }

.options-list { display: grid; gap: 10px; }
.option-btn {
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.75);
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  padding: 13px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.16s var(--spring), border-color 0.16s ease, background 0.16s ease;
}
.option-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(5, 150, 105, 0.45);
  background: rgba(236, 253, 245, 0.9);
}
.option-btn:disabled { cursor: default; }
.opt-key {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 999px;
  background: rgba(241, 245, 249, 0.9);
  color: var(--slate-700);
  font-weight: 700;
  display: grid;
  place-items: center;
}
.opt-text { display: grid; gap: 2px; color: var(--slate-900); }
.opt-en { font-size: 0.88rem; color: var(--slate-600); font-style: italic; }

.option-btn.correct {
  border-color: var(--emerald-500);
  background: rgba(209, 250, 229, 0.72);
}
.option-btn.correct .opt-key { background: var(--emerald-600); color: #ffffff; }

.option-btn.wrong {
  border-color: var(--red-600);
  background: rgba(254, 226, 226, 0.72);
}
.option-btn.wrong .opt-key { background: var(--red-600); color: #ffffff; }

.feedback-banner {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.9rem;
}
.feedback-banner.correct { background: rgba(16, 185, 129, 0.16); color: var(--emerald-900); }
.feedback-banner.wrong { background: rgba(239, 68, 68, 0.14); color: var(--red-600); }

.nav-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}
.nav-counter { font-weight: 700; font-size: 0.9rem; color: var(--slate-600); }

/* Sidebar Navigator */
.sidebar-card {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(26px) saturate(185%);
  -webkit-backdrop-filter: blur(26px) saturate(185%);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--glass-shadow);
  position: sticky;
  top: 84px;
}
.sidebar-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.sidebar-head h3 { margin: 0; font-size: 1rem; }
.legend-row { display: flex; gap: 12px; font-size: 0.76rem; color: var(--slate-600); margin-bottom: 10px; }
.leg-dot { display: inline-block; width: 10px; height: 10px; border-radius: 999px; margin-right: 4px; }
.leg-dot.correct { background: var(--emerald-500); }
.leg-dot.wrong { background: var(--red-600); }
.leg-dot.empty { background: rgba(148, 163, 184, 0.35); }

.state-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.tab-btn {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  cursor: pointer;
}
.tab-btn.active { background: var(--slate-900); color: #ffffff; border-color: var(--slate-900); }

.q-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  max-height: 430px;
  overflow-y: auto;
}
.q-tile {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 7px 0;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.72);
  color: var(--slate-700);
  cursor: pointer;
}
.q-tile.correct { background: var(--emerald-600); border-color: var(--emerald-600); color: #ffffff; }
.q-tile.wrong { background: var(--red-600); border-color: var(--red-600); color: #ffffff; }
.q-tile.current { box-shadow: 0 0 0 2px var(--slate-900); }

/* Modal */
.modal {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  padding: 16px;
}
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.58); backdrop-filter: blur(8px); }
.modal-content {
  position: relative;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 22px;
  padding: 14px;
  max-width: 92vw;
  max-height: 88vh;
  z-index: 1;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
}
.modal-content img { max-width: 86vw; max-height: 80vh; display: block; object-fit: contain; }
.modal-x {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--slate-900);
  color: #ffffff;
  cursor: pointer;
}

.mobile-only { display: none; }

@media (max-width: 900px) {
  .mobile-only { display: inline-flex; }
  .nav-links, .trust-divider { display: none; }
  .trust-strip { grid-template-columns: 1fr; gap: 14px; padding: 16px 20px; }
  .trust-item { justify-content: flex-start; }
  .floating-nav { border-radius: 22px; padding: 10px 12px; }
  .quiz-layout { grid-template-columns: 1fr; }
  .quiz-sidebar {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
    padding: 16px;
    display: none;
    align-items: center;
    justify-content: center;
  }
  .quiz-sidebar.open { display: flex; }
  .sidebar-card { width: 100%; max-width: 420px; position: static; }
  .user-email, .slide-hint { display: none; }
  .chapter-card { flex: 0 0 280px; }
}

/* Profile Onboarding (CAPS LOCK) & Admin Control Panel */
.caps-input {
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.demo-form select {
  padding: 11px 12px;
  border: 1.5px solid var(--slate-200);
  border-radius: 12px;
  font-size: 0.94rem;
  font-family: inherit;
  background: #ffffff;
  color: #1D1D1F;
}
.demo-form select:focus {
  outline: none;
  border-color: var(--emerald-600);
}
.profile-actions {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}
.btn-admin {
  background: #0F172A;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}
.btn-admin:hover { background: #1E293B; }

.admin-container {
  padding-top: 22px;
  padding-bottom: 48px;
}
.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.admin-kpi-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}
.kpi-label { font-size: 0.78rem; color: #64748B; font-weight: 600; }
.kpi-val { font-size: 1.7rem; font-weight: 800; color: #1D1D1F; margin-top: 4px; }

.admin-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 18px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
}
.admin-filter-field {
  display: grid;
  gap: 4px;
  min-width: 170px;
}
.admin-filter-grow { flex: 1; min-width: 220px; }
.admin-filter-field span {
  font-size: 0.74rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.admin-filter-field select,
.admin-filter-field input {
  padding: 9px 12px;
  border: 1.5px solid var(--slate-200);
  border-radius: 10px;
  font-size: 0.88rem;
  font-family: inherit;
  background: #ffffff;
}

.admin-table-wrap {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.admin-table th {
  text-align: left;
  padding: 12px 14px;
  background: #F8FAFC;
  color: #334155;
  font-weight: 700;
  border-bottom: 1px solid var(--slate-200);
  white-space: nowrap;
}
.admin-table td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  color: #1E293B;
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.center-cell { text-align: center; padding: 28px !important; }
.status-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}
.status-done { background: #ECFDF5; color: #047857; }
.status-wip { background: #EFF6FF; color: #1D63ED; }

@media (max-width: 1080px) {
  .floating-nav .nav-links { display: none; }
}
@media (max-width: 780px) {
  .floating-nav { border-radius: 22px; padding: 10px 12px; flex-wrap: wrap; }
  .user-bar { flex-wrap: wrap; justify-content: flex-end; }
}
@media (max-width: 900px) {
  .admin-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
