/* =============================================================
   Managerial Economics Quiz — Stylesheet
   Mobile-first. Design tokens at :root. RTL support for Arabic.
   ============================================================= */

:root {
  /* Brand palette — matches the printed .docx series */
  --navy: #1F3864;
  --blue: #2E74B5;
  --lightblue: #EAF1FA;
  --yellow: #FFF2CC;
  --row-shade: #F2F7FB;

  /* Surfaces */
  --bg: #F5F7FB;
  --card: #FFFFFF;
  --text: #1A1A1A;
  --muted: #6B7280;
  --border: #E5E7EB;

  /* Feedback */
  --green: #16A34A;
  --green-bg: #DCFCE7;
  --green-border: #86EFAC;
  --red: #DC2626;
  --red-bg: #FEE2E2;
  --red-border: #FCA5A5;
  --amber: #D97706;
  --amber-bg: #FEF3C7;
  --amber-border: #FCD34D;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  margin: 0;
  padding: 0;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, "Calibri", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  overscroll-behavior: none;
}

button {
  font-family: inherit;
  color: inherit;
}

a {
  color: var(--blue);
  text-decoration: none;
}

/* Top-level container */
.app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* =============================================================
   Screens
   ============================================================= */
.screen {
  display: none;
  flex: 1;
  flex-direction: column;
}
.screen.active { display: flex; }

.main-content {
  padding: 20px 18px 40px;
}

/* =============================================================
   Hero (landing page)
   ============================================================= */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
  color: #fff;
  padding: 28px 22px 26px;
  text-align: center;
}
.hero-logo-wrap {
  width: 92px;
  height: 92px;
  margin: 0 auto 14px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  padding: 8px;
}
.hero-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.hero-institution {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  opacity: 0.95;
  margin-bottom: 8px;
  letter-spacing: 0.2px;
}
.hero-affil {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  background: rgba(255,255,255,0.15);
  display: inline-block;
  padding: 5px 14px;
  border-radius: 12px;
  margin-bottom: 4px;
}
.hero-divider {
  width: 36px;
  height: 2px;
  background: rgba(255,255,255,0.4);
  margin: 14px auto 14px;
  border-radius: 1px;
}
.hero-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.3px;
  margin-bottom: 6px;
}
.hero-author {
  font-size: 14px;
  font-weight: 600;
  opacity: 0.95;
}

/* Section heading on landing */
.section-heading {
  color: var(--navy);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}
.section-sub {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
}

/* =============================================================
   Lecture cards (landing page)
   ============================================================= */
.lectures-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lecture-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 72px;
  text-decoration: none;
  color: inherit;
}
.lecture-card:hover { border-color: var(--blue); transform: translateY(-1px); }
.lecture-card:active { transform: scale(0.99); }
.lecture-card.unavailable {
  cursor: not-allowed;
  opacity: 0.55;
}
.lecture-card.unavailable:hover { border-color: var(--border); transform: none; }

.lect-num-chip {
  width: 44px;
  height: 44px;
  background: var(--navy);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.lect-card-body { flex: 1; min-width: 0; }
.lect-card-title {
  color: var(--navy);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 4px;
}
.lect-card-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.lect-card-chevron {
  color: var(--blue);
  font-size: 22px;
  flex-shrink: 0;
  font-weight: 600;
}
.lect-card-soon {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: #F3F4F6;
  padding: 4px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}

.loading-card {
  text-align: center;
  color: var(--muted);
  padding: 28px;
  font-size: 14px;
}

/* =============================================================
   Footer
   ============================================================= */
.footer {
  margin-top: auto;
  padding: 24px 18px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
  border-top: 1px solid var(--border);
  background: #fff;
}

/* =============================================================
   Quiz page header
   ============================================================= */
.quiz-header {
  background: var(--navy);
  color: #fff;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.back-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
}
.back-btn:hover { background: rgba(255,255,255,0.25); }
.quiz-header-title {
  flex: 1;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.quiz-header-chip {
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 10px;
  min-width: 36px;
  text-align: center;
  flex-shrink: 0;
}

/* =============================================================
   Lecture welcome hero
   ============================================================= */
.lecture-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
  color: #fff;
  padding: 28px 22px;
  border-radius: 16px;
  margin-bottom: 18px;
  text-align: center;
}
.lect-num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  opacity: 0.85;
  margin-bottom: 6px;
}
.lect-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
}
.lect-stats {
  font-size: 13px;
  opacity: 0.9;
}

/* Resume box */
.resume-box {
  background: var(--yellow);
  border: 1px solid var(--amber-border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.resume-text {
  font-size: 14px;
  color: #6B4F00;
  font-weight: 600;
}

/* =============================================================
   Welcome card + mode selector
   ============================================================= */
.welcome-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}
.card-heading {
  color: var(--navy);
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 12px;
}
.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 14px;
}

