/* ============================================================
   KIS AI Literacy Course · Styles
   Palette: Electric Teal #47D7AC · Deep Charcoal Navy #2B3D59
            Sky Blue #00C8FF · Bright Coral #FF5A66 · Warm Sand #D9C9B3
   Type: Poppins (headings) · Lato (body)
   ============================================================ */

:root {
  --teal: #47D7AC;
  --teal-dark: #2FA983;
  --teal-deep: #1E7A5E;
  --navy: #2B3D59;
  --navy-deep: #1E2C42;
  --sky: #00C8FF;
  --sky-deep: #0084AD;
  --coral: #FF5A66;
  --coral-deep: #D63844;
  --sand: #D9C9B3;
  --sand-light: #F0E9DE;
  --bg: #F8F7F4;
  --surface: #FFFFFF;
  --ink: #22314A;
  --ink-soft: #4A5A75;
  --line: #E3E0D9;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(43, 61, 89, 0.07), 0 8px 24px rgba(43, 61, 89, 0.07);
  --font-head: "Poppins", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Lato", "Helvetica Neue", Arial, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--navy);
  line-height: 1.25;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); font-weight: 600; }
h3 { font-size: 1.2rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }

p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.4em; }
li { margin-bottom: 0.4em; }
a { color: var(--sky-deep); }
h2:focus, h3:focus, main:focus { outline: none; }

.lead { font-size: 1.15rem; color: var(--navy); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------- Buttons ---------------- */

.btn {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  padding: 0.7em 1.6em;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

.btn-primary {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 2px 8px rgba(43, 61, 89, 0.25);
}
.btn-primary:hover:not(:disabled) { background: var(--navy-deep); transform: translateY(-1px); }
.btn-primary:disabled {
  background: #B9C1CE;
  color: #F3F5F8;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-lg { font-size: 1.1rem; padding: 0.85em 2.2em; }

.btn-ghost {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover { border-color: var(--navy); }

.btn-tiny {
  font-size: 0.75rem;
  padding: 0.25em 0.9em;
  background: var(--navy);
  color: #fff;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  vertical-align: middle;
  margin-left: 0.5em;
}

.linklike {
  background: none; border: none; padding: 0;
  color: var(--sky-deep); text-decoration: underline;
  cursor: pointer; font: inherit;
}

/* ---------------- Welcome ---------------- */

body.welcome-mode {
  background:
    radial-gradient(1000px 500px at 85% -10%, rgba(71, 215, 172, 0.16), transparent 60%),
    radial-gradient(800px 500px at -10% 110%, rgba(0, 200, 255, 0.10), transparent 60%),
    var(--bg);
  min-height: 100vh;
}

.welcome {
  display: flex;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3.5rem) 1rem 4rem;
}

.welcome-card {
  max-width: 720px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: clamp(1.6rem, 4vw, 3rem);
}

.brand-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1.6rem; }

.brand-logo {
  height: 64px;
  width: auto;
  display: block;
}

.brand-logo-sm { height: 44px; }

.welcome-audience {
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-deep);
  margin-bottom: 0.4rem;
}

.welcome-card h1 { margin-bottom: 0.1em; }

.welcome-tagline {
  font-family: var(--font-head);
  font-size: 1.25rem;
  color: var(--sky-deep);
  font-weight: 500;
  margin-bottom: 1rem;
}

.welcome-intro { font-size: 1.1rem; }

.welcome-meta {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.2rem 0;
}
.welcome-meta li {
  background: var(--sand-light);
  border: 1px solid var(--sand);
  border-radius: 999px;
  padding: 0.4em 1em;
  font-size: 0.9rem;
  margin: 0;
}

.welcome-byline {
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--teal-deep);
  margin: -0.4rem 0 1.2rem;
}

.welcome-expect {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  margin: 1.4rem 0;
}
.welcome-expect h2 { font-size: 1.05rem; margin-bottom: 0.6em; }
.welcome-expect ul { margin-bottom: 0; }

.welcome-note { color: var(--ink-soft); font-style: italic; }

.welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-top: 1.6rem;
}

