:root {
  --primary: #0B1F3A;
  --primary-light: #14294D;
  --primary-soft: #1B3253;
  --accent: #F4B400;
  --accent-soft: #FEF3C7;
  --success: #22C55E;
  --success-soft: #ECFDF3;
  --warning: #F59E0B;
  --warning-soft: #FFFBEB;
  --danger: #EF4444;
  --danger-soft: #FEF2F2;
  --bg: #EFF3F9;
  --bg-grad-1: #EFF3F9;
  --bg-grad-2: #E4ECFB;
  --card-bg: #FFFFFF;
  --text: #0F172A;
  --text-muted: #64748B;
  --text-faint: #94A3B8;
  --border: #E4E9F2;
  --shadow-sm: 0 2px 8px rgba(11, 31, 58, 0.06);
  --shadow: 0 12px 32px rgba(11, 31, 58, 0.10);
  --shadow-lg: 0 24px 60px rgba(11, 31, 58, 0.16);
  --radius: 18px;
  --radius-sm: 12px;
  --font-display: 'Poppins', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  --font-body: 'Poppins', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  --font-tagline: 'Caveat', cursive;
}

[data-theme="dark"] {
  --bg: #0A0F1C;
  --bg-grad-1: #0A0F1C;
  --bg-grad-2: #0F1830;
  --card-bg: #131C31;
  --text: #ECF1FA;
  --text-muted: #94A3B8;
  --text-faint: #64748B;
  --border: #223154;
  --accent-soft: #2E2408;
  --success-soft: #0B2E1D;
  --warning-soft: #2A2110;
  --danger-soft: #3A1414;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: linear-gradient(160deg, var(--bg-grad-1) 0%, var(--bg-grad-2) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  transition: background .3s ease, color .3s ease;
  -webkit-font-smoothing: antialiased;
}

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* ===== Header ===== */
.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; background: linear-gradient(120deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white; box-shadow: 0 4px 20px rgba(11,31,58,0.25);
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #0090cc);
  color: var(--primary); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(244,180,0,0.35);
}
.brand-title { font-size: 17px; font-weight: 800; letter-spacing: .2px; }
.brand-sub { font-size: 11.5px; opacity: .78; font-weight: 500; margin-top: 1px; }
.header-actions { display: flex; gap: 8px; }
.icon-btn {
  background: rgba(255,255,255,0.12); border: none; color: white; width: 38px; height: 38px;
  border-radius: 50%; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center;
  transition: background .15s ease, transform .15s ease;
}
.icon-btn:hover { background: rgba(255,255,255,0.24); transform: translateY(-1px); }
.btn-install {
  background: rgba(255,255,255,0.14); color: white; border: 1.5px solid rgba(255,255,255,0.3);
  padding: 9px 16px; border-radius: 999px; font-size: 12.5px; font-weight: 700; cursor: pointer;
  transition: background .15s ease;
}
.btn-install:hover { background: rgba(255,255,255,0.26); }

.offline-banner {
  display: none; align-items: center; justify-content: center; gap: 8px;
  background: var(--warning-soft); color: #92400E; font-size: 12.5px; font-weight: 700;
  padding: 8px 16px; text-align: center;
}
[data-theme="dark"] .offline-banner { color: var(--warning); }
.offline-banner.show { display: flex; }

/* ===== Main / Screens ===== */
#app-main { flex: 1; padding: 40px 16px 70px; display: flex; flex-direction: column; align-items: center; }
.screen { display: none; width: 100%; max-width: 740px; animation: fadeIn .35s cubic-bezier(.22,1,.36,1); }
.screen.active { display: block; }
#screen-dashboard.active { max-width: 920px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

