/* =========================================================
   LearnHub LMS — Modern MOOC Theme (Udemy / Coursera style)
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Thai:wght@400;500;600;700&display=swap');

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --primary: #6d28d9;
  --primary-dark: #5b21b6;
  --primary-light: #ede9fe;
  --accent: #2563eb;
  --success: #10b981;
  --success-soft: #d1fae5;
  --success-ink: #065f46;
  --warning: #f59e0b;
  --warning-soft: #fef3c7;
  --warning-ink: #92400e;
  --danger: #ef4444;
  --danger-soft: #fee2e2;
  --danger-ink: #991b1b;
  --info-soft: #dbeafe;
  --info-ink: #1e40af;
  --border: #e2e8f0;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 4px 16px rgba(15, 23, 42, .08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .14);
  --header-h: 64px;
  --grad-brand: linear-gradient(135deg, #6d28d9 0%, #2563eb 100%);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'IBM Plex Sans Thai', 'Segoe UI', 'Inter', 'Noto Sans Thai', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.2; }

/* ================= HEADER ================= */
.navbar {
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.navbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  height: var(--header-h);
}
.brand {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -.02em;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}
.nav-links { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.nav-links a {
  color: var(--text);
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--primary); background: var(--primary-light); text-decoration: none; }
.nav-links a.btn { color: #fff; }

/* ================= CONTAINER ================= */
.container { max-width: 1240px; margin: 0 auto; padding: 28px 20px; }
.container-narrow { max-width: 900px; margin: 0 auto; padding: 28px 20px; }

/* ================= HERO (หน้าแรก) ================= */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--grad-brand);
  background-size: 160% 160%;
  background-position: 50% 50%;
  color: #fff;
  border-radius: 0 0 28px 28px;
  padding: 56px 20px 64px;
  text-align: center;
  animation: heroBg 22s ease-in-out infinite;
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  animation: hbFloat 22s ease-in-out infinite;
}
.hero::before { width: 420px; height: 420px; top: -160px; left: -120px; animation-delay: -8s; }
.hero::after { width: 320px; height: 320px; bottom: -140px; right: -80px; animation-delay: -14s; }
.hero-inner { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; }
.hero h1 { font-size: 2.4rem; font-weight: 800; margin: 0 0 10px; letter-spacing: -.02em; }
.hero p { font-size: 1.1rem; opacity: .92; margin: 0 0 8px; }