/* ---------------- Top bar ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1rem;
}

.topbar-brand { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }

.topbar-titles { display: flex; flex-direction: column; min-width: 0; }
.topbar-course {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-sub { font-size: 0.75rem; color: var(--ink-soft); }

.topbar-progress {
  flex: 1;
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  min-width: 60px;
}
.topbar-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--teal), var(--sky));
  border-radius: 999px;
  transition: width 0.5s ease;
}
.topbar-pct {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--teal-deep);
  min-width: 3ch;
  text-align: right;
}

.nav-toggle { display: none; }

/* ---------------- Layout: nav + main ---------------- */

.layout {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  padding: 1.6rem 1rem 3rem;
  align-items: start;
}

.course-nav {
  position: sticky;
  top: 72px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.course-nav ol { list-style: none; margin: 0; padding: 0; }
.course-nav li { margin: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink);
  cursor: pointer;
}
.nav-item:hover:not(:disabled) { background: var(--sand-light); }
.nav-item.active { background: var(--navy); color: #fff; }
.nav-item.active .nav-time { color: rgba(255, 255, 255, 0.7); }
.nav-item.locked { color: #A6ADBB; cursor: not-allowed; }
.nav-item:focus-visible { outline: 3px solid var(--sky); outline-offset: -2px; }

.nav-icon {
  flex: 0 0 1.4em;
  text-align: center;
  font-size: 0.85em;
}
.nav-item.done .nav-icon { color: var(--teal-dark); font-weight: 900; }
.nav-item.active.done .nav-icon { color: var(--teal); }
.nav-label { flex: 1; }
.nav-time { font-size: 0.75rem; color: var(--ink-soft); }

.main { min-width: 0; }

.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: clamp(1.4rem, 3.5vw, 2.6rem);
}

.step-eyebrow {
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.5em;
}

.chip {
  display: inline-block;
  border-radius: 999px;
  padding: 0.15em 0.8em;
  font-size: 0.75rem;
  text-transform: none;
  letter-spacing: 0.02em;
}
.chip-teal  { background: rgba(71, 215, 172, 0.18); color: var(--teal-deep); }
.chip-sky   { background: rgba(0, 200, 255, 0.14);  color: var(--sky-deep); }
.chip-sand  { background: var(--sand-light);         color: #8A7658; }
.chip-coral { background: rgba(255, 90, 102, 0.13);  color: var(--coral-deep); }
.chip-navy  { background: rgba(43, 61, 89, 0.10);    color: var(--navy); }

.review-note {
  background: var(--sand-light);
  border: 1px solid var(--sand);
  border-radius: 10px;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
}

.page-divider { border: none; border-top: 1px dashed var(--line); margin: 2rem 0; }

/* ---------------- Blocks ---------------- */

.block-quote {
  margin: 1.6rem 0;
  padding: 1.4rem 1.8rem;
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-size: 1.25rem;
  line-height: 1.5;
  text-align: center;
}
.block-quote strong { color: var(--teal); }

.callout {
  border-radius: var(--radius);
  padding: 1.1rem 1.4rem;
  margin: 1.4rem 0;
  border: 1px solid;
}
.callout p:last-child, .callout ul:last-child, .callout ol:last-child { margin-bottom: 0; }
.callout-title {
  font-family: var(--font-head);
  font-weight: 600;
  margin-bottom: 0.5em;
}
.callout-key    { background: rgba(71, 215, 172, 0.10); border-color: rgba(71, 215, 172, 0.5); }
.callout-key .callout-title { color: var(--teal-deep); }
.callout-safety { background: rgba(255, 90, 102, 0.07); border-color: rgba(255, 90, 102, 0.4); }
.callout-safety .callout-title { color: var(--coral-deep); }
.callout-note   { background: var(--sand-light); border-color: var(--sand); }
.callout-note .callout-title { color: #8A7658; }
.callout-tip    { background: rgba(0, 200, 255, 0.07); border-color: rgba(0, 200, 255, 0.4); }
.callout-tip .callout-title { color: var(--sky-deep); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.9rem;
  margin: 1.4rem 0;
}

.mini-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.mini-card-icon { font-size: 1.5rem; display: block; margin-bottom: 0.4rem; }
.mini-card h3 { font-size: 0.98rem; margin-bottom: 0.3em; }
.mini-card p { font-size: 0.88rem; color: var(--ink-soft); margin: 0; }

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.4rem 0;
}
.compare-col {
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  border: 1px solid;
}
.compare-col h3 { font-size: 1rem; margin-bottom: 0.6em; }
.compare-col ul { margin: 0; padding-left: 1.2em; }
.compare-col li { font-size: 0.93rem; margin-bottom: 0.5em; }
.compare-yes { background: rgba(71, 215, 172, 0.08); border-color: rgba(71, 215, 172, 0.45); }
.compare-yes h3 { color: var(--teal-deep); }
.compare-no  { background: rgba(255, 90, 102, 0.05); border-color: rgba(255, 90, 102, 0.35); }
.compare-no h3 { color: var(--coral-deep); }

/* ---------------- Framework visual ---------------- */

.framework {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
  border-radius: var(--radius);
  padding: 1.4rem 1.2rem 1.6rem;
  margin: 1.4rem 0;
}
.framework-title {
  font-family: var(--font-head);
  color: var(--sand);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 1.1rem;
}
.framework-track {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
}
.framework-node {
  flex: 1;
  max-width: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.4rem 0.3rem;
  border-radius: 12px;
  transition: opacity 0.3s ease;
}
.framework-node.dim { opacity: 0.38; }
.framework-node.highlight {
  background: rgba(255, 255, 255, 0.08);
  outline: 1.5px solid rgba(255, 255, 255, 0.25);
}
.framework-num {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  width: 2.1em; height: 2.1em;
  display: grid; place-items: center;
  border-radius: 50%;
  margin-bottom: 0.45rem;
  color: var(--navy-deep);
}
.node-teal  .framework-num { background: var(--teal); }
.node-sky   .framework-num { background: var(--sky); }
.node-sand  .framework-num { background: var(--sand); }
.node-coral .framework-num { background: var(--coral); }
.node-navy  .framework-num { background: #fff; }
.framework-name {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.85rem;
  color: #fff;
}
.framework-q { font-size: 0.72rem; color: rgba(255, 255, 255, 0.75); line-height: 1.3; margin-top: 0.15rem; }
.framework-link {
  align-self: center;
  width: 18px;
  height: 2px;
  background: rgba(255, 255, 255, 0.3);
  flex: 0 0 auto;
  margin-top: -1.4rem;
}

/* ---------------- Accordion ---------------- */

.accordion { margin: 1.4rem 0; }
.accordion-intro { font-size: 0.92rem; color: var(--ink-soft); }
.accordion-req { color: var(--coral-deep); }

.acc-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 0.6rem;
  background: var(--surface);
  overflow: hidden;
}
.acc-item.visited { border-color: rgba(71, 215, 172, 0.6); }

.acc-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  background: none;
  border: none;
  padding: 0.85rem 1rem;
  font-family: var(--font-head);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--navy);
  text-align: left;
  cursor: pointer;
}
.acc-head:hover { background: var(--sand-light); }
.acc-head:focus-visible { outline: 3px solid var(--sky); outline-offset: -3px; }