.mode-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mode-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 64px;
  text-align: left;
  width: 100%;
}
.mode-card:hover { border-color: var(--blue); background: #FAFCFE; }
.mode-card:active { transform: scale(0.99); }
.mode-info { flex: 1; }
.mode-name {
  color: var(--navy);
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.35;
}
.mode-desc {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
  line-height: 1.45;
}
.mode-count {
  background: var(--lightblue);
  color: var(--navy);
  font-weight: 700;
  font-size: 13px;
  padding: 5px 11px;
  border-radius: 10px;
  flex-shrink: 0;
  min-width: 36px;
  text-align: center;
}
.mode-card-analytical {
  border-color: var(--blue);
  background: linear-gradient(180deg, #FAFCFE 0%, #fff 100%);
}
.mode-card-analytical .mode-count {
  background: var(--blue);
  color: #fff;
}

/* Section list */
.sections-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.section-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
}
.section-card:hover { border-color: var(--blue); }
.section-card-num {
  width: 32px;
  height: 32px;
  background: var(--navy);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.section-card-info { flex: 1; }
.section-card-title {
  color: var(--navy);
  font-weight: 700;
  font-size: 14px;
}
.section-card-count {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

/* Number input (Start from N) */
.number-input-wrap { margin-bottom: 10px; }
.number-input {
  width: 100%;
  padding: 16px;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
}
.number-input:focus {
  outline: none;
  border-color: var(--navy);
}
.inline-error {
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--red-bg);
  border-radius: 8px;
}

/* =============================================================
   Buttons
   ============================================================= */
.btn-primary {
  width: 100%;
  padding: 15px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 52px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-primary:hover { background: var(--blue); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled {
  background: #B7C4D6;
  cursor: not-allowed;
}

.btn-secondary {
  width: 100%;
  padding: 13px;
  background: #fff;
  color: var(--navy);
  border: 2px solid var(--navy);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-secondary:hover { background: var(--lightblue); }
.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--blue);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 10px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}
.btn-text:hover { color: var(--navy); }

/* =============================================================
   Progress bar
   ============================================================= */
.progress-wrap {
  background: #fff;
  padding: 10px 18px 12px;
  border-bottom: 1px solid var(--border);
}
.progress-bar {
  height: 6px;
  background: var(--lightblue);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy), var(--blue));
  border-radius: 3px;
  transition: width 0.4s ease;
  width: 0%;
}
.qid-label {
  display: block;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  font-weight: 600;
  letter-spacing: 0.4px;
}

/* =============================================================
   Quiz screen
   ============================================================= */
.quiz-main { padding-bottom: 80px; }
.qtype-row { margin-bottom: 10px; }
.qtype-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 10px;
  background: var(--lightblue);
  color: var(--navy);
  letter-spacing: 0.7px;
}
.qtype-badge.mc { background: #E4F0F8; color: var(--blue); }
.section-tag {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
  font-weight: 500;
}
.concept-tag {
  font-size: 13px;
  color: var(--blue);
  font-weight: 700;
  margin-bottom: 12px;
  background: var(--lightblue);
  padding: 6px 12px;
  border-radius: 10px;
  display: inline-block;
}
.qcard {
  background: var(--card);
  border-radius: 16px;
  padding: 22px 20px;
  box-shadow: 0 2px 8px rgba(31,56,100,0.06);
  margin-bottom: 16px;
  border-left: 4px solid var(--navy);
}
.qtext {
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.6;
}

/* T/F buttons */
.tf-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.tf-btn {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 56px;
  color: var(--text);
  width: 100%;
}
.tf-btn:hover { border-color: var(--blue); }
.tf-btn.selected { border-color: var(--navy); background: var(--lightblue); color: var(--navy); }
.tf-btn.correct { border-color: var(--green-border); background: var(--green-bg); color: var(--green); }
.tf-btn.incorrect { border-color: var(--red-border); background: var(--red-bg); color: var(--red); }
.tf-btn:disabled { cursor: default; }

/* MC options */
.mc-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.opt {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  text-align: left;
  width: 100%;
  font-size: 15px;
  color: var(--text);
  line-height: 1.45;
}
.opt:hover { border-color: var(--blue); }
.opt:active { transform: scale(0.99); }
.opt .letter {
  background: var(--lightblue);
  color: var(--navy);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.opt .opt-text { flex: 1; }
.opt.selected { border-color: var(--navy); background: var(--lightblue); }
.opt.selected .letter { background: var(--navy); color: #fff; }
.opt.correct { border-color: var(--green-border); background: var(--green-bg); }
.opt.correct .letter { background: var(--green); color: #fff; }
.opt.incorrect { border-color: var(--red-border); background: var(--red-bg); }
.opt.incorrect .letter { background: var(--red); color: #fff; }
.opt:disabled { cursor: default; }

/* Feedback */
.feedback {
  padding: 13px 15px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}
.feedback.correct { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.feedback.incorrect { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }
.feedback .icon {
  font-size: 20px;
  font-weight: 700;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Why? & Translate buttons row */
.why-translate-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.btn-why, .btn-translate {
  background: #fff;
  border: 2px solid var(--blue);
  color: var(--blue);
  padding: 12px 10px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-why:hover, .btn-translate:hover { background: var(--lightblue); }
.btn-why:active, .btn-translate:active { transform: scale(0.99); }
.btn-why.active, .btn-translate.active {
  background: var(--lightblue);
  border-color: var(--navy);
  color: var(--navy);
}
.btn-translate {
  border-color: #059669;
  color: #059669;
}
.btn-translate:hover { background: #ECFDF5; }
.btn-translate.active { background: #ECFDF5; border-color: #059669; color: #047857; }
.globe-icon {
  font-size: 16px;
  line-height: 1;
}

/* Explanation card */
.explanation-card {
  background: var(--lightblue);
  border-left: 4px solid var(--navy);
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 14.5px;
  line-height: 1.65;
  color: #1A2B4A;
}
.explanation-card-header {
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}

/* Translation card */
.translate-box {
  background: #ECFDF5;
  border-left: 4px solid #059669;
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 15px;
  line-height: 1.75;
  color: #064E3B;
  direction: rtl;
  text-align: right;
  font-family: "Segoe UI", "Cairo", Tahoma, Arial, sans-serif;
}
.translate-box-header {
  color: #047857;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
  direction: ltr;
  text-align: left;
}
.translate-box-block { margin-bottom: 10px; }
.translate-box-block:last-child { margin-bottom: 0; }
.translate-box-label {
  font-size: 12px;
  font-weight: 700;
  color: #047857;
  margin-bottom: 3px;
}
.translate-loading {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 14px;
  direction: ltr;
}
.translate-error {
  background: var(--red-bg);
  color: var(--red);
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  border: 1px solid var(--red-border);
  direction: ltr;
}

/* Quiz actions */
.quiz-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

/* =============================================================
   Analytical
   ============================================================= */
.answer-textarea {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  resize: vertical;
  min-height: 140px;
  margin-bottom: 6px;
  line-height: 1.6;
  background: #fff;
  color: var(--text);
}
.answer-textarea:focus {
  outline: none;
  border-color: var(--blue);
}
.char-count {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  margin-bottom: 12px;
}
.btn-show-model {
  margin-bottom: 14px;
}

.model-answer-box {
  background: var(--lightblue);
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}
.model-answer-header {
  color: var(--navy);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}
.model-answer-text {
  font-size: 15px;
  line-height: 1.65;
  color: #1A2B4A;
}

.self-grade-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(31,56,100,0.15);
}
.self-grade-prompt {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
}
.self-grade-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.self-grade-btn {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 11px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text);
  min-height: 44px;
}
.self-grade-btn[data-grade="got_it"].selected { border-color: var(--green-border); background: var(--green-bg); color: var(--green); }
.self-grade-btn[data-grade="partial"].selected { border-color: var(--amber-border); background: var(--amber-bg); color: var(--amber); }
.self-grade-btn[data-grade="review"].selected { border-color: var(--red-border); background: var(--red-bg); color: var(--red); }

/* =============================================================
   Results screen
   ============================================================= */
.result-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
  color: #fff;
  padding: 32px 22px;
  border-radius: 18px;
  text-align: center;
  margin-bottom: 18px;
}
.result-score {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
}
.result-percent {
  font-size: 18px;
  opacity: 0.9;
  margin-top: 8px;
}
.result-band {
  display: inline-block;
  margin-top: 14px;
  background: rgba(255,255,255,0.18);
  padding: 6px 16px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.result-hero-analytical { padding: 22px; }
.analytical-tally {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tally-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,0.12);
  padding: 10px 14px;
  border-radius: 10px;
}
.tally-label { font-size: 14px; font-weight: 600; }
.tally-num { font-size: 22px; font-weight: 700; }

.result-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 14px;
}
.result-time {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.section-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.section-row:last-child { border-bottom: none; }
.section-row-name {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}
.section-row-bar {
  width: 80px;
  height: 6px;
  background: var(--lightblue);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}
.section-row-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy), var(--blue));
}
.section-row-score {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  width: 40px;
  text-align: right;
  flex-shrink: 0;
}

.review-concepts-list {
  list-style: none;
}
.review-concepts-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
}
.review-concepts-list li:last-child { border: none; }

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

/* =============================================================
   Loading / Error
   ============================================================= */
.loading-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 14px;
  gap: 14px;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--lightblue);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

.error-box {
  background: #FEE2E2;
  border: 1px solid var(--red-border);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
}
.error-title {
  color: var(--red);
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 8px;
}
.error-msg {
  color: var(--red);
  font-size: 13px;
  margin-bottom: 14px;
  line-height: 1.55;
}

/* =============================================================
   Larger screens
   ============================================================= */
@media (min-width: 520px) {
  .app {
    box-shadow: 0 2px 20px rgba(31,56,100,0.08);
    min-height: 100vh;
  }
  .hero-title { font-size: 28px; }
  .lect-title { font-size: 22px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
