:root {
  --navy: #112f41;
  --yellow: #ffc902;
  --white: #ffffff;
  --ink: #18323f;
  --muted: #62727b;
  --mist: #edf2f4;
  --green: #2f7653;
  --red: #a94442;
  --focus: #196fb1;
  --shadow: 0 18px 45px rgba(17, 47, 65, .14);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; overflow-x: hidden; }
body {
  margin: 0;
  background: #f5f7f8;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
}
img, audio { max-width: 100%; }
.draft-banner {
  padding: 9px 18px;
  background: #9f1d20;
  color: var(--white);
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .08em;
}
button, input { font: inherit; }
button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
}

.course-header {
  min-height: 92px;
  padding: 18px 30px;
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--white);
  border-bottom: 5px solid var(--yellow);
}
.brand-logo { width: 180px; height: 56px; object-fit: contain; }
.header-copy { flex: 1; min-width: 0; }
.course-label { color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .08em; }
.header-title { margin-top: 3px; font-weight: 700; color: var(--navy); }
.header-actions { display: flex; flex-shrink: 0; align-items: center; gap: 10px; }
.reset-button { white-space: nowrap; }
.log-button { white-space: nowrap; }
.menu-button, .secondary-button, .primary-button, .audio-button, .download-button {
  border: 0;
  border-radius: 6px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
}
.menu-button { display: none; }
.menu-button, .secondary-button, .audio-button { background: var(--mist); color: var(--navy); }
.primary-button, .download-button { background: var(--yellow); color: var(--navy); }
button:disabled { opacity: .45; cursor: not-allowed; }