.acc-check {
  flex: 0 0 1.5em;
  height: 1.5em;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 0.8em;
  color: var(--teal-deep);
}
.acc-item.visited .acc-check { border-color: var(--teal); background: rgba(71, 215, 172, 0.15); }
.acc-title { flex: 1; }
.acc-chevron { color: var(--ink-soft); transition: transform 0.2s ease; }
.acc-head[aria-expanded="true"] .acc-chevron { transform: rotate(180deg); }

.acc-body { padding: 0 1.1rem 1rem 3.2rem; font-size: 0.95rem; }
.acc-body p { margin-bottom: 0.7em; }
.acc-body p:last-child { margin-bottom: 0; }

/* ---------------- Activities ---------------- */

.activity {
  border: 1.5px solid var(--teal);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  margin: 1.4rem 0;
  background: linear-gradient(180deg, rgba(71, 215, 172, 0.06), transparent 30%);
}
.activity-badge {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--teal);
  color: var(--navy-deep);
  border-radius: 999px;
  padding: 0.25em 1em;
  margin-bottom: 0.8rem;
}
.activity-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 1rem;
  margin: 0.8rem 0;
}
.activity-cell h4 { color: var(--teal-deep); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.activity-cell p, .activity-cell ol { font-size: 0.95rem; margin-bottom: 0; }

.activity-prompt { margin: 1rem 0; }
.activity-prompt h4 { color: var(--teal-deep); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.prompt-text {
  background: var(--navy-deep);
  color: #DFF7EE;
  border-radius: 10px;
  padding: 1rem 1.2rem;
  font-family: "SF Mono", "Consolas", monospace;
  font-size: 0.83rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0.4rem 0 0;
}

.activity-safety {
  background: rgba(255, 90, 102, 0.07);
  border: 1px solid rgba(255, 90, 102, 0.35);
  border-radius: 10px;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  margin: 1rem 0 0;
}

/* ---------------- Reflections ---------------- */

.reflection {
  background: rgba(0, 200, 255, 0.05);
  border: 1px solid rgba(0, 200, 255, 0.35);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  margin: 1.4rem 0 0.4rem;
}
.reflection-label {
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sky-deep);
  margin-bottom: 0.4em;
}
.reflection-prompt { display: block; font-weight: 600; color: var(--navy); margin-bottom: 0.6rem; }
.reflection-input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  font: inherit;
  font-size: 0.95rem;
  resize: vertical;
  background: #fff;
  color: var(--ink);
}
.reflection-input:focus-visible { outline: 3px solid var(--sky); outline-offset: 1px; border-color: transparent; }
.reflection-hint { font-size: 0.8rem; color: var(--ink-soft); margin: 0.4rem 0 0; }