@keyframes heroBg {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ================= HOME BACKGROUND (animation เฉพาะหน้าแรก/หน้าเข้าสู่ระบบ) ================= */
.home-bg {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
body.page-home .home-bg,
body.page-auth .home-bg { display: block; }
body.page-home .navbar,
body.page-home .hero,
body.page-home .container,
body.page-auth .navbar,
body.page-auth .auth-wrapper { position: relative; z-index: 1; }

.hb-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .5;
  will-change: transform;
}
.hb-a { width: 480px; height: 480px; background: #8b5cf6; top: -140px; left: -120px; animation: hbFloat 18s ease-in-out infinite; }
.hb-b { width: 440px; height: 440px; background: #38bdf8; bottom: -180px; right: -120px; opacity: .4; animation: hbFloat 22s ease-in-out infinite reverse; }
.hb-c { width: 380px; height: 380px; background: #fb923c; top: 42%; left: 56%; opacity: .22; animation: hbFloat 26s ease-in-out 2s infinite; }

@keyframes hbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(70px, -50px) scale(1.1); }
  66%      { transform: translate(-50px, 40px) scale(.94); }
}

.hb-p {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(109, 40, 217, .4);
  animation: hbRise 18s linear infinite;
}
.hb-p:nth-child(4)  { left: 8%;  bottom: -12px; animation-duration: 15s; animation-delay: 0s; }
.hb-p:nth-child(5)  { left: 18%; bottom: -12px; width: 4px; height: 4px; opacity: .6; animation-duration: 19s; animation-delay: 3s; }
.hb-p:nth-child(6)  { left: 32%; bottom: -12px; animation-duration: 17s; animation-delay: 6s; }
.hb-p:nth-child(7)  { left: 47%; bottom: -12px; width: 5px; height: 5px; opacity: .5; animation-duration: 22s; animation-delay: 2s; }
.hb-p:nth-child(8)  { left: 61%; bottom: -12px; animation-duration: 16s; animation-delay: 8s; }
.hb-p:nth-child(9)  { left: 74%; bottom: -12px; width: 4px; height: 4px; opacity: .55; animation-duration: 18s; animation-delay: 5s; }
.hb-p:nth-child(10) { left: 86%; bottom: -12px; animation-duration: 21s; animation-delay: 1s; }
.hb-p:nth-child(11) { left: 94%; bottom: -12px; width: 5px; height: 5px; opacity: .4; animation-duration: 17s; animation-delay: 9s; }
.hb-p:nth-child(12) { left: 12%; bottom: -12px; width: 3px; height: 3px; opacity: .5; animation-duration: 25s; animation-delay: 12s; }

@keyframes hbRise {
  0%   { transform: translateY(0); opacity: 0; }
  6%   { opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translateY(-108vh); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero,
  .hero::before, .hero::after,
  .hb-blob, .hb-p { animation: none !important; }
}

/* ================= CARDS ================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}

/* ================= COURSE GRID ================= */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}
.course-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.course-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}
.course-cover {
  height: 150px;
  background: var(--grad-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -.02em;
}
.course-body { padding: 18px; display: flex; flex-direction: column; flex: 1; }
.course-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 6px; min-height: 2.4em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-title a { color: var(--text); }
.course-title a:hover { color: var(--primary); text-decoration: none; }
.course-meta { color: var(--text-muted); font-size: .85rem; margin-bottom: 12px; }
.course-body > .btn, .course-body > .progress-track { margin-top: auto; }

/* ================= CATALOG FILTER ================= */
.catalog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.catalog-head h1 { font-size: 1.6rem; margin: 0; font-weight: 800; }

/* ================= PROGRESS ================= */
.progress-track {
  background: #e8e8ef;
  height: 8px;
  border-radius: 99px;
  overflow: hidden;
  margin-top: auto;
}
.progress-fill {
  background: var(--grad-brand);
  height: 100%;
  border-radius: 99px;
  transition: width .3s ease;
}

/* ================= BUTTONS ================= */
.btn {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  text-align: center;
  font-family: 'IBM Plex Sans Thai', 'Segoe UI', system-ui, sans-serif;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(109, 40, 217, .28); }
.btn-outline { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); box-shadow: none; transform: none; color: var(--primary); }
.btn-success { background: var(--success); }
.btn-success:hover { background: #059669; box-shadow: 0 6px 16px rgba(16, 185, 129, .28); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; box-shadow: 0 6px 16px rgba(239, 68, 68, .28); }
.btn-sm { padding: 6px 12px; font-size: .8rem; border-radius: 8px; }
.btn-block { display: block; width: 100%; }

/* ================= FORMS ================= */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .9rem; }
.form-control {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-family: 'IBM Plex Sans Thai', 'Segoe UI', system-ui, sans-serif;
  background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(109, 40, 217, .15); }
select.form-control { cursor: pointer; }

/* ================= AUTH ================= */
.auth-wrapper { max-width: 420px; margin: 48px auto; }
.auth-title { text-align: center; margin-bottom: 8px; font-weight: 800; }
.auth-sub { text-align: center; color: var(--text-muted); margin-bottom: 28px; }
.auth-card { padding: 32px; }

/* ================= HELP (?) BUTTON + MODAL ================= */
.help-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 60;
}
.help-fab:hover { background: var(--primary-dark); transform: translateY(-1px); }
.help-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(15, 23, 42, .45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.help-modal.open { display: flex; }
.help-modal-content {
  background: var(--surface);
  border-radius: var(--radius);
  max-width: 520px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 24px 26px;
  box-shadow: var(--shadow-lg);
}

/* ================= BADGE ================= */
.badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .01em;
}
.badge-green { background: var(--success-soft); color: var(--success-ink); }
.badge-amber { background: var(--warning-soft); color: var(--warning-ink); }
.badge-gray { background: #eef2f7; color: #475569; }
.badge-red { background: var(--danger-soft); color: var(--danger-ink); }
.badge-blue { background: var(--info-soft); color: var(--info-ink); }

/* ================= ALERT ================= */
.alert { padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: .9rem; }
.alert-error { background: var(--danger-soft); color: var(--danger-ink); border: 1px solid #fecaca; }
.alert-success { background: var(--success-soft); color: var(--success-ink); border: 1px solid #a7f3d0; }

/* ================= NOTES (เอกสารประกอบ) ================= */
.notes-wrap {
  max-width: 640px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 36px 40px;
}
.notes-body {
  color: var(--text);
  line-height: 1.9;
  font-size: 1rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.notes-body { color: var(--text); }
@media (max-width: 640px) {
  .notes-wrap { padding: 24px 20px; }
}

/* CTA เด่น — เอกสารประกอบการเรียน */
.notes-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--primary-light) 0%, #f5f3ff 100%);
  border: 1px solid #ddd6fe;
  border-left: 5px solid var(--primary);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.notes-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.notes-cta-icon {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}
.notes-cta strong { display: block; font-size: 1.02rem; color: var(--text); }
.notes-cta span { display: block; color: var(--text-muted); font-size: .85rem; }
.notes-cta-arrow {
  margin-left: auto;
  font-size: 1.3rem;
  color: var(--primary);
  font-weight: 700;
}

/* ================= VIDEO CLASSROOM ================= */
.classroom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}
.main-col { min-width: 0; }

.video-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.video-frame {
  aspect-ratio: 16 / 9;
  background: #0f172a;
}
.video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

.video-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.video-title h2 { margin: 0; font-size: 1.15rem; font-weight: 700; }
.video-title small { color: var(--text-muted); }

.video-progress-info { display: flex; align-items: center; justify-content: space-between; font-size: .85rem; color: var(--text-muted); }

/* Playlist (sidebar) */
.class-tabs,
.tab-nav {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--border);
  padding: 0 8px;
  background: var(--surface);
}
.class-tabs button,
.tab-nav button {
  background: none; border: none; padding: 14px 16px;
  font-size: .95rem; font-weight: 600; cursor: pointer;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s ease;
}
.class-tabs button.active,
.tab-nav button.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-link {
  background: none;
  border: none;
  padding: 14px 16px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tab-link:hover { color: var(--primary); text-decoration: none; }

.tab-panel { display: none; padding: 22px 18px; }
.tab-panel.active { display: block; }

.playlist-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  padding: 16px;
  max-height: calc(100vh - var(--header-h) - 32px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.playlist { list-style: none; margin: 12px 0 0; padding: 0; }
.playlist li { border-bottom: 1px solid var(--border); }
.playlist li:last-child { border-bottom: none; }
.playlist a {
  display: flex;
  gap: 12px;
  padding: 11px 10px;
  color: var(--text);
  align-items: flex-start;
  border-radius: var(--radius-sm);
  transition: background .13s ease;
}
.playlist a:hover { background: var(--bg); text-decoration: none; }
.playlist a.active { background: var(--primary-light); }
.lesson-num {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700;
  background: var(--bg); color: var(--text-muted);
}
.playlist a.active .lesson-num { background: var(--primary); color: #fff; }
.lesson-locked .lesson-num { background: var(--border); color: #94a3b8; }

/* ================= QUIZ ================= */
.quiz-question { margin-bottom: 24px; }
.quiz-option {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background .13s ease, border-color .13s ease;
}
.quiz-option:hover { background: var(--bg); border-color: var(--primary); }
.quiz-option input { margin-right: 8px; }

/* ================= TABLE (ADMIN) ================= */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 13px 15px; text-align: left; border-bottom: 1px solid var(--border); font-size: .9rem; }
.table th { background: var(--bg); color: var(--text-muted); font-weight: 700; text-transform: uppercase; font-size: .75rem; letter-spacing: .03em; }
.table tr:hover td { background: #fafbff; }

/* ================= KPI ================= */
.row { display: flex; gap: 18px; flex-wrap: wrap; }
.col { flex: 1; min-width: 240px; }
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-num { font-size: 1.9rem; font-weight: 800; color: var(--primary); letter-spacing: -.02em; }
.kpi-label { color: var(--text-muted); font-size: .85rem; margin-bottom: 4px; }

/* ================= FOOTER ================= */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: .85rem;
  margin-top: 56px;
  background: var(--surface);
}

/* ================= MOBILE ================= */
@media (max-width: 900px) {
  .classroom { grid-template-columns: 1fr; }
  .playlist-sidebar { position: static; max-height: none; }
}

/* ---- Navbar บนมือถือ: แสดงลิงก์แนวนอน เลื่อนได้ ---- */
@media (max-width: 768px) {
  .navbar-inner { flex-wrap: nowrap; }
  .nav-links {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 4px;
    margin-left: auto;
    scrollbar-width: none;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a {
    padding: 10px 12px;
    font-size: .92rem;
    white-space: nowrap;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .nav-links span { white-space: nowrap; display: none; }
  .course-grid { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 1.9rem; }
}

/* ---- จอแคบ < 480px ---- */
@media (max-width: 480px) {
  .course-grid { grid-template-columns: 1fr; }
  .navbar-inner { gap: 10px; padding: 0 12px; }
  .container, .container-narrow { padding: 20px 14px; }

  /* Hero */
  .hero { padding: 40px 14px 48px; }
  .hero h1 { font-size: 1.5rem; }
  .hero p { font-size: .95rem; }

  /* Search form หน้าแรก */
  .catalog-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  form.card[method="get"] { flex-direction: column; gap: 12px; align-items: stretch; }
  form.card[method="get"] .form-group { min-width: 100%; width: 100%; }
  form.card[method="get"] button, form.card[method="get"] a.btn { width: 100%; }

  /* Auth (login/register) */
  .auth-wrapper { margin: 28px auto; padding: 0 14px; }
  .auth-card { padding: 24px 20px; }

  /* KPI */
  .kpi { padding: 16px; }
  .kpi-num { font-size: 1.5rem; }

  /* Quiz options */
  .quiz-option { padding: 12px 12px; }
  .quiz-option label { font-size: .95rem; }
  .quiz-option input { margin-right: 6px; transform: scale(1.15); }

  /* Video classroom */
  .video-bar { flex-direction: column; align-items: flex-start; padding: 12px 14px; }
  .video-bar h2 { font-size: 1.05rem; }
  .tab-nav button { flex: 1; justify-content: center; padding: 10px 4px; font-size: .85rem; }

  .footer { padding: 22px 14px; }
}

/* ---- Table ให้เลื่อนซ้าย-ขวาบนจอแคบ (my_results, admin card) ---- */
@media (max-width: 768px) {
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { min-width: 640px; }
  .row > .col { min-width: 100%; }
}

/* ---- Touch targets ทั่วไปบนมือถือ ---- */
@media (max-width: 768px) {
  .btn, .nav-links a, .course-card a, .tab-nav button, .tab-btn, .playlist a, input, select, textarea, .help-fab {
    min-height: 44px;
  }
  .btn-sm, .btn-sm * { min-height: 36px; }
}

/* ---- Modal บนจอมือถือ ---- */
@media (max-width: 480px) {
  .modal-box { padding: 18px 16px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }
  .help-modal-content { padding: 18px 16px; }
}

/* ---- Modal ยืนยันการส่งแบบทดสอบ ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-box {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  max-width: 420px;
  width: 100%;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ---- เฉลยคำตอบ (quiz reveal) ---- */
.quiz-reveal-item { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 10px; background: #fff; }
.quiz-explanation {
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--primary-light);
  border-radius: 6px;
  color: var(--text);
}