.progress-shell { height: 8px; background: #dfe7ea; }
.progress-bar { height: 100%; width: 0; background: var(--yellow); transition: width .2s ease; }
.course-navigation {
  position: sticky;
  top: 0;
  z-index: 15;
  min-height: 78px;
  padding: 14px 30px;
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--white);
  border-bottom: 1px solid #d9e2e6;
  box-shadow: 0 6px 18px rgba(17, 47, 65, .08);
}
.course-navigation > * { min-width: 0; }
.course-shell { min-height: calc(100vh - 256px); display: flex; }
.course-menu {
  width: 290px;
  padding: 24px 18px;
  background: var(--navy);
  color: var(--white);
  overflow-y: auto;
}
.menu-item {
  width: 100%;
  display: block;
  padding: 13px 14px;
  border: 0;
  border-left: 4px solid transparent;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.menu-item.current { border-left-color: var(--yellow); background: rgba(255,255,255,.09); }
.menu-item.complete::after { content: "  ✓"; color: var(--yellow); }
.menu-item.locked { opacity: .55; cursor: not-allowed; }

.course-main {
  flex: 1;
  min-width: 0;
  padding: 36px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.screen { width: min(1100px, 100%); }
.eyebrow { color: var(--muted); font-size: 14px; font-weight: 700; letter-spacing: .08em; }
h1 { margin: 8px 0 18px; color: var(--navy); font-size: clamp(34px, 4vw, 54px); line-height: 1.05; }
h2 { color: var(--navy); font-size: 30px; }
.lead { font-size: 22px; line-height: 1.5; max-width: 800px; }
.yellow-rule { width: 110px; height: 6px; margin: 18px 0 26px; background: var(--yellow); }

.welcome-panel, .assessment-panel, .certificate-panel {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.welcome-hero { display: grid; grid-template-columns: 1.15fr .85fr; }
.welcome-copy { padding: 48px; }
.welcome-art { min-height: 440px; background: var(--navy) url('assets/children.jpg') center/cover no-repeat; }
.identity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 28px; }
.identity-email { grid-column: 1 / -1; }
label { display: block; font-weight: 700; color: var(--navy); }
input[type="text"], input[type="email"] {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  border: 2px solid #cbd7dc;
  border-radius: 6px;
}
.privacy-note { margin-top: 18px; color: var(--muted); font-size: 15px; line-height: 1.45; }

.slide-stage { background: var(--navy); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
.slide-image { display: block; width: 100%; height: auto; aspect-ratio: 16/9; object-fit: contain; background: #fff; }
.narration-row { display: flex; gap: 16px; align-items: center; padding: 16px 20px; background: var(--white); }
.narration-row audio { display: block; width: min(480px, 100%); min-width: 0; }
.narration-status { flex: 1; color: var(--muted); font-size: 15px; }
.transcript { margin-top: 18px; padding: 20px 24px; background: var(--white); border-left: 6px solid var(--yellow); line-height: 1.5; }

.assessment-panel { padding: 38px; }
.question { padding: 22px 0; border-top: 1px solid #dce4e7; }
.question:first-of-type { border-top: 0; }
.question legend { padding: 0; font-weight: 700; color: var(--navy); line-height: 1.35; }
.option { display: flex; gap: 12px; align-items: flex-start; margin-top: 13px; padding: 10px; border-radius: 6px; }
.option:hover { background: var(--mist); }
.option input { margin-top: 4px; transform: scale(1.25); }
.result-banner { margin: 24px 0; padding: 18px; border-left: 7px solid var(--yellow); background: var(--mist); }
.result-banner.pass { border-left-color: var(--green); }
.result-banner.fail { border-left-color: var(--red); }
.review-item { margin: 12px 0; padding: 15px; background: #f7f9fa; }
.review-item.correct { border-left: 5px solid var(--green); }
.review-item.incorrect { border-left: 5px solid var(--red); }

.certificate-panel { padding: 30px; }
.certificate {
  min-height: 610px;
  padding: 54px;
  border: 18px solid var(--navy);
  outline: 8px solid var(--yellow);
  outline-offset: -30px;
  text-align: center;
  background: var(--white);
}
.certificate img { width: 250px; }
.certificate-draft { margin-bottom: 10px; color: var(--red); font-size: 15px; font-weight: 800; letter-spacing: .08em; }
.certificate h1 { margin-top: 44px; }
.certificate-name { margin: 28px auto 12px; max-width: 760px; padding-bottom: 8px; border-bottom: 2px solid var(--navy); color: var(--navy); font-size: 40px; font-weight: 700; }
.certificate-course { margin: 20px auto; max-width: 760px; font-size: 24px; font-weight: 700; }
.certificate-meta { margin-top: 38px; color: var(--muted); font-size: 15px; }
.certificate-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.email-status { margin-top: 14px; color: var(--muted); }

.status-text { flex: 1; text-align: center; color: var(--muted); font-size: 15px; }

@media (max-width: 900px) {
  .menu-button { display: block; }
  .course-menu { position: fixed; z-index: 20; top: 178px; bottom: 0; left: -310px; transition: left .2s ease; }
  .course-menu.open { left: 0; }
  .course-main { padding: 22px 16px; }
  .header-title { display: none; }
  .reset-button { padding: 10px 12px; font-size: 14px; }
  .log-button { padding: 10px 12px; font-size: 14px; }
}

@media (max-width: 680px) {
  .draft-banner {
    padding: 8px 12px;
    font-size: 11px;
    line-height: 1.35;
  }
  .course-header {
    min-height: 72px;
    padding: 12px 14px;
    gap: 10px;
  }
  .brand-logo { width: 156px; height: auto; }
  .header-copy { display: none; }
  .header-actions { margin-left: auto; gap: 6px; }
  .log-button { display: none; }
  .reset-button, .menu-button {
    width: 44px;
    height: 44px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }
  .reset-button::before {
    content: "↻";
    font-size: 25px;
    line-height: 1;
  }
  .menu-button::before {
    content: "☰";
    font-size: 22px;
    line-height: 1;
  }
  .course-navigation {
    min-height: 68px;
    grid-template-columns: 70px minmax(0, 1fr) 112px;
    display: grid;
    padding: 10px 12px;
    gap: 8px;
  }
  .course-navigation .secondary-button,
  .course-navigation .primary-button {
    width: 100%;
    padding: 11px 8px;
    font-size: 14px;
  }
  .course-navigation .status-text {
    font-size: 12px;
    line-height: 1.25;
  }
  .course-main { padding: 16px 12px; }
  .welcome-copy { padding: 28px 22px; }
  .welcome-hero { grid-template-columns: 1fr; }
  .welcome-art { min-height: 210px; }
  .identity-grid { grid-template-columns: 1fr; }
  h1 { font-size: 38px; }
  h2 { font-size: 26px; }
  .lead { font-size: 19px; line-height: 1.45; }
  .narration-row {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
  }
  .assessment-panel, .certificate-panel { padding: 26px 20px; }
  .transcript { padding: 18px; }
  .certificate { min-height: 0; padding: 42px 22px; border-width: 12px; }
  .certificate-name { font-size: 30px; }
}

@media print {
  body * { visibility: hidden !important; }
  .certificate, .certificate * { visibility: visible !important; }
  .certificate { position: fixed; inset: 0; min-height: 100vh; outline-offset: -26px; }
  @page { size: landscape; margin: 0; }
}