/* ---------------- Step controls ---------------- */

.step-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  margin-top: 2rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}
.gate-msg { width: 100%; font-size: 0.85rem; color: var(--coral-deep); margin: 0; }

.page-dots { display: flex; gap: 0.45rem; justify-content: center; margin-top: 1.8rem; }
.dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--line);
}
.dot.past { background: var(--teal); opacity: 0.5; }
.dot.on { background: var(--teal); transform: scale(1.25); }

/* ---------------- Quiz ---------------- */

.quiz-intro { font-size: 1.05rem; margin-bottom: 1.6rem; }

.quiz-progress {
  font-size: 0.9rem;
  color: var(--ink-soft);
  background: var(--sand-light);
  border-radius: 999px;
  display: inline-block;
  padding: 0.3em 1.1em;
  margin-bottom: 1.4rem;
}

.question { margin-top: 0.4rem; }
.q-kind {
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sky-deep);
  margin-bottom: 0.4em;
}
.q-prompt { font-size: 1.15rem; line-height: 1.5; margin-bottom: 1.2rem; }

.options { display: flex; flex-direction: column; gap: 0.7rem; margin-bottom: 1.4rem; }

.option {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  text-align: left;
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1.1rem;
  font: inherit;
  font-size: 0.98rem;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.option:hover:not(:disabled) { border-color: var(--navy); background: #fff; }
.option:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

.option-mark {
  flex: 0 0 1.3em;
  height: 1.3em;
  margin-top: 0.15em;
  border-radius: 50%;
  border: 2px solid #B9C1CE;
  display: grid;
  place-items: center;
  font-size: 0.75em;
  font-weight: 900;
  color: #fff;
}
.option.selected { border-color: var(--navy); background: rgba(43, 61, 89, 0.06); }
.option.selected .option-mark { border-color: var(--navy); background: var(--navy); }
.option.selected .option-mark::after { content: "●"; font-size: 0.6em; }

.option.is-correct { border-color: var(--teal-dark); background: rgba(71, 215, 172, 0.12); }
.option.is-correct .option-mark { border-color: var(--teal-dark); background: var(--teal-dark); }
.option.is-correct .option-mark::after { content: "✓"; }
.option.is-wrong { border-color: var(--coral); background: rgba(255, 90, 102, 0.08); }
.option.is-wrong .option-mark { border-color: var(--coral); background: var(--coral); }
.option.is-wrong .option-mark::after { content: "✕"; }
.option:disabled { cursor: default; }

.feedback { border-radius: var(--radius); padding: 0; }
.feedback.ok, .feedback.no { padding: 1.1rem 1.3rem; margin-top: 0.4rem; }
.feedback.ok { background: rgba(71, 215, 172, 0.10); border: 1px solid rgba(71, 215, 172, 0.5); }
.feedback.no { background: rgba(255, 90, 102, 0.06); border: 1px solid rgba(255, 90, 102, 0.4); }
.fb-head { font-family: var(--font-head); font-weight: 600; }
.feedback.ok .fb-head { color: var(--teal-deep); }
.feedback.no .fb-head { color: var(--coral-deep); }
.fb-retry { font-size: 0.88rem; color: var(--ink-soft); }
.feedback .btn { margin-top: 0.4rem; }

.quiz-done { text-align: center; padding: 1.6rem 0 0.8rem; }
.quiz-done-icon {
  width: 2.2em; height: 2.2em;
  margin: 0 auto 0.8rem;
  display: grid; place-items: center;
  background: rgba(71, 215, 172, 0.18);
  color: var(--teal-deep);
  font-size: 1.6rem;
  font-weight: 900;
  border-radius: 50%;
}
.quiz .btn-primary { display: inline-block; }
.quiz-done + .btn { margin: 0 auto; display: block; }

/* ---------------- Completion ---------------- */

.complete-hero { text-align: center; padding: 1rem 0 1.6rem; }
.complete-check {
  width: 2.4em; height: 2.4em;
  margin: 0 auto 1rem;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--teal), var(--sky));
  color: var(--navy-deep);
  font-size: 1.8rem;
  font-weight: 900;
  border-radius: 50%;
  box-shadow: 0 6px 20px rgba(71, 215, 172, 0.4);
}
.completion h3 { margin-top: 2rem; }
.takeaways .mini-card h3 { margin-top: 0; }
.next-steps li { margin-bottom: 0.6em; }
.resources li { margin-bottom: 0.6em; font-size: 0.95rem; }
.disclaimer {
  font-size: 0.83rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  margin-top: 2rem;
}