.card {
  background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 38px 36px; border: 1px solid var(--border);
}
.card-eyebrow {
  font-size: 11.5px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase;
  color: #B8860B; margin-bottom: 6px;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: .2px; }

/* ===== Landing ===== */
.landing-card { text-align: center; }
.landing-logo {
  width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-soft));
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow);
}
.landing-card h1 { font-size: 27px; margin: 0 0 4px; color: var(--text); }
.brand-tagline {
  font-family: var(--font-tagline); font-size: 24px; color: var(--accent); font-weight: 600;
  margin-bottom: 14px; transform: rotate(-1.5deg); display: inline-block;
}
.muted { color: var(--text-muted); font-size: 14.5px; line-height: 1.65; }
.form-group { text-align: left; margin: 22px 0; }
.form-group label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 7px; color: var(--text); letter-spacing: .2px; }
.req { color: var(--danger); }
.optional { color: var(--text-faint); font-weight: 500; }
input[type="text"] {
  width: 100%; padding: 13px 16px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 15px; font-family: var(--font-body);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field-error { display: none; color: var(--danger); font-size: 12.5px; margin-top: 7px; font-weight: 600; }
.field-error.show { display: block; animation: shake .3s ease; }
@keyframes shake { 0%,100%{transform:translateX(0);} 25%{transform:translateX(-4px);} 75%{transform:translateX(4px);} }

/* ===== Buttons ===== */
.btn {
  padding: 14px 24px; border-radius: var(--radius-sm); border: none; font-size: 14.5px; font-weight: 700;
  cursor: pointer; transition: transform .12s ease, opacity .15s ease, background .15s ease, box-shadow .15s ease;
  font-family: var(--font-body);
}
.btn:active { transform: scale(0.97); }
.btn-block { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-arrow { transition: transform .15s ease; }
.btn-block:hover .btn-arrow { transform: translateX(3px); }
.btn-primary { background: linear-gradient(135deg, var(--accent), #D99A00); color: #1A1400; box-shadow: 0 6px 18px rgba(244,180,0,0.35); }
.btn-primary:hover { box-shadow: 0 8px 22px rgba(244,180,0,0.45); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.btn-secondary { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: white; box-shadow: 0 6px 16px rgba(11,31,58,0.25); }
.btn-secondary:hover { opacity: .92; }
.btn-ghost { background: var(--card-bg); color: var(--text); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.dashboard-clear-btn:hover { border-color: var(--danger); color: var(--danger); }

/* ===== Instructions ===== */
.instructions-list { list-style: none; padding: 0; margin: 20px 0 26px; }
.instructions-list li { display: flex; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--border); font-size: 14px; line-height: 1.5; }
.instructions-list li:last-child { border-bottom: none; }
.inst-icon { font-size: 20px; flex-shrink: 0; }

/* ===== Quiz ===== */
.quiz-header { width: 100%; max-width: 740px; margin-bottom: 16px; }
.quiz-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 14px; font-weight: 700; }
.q-of { color: var(--text-faint); font-weight: 500; margin: 0 2px; }
.timer {
  font-variant-numeric: tabular-nums; background: var(--card-bg); border: 1.5px solid var(--border);
  padding: 7px 16px; border-radius: 999px; box-shadow: var(--shadow-sm); font-size: 15px;
}
.timer.low-time { color: var(--danger); border-color: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
.progress-track { height: 9px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 5%; background: linear-gradient(90deg, var(--accent), #67D6FF); border-radius: 999px; transition: width .3s cubic-bezier(.22,1,.36,1); }

.quiz-card { margin-bottom: 20px; }
.q-meta { display: flex; gap: 8px; margin-bottom: 16px; }
.category-badge, .difficulty-badge {
  font-size: 10.5px; font-weight: 800; padding: 6px 13px; border-radius: 999px; text-transform: uppercase; letter-spacing: .6px;
}
.category-badge { background: var(--accent-soft); color: #B8860B; }
.difficulty-badge { background: var(--border); color: var(--text-muted); }
.difficulty-badge.easy { background: var(--success-soft); color: var(--success); }
.difficulty-badge.medium { background: var(--warning-soft); color: var(--warning); }
.difficulty-badge.hard { background: var(--danger-soft); color: var(--danger); }
.q-text { font-size: 20px; line-height: 1.45; margin: 0 0 22px; color: var(--text); font-weight: 700; }

.options { display: flex; flex-direction: column; gap: 11px; }
.option-btn {
  text-align: left; padding: 15px 18px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 14.5px; cursor: pointer; font-family: var(--font-body);
  display: flex; align-items: center; gap: 14px; transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.option-btn:hover { border-color: var(--accent); transform: translateX(2px); }
.option-btn.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(244,180,0,0.12); }
.option-letter {
  width: 28px; height: 28px; border-radius: 50%; background: var(--card-bg); border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex-shrink: 0;
}
.option-btn.selected .option-letter { background: var(--accent); color: #1A1400; border-color: var(--accent); }

.quiz-nav { display: flex; justify-content: space-between; width: 100%; max-width: 740px; }
.quiz-nav-right { display: flex; gap: 10px; }

/* ===== Results ===== */
.results-card { text-align: center; }
.result-badge {
  display: inline-block; padding: 7px 20px; border-radius: 999px; font-size: 12px; font-weight: 800;
  letter-spacing: 1.2px; margin-bottom: 12px;
}
.result-badge.pass { background: var(--success-soft); color: var(--success); }
.result-badge.fail { background: var(--danger-soft); color: var(--danger); }
.results-card h1 { font-size: 58px; margin: 4px 0; font-family: var(--font-display); }
.results-meta {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; text-align: left;
  margin: 26px 0; padding: 18px 20px; background: var(--bg); border-radius: var(--radius-sm);
}
.results-meta .label { display: block; font-size: 10.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 3px; font-weight: 700; }
.section-label { text-align: left; font-size: 15px; margin: 28px 0 14px; font-family: var(--font-display); }
.category-breakdown { display: flex; flex-direction: column; gap: 11px; text-align: left; }
.cat-row { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.cat-row .cat-name { width: 170px; flex-shrink: 0; text-align: left; font-weight: 600; }
.cat-bar-track { flex: 1; height: 9px; background: var(--border); border-radius: 999px; overflow: hidden; }
.cat-bar-fill { height: 100%; border-radius: 999px; transition: width .5s ease; }
.cat-row .cat-pct { width: 42px; text-align: right; font-weight: 800; }

.recommendations { text-align: left; padding-left: 22px; font-size: 13.5px; line-height: 1.75; color: var(--text-muted); }
.results-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 30px; }

/* ===== Review ===== */
.review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; }
.review-item { padding: 18px 0; border-bottom: 1px solid var(--border); }
.review-item:last-child { border-bottom: none; }
.review-q { font-size: 15px; font-weight: 700; margin-bottom: 11px; }
.review-opt { padding: 9px 13px; border-radius: 9px; font-size: 13px; margin-bottom: 7px; border: 1.5px solid var(--border); }
.review-opt.correct-answer { border-color: var(--success); background: var(--success-soft); }
.review-opt.wrong-answer { border-color: var(--danger); background: var(--danger-soft); }
.review-explain { font-size: 12.5px; color: var(--text-muted); margin-top: 9px; font-style: italic; line-height: 1.5; }

/* ===== Certificate ===== */
.cert-controls { display: flex; justify-content: space-between; width: 100%; max-width: 920px; margin-bottom: 18px; }
.certificate {
  background: #FFFDF8; width: 100%; max-width: 920px; aspect-ratio: 1.414 / 1; padding: 22px;
  box-shadow: var(--shadow-lg); border-radius: 10px;
  background-image:
    radial-gradient(circle at top left, rgba(244,180,0,0.06), transparent 45%),
    radial-gradient(circle at bottom right, rgba(11,31,58,0.05), transparent 45%);
}
.cert-border {
  border: 2.5px solid var(--primary); height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 36px;
  position: relative; border-radius: 4px;
}
.cert-border::before {
  content: ""; position: absolute; inset: 9px; border: 1px solid var(--accent); border-radius: 2px;
  pointer-events: none;
}
.cert-corner { position: absolute; width: 26px; height: 26px; border: 2.5px solid var(--accent); }
.cert-corner-tl { top: 14px; left: 14px; border-right: none; border-bottom: none; }
.cert-corner-tr { top: 14px; right: 14px; border-left: none; border-bottom: none; }
.cert-corner-bl { bottom: 14px; left: 14px; border-right: none; border-top: none; }
.cert-corner-br { bottom: 14px; right: 14px; border-left: none; border-top: none; }
.cert-seal { margin-bottom: 6px; }
.cert-header { font-family: var(--font-display); font-size: 26px; font-weight: 800; color: var(--primary); letter-spacing: 3px; margin-top: 4px; }
.cert-ribbon {
  font-family: var(--font-display); font-size: 34px; font-weight: 700; color: var(--accent);
  margin-top: 12px; font-style: italic;
}
.cert-course { font-size: 14px; color: var(--text-muted); margin-top: 8px; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700; }
.cert-presented { font-size: 13px; color: var(--text-muted); margin-top: 22px; max-width: 480px; line-height: 1.5; }
.cert-name { font-size: 34px; font-weight: 800; color: var(--primary); margin-top: 10px; font-family: var(--font-display); border-bottom: 2px solid var(--accent-soft); padding-bottom: 8px; }
.cert-score { font-size: 30px; font-weight: 800; color: var(--success); margin-top: 10px; font-family: var(--font-display); }
.cert-footer { display: flex; gap: 60px; margin-top: 32px; align-items: flex-end; }
.cert-footer-col { text-align: center; }
.cert-line { font-size: 13.5px; font-weight: 700; border-top: 1.5px solid var(--text-faint); padding-top: 7px; min-width: 130px; color: var(--text); }
.cert-signature-script { font-family: var(--font-display); font-style: italic; font-size: 18px; color: var(--primary); }
.cert-line-label { font-size: 9.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 1.2px; margin-top: 5px; font-weight: 700; }

/* ===== Teacher Dashboard ===== */
.dashboard-note { margin: -6px 0 20px; }
.dashboard-toolbar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.dashboard-toolbar input[type="text"] { flex: 1; min-width: 200px; }
.dashboard-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.dashboard-stat {
  background: var(--bg); border-radius: var(--radius-sm); padding: 14px 16px; text-align: center;
}
.dashboard-stat .stat-value { font-size: 24px; font-weight: 800; font-family: var(--font-display); color: var(--primary); }
[data-theme="dark"] .dashboard-stat .stat-value { color: var(--accent); }
.dashboard-stat .stat-label { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 3px; font-weight: 700; }

.dashboard-table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.dashboard-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dashboard-table thead { background: var(--bg); }
.dashboard-table th {
  text-align: left; padding: 12px 14px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted); font-weight: 800; border-bottom: 1.5px solid var(--border);
}
.dashboard-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.dashboard-table tbody tr:last-child td { border-bottom: none; }
.dashboard-table tbody tr:hover { background: var(--bg); }
.dashboard-table .name-cell { font-weight: 700; }
.dashboard-pct { font-weight: 800; }
.dashboard-pct.high { color: var(--success); }
.dashboard-pct.mid { color: var(--warning); }
.dashboard-pct.low { color: var(--danger); }
.dashboard-result-badge { font-size: 10.5px; font-weight: 800; padding: 4px 10px; border-radius: 999px; text-transform: uppercase; }
.dashboard-result-badge.pass { background: var(--success-soft); color: var(--success); }
.dashboard-result-badge.fail { background: var(--danger-soft); color: var(--danger); }
.dashboard-view-btn { background: none; border: 1px solid var(--border); color: var(--text-muted); font-size: 11.5px; padding: 5px 10px; border-radius: 7px; cursor: pointer; font-weight: 700; }
.dashboard-view-btn:hover { border-color: var(--accent); color: var(--accent); }
.dashboard-empty { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 14px; }

/* ===== Onboarding ===== */
.onboarding-steps { display: flex; flex-direction: column; gap: 10px; margin: 22px 0; text-align: left; }
.onboarding-step {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--bg); font-size: 13.5px; font-weight: 600;
}
.step-num {
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #1A1400;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex-shrink: 0;
}
.onboarding-note { margin-top: 16px; font-size: 12.5px; }

/* ===== Course Catalog ===== */
.catalog-card { max-width: 100%; }
.catalog-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 22px; }
.course-list { display: flex; flex-direction: column; gap: 16px; }
.course-item {
  display: flex; gap: 18px; padding: 22px; border-radius: var(--radius); border: 1.5px solid var(--border);
  background: var(--bg); align-items: flex-start; flex-wrap: wrap;
}
.course-icon-wrap {
  width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  font-size: 26px; flex-shrink: 0; box-shadow: var(--shadow-sm);
}
.course-info { flex: 1; min-width: 220px; }
.course-info h3 { font-family: var(--font-display); font-size: 18px; margin: 0 0 6px; }
.course-info p { font-size: 13px; color: var(--text-muted); line-height: 1.55; margin: 0 0 12px; }
.course-cert-badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; color: var(--success);
  background: var(--success-soft); padding: 4px 10px; border-radius: 999px; margin-bottom: 10px;
}
.course-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== Admin Tabs ===== */
.admin-tabs { display: flex; gap: 8px; margin-bottom: 20px; border-bottom: 1.5px solid var(--border); padding-bottom: 0; }
.admin-tab {
  background: none; border: none; padding: 10px 18px; font-size: 13.5px; font-weight: 700; color: var(--text-muted);
  cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -1.5px;
}
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.admin-panel { display: none; }
.admin-panel.active { display: block; animation: fadeIn .25s ease; }

.course-filter-select {
  padding: 12px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 14px; font-family: var(--font-body);
}

.course-badge-pill {
  display: inline-block; font-size: 10.5px; font-weight: 800; padding: 4px 10px; border-radius: 999px;
  background: var(--accent-soft); color: #B8860B;
}

@media (max-width: 640px) {
  .course-item { flex-direction: column; }
  .catalog-header { flex-direction: column; }
}

/* ===== Footer ===== */
.bottom-bar { text-align: center; font-size: 11.5px; color: var(--text-muted); padding: 18px; }

/* ===== Class Notes ===== */
.btn-notes-link { margin-top: 12px; }
.notes-intro { margin: -6px 0 20px; }
.notes-accordion { display: flex; flex-direction: column; gap: 10px; margin-bottom: 26px; }
.notes-item { border: 1.5px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg); }
.notes-item-header {
  display: flex; align-items: center; gap: 12px; padding: 15px 18px; cursor: pointer;
  background: var(--card-bg); transition: background .15s ease;
}
.notes-item-header:hover { background: var(--accent-soft); }
.notes-item-icon { font-size: 20px; flex-shrink: 0; }
.notes-item-title { font-weight: 700; font-size: 14.5px; flex: 1; }
.notes-item-summary { font-size: 12px; color: var(--text-muted); display: none; }
.notes-item-chevron { font-size: 12px; color: var(--text-faint); transition: transform .2s ease; flex-shrink: 0; }
.notes-item.open .notes-item-chevron { transform: rotate(180deg); }
.notes-item-body { max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.notes-item.open .notes-item-body { max-height: 800px; }
.notes-item-body-inner { padding: 4px 18px 18px 50px; }
.notes-item-body-inner ul { margin: 0; padding-left: 18px; }
.notes-item-body-inner li { font-size: 13.5px; line-height: 1.65; color: var(--text); margin-bottom: 9px; }
.notes-cta { margin-top: 8px; }

@media (max-width: 640px) {
  .notes-item-body-inner { padding-left: 20px; }
}

/* ===== Confetti ===== */
.confetti-piece {
  position: fixed; top: -20px; width: 8px; height: 14px; opacity: 0.9; z-index: 999;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(110vh) rotate(540deg); opacity: 0.3; }
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .top-bar { padding: 14px 18px; }
  #app-main { padding: 24px 12px 60px; }
  .card { padding: 26px 22px; }
  .results-meta { grid-template-columns: 1fr; }
  .results-card h1 { font-size: 44px; }
  .cert-footer { gap: 24px; flex-wrap: wrap; }
  .cert-header { font-size: 19px; letter-spacing: 1.5px; }
  .cert-ribbon { font-size: 24px; }
  .cert-name { font-size: 24px; }
  .quiz-nav-right { flex-direction: column; width: 100%; }
  .quiz-nav { flex-direction: column; gap: 10px; }
  .dashboard-summary { grid-template-columns: repeat(2, 1fr); }
  .dashboard-toolbar { flex-direction: column; }
}

/* ===== Print ===== */
@media print {
  .no-print, .top-bar, .bottom-bar { display: none !important; }
  body, .app-shell, html { background: white !important; }
  #app-main { padding: 0; }
  .screen { display: none !important; max-width: 100% !important; }
  #screen-certificate.active, #screen-results.active { display: block !important; }
  .certificate, .card { box-shadow: none; border: 1px solid #ddd; }
}
