:root {
  --navy: #0b1f3a;
  --navy-2: #12305a;
  --ink: #1b2733;
  --muted: #5b6b7c;
  --line: #dfe6ee;
  --bg: #f5f8fc;
  --card: #ffffff;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #0ea5a4;
  --ok: #15803d;
  --ok-bg: #e8f7ee;
  --bad: #b91c1c;
  --bad-bg: #fdecec;
  --warn: #b45309;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(11, 31, 58, .08);
  --shadow-sm: 0 3px 10px rgba(11, 31, 58, .07);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
}

a { color: var(--primary); }

h1, h2, h3, h4 { line-height: 1.25; color: var(--navy); }

h1 { font-size: 2rem; margin: 0 0 .5rem; }
h2 { font-size: 1.4rem; margin: 2.2rem 0 .6rem; }
h3 { font-size: 1.12rem; margin: 1.6rem 0 .4rem; }

p { margin: .6rem 0; }

code {
  background: #eef2f7;
  border: 1px solid #dde5ee;
  border-radius: 5px;
  padding: .08em .38em;
  font-family: "Cascadia Code", Consolas, "Courier New", monospace;
  font-size: .9em;
  color: #123;
}

pre {
  background: var(--navy);
  color: #e6edf6;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  overflow-x: auto;
  font-size: .86rem;
  line-height: 1.55;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: 1em;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: .6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.site-header {
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 64px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: .2px;
}
.brand-mark {
  background: var(--primary);
  border-radius: 8px;
  padding: .1rem .5rem;
  font-family: Consolas, monospace;
  font-size: .95rem;
}
.site-nav {
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
  margin-left: .5rem;
}
.site-nav a {
  color: #cdd9ea;
  text-decoration: none;
  padding: .45rem .7rem;
  border-radius: 8px;
  font-size: .94rem;
  font-weight: 500;
}
.site-nav a:hover { background: rgba(255,255,255,.09); color: #fff; }
.site-nav a.is-active { background: var(--primary); color: #fff; }
.header-user { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.header-user .who { color: #cdd9ea; font-size: .92rem; text-decoration: none; }
.header-user .who:hover { color: #fff; text-decoration: underline; }
.role-badge {
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: .2rem .5rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.25);
}
.role-lecturer { background: #f59e0b; color: #3b2500; border-color: transparent; }
.role-student { background: rgba(255,255,255,.12); color: #cdd9ea; }

/* Buttons */
.btn {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: .65rem 1.15rem;
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.25); }
.btn-ghost:hover { background: rgba(255,255,255,.16); }
.btn-outline { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: .4rem .8rem; font-size: .86rem; }
.btn-lg { padding: .85rem 1.6rem; font-size: 1.02rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

main.wrap { padding-top: 2rem; padding-bottom: 3rem; }

/* Flash + alerts */
.flash {
  background: var(--ok-bg);
  border: 1px solid #b6e2c6;
  color: var(--ok);
  border-radius: 10px;
  padding: .7rem 1rem;
  margin: 1rem 0 0;
  font-weight: 500;
}
.alert { border-radius: 10px; padding: .75rem 1rem; margin: 1rem 0; }
.alert-error { background: var(--bad-bg); border: 1px solid #f3c0c0; color: var(--bad); }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 60%, #17427a 100%);
  color: #fff;
  border-radius: 20px;
  padding: 2.6rem 2rem;
  margin: 1.5rem 0 2rem;
  box-shadow: var(--shadow);
}
.hero h1 { color: #fff; font-size: 2.15rem; margin-bottom: .6rem; }
.hero p { color: #c8d6e8; max-width: 62ch; font-size: 1.03rem; }
.hero-actions { margin-top: 1.4rem; display: flex; gap: .7rem; flex-wrap: wrap; }

/* Cards & grids */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem 1.35rem;
  box-shadow: var(--shadow-sm);
}
.card h3 { margin-top: 0; }
.card-link { display: block; text-decoration: none; color: inherit; transition: transform .12s, box-shadow .12s; }
.card-link:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-icon {
  width: 42px; height: 42px; border-radius: 11px;
  display: grid; place-items: center;
  background: #e8effb; color: var(--primary);
  font-size: 1.2rem; margin-bottom: .7rem; font-weight: 700;
}
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.section-title h2 { margin-bottom: .2rem; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }

/* Progress bars */
.bar { background: #e7edf5; border-radius: 999px; height: 10px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 999px; transition: width .4s; }
.progress-row { display: flex; align-items: center; gap: .75rem; margin: .55rem 0; }
.progress-row .label { min-width: 120px; font-size: .88rem; color: var(--muted); }
.progress-row .bar { flex: 1; }
.progress-row .value { font-size: .85rem; font-weight: 600; color: var(--navy); min-width: 46px; text-align: right; }

/* Badges / pills */
.badge {
  display: inline-block; font-size: .76rem; font-weight: 700;
  padding: .18rem .55rem; border-radius: 999px;
  background: #e8effb; color: var(--primary); text-transform: uppercase; letter-spacing: .04em;
}
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: #fdf1e0; color: var(--warn); }

/* Chapter tabs */
.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin: 1rem 0 1.5rem; }
.tabs a {
  text-decoration: none; padding: .5rem 1rem; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--navy); font-weight: 600; font-size: .92rem;
}
.tabs a.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Lesson layout */
.lesson-layout { display: grid; grid-template-columns: 280px 1fr; gap: 1.75rem; align-items: start; }
.lesson-side { position: sticky; top: 84px; }
.lesson-side ol { list-style: none; margin: 0; padding: 0; counter-reset: l; }
.lesson-side li { counter-increment: l; }
.lesson-side a {
  display: flex; gap: .6rem; align-items: flex-start;
  padding: .55rem .7rem; border-radius: 10px; text-decoration: none; color: var(--ink); font-size: .92rem;
}
.lesson-side a::before {
  content: counter(l); flex: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: #e8effb; color: var(--primary);
  font-size: .74rem; font-weight: 700; display: grid; place-items: center; margin-top: 2px;
}
.lesson-side a:hover { background: #eef3fa; }
.lesson-side a.is-active { background: var(--navy); color: #fff; }
.lesson-side a.is-active::before { background: var(--primary); color: #fff; }
.lesson-side a.done::before { background: var(--ok); color: #fff; }

.lesson-body { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem 1.8rem; box-shadow: var(--shadow-sm); }
.lesson-body table, .slide-content table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .93rem; }
.lesson-body th, .lesson-body td, .slide-content th, .slide-content td { padding: .6rem .75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.lesson-body thead th, .slide-content thead th { background: #f1f5fb; color: var(--navy); }
.lesson-body ul, .lesson-body ol, .slide-content ul, .slide-content ol { padding-left: 1.35rem; }
.lesson-body li, .slide-content li { margin: .3rem 0; }
.lesson-body ol.steps, .slide-content ol.steps { counter-reset: s; list-style: none; padding-left: 0; }
.lesson-body ol.steps li, .slide-content ol.steps li { counter-increment: s; position: relative; padding-left: 2.2rem; margin: .6rem 0; }
.lesson-body ol.steps li::before, .slide-content ol.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 1px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: .8rem; font-weight: 700;
  display: grid; place-items: center;
}
.callout {
  background: #eef6ff; border-left: 4px solid var(--primary);
  border-radius: 0 10px 10px 0; padding: .8rem 1rem; margin: 1.1rem 0;
}
.callout p { margin: 0; }

.lesson-footer { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1.6rem; flex-wrap: wrap; }

/* Quiz */
.question { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.35rem; margin-bottom: 1.1rem; box-shadow: var(--shadow-sm); }
.question .q-head { display: flex; gap: .7rem; align-items: baseline; }
.question .q-num { font-weight: 700; color: var(--primary); }
.options { display: grid; gap: .5rem; margin-top: .85rem; }
.option {
  display: flex; gap: .7rem; align-items: center; text-align: left;
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: .7rem .85rem; cursor: pointer; font: inherit; color: var(--ink);
  transition: border-color .12s, background .12s;
}
.option:hover:not([disabled]) { border-color: var(--primary); background: #f5f9ff; }
.option .key {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: #eef2f7; color: var(--navy); font-weight: 700; font-size: .82rem;
  display: grid; place-items: center;
}
.option.correct { border-color: #79c79a; background: var(--ok-bg); }
.option.correct .key { background: var(--ok); color: #fff; }
.option.wrong { border-color: #e79b9b; background: var(--bad-bg); }
.option.wrong .key { background: var(--bad); color: #fff; }
.option[disabled] { cursor: default; }
.explanation { margin-top: .8rem; padding: .7rem .9rem; border-radius: 10px; background: #f1f5fb; font-size: .92rem; display: none; }
.explanation.show { display: block; }

.quiz-summary {
  background: var(--navy); color: #fff; border-radius: var(--radius);
  padding: 1.4rem 1.6rem; margin: 1.5rem 0; text-align: center;
}
.quiz-summary .score { font-size: 2.6rem; font-weight: 800; }
.quiz-summary .score span { font-size: 1.2rem; opacity: .7; }

/* Matching */
.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.match-col h3 { margin-top: 0; }
.chip, .slot {
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: .7rem .9rem; margin-bottom: .6rem; font-size: .93rem;
}
.chip { cursor: grab; user-select: none; font-weight: 600; color: var(--navy); }
.chip.selected { border-color: var(--primary); background: #eaf1ff; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.chip.matched, .slot.matched { border-color: #79c79a; background: var(--ok-bg); color: var(--ok); cursor: default; }
.chip.dragging { opacity: .5; }
.slot { min-height: 46px; display: flex; align-items: center; }
.slot.over { border-color: var(--primary); background: #f5f9ff; }
.slot .pair-term { font-weight: 700; color: var(--primary); margin-left: .4rem; }
.match-msg { font-weight: 600; margin: 1rem 0; min-height: 1.4rem; }
.match-msg.ok { color: var(--ok); }
.match-msg.bad { color: var(--bad); }

/* Playground */
.playground { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.editor-pane { display: flex; flex-direction: column; gap: .75rem; }
.editor-block label { display: block; font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .3rem; }
.editor-block textarea {
  width: 100%; min-height: 150px; resize: vertical;
  font-family: Consolas, "Cascadia Code", monospace; font-size: .85rem; line-height: 1.5;
  border: 1px solid var(--line); border-radius: 10px; padding: .7rem; background: #fbfdff; color: var(--ink);
}
.editor-block textarea:focus { outline: 2px solid rgba(37,99,235,.35); border-color: var(--primary); }
.preview-pane { display: flex; flex-direction: column; }
.preview-pane iframe { flex: 1; width: 100%; min-height: 520px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.preview-bar { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .5rem; flex-wrap: wrap; }
.pg-output {
  flex: 1; min-height: 380px; overflow: auto;
  border: 1px solid var(--line); border-radius: 12px;
  background: #0b1f3a; color: #e6edf6;
  padding: 1rem 1.1rem; white-space: pre-wrap; word-break: break-word;
  font-family: Consolas, "Cascadia Code", monospace; font-size: .88rem; line-height: 1.6;
}
.pg-output .muted { color: #8fb3e0; }
.sql-result { width: 100%; border-collapse: collapse; font-size: .82rem; margin: .3rem 0; }
.sql-result th, .sql-result td { border: 1px solid rgba(255,255,255,.18); padding: .3rem .5rem; text-align: left; white-space: nowrap; }
.sql-result th { background: rgba(255,255,255,.1); }
.sql-ok { color: #86efac; margin: .3rem 0; }
.sql-err { color: #fca5a5; margin: .3rem 0; }

/* Auth forms */
.auth-card { max-width: 430px; margin: 3rem auto; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; color: var(--navy); }
.field input {
  width: 100%; padding: .7rem .85rem; border: 1px solid var(--line);
  border-radius: 10px; font: inherit; background: #fff;
}
.field input:focus { outline: 2px solid rgba(37,99,235,.35); border-color: var(--primary); }

/* Lab activities */
.lab-task { margin-bottom: 1.5rem; }
.lab-task-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.lab-task-head h2 { margin: 0; font-size: 1.2rem; flex: 1; min-width: 200px; }
.lab-num {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary); color: #fff; font-weight: 700;
  display: grid; place-items: center;
}
.lab-task-body { margin: .7rem 0 1.1rem; }
.lab-task-body h3 { margin-top: 1rem; }
.lab-editor { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; align-items: start; }
.lab-panes { display: flex; flex-direction: column; gap: .8rem; }
.lab-pane-label {
  display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); margin-bottom: .25rem;
}
.lab-input {
  width: 100%; min-height: 200px; resize: vertical;
  font-family: Consolas, "Cascadia Code", monospace; font-size: .85rem; line-height: 1.5;
  border: 1px solid var(--line); border-radius: 10px; padding: .7rem; background: #fbfdff; color: var(--ink);
}
.lab-input:focus { outline: 2px solid rgba(37,99,235,.35); border-color: var(--primary); }
.lab-preview { width: 100%; min-height: 380px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.lab-code-wrap { position: relative; margin-bottom: 1rem; }
.lab-file-name {
  position: absolute; top: .6rem; left: 1.1rem; z-index: 2;
  font-size: .75rem; color: #8fb3e0; font-family: Consolas, monospace;
}
.lab-code-wrap pre { padding: 2.2rem 5.5rem 1rem 1.1rem; }
.lab-code-wrap .lab-copy { position: absolute; top: .6rem; right: .6rem; z-index: 2; }
.lab-actions { margin-top: 1rem; }
@media (max-width: 800px) { .lab-editor { grid-template-columns: 1fr; } }

/* Toggle switch */
.switch { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; font-size: .92rem; }
.switch input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; flex: none; }
.switch input:disabled { opacity: .5; }

/* Lesson activity: complete the code */
.activity { margin-top: 1rem; }
.activity-section { margin-top: 1.8rem; border-top: 1px solid var(--line); padding-top: 1.5rem; }
.slide-activity .slide-content { max-width: none; }
.activity-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 1.2rem; align-items: start; }
.activity-code pre {
  background: var(--navy); color: #e6edf6; padding: 1rem 1.1rem; border-radius: 12px;
  overflow-x: auto; font-size: .86rem; line-height: 1.9; margin: 0;
}
.code-line { white-space: pre; }
.dz {
  display: inline-block; min-width: 84px; min-height: 1.5em; vertical-align: middle;
  border: 1px dashed #6b8bb5; border-radius: 6px; background: rgba(255,255,255,.08);
  margin: 0 2px; padding: 0 .4rem; color: #fff; cursor: pointer;
}
.dz.over { border-color: var(--accent); background: rgba(14,165,164,.25); }
.dz.ok { border: 1px solid #79c79a; background: rgba(21,128,61,.4); }
.dz.bad { border: 1px solid #e79b9b; background: rgba(185,28,28,.4); }
.token-bank {
  display: flex; flex-wrap: wrap; gap: .5rem; min-height: 64px; padding: .7rem;
  border: 1px dashed var(--line); border-radius: 12px; background: #f8fafd;
}
.token {
  font-family: Consolas, "Cascadia Code", monospace; font-size: .82rem;
  border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: .35rem .55rem;
  cursor: grab; color: var(--navy); white-space: nowrap;
}
.token:hover { border-color: var(--primary); }
.token.selected { border-color: var(--primary); background: #eaf1ff; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.token.used { opacity: .25; cursor: default; }
.activity-actions { display: flex; gap: .5rem; margin-top: .9rem; }
.activity-msg { font-weight: 600; margin: .7rem 0 0; min-height: 1.3rem; }
.activity-msg.ok { color: var(--ok); }
.activity-msg.bad { color: var(--bad); }
@media (max-width: 800px) { .activity-grid { grid-template-columns: 1fr; } }

/* Data tables */
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th, .data-table td { padding: .6rem .7rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.data-table thead th { background: #f1f5fb; color: var(--navy); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; }
.data-table tbody tr:hover { background: #f8fafd; }
.data-table .row-num { width: 48px; text-align: right; }

/* Slide deck */
.deck {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-top: 1.2rem;
}
.deck-top {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .7rem 1.1rem; background: var(--navy); color: #fff;
}
.deck-title { font-weight: 700; font-size: .98rem; }
.deck-hint { color: #9fb3cc; font-size: .78rem; }
.deck-tools { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.deck-counter { font-variant-numeric: tabular-nums; font-size: .85rem; color: #cdd9ea; }
.deck-stage { position: relative; flex: 1; min-height: min(74vh, 700px); background: #fff; }

.slide {
  position: absolute; inset: 0; overflow: auto;
  padding: 2rem 2.2rem 2.4rem;
  opacity: 0; transform: translateX(26px);
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
}
.slide.is-active { opacity: 1; transform: none; pointer-events: auto; }
.slide.is-prev { transform: translateX(-26px); }

.slide-cover, .slide-section { display: flex; }
.slide-cover > .slide-content, .slide-section > .slide-content { margin: auto; }
.slide-cover, .slide-section { background: linear-gradient(135deg, #0b1f3a 0%, #17427a 100%); }
.slide-cover .slide-title, .slide-section .slide-title { color: #fff; font-size: 2.4rem; }
.slide-cover .slide-lead, .slide-section .slide-lead { color: #c8d6e8; }
.slide-cover .slide-kicker, .slide-section .slide-kicker { color: #7fb0f5; }

.slide-kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .76rem; font-weight: 700; color: var(--primary); margin-bottom: .55rem; }
.slide-title { font-size: 1.8rem; margin: 0 0 .7rem; }
.slide-lead { font-size: 1.12rem; color: var(--muted); max-width: 62ch; }
.slide-content { max-width: 78ch; }

.deck-bottom {
  display: flex; align-items: center; gap: 1rem;
  padding: .65rem 1.1rem; border-top: 1px solid var(--line); background: #f8fafd;
}
.deck-progress { flex: 1; height: 6px; background: #e7edf5; border-radius: 999px; overflow: hidden; }
.deck-progress > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .3s; }
.deck-nav { display: flex; gap: .5rem; }

/* Fullscreen presentation */
.deck:fullscreen, .deck:-webkit-full-screen {
  border-radius: 0; border: 0; margin: 0; width: 100vw; height: 100vh; background: #fff;
}
.deck:fullscreen .deck-stage, .deck:-webkit-full-screen .deck-stage { min-height: 0; }
.deck:fullscreen .slide, .deck:-webkit-full-screen .slide { padding: 3.5rem 5rem; font-size: 1.08rem; }
.deck:fullscreen .slide-title, .deck:-webkit-full-screen .slide-title { font-size: 2.4rem; }
.deck:fullscreen .slide-cover .slide-title, .deck:-webkit-full-screen .slide-cover .slide-title,
.deck:fullscreen .slide-section .slide-title, .deck:-webkit-full-screen .slide-section .slide-title { font-size: 3.2rem; }
.deck:fullscreen .slide-content, .deck:-webkit-full-screen .slide-content { max-width: 100ch; }

/* Footer */
.site-footer { background: #0d2038; color: #93a5bd; margin-top: 2rem; padding: 1.6rem 0; font-size: .9rem; }
.site-footer p { margin: .2rem 0; }

@media (max-width: 900px) {
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-side { position: static; }
  .playground { grid-template-columns: 1fr; }
  .deck-stage { min-height: 68vh; }
  .slide { padding: 1.5rem 1.3rem 1.8rem; }
  .slide-title { font-size: 1.45rem; }
  .slide-cover .slide-title, .slide-section .slide-title { font-size: 1.9rem; }
}
@media (max-width: 640px) {
  .match-grid { grid-template-columns: 1fr; }
  .hero { padding: 1.8rem 1.3rem; }
  .hero h1 { font-size: 1.7rem; }
  .header-user { width: 100%; margin-left: 0; }
}

/* Print / Save as PDF â€” one slide per landscape page */
@page { size: A4 landscape; margin: 12mm; }

@media print {
  html, body { background: #fff !important; }
  body { font-size: 11pt; }

  .skip-link,
  .site-header,
  .site-footer,
  .flash,
  .tabs,
  .section-title,
  .deck-top,
  .deck-bottom,
  .deck-hint { display: none !important; }

  .wrap { max-width: none; padding: 0; margin: 0; }

  .deck {
    display: block !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  .deck-stage { position: static !important; min-height: 0 !important; }

  .slide {
    position: static !important;
    inset: auto !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
    overflow: visible !important;
    padding: 8mm 10mm !important;
    min-height: 180mm;
    break-after: page;
    page-break-after: always;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .slide:last-child { break-after: auto; page-break-after: auto; }

  .slide-cover, .slide-section {
    display: block !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .slide-cover > .slide-content,
  .slide-section > .slide-content { margin: 0 !important; }

  .slide-content { max-width: none !important; }

  .slide pre,
  .slide .callout,
  .slide-content table,
  .slide-content thead th {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