.legal-notice {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 0.4rem;
}

.cert-section {
  background: var(--navy);
  border-radius: var(--radius);
  padding: 1.6rem 1.8rem;
  margin-top: 1.4rem;
  color: #E8EDF5;
}
.cert-section h3 { color: #fff; margin-top: 0 !important; }
.cert-form { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: flex-end; margin-top: 1rem; }
.cert-form label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.3rem; width: 100%; }
.cert-form input {
  flex: 1;
  min-width: 220px;
  border: none;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font: inherit;
  font-size: 1rem;
}
.cert-form input:focus-visible { outline: 3px solid var(--teal); }
.cert-form .btn-primary { background: var(--teal); color: var(--navy-deep); }
.cert-form .btn-primary:hover:not(:disabled) { background: #5FE2BB; }
.cert-form .btn-primary:disabled { background: #55677F; color: #93A2B8; }

/* ---------------- Certificate ---------------- */

body.cert-open { overflow: hidden; }

.cert-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(30, 44, 66, 0.85);
  overflow: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}
.cert-toolbar { display: flex; gap: 0.8rem; }
.cert-toolbar .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.4); }

.certificate {
  background: #FDFCFA;
  width: min(920px, 100%);
  aspect-ratio: 1.414 / 1;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  padding: clamp(0.8rem, 2vw, 1.6rem);
}
.cert-border {
  height: 100%;
  border: 3px solid var(--navy);
  outline: 1px solid var(--teal);
  outline-offset: -10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(1rem, 3vw, 2.5rem);
  position: relative;
}
.cert-brand { margin-bottom: clamp(0.6rem, 2vw, 1.4rem); }
.cert-logo {
  height: clamp(48px, 9vw, 84px);
  width: auto;
  display: block;
}
.cert-label {
  font-family: var(--font-head);
  font-size: clamp(0.75rem, 1.6vw, 1rem);
  font-weight: 600;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--teal-deep);
  margin-bottom: clamp(0.8rem, 2.5vw, 2rem);
}
.cert-presents { font-size: clamp(0.75rem, 1.5vw, 0.95rem); color: var(--ink-soft); margin-bottom: 0.3em; }
.cert-name {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 4.5vw, 3rem);
  font-weight: 700;
  color: var(--navy);
  border-bottom: 2px solid var(--sand);
  padding: 0 1em 0.15em;
  margin-bottom: clamp(0.7rem, 2vw, 1.4rem);
}
.cert-statement {
  max-width: 60ch;
  font-size: clamp(0.7rem, 1.5vw, 0.95rem);
  color: var(--ink-soft);
  margin-bottom: clamp(0.6rem, 1.8vw, 1.2rem);
}
.cert-course {
  font-family: var(--font-head);
  font-size: clamp(1rem, 2.4vw, 1.5rem);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.3em;
}
.cert-details { font-size: clamp(0.7rem, 1.4vw, 0.9rem); color: var(--ink-soft); }
.cert-framework {
  font-family: var(--font-head);
  font-size: clamp(0.65rem, 1.3vw, 0.85rem);
  font-weight: 600;
  color: var(--teal-deep);
  margin-top: 0.2em;
}
.cert-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  width: 100%;
  margin-top: auto;
  padding-top: clamp(0.6rem, 2vw, 1.5rem);
}
.cert-sig { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; font-size: clamp(0.65rem, 1.3vw, 0.85rem); color: var(--ink-soft); }
.cert-sig-line { width: clamp(120px, 20vw, 200px); border-top: 1.5px solid var(--navy); }
.cert-seal {
  width: clamp(3em, 7vw, 4.5em);
  height: clamp(3em, 7vw, 4.5em);
  border-radius: 50%;
  background: var(--navy);
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 3px #FDFCFA, 0 0 0 5px var(--teal);
}
.cert-seal img { width: 78%; height: auto; display: block; }
.cert-copyright {
  font-size: clamp(0.55rem, 1.1vw, 0.7rem);
  color: var(--ink-soft);
  margin: 0.6rem 0 0;
  text-align: center;
  width: 100%;
}

/* ---------------- Footer ---------------- */

.course-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
}

/* ---------------- Responsive ---------------- */

@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; padding-top: 1rem; }

  .topbar-titles { display: none; }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--sand-light);
    border: 1px solid var(--sand);
    border-radius: 999px;
    padding: 0.4em 1em;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--navy);
    cursor: pointer;
  }
  .nav-toggle-pct { color: var(--teal-deep); }
  .topbar-progress { display: none; }
  .topbar-pct { display: none; }

  .course-nav { display: none; position: static; max-height: none; }
  .course-nav.open { display: block; }

  .compare { grid-template-columns: 1fr; }
  .activity-grid { grid-template-columns: 1fr; }

  .framework-track { flex-direction: column; gap: 0.5rem; align-items: stretch; }
  .framework-node { max-width: none; flex-direction: row; text-align: left; gap: 0.8rem; padding: 0.5rem 0.8rem; }
  .framework-num { margin-bottom: 0; flex: 0 0 auto; }
  .framework-name { flex: 0 0 auto; min-width: 9.5em; }
  .framework-q { margin-top: 0; }
  .framework-link { display: none; }
}

/* ---------------- Reduced motion ---------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------------- Print: certificate only ---------------- */

@media print {
  body.cert-open > *:not(.cert-overlay) { display: none !important; }
  body.cert-open { background: #fff; }
  .cert-overlay {
    position: static;
    background: none;
    padding: 0;
    overflow: visible;
  }
  .cert-toolbar { display: none; }
  .certificate {
    box-shadow: none;
    width: 100%;
    aspect-ratio: auto;
    height: 96vh;
  }
  @page { size: landscape; margin: 0.5cm; }
}
