/* ============================================================
   AliceCode · Level 4 Hub — design system
   Palette from the הסמכה 4 deck masters:
   gradient #674C9B → #A43F86, accent pink #D83474,
   deep purple ink #3B1F5C, soft pink #EFA6C3, white cards.
   ============================================================ */

:root {
  --grad-top: #674C9B;
  --grad-mid: #8F4590;
  --grad-bot: #B43F82;
  --pink: #D83474;
  --pink-soft: #EFA6C3;
  --ink: #3B1F5C;
  --ink-soft: #6B5590;
  --card: #FFFFFF;
  --mint: #2FB380;
  --orange: #F2842C;
  --red: #E04F5F;
  --yellow: #FFD166;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(43, 16, 74, 0.25);
  --font-head: "Baloo 2", "Rubik", sans-serif;
  --font-body: "Nunito", "Rubik", sans-serif;
  --font-code: "JetBrains Mono", "Fira Code", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(160deg, var(--grad-top) 0%, var(--grad-mid) 55%, var(--grad-bot) 100%) fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---------- floating doodles layer ---------- */
.doodles {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.doodle {
  position: absolute;
  opacity: .35;
  animation: floaty 9s ease-in-out infinite;
}
.doodle:nth-child(2n) { animation-duration: 12s; animation-delay: -3s; }
.doodle:nth-child(3n) { animation-duration: 15s; animation-delay: -6s; }
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-18px) rotate(6deg); }
}

/* ---------- layout ---------- */
.wrap { position: relative; z-index: 1; max-width: 1060px; margin: 0 auto; padding: 0 16px 80px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 12px; z-index: 50;
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  box-shadow: var(--shadow);
  padding: 10px 18px;
  margin: 14px auto 28px;
  max-width: 1060px;
  flex-wrap: wrap;
}
.logo {
  font-family: var(--font-head);
  font-weight: 800; font-size: 1.25rem;
  color: var(--ink); text-decoration: none;
  display: flex; align-items: center; gap: 2px;
  white-space: nowrap;
}
.logo .brace { color: var(--pink); font-size: 1.5rem; font-weight: 800; transform: translateY(-2px); }
.logo .logo-stars { color: var(--pink); font-size: .7rem; align-self: flex-start; margin-right: 2px; animation: sparkle 2.4s ease-in-out infinite; }
.logo-lockup { text-align: center; color: #fff; margin-bottom: 10px; }
.logo-lockup .stars { display: block; font-size: clamp(1rem, 2.5vw, 1.5rem); letter-spacing: 18px; margin-bottom: 2px; }
.logo-lockup .stars span { display: inline-block; animation: sparkle 2.6s ease-in-out infinite; }
.logo-lockup .stars span:nth-child(2) { animation-delay: .6s; font-size: 1.4em; }
.logo-lockup .stars span:nth-child(3) { animation-delay: 1.2s; }
.logo-lockup .mark { font-family: var(--font-head); font-weight: 800; font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1.05; }
.logo-lockup .mark .brace { color: var(--pink-soft); font-size: 1.18em; vertical-align: -0.06em; }
.logo-lockup .tagline { direction: rtl; font-weight: 700; font-size: clamp(.85rem, 2vw, 1.05rem); opacity: .92; margin-top: 6px; }
.logo .lvl { color: var(--pink); font-size: .8rem; margin-left: 6px; background: rgba(216,52,116,.12); padding: 2px 9px; border-radius: 999px; }
.nav .links { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.nav a.nl {
  text-decoration: none; color: var(--ink-soft);
  font-weight: 700; font-size: .92rem;
  padding: 7px 13px; border-radius: 999px;
  transition: all .2s;
}
.nav a.nl:hover { background: rgba(216,52,116,.1); color: var(--pink); }
.nav a.nl.active { background: var(--pink); color: #fff; }

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
  margin-bottom: 26px;
}
.card.tight { padding: 22px; }

/* ---------- typography ---------- */
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; margin-bottom: 14px; }
h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; }
p  { line-height: 1.65; }
.pink { color: var(--pink); }
.white { color: #fff; }
.center { text-align: center; }
.muted { color: var(--ink-soft); }

.hero {
  text-align: center; color: #fff;
  padding: 44px 10px 34px;
}
.hero .braces { font-family: var(--font-head); font-weight: 800; color: var(--pink-soft); }
.hero p.sub { font-size: 1.2rem; max-width: 640px; margin: 14px auto 0; opacity: .95; }

.badge {
  display: inline-block; background: rgba(255,255,255,.18);
  border: 1.5px solid rgba(255,255,255,.5);
  color: #fff; border-radius: 999px;
  padding: 6px 16px; font-weight: 700; font-size: .9rem;
  margin-bottom: 18px; letter-spacing: .4px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  background: var(--pink); color: #fff;
  font-family: var(--font-head); font-weight: 700;
  text-decoration: none; border: none; cursor: pointer;
  padding: 12px 26px; border-radius: 999px;
  font-size: 1rem;
  box-shadow: 0 6px 18px rgba(216,52,116,.45);
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 10px 24px rgba(216,52,116,.55); }
.btn.ghost { background: transparent; border: 2px solid #fff; box-shadow: none; }
.btn.ghost:hover { background: rgba(255,255,255,.15); }
.btn.small { padding: 8px 18px; font-size: .9rem; }
.btn.dark { background: var(--ink); box-shadow: 0 6px 18px rgba(59,31,92,.4); }

/* ---------- pipeline (3 agents) ---------- */
.pipeline { display: flex; align-items: stretch; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 18px 0 6px; }
.pipe-step {
  flex: 1 1 180px; max-width: 240px;
  background: #fff; border-radius: 18px;
  border: 2.5px solid var(--pink-soft);
  padding: 18px 14px; text-align: center;
  transition: transform .2s, border-color .2s;
}
.pipe-step:hover { transform: translateY(-4px); border-color: var(--pink); }
.pipe-step .big { font-size: 2rem; display: block; margin-bottom: 6px; animation: bounce-soft 2.4s ease-in-out infinite; }
.pipe-step:nth-child(3) .big { animation-delay: .3s; }
.pipe-step:nth-child(5) .big { animation-delay: .6s; }
@keyframes bounce-soft { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.pipe-arrow { align-self: center; font-size: 1.6rem; color: var(--pink); font-weight: 800; animation: pulse-arrow 1.6s ease-in-out infinite; }
@keyframes pulse-arrow { 0%,100% { opacity: .45; transform: translateX(0);} 50% { opacity: 1; transform: translateX(5px);} }

/* ---------- timeline / roadmap ---------- */
.timeline { position: relative; margin: 10px 0; }
.timeline::before {
  content: ""; position: absolute; left: 26px; top: 8px; bottom: 8px;
  width: 4px; border-radius: 4px;
  background: linear-gradient(var(--pink-soft), var(--pink));
}
.tl-item { position: relative; padding: 0 0 22px 70px; }
.tl-item .dot {
  position: absolute; left: 10px; top: 0;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--pink); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 800;
  box-shadow: 0 0 0 5px rgba(216,52,116,.2);
}
.tl-item.special .dot { background: var(--ink); box-shadow: 0 0 0 5px rgba(59,31,92,.25); }
.tl-item h3 a { color: var(--ink); text-decoration: none; }
.tl-item h3 a:hover { color: var(--pink); }
.tl-item .when { font-size: .85rem; font-weight: 800; color: var(--pink); text-transform: uppercase; letter-spacing: .5px; }

/* ---------- lesson grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.lesson-card {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 10px;
  transition: transform .2s;
  text-decoration: none; color: var(--ink);
}
.lesson-card:hover { transform: translateY(-5px) rotate(-.5deg); }
.lesson-card .num {
  font-family: var(--font-head); font-weight: 800;
  font-size: .8rem; color: var(--pink);
  letter-spacing: 1px; text-transform: uppercase;
}
.lesson-card .emoji { font-size: 2.2rem; }
.lesson-card::after {
  content: "{ }"; position: absolute; right: -6px; bottom: -14px;
  font-family: var(--font-head); font-weight: 800; font-size: 4rem;
  color: rgba(216,52,116,.08);
}
.lesson-card .cta { margin-top: auto; color: var(--pink); font-weight: 800; }

/* ---------- meme cards ---------- */
.meme-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.meme {
  border-radius: 18px; padding: 22px;
  color: #fff; font-family: var(--font-head);
  font-weight: 700; font-size: 1.05rem; line-height: 1.4;
  position: relative; overflow: hidden;
  min-height: 130px; display: flex; flex-direction: column; justify-content: center;
  transform: rotate(-1deg);
  transition: transform .2s;
  box-shadow: var(--shadow);
}
.meme:nth-child(2n) { transform: rotate(1.2deg); }
.meme:hover { transform: rotate(0) scale(1.04); }
.meme .tag { font-size: .72rem; opacity: .85; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 8px; font-family: var(--font-body); font-weight: 800; }
.meme .spark { position: absolute; font-size: 1.4rem; animation: sparkle 2.2s ease-in-out infinite; }
.meme .spark.s1 { top: 10px; right: 14px; }
.meme .spark.s2 { bottom: 10px; left: 14px; animation-delay: 1.1s; }
@keyframes sparkle { 0%,100% { transform: scale(.7); opacity: .4; } 50% { transform: scale(1.2); opacity: 1; } }
.meme.m-pink   { background: linear-gradient(135deg, #D83474, #A43F86); }
.meme.m-purple { background: linear-gradient(135deg, #674C9B, #3B1F5C); }
.meme.m-sunset { background: linear-gradient(135deg, #F2842C, #D83474); }
.meme.m-mint   { background: linear-gradient(135deg, #2FB380, #0E7C5B); }

/* ---------- terminal ---------- */
.terminal {
  background: #241436;
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  font-family: var(--font-code);
  font-size: .88rem;
}
.term-bar {
  background: #37204F; padding: 10px 14px;
  display: flex; align-items: center; gap: 7px;
}
.term-bar .dot-r, .term-bar .dot-y, .term-bar .dot-g { width: 12px; height: 12px; border-radius: 50%; }
.dot-r { background: #E04F5F; } .dot-y { background: #FFD166; } .dot-g { background: #2FB380; }
.term-bar .title { color: #C9B6E4; margin-left: 8px; font-size: .8rem; }
.term-body { padding: 18px; min-height: 300px; color: #EDE4FA; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.term-body .u  { color: #FF79A8; font-weight: 700; }   /* user input */
.term-body .ai { color: #9FF0C8; }                      /* agent output */
.term-body .dim{ color: #8E7BB0; }
.cursor { display: inline-block; width: 9px; height: 1.1em; background: #FF79A8; vertical-align: text-bottom; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- slides viewer ---------- */
.stage-wrap { position: relative; z-index: 1; max-width: 1060px; margin: 0 auto; padding: 0 16px; }
.stage {
  position: relative;
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9.4;
  overflow: hidden;
}
.slide {
  position: absolute; inset: 0;
  padding: clamp(18px, 4vw, 48px);
  display: none; flex-direction: column;
  animation: slide-in .35s ease;
}
.slide.on { display: flex; }
@keyframes slide-in { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }

.slide .s-title { color: var(--ink); font-size: clamp(1.25rem, 3vw, 2rem); margin-bottom: 4px; }
.slide .s-lead  { color: var(--pink); font-weight: 800; margin: 2px 0 10px; font-size: clamp(.85rem, 1.8vw, 1.05rem); }
.slide .s-body  { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: clamp(8px, 1.6vw, 16px); }

.slide.k-title, .slide.k-section {
  background: linear-gradient(150deg, var(--grad-top), var(--grad-bot));
  color: #fff; align-items: center; justify-content: center; text-align: center;
}
.slide.k-title h1, .slide.k-section h1 { color: #fff; }
.slide.k-title .sub, .slide.k-section .sub { font-size: clamp(.95rem, 2.2vw, 1.3rem); margin-top: 14px; opacity: .92; font-weight: 700; }
.slide.k-title .brace-art { font-family: var(--font-head); font-weight: 800; font-size: clamp(2.6rem, 7vw, 5rem); color: var(--pink-soft); line-height: 1; }

.s-lines { list-style: none; }
.s-lines li {
  position: relative; padding: clamp(4px,1vw,8px) 0 clamp(4px,1vw,8px) 30px;
  font-size: clamp(.9rem, 2vw, 1.15rem); font-weight: 600; line-height: 1.5;
}
.s-lines li::before { content: "▸"; position: absolute; left: 6px; color: var(--pink); font-weight: 800; }

.s-cards { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: clamp(8px, 1.5vw, 16px); }
.s-card {
  border-radius: 14px; padding: clamp(10px, 1.8vw, 18px);
  border: 2.5px solid; background: #fff;
  text-align: center;
}
.s-card h4 { font-family: var(--font-head); font-size: clamp(.85rem, 1.8vw, 1.1rem); margin-bottom: 6px; }
.s-card p { font-size: clamp(.75rem, 1.5vw, .95rem); font-weight: 600; line-height: 1.45; }
.s-card.c-pink   { border-color: var(--pink); }       .s-card.c-pink h4 { color: var(--pink); }
.s-card.c-orange { border-color: var(--orange); }     .s-card.c-orange h4 { color: var(--orange); }
.s-card.c-green  { border-color: var(--mint); }       .s-card.c-green h4 { color: var(--mint); }
.s-card.c-red    { border-color: var(--red); }        .s-card.c-red h4 { color: var(--red); }
.s-card.c-purple { border-color: var(--grad-top); }   .s-card.c-purple h4 { color: var(--grad-top); }
.s-card.c-dark   { border-color: var(--ink); }        .s-card.c-dark h4 { color: var(--ink); }

.s-note {
  background: rgba(216,52,116,.09);
  border-left: 5px solid var(--pink);
  border-radius: 10px;
  padding: clamp(8px,1.4vw,14px) clamp(10px,1.8vw,18px);
  font-weight: 700; font-size: clamp(.8rem, 1.7vw, 1rem);
  color: var(--ink);
}

.s-code {
  background: #241436; color: #EDE4FA;
  font-family: var(--font-code);
  font-size: clamp(.68rem, 1.5vw, .95rem);
  border-radius: 12px; padding: clamp(10px,1.8vw,18px);
  line-height: 1.6; overflow-x: auto; white-space: pre;
}

.s-rows { width: 100%; border-collapse: collapse; }
.s-rows td { padding: clamp(5px,1vw,9px) 10px; font-size: clamp(.72rem, 1.5vw, .95rem); border-bottom: 1.5px solid #F2E8F5; vertical-align: top; line-height: 1.45; }
.s-rows td:first-child { font-weight: 800; color: var(--pink); white-space: nowrap; }

.s-ba { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: clamp(8px,1.5vw,16px); }
.s-ba .col { border-radius: 14px; padding: clamp(10px,2vw,20px); text-align: center; }
.s-ba .col h4 { font-family: var(--font-head); margin-bottom: 8px; font-size: clamp(.9rem,1.9vw,1.15rem); }
.s-ba .before { background: rgba(224,79,95,.1); border: 2.5px solid var(--red); }
.s-ba .before h4 { color: var(--red); }
.s-ba .after { background: rgba(47,179,128,.1); border: 2.5px solid var(--mint); }
.s-ba .after h4 { color: var(--mint); }
.s-ba .col p { font-size: clamp(.75rem,1.6vw,.98rem); font-weight: 600; line-height: 1.5; }
.s-ba .mid { align-self: center; font-size: clamp(1.4rem,3vw,2.2rem); animation: pulse-arrow 1.6s infinite; }

.s-newword { text-align: center; display: flex; flex-direction: column; justify-content: center; gap: 12px; flex: 1; }
.s-newword .nw-tag { font-weight: 800; color: var(--pink); letter-spacing: 2px; font-size: clamp(.75rem,1.5vw,.9rem); }
.s-newword .nw-term { font-family: var(--font-code); font-weight: 700; font-size: clamp(1.6rem, 4vw, 2.8rem); color: var(--ink); }
.s-newword .nw-meaning { font-size: clamp(.95rem, 2.2vw, 1.3rem); font-weight: 700; max-width: 620px; margin: 0 auto; }
.s-newword .nw-extra { color: var(--ink-soft); font-weight: 600; font-size: clamp(.8rem, 1.7vw, 1rem); }

/* slide controls */
.slide-controls {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin: 18px 0 10px; color: #fff; font-weight: 700;
}
.slide-controls button {
  background: rgba(255,255,255,.92); border: none; cursor: pointer;
  color: var(--pink); font-size: 1.25rem; font-weight: 800;
  width: 46px; height: 46px; border-radius: 50%;
  box-shadow: var(--shadow); transition: transform .15s;
}
.slide-controls button:hover { transform: scale(1.12); }
.slide-controls button:disabled { opacity: .35; cursor: default; transform: none; }
.progress-dots { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; max-width: 480px; }
.progress-dots span { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.4); cursor: pointer; transition: all .2s; }
.progress-dots span.on { background: #fff; transform: scale(1.35); }

/* ---------- checklists ---------- */
.check-list { list-style: none; }
.check-list li { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1.5px solid #F2E8F5; }
.check-list li:last-child { border-bottom: none; }
.check-list input[type=checkbox] {
  appearance: none; width: 26px; height: 26px; min-width: 26px;
  border: 2.5px solid var(--pink-soft); border-radius: 8px;
  cursor: pointer; position: relative; transition: all .2s; margin-top: 1px;
}
.check-list input[type=checkbox]:checked { background: var(--pink); border-color: var(--pink); }
.check-list input[type=checkbox]:checked::after {
  content: "✓"; color: #fff; font-weight: 800;
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
}
.check-list label { cursor: pointer; font-weight: 600; line-height: 1.5; flex: 1; }
.check-list input:checked + label { text-decoration: line-through; opacity: .55; }

/* ---------- link cards / resources ---------- */
.res-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.res {
  display: block; text-decoration: none; color: var(--ink);
  background: #fff; border-radius: 16px; padding: 18px;
  border: 2px solid transparent; box-shadow: var(--shadow);
  transition: all .2s;
}
.res:hover { border-color: var(--pink); transform: translateY(-3px); }
.res .r-kind { font-size: .72rem; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--pink); }
.res h3 { margin: 6px 0 4px; }
.res p { font-size: .9rem; color: var(--ink-soft); line-height: 1.5; }
.res .r-url { display: inline-block; margin-top: 8px; font-size: .8rem; font-weight: 800; color: var(--pink); word-break: break-all; }

/* github card */
.gh-card {
  display: flex; gap: 16px; align-items: center;
  background: #241436; color: #fff; border-radius: 16px; padding: 20px;
  text-decoration: none; box-shadow: var(--shadow);
  transition: transform .2s;
}
.gh-card:hover { transform: translateY(-3px); }
.gh-card .gh-icon { font-size: 2rem; }
.gh-card h3 { color: #fff; margin: 0 0 3px; font-family: var(--font-code); font-size: 1rem; }
.gh-card p { color: #C9B6E4; font-size: .85rem; line-height: 1.5; }

/* steps */
.steps { counter-reset: st; list-style: none; }
.steps > li { position: relative; padding: 0 0 26px 62px; counter-increment: st; }
.steps > li::before {
  content: counter(st);
  position: absolute; left: 0; top: 0;
  width: 42px; height: 42px; border-radius: 14px;
  background: var(--pink); color: #fff;
  font-family: var(--font-head); font-weight: 800; font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 5px 14px rgba(216,52,116,.4);
}
.steps > li::after {
  content: ""; position: absolute; left: 20px; top: 48px; bottom: 6px;
  width: 3px; background: var(--pink-soft); border-radius: 3px;
}
.steps > li:last-child::after { display: none; }
.steps code, .inline-code {
  font-family: var(--font-code); background: #F3EAF7; color: #A4256B;
  padding: 2px 8px; border-radius: 7px; font-size: .88em; font-weight: 600;
}
.steps a { color: var(--pink); font-weight: 800; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s, transform .6s; }
.reveal.seen { opacity: 1; transform: none; }

/* confetti burst (tasks done) */
.confetti-bit { position: fixed; z-index: 99; pointer-events: none; font-size: 1.3rem; animation: conf-fall 1.4s ease-in forwards; }
@keyframes conf-fall { to { transform: translateY(70vh) rotate(540deg); opacity: 0; } }

/* footer */
.footer { text-align: center; color: rgba(255,255,255,.85); padding: 26px 10px 36px; position: relative; z-index: 1; font-weight: 600; }
.footer a { color: #fff; }

@media (max-width: 700px) {
  .s-cards { grid-auto-flow: row; }
  .s-ba { grid-template-columns: 1fr; }
  .s-ba .mid { transform: rotate(90deg); justify-self: center; }
  .stage { aspect-ratio: auto; min-height: 480px; }
  .slide { position: relative; inset: auto; min-height: 480px; }
  .slide:not(.on) { display: none; }
  .nav .links { margin-left: 0; }
}

/* ============================================================
   v2 — structured nav, mobile menu, modal, calendar, admin,
   fullscreen presentations
   ============================================================ */

/* ---------- nav v2 ---------- */
.nav { gap: 8px; }
.nav .nl-ic { margin-right: 5px; }
.burger {
  display: none; margin-left: auto;
  background: none; border: none; cursor: pointer;
  width: 44px; height: 44px; border-radius: 12px;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.burger span { display: block; width: 22px; height: 3px; border-radius: 3px; background: var(--ink); transition: all .25s; }
.burger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.mobile-menu { display: none; }
.admin-link { font-size: 1.05rem; }

.admin-banner {
  position: relative; z-index: 40;
  max-width: 1060px; margin: -16px auto 20px;
  background: var(--ink); color: #fff;
  border-radius: 14px; padding: 10px 18px;
  font-weight: 700; font-size: .9rem;
  box-shadow: var(--shadow);
}
.admin-banner a { color: var(--pink-soft); }

@media (max-width: 860px) {
  .desktop-links { display: none !important; }
  .burger { display: flex; }
  .mobile-menu {
    display: block; width: 100%;
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .mobile-menu.open { max-height: 480px; }
  .mobile-menu .nl {
    display: flex; align-items: center;
    padding: 12px 14px; font-size: 1rem; border-radius: 14px;
  }
  .mobile-menu .mm-group {
    font-size: .7rem; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase;
    color: var(--pink); padding: 12px 14px 2px;
  }
  .nav { border-radius: 24px; }
}

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(32, 12, 56, .72);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 18px 10px; overflow-y: auto;
  animation: fade-in .2s ease;
}
@keyframes fade-in { from { opacity: 0; } }
.modal {
  background: #fff; border-radius: 24px;
  max-width: 680px; width: 100%;
  padding: 26px; margin: auto 0;
  box-shadow: 0 24px 70px rgba(0,0,0,.4);
  position: relative;
  animation: pop-in .25s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes pop-in { from { transform: scale(.92) translateY(14px); opacity: 0; } }
.modal-x {
  position: absolute; top: 14px; right: 14px;
  background: #F3EAF7; border: none; cursor: pointer;
  width: 38px; height: 38px; border-radius: 50%;
  font-size: 1rem; font-weight: 800; color: var(--ink);
}
.modal-head h2 { margin: 8px 0 4px; }

.flow-list { margin-top: 14px; }
.flow-stage { border-left: 4px solid var(--pink-soft); padding: 0 0 16px 16px; position: relative; }
.flow-stage:last-child { padding-bottom: 0; }
.flow-tasks { border-left-color: var(--mint); }
.flow-tasks .fs-body { background: #F3FBF7; border-radius: 14px; padding: 10px 12px; }
.flow-tasks .check-list { margin-top: 6px; }
.flow-stage::before {
  content: ""; position: absolute; left: -9px; top: 4px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--pink); box-shadow: 0 0 0 4px rgba(216,52,116,.18);
}
.fs-head { display: flex; align-items: center; gap: 9px; }
.fs-head h3 { margin: 0; font-size: 1.02rem; }
.fs-ic { font-size: 1.2rem; }
.fs-min { margin-left: auto; font-weight: 800; color: var(--pink); font-size: .85rem; white-space: nowrap; }
.fs-body { padding: 4px 0 0 30px; font-size: .93rem; line-height: 1.55; }
.fs-body .muted { font-size: .85rem; margin-top: 4px; }
.flow-sources { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.flow-sources a {
  background: #F3EAF7; color: var(--ink); text-decoration: none;
  font-weight: 700; font-size: .8rem; padding: 6px 12px; border-radius: 999px;
}
.flow-sources a:hover { background: var(--pink); color: #fff; }
.flow-start {
  margin-top: 10px; background: rgba(47,179,128,.1);
  border-left: 4px solid var(--mint); border-radius: 10px;
  padding: 10px 14px; font-size: .9rem;
}

/* ---------- locked cards ---------- */
.lesson-card.locked { opacity: .92; }
.lesson-card.locked .emoji { filter: grayscale(1); }
.locked-pill {
  display: inline-block; background: var(--ink); color: #fff;
  font-size: .72rem; font-weight: 800; letter-spacing: 1px;
  padding: 4px 11px; border-radius: 999px;
}
.admin-locked-pill { background: var(--orange); }
.lock-screen { text-align: center; padding: 60px 20px; }
.lock-screen .big-lock { font-size: 4rem; animation: bounce-soft 2.4s infinite; display: inline-block; }

/* ---------- calendar ---------- */
.cal-month { margin-bottom: 26px; }
.cal-month h2 {
  color: #fff; display: flex; align-items: center; gap: 10px;
  margin: 0 4px 12px;
}
.cal-month h2 .mcount { font-size: .8rem; background: rgba(255,255,255,.2); border-radius: 999px; padding: 3px 12px; }
.cal-ev {
  display: flex; gap: 14px; align-items: flex-start;
  background: #fff; border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px 18px; margin-bottom: 10px;
  text-decoration: none; color: var(--ink);
  border-left: 6px solid var(--pink);
  transition: transform .15s;
}
a.cal-ev:hover { transform: translateX(4px); }
.cal-ev.k-event { border-left-color: var(--orange); }
.cal-ev.k-off { border-left-color: #B9A8CF; opacity: .85; }
.cal-ev.k-block { border-left-color: var(--mint); }
.cal-ev.today { outline: 3px solid var(--yellow); }
.cal-ev .d {
  min-width: 56px; text-align: center;
  background: #F6EDF9; border-radius: 12px; padding: 7px 4px;
}
.cal-ev .d .dd { font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; line-height: 1; }
.cal-ev .d .dw { font-size: .68rem; font-weight: 800; color: var(--pink); text-transform: uppercase; letter-spacing: 1px; }
.cal-ev h3 { margin: 0 0 3px; font-size: 1.02rem; }
.cal-ev p { font-size: .87rem; color: var(--ink-soft); line-height: 1.5; margin: 0; }
.cal-ev .locked-pill { margin-left: 6px; vertical-align: 2px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; color: #fff; font-weight: 700; font-size: .85rem; margin: 4px 4px 20px; }
.cal-legend span::before { content: "●"; margin-right: 6px; }
.cal-legend .l-lesson::before { color: var(--pink); }
.cal-legend .l-event::before { color: var(--orange); }
.cal-legend .l-block::before { color: var(--mint); }
.cal-legend .l-off::before { color: #B9A8CF; }

/* ---------- admin ---------- */
.admin-card input[type=password], .admin-card input[type=text] {
  width: 100%; padding: 13px 16px;
  border: 2px solid #E8DCF0; border-radius: 14px;
  font-family: var(--font-code); font-size: .95rem;
  outline: none;
}
.admin-card input:focus { border-color: var(--pink); }
.admin-user { display: flex; align-items: center; gap: 14px; }
.admin-user img { width: 52px; height: 52px; border-radius: 50%; border: 3px solid var(--pink); }
.lock-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 0; border-bottom: 1.5px solid #F2E8F5;
}
.lock-row:last-child { border-bottom: none; }
.lock-row .lr-name { font-weight: 700; flex: 1; }
.lock-row .lr-date { color: var(--ink-soft); font-size: .85rem; }
.switch { position: relative; width: 56px; height: 30px; flex-shrink: 0; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .sl {
  position: absolute; inset: 0; border-radius: 999px;
  background: #CBB8DD; transition: .25s;
}
.switch .sl::before {
  content: "🔒"; font-size: .75rem; line-height: 24px; text-align: center;
  position: absolute; width: 24px; height: 24px; left: 3px; top: 3px;
  border-radius: 50%; background: #fff; transition: .25s;
}
.switch input:checked + .sl { background: var(--mint); }
.switch input:checked + .sl::before { transform: translateX(26px); content: "🔓"; }
.switch input:disabled + .sl { opacity: .5; cursor: wait; }
.admin-status { font-weight: 700; font-size: .88rem; margin-top: 10px; min-height: 22px; }
.admin-status.ok { color: var(--mint); }
.admin-status.err { color: var(--red); }

/* ---------- presentation: mobile + fullscreen ---------- */
.stage-tools {
  display: flex; justify-content: flex-end; gap: 8px;
  margin: 0 0 10px;
}
.stage-tools .btn.small { display: inline-flex; align-items: center; gap: 7px; }

@media (max-width: 700px) {
  .stage { aspect-ratio: auto; min-height: 76dvh; }
  .slide { position: absolute; inset: 0; min-height: 0; overflow-y: auto; }
  .slide .s-body { justify-content: flex-start; padding-top: 6px; }
  .s-lines li { font-size: 1.02rem; }
  .s-card p { font-size: .9rem; }
  .slide.k-title h1, .slide.k-section h1 { font-size: 1.7rem; }
  .wrap { padding-bottom: 50px; }
}

/* fullscreen presentation */
.stage-wrap:fullscreen { background: #241436; padding: 0; max-width: none; display: flex; flex-direction: column; justify-content: center; }
.stage-wrap:fullscreen .stage { border-radius: 0; aspect-ratio: auto; flex: 1; min-height: 0; }
.stage-wrap:fullscreen .slide { overflow-y: auto; }
.stage-wrap:fullscreen .stage-tools { display: none; }
.stage-wrap:fullscreen .slide-controls { margin: 8px 0; }
.stage-wrap:fullscreen .lesson-tip { display: none; }
.stage-wrap:fullscreen .slide .s-title { font-size: clamp(1.6rem, 3.2vw, 2.6rem); }
.stage-wrap:fullscreen .s-lines li { font-size: clamp(1.05rem, 2.2vw, 1.5rem); }
.stage-wrap:fullscreen .s-card p { font-size: clamp(.9rem, 1.8vw, 1.2rem); }
.stage-wrap:fullscreen .s-note { font-size: clamp(.95rem, 1.9vw, 1.25rem); }
.stage-wrap:fullscreen .s-rows td { font-size: clamp(.85rem, 1.7vw, 1.15rem); }
.stage-wrap:fullscreen .s-code { font-size: clamp(.8rem, 1.6vw, 1.1rem); }

/* ---------- tokenizer widget + free-tier warning ---------- */
.tok-box input[type=text] {
  flex: 1; min-width: 200px;
  padding: 12px 16px; border: 2px solid #E8DCF0; border-radius: 14px;
  font-family: var(--font-code); font-size: .9rem; outline: none;
}
.tok-box input[type=text]:focus { border-color: var(--pink); }
.tok-area { display: flex; flex-wrap: wrap; gap: 6px; min-height: 44px; padding: 6px 0; }
.tok-chip {
  color: #fff; font-family: var(--font-code); font-weight: 700; font-size: .85rem;
  padding: 5px 9px; border-radius: 9px;
  opacity: 0; transform: scale(.4) rotate(-8deg);
  animation: chip-pop .35s cubic-bezier(.2,.9,.3,1.4) forwards;
}
@keyframes chip-pop { to { opacity: 1; transform: none; } }
.tok-count { font-size: 1.05rem; margin-top: 8px; min-height: 26px; }
.cost-rows { margin-top: 8px; }
.cost-row {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 8px 12px; border-radius: 10px; margin-bottom: 6px;
  background: #F8F2FA; font-size: .9rem;
  opacity: 0; transform: translateX(-14px);
  animation: row-in .4s ease forwards;
}
.cost-row b { color: var(--pink); white-space: nowrap; }
.cost-row.total { background: rgba(216,52,116,.1); font-weight: 700; }
@keyframes row-in { to { opacity: 1; transform: none; } }

.free-tier-warning {
  margin-top: 18px; border: 3px solid var(--red);
  background: rgba(224,79,95,.06); border-radius: 18px; padding: 18px 20px;
}
.free-tier-warning h3 { color: var(--red); margin-bottom: 8px; }

/* ---------- official AliceCode logo ---------- */
.logo-img { height: 38px; width: auto; display: block; }
.hero-logo { width: min(340px, 72vw); height: auto; margin: 0 auto 6px; display: block; filter: drop-shadow(0 4px 14px rgba(0,0,0,.18)); }
@media (max-width: 860px) { .logo-img { height: 32px; } }

/* ---------- visual slots (Upgrade B) ---------- */
.s-visual { text-align: center; }
.s-visual img { max-height: 34vh; max-width: 70%; border-radius: 14px; box-shadow: 0 6px 20px rgba(43,16,74,.18); }
.s-visual.missing img { display: none; }
/* a loaded picture takes only the space the text leaves, so nothing spills off the card */
.s-body.vis-top > .s-visual:not(.missing) { flex: 1 1 0; min-height: 70px; display: flex; justify-content: center; }
.s-body.vis-top > .s-visual:not(.missing) img { height: 100%; max-height: none; max-width: 100%; width: auto; object-fit: contain; }
.s-body.vis-top > :not(.s-visual) { flex: none; }
.s-body.vis-row { flex-direction: column; }
.s-body.vis-row .s-col { display: flex; flex-direction: column; gap: clamp(8px, 1.6vw, 16px); }
.s-body.vis-row:has(> .s-visual:not(.missing)) {
  display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: clamp(12px, 2.4vw, 28px); min-height: 0;
}
.s-body.vis-row > .s-visual:not(.missing) { min-height: 0; height: 100%; display: flex; align-items: center; justify-content: center; }
.s-body.vis-row > .s-visual:not(.missing) img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
@media (max-width: 700px) {
  .s-body.vis-top > .s-visual:not(.missing) { flex: none; }
  .s-body.vis-top > .s-visual:not(.missing) img { height: auto; max-height: 28vh; }
  .s-body.vis-row:has(> .s-visual:not(.missing)) { grid-template-columns: 1fr; }
  .s-body.vis-row > .s-visual:not(.missing) img { max-height: 28vh; }
}
.s-visual:not(.missing) .s-vis-ph, .s-visual:not(.missing) .s-vis-chip { display: none; }
.s-vis-ph {
  border: 2.5px dashed var(--pink-soft); border-radius: 14px;
  padding: 12px 16px; text-align: left;
  background: #FDF7FB; font-size: .78rem; line-height: 1.5;
}
.s-vis-ph b { color: var(--pink); display: block; margin-bottom: 4px; }
.s-vis-ph span { color: var(--ink-soft); display: block; }
.s-vis-ph i { color: var(--ink); display: block; margin-top: 6px; font-style: normal; font-weight: 700; }
.s-vis-ph code { background: #F3EAF7; padding: 1px 6px; border-radius: 6px; }
.s-vis-chip {
  display: inline-block; background: #F6EDF9; color: var(--ink-soft);
  border-radius: 999px; padding: 5px 14px; font-size: .78rem; font-weight: 700;
}

/* ---------- Button Lab (Upgrade C) ---------- */
.lab-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.lab-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-height: 340px; }
.lab-editor-wrap { display: flex; flex-direction: column; }
.lab-code { flex: 1; position: relative; min-height: 300px; }
.lab-editor, .lab-hl {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  border: none; outline: none; resize: none;
  background: #241436; color: #EDE4FA;
  font-family: var(--font-code); font-size: .82rem; line-height: 1.55;
  padding: 14px; white-space: pre; overflow: auto; tab-size: 2;
}
.lab-preview-wrap {
  border: 2.5px solid var(--pink-soft); border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column; background: #fff;
}
.lab-preview-bar { background: #F6EDF9; font-weight: 800; font-size: .78rem; padding: 7px 12px; color: var(--ink-soft); }
.lab-preview { flex: 1; border: none; width: 100%; min-height: 300px; background: #fff; }
@media (max-width: 760px) { .lab-split { grid-template-columns: 1fr; } }

/* ---------- Lab inside the deck ---------- */
.slide.k-lab { padding: clamp(14px, 2.5vw, 28px); }
.slide.k-lab .s-title { text-align: center; }
.slide.k-lab .s-lead { text-align: center; }
.slide.k-lab .lab-embed { flex: 1; display: flex; flex-direction: column; min-height: 0; margin-top: 8px; }
.slide.k-lab .lab-buttons { justify-content: center; margin-bottom: 8px; }
.slide.k-lab .lab-split { flex: 1; min-height: 0; }
.slide.k-lab .lab-code { min-height: 0; }
.slide.k-lab .lab-editor, .slide.k-lab .lab-hl { font-size: clamp(.68rem, 1.3vw, .85rem); }
.slide.k-lab .lab-preview { min-height: 0; }
.slide.k-lab .lab-buttons .btn.small { font-size: clamp(.68rem, 1.3vw, .9rem); padding: 7px 13px; }
@media (max-width: 700px) {
  .slide.k-lab .lab-split { min-height: 420px; }
}

/* ---------- Lab "juice" (lesson 1 first; see SLIDE-UPGRADE-RULES.md) ---------- */
.lab-host { position: relative; }
.lab-icon { box-shadow: none; border-color: var(--pink); color: var(--pink); }
.lab-juice .lab-buttons .btn.on { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--pink), 0 8px 20px rgba(216,52,116,.45); }
.lab-yt-btn { background: linear-gradient(135deg, #FFB347, #F2842C); box-shadow: 0 6px 18px rgba(242,132,44,.4); }

/* highlight layer sits under a transparent textarea */
.lab-juice .lab-hl { overflow: hidden; pointer-events: none; transition: background .4s, color .4s; }
.lab-juice .lab-editor { background: transparent; color: transparent; -webkit-text-fill-color: transparent; caret-color: #FF79A8; z-index: 1; }
.lab-juice .lab-editor::selection { background: rgba(255,121,168,.35); }
.tk-com { color: #8E7BB0; font-style: italic; }
.tk-tag { color: #FF79A8; }
.tk-sel { color: #FFD166; font-weight: 700; }
.tk-prop { color: #7FE3FF; }
.tk-num { color: #FFB86C; }
.tk-hex { color: #9FF0C8; }
.tk-prop.lit, .tk-sel.lit {
  color: #fff; background: rgba(255,121,168,.35); border-radius: 4px;
  box-shadow: 0 0 0 2px rgba(255,121,168,.6), 0 0 14px rgba(255,121,168,.8);
  animation: lab-glow 1.2s ease-in-out infinite;
}
@keyframes lab-glow { 50% { box-shadow: 0 0 0 2px rgba(255,121,168,.9), 0 0 22px rgba(255,121,168,1); } }

/* BEFORE = dull gray editor; AFTER = colors pop + neon frame */
.lab-editor-wrap { transition: box-shadow .4s, filter .4s; }
.lab-editor-wrap.dull { filter: grayscale(1); }
.lab-editor-wrap.dull .lab-hl { background: #34323A; color: #9C9AA3; }
.lab-editor-wrap.dull .lab-hl span { color: inherit; font-weight: 400; font-style: normal; }
.lab-editor-wrap.dull .term-bar { background: #45434B; }
.lab-editor-wrap.vivid { box-shadow: 0 0 0 2.5px #FF79A8, 0 0 26px rgba(255,121,168,.55), var(--shadow); }
.lab-editor-wrap.vivid .lab-hl { background: #1E0F30; }
.lab-preview-wrap { transition: border-color .4s, filter .4s; }
.lab-preview-wrap.dull { border-color: #C9C6CF; }
.lab-preview-wrap.pop { animation: lab-pop .6s ease; }
@keyframes lab-pop { 40% { transform: scale(1.03); box-shadow: 0 0 30px rgba(255,154,158,.8); } }

/* prompt bubble */
.lab-bubble {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  background: #F6EDF9; border-radius: 16px 16px 16px 4px;
  padding: 8px 14px; margin-bottom: 10px;
  font-weight: 700; font-size: clamp(.72rem, 1.4vw, .95rem); color: var(--ink);
  transition: background .3s;
}
.lab-bubble .who { font-size: .72em; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--pink); white-space: nowrap; }
.lab-bubble .dim { opacity: .65; }
.lab-bubble.b-vague { background: #ECEBEF; color: #77757E; }
.lab-bubble.b-vague .who { color: #77757E; }
.lab-bubble.b-explicit, .lab-bubble.b-yourturn { background: #241436; color: #EDE4FA; }
.lab-bubble .kw {
  font-family: var(--font-code); font-weight: 800; color: #FF79A8; cursor: pointer;
  text-shadow: 0 0 8px rgba(255,121,168,.85); border-radius: 4px; padding: 0 2px; outline: none;
  transition: background .2s, color .2s;
}
.lab-bubble .kw:nth-of-type(3n+2) { color: #7FE3FF; text-shadow: 0 0 8px rgba(127,227,255,.85); }
.lab-bubble .kw:nth-of-type(3n) { color: #C8FF6B; text-shadow: 0 0 8px rgba(200,255,107,.8); }
.lab-bubble .kw.lit, .lab-bubble .kw:hover, .lab-bubble .kw:focus { background: rgba(255,255,255,.14); color: #fff; }
.yt-input {
  flex: 1; min-width: 180px; padding: 6px 10px; border-radius: 10px; border: 2px dashed #FFB347;
  background: transparent; color: #fff; font: inherit; outline: none;
}
.yt-input::placeholder { color: #B9A7D3; }
.lab-bubble .yt-run { padding: 6px 14px; font-size: .9em; background: linear-gradient(135deg, #2FB380, #0E7C5B); box-shadow: 0 4px 12px rgba(47,179,128,.45); }
.yt-msg { width: 100%; color: #FFD166; font-weight: 700; font-size: .9em; }
.yt-msg:empty { display: none; }
.yt-words { display: flex; gap: 6px; flex-wrap: wrap; }
.yt-chip {
  font-family: var(--font-code); font-size: .85em; padding: 2px 9px; border-radius: 999px;
  border: 1.5px solid #6B5590; color: #B9A7D3; transition: all .25s;
}
.yt-chip.said { color: #FFB347; border-color: #FFB347; text-shadow: 0 0 8px rgba(255,179,71,.8); }
.yt-chip.done { color: #241436; background: #9FF0C8; border-color: #9FF0C8; text-shadow: none; }
.yt-chip.done::before { content: "✓ "; }
.yt-win { width: 100%; color: #9FF0C8; font-weight: 800; animation: pop-in .4s ease; }

/* arrow from prompt keyword to the CSS line */
.lab-arrow { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; overflow: visible; opacity: 0; transition: opacity .3s; }
.lab-arrow.on { opacity: 1; }
.lab-arrow-path { fill: none; stroke: #FF79A8; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 7 6; filter: drop-shadow(0 0 4px rgba(255,121,168,.9)); animation: lab-dash 1s linear infinite; }
.lab-arrow marker path { fill: #FF79A8; }
@keyframes lab-dash { to { stroke-dashoffset: -13; } }

/* sparkle burst */
.lab-spark {
  position: absolute; z-index: 4; pointer-events: none; font-size: 18px;
  transform: translate(-50%, -50%); animation: lab-spark .85s ease-out forwards;
}
@keyframes lab-spark {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(.4); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.2) rotate(90deg); }
}
@media (prefers-reduced-motion: reduce) {
  .tk-prop.lit, .tk-sel.lit, .lab-arrow-path, .lab-preview-wrap.pop { animation: none; }
}

/* ============================================================
   v3 — official AliceCode template applied to the WEB slides
   (same backgrounds as the PPTX export)
   ============================================================ */

/* content slides: the template frame + white card IS the background */
.stage {
  background: #fff url("tpl-content.png") center / 100% 100% no-repeat;
}
.slide {
  /* keep text inside the white card of the background image */
  padding: 7.5% 7% 9%;
}
.slide .s-title { text-align: center; }
.slide .s-lead { text-align: center; }

/* template lavender boxes for text lines */
.s-lines {
  background: #E5DBFD;
  border-radius: 16px;
  padding: clamp(10px, 1.6vw, 18px) clamp(14px, 2vw, 24px);
}
.s-lines li { color: #43317E; }
.s-lines li::before { color: var(--pink); }

/* template-style cards: lavender fill, colored headers */
.s-card {
  background: #E5DBFD;
  border: none;
}
.s-card p { color: #43317E; }

/* new-word meaning gets the lavender treatment */
.s-newword .nw-meaning {
  background: #E5DBFD; color: #43317E;
  border-radius: 14px; padding: 12px 22px;
}

/* title + section slides: template gradient + the white badge */
.slide.k-title, .slide.k-section {
  background: url("tpl-title.jpg") center / cover no-repeat;
  padding: clamp(18px, 4vw, 48px);
}
.slide.k-title::after, .slide.k-section::after {
  content: "";
  position: absolute; top: 4.5%; right: 3%;
  width: clamp(96px, 13%, 150px); height: clamp(30px, 8%, 46px);
  background: #fff url("https://alicecode.org/__l5e/assets-v1/91e0a7b0-8b4c-4879-817f-ca5d41c350df/alicecode-logo.png") center / 78% auto no-repeat;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

/* before/after panels: match the template two-column look */
.s-ba .after { background: #E5DBFD; }
.s-ba .col p { color: #43317E; }

/* lab slides sit on the card too — keep their own padding */
.slide.k-lab { padding: 6.5% 6.5% 8.5%; }

/* mobile: tall stage would warp the frame image — fall back to plain card */
@media (max-width: 700px) {
  .stage { background: #fff; }
  .slide { padding: clamp(18px, 4vw, 48px); }
}
/* fullscreen keeps the frame (stage is ~16:9 there) */
.stage-wrap:fullscreen .stage {
  background: #fff url("tpl-content.png") center / 100% 100% no-repeat;
}

/* ============================================================
   Live slide demos (demos.js) — Part 2 upgrades
   ============================================================ */
.slide.k-demo { padding: 6.5% 6% 7.5%; }
.slide.k-demo .demo-embed { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; margin-top: 6px; position: relative; font-size: clamp(.62rem, 1.25vw, .9rem); }
.demo-embed .btn.small { font-size: clamp(.66rem, 1.25vw, .88rem); padding: 6px 13px; }
.demo-embed .terminal { display: flex; flex-direction: column; min-height: 0; font-size: inherit; }
.demo-embed .term-bar { padding: 6px 10px; }
.demo-embed .term-bar .title { font-size: .85em; }
.j-key { color: #7FE3FF; } .j-str { color: #9FF0C8; } .j-num { color: #FFB86C; } .j-dim { color: #8E7BB0; }
.c-kw { color: #FF79A8; } .c-fn { color: #FFD166; } .c-str { color: #9FF0C8; } .c-com { color: #8E7BB0; font-style: italic; }

/* A · chat vs agent race */
.race { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.race-side { border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.race-chat { background: #ECEBEF; border: 2px solid #D5D3DA; filter: saturate(.6); }
.race-head { display: flex; justify-content: space-between; padding: 6px 12px; font-weight: 800; color: #5F5D66; background: #DEDCE3; }
.race-clock { font-family: var(--font-code); color: var(--red); }
.race-screen { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1.3fr 1fr; gap: 8px; padding: 8px; }
.rz { background: #fff; border-radius: 10px; padding: 6px 8px; border: 2px solid transparent; transition: border-color .3s; overflow: hidden; color: #55535C; }
.rz b { display: block; font-size: .85em; color: #8A8891; margin-bottom: 3px; }
.rz.on { border-color: #A9A6B3; }
.rz-chat { grid-column: 1 / 3; }
.rz-msg { font-size: .9em; line-height: 1.35; }
.race-cursor { position: absolute; width: 22px; height: 22px; left: 50%; top: 30%; z-index: 2; transition: left .9s ease-in-out, top .9s ease-in-out; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.race-cursor path { fill: #fff; stroke: #222; stroke-width: 1.6; stroke-linejoin: round; }
.race-toast { position: absolute; right: 10px; bottom: 10px; background: #3B3A40; color: #fff; padding: 4px 10px; border-radius: 8px; font-weight: 700; opacity: 0; }
.race-toast.pop { animation: race-toast 1.2s ease; }
@keyframes race-toast { 15%, 75% { opacity: 1; transform: translateY(-4px); } 100% { opacity: 0; } }
.race-cap { padding: 6px 12px; font-weight: 700; color: #6B6973; background: #E4E2E8; min-height: 2.4em; }
.race-agent { box-shadow: 0 0 0 2px #2FB380, var(--shadow); transition: box-shadow .4s; }
.race-agent.won { box-shadow: 0 0 0 3px #2FB380, 0 0 28px rgba(47,179,128,.7); }
.race-term { flex: 1; min-height: 0; margin: 0; padding: 10px 12px; overflow: auto; color: #EDE4FA; font-family: var(--font-code); font-size: .92em; line-height: 1.6; white-space: pre-wrap; }
.t-dim { color: #8E7BB0; } .t-run { color: #FFD166; } .t-ok { color: #9FF0C8; } .t-done { color: #fff; font-weight: 700; text-shadow: 0 0 10px #2FB380; }
.race-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; font-weight: 700; }
.race-score .bad { color: var(--red); } .race-score .good { color: var(--mint); }

/* B · TikTok Studio loop */
.sl-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr) auto minmax(0,1fr); gap: 8px; align-items: stretch; cursor: pointer; }
.sl-col { display: flex; flex-direction: column; min-height: 0; }
.sl-head { text-align: center; font-family: var(--font-head); font-weight: 800; color: #B9AFC9; transition: color .3s; margin-bottom: 4px; }
.sl-head small { display: block; font-family: var(--font-body); font-weight: 700; font-size: .75em; }
.sl-col.on .sl-head { color: var(--ink); } .sl-col.now .sl-head { color: var(--pink); }
.sl-box { flex: 1; min-height: 0; border: 2.5px dashed #E1D7EE; border-radius: 16px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; background: #FBF8FE; }
.sl-col.on .sl-box { border-style: solid; border-color: var(--pink-soft); }
.sl-empty { font-size: 2.4em; font-weight: 800; color: #E1D7EE; }
.sl-col.on .sl-empty { display: none; }
.sl-json, .sl-brain, .sl-phone { display: none; }
.sl-col.on .sl-json { display: block; max-width: 94%; overflow: hidden; }
.sl-col.on .sl-brain, .sl-col.on .sl-phone { display: flex; }
.sl-json { margin: 0; background: #241436; color: #EDE4FA; border-radius: 12px; padding: 10px 12px; font-family: var(--font-code); font-size: .9em; line-height: 1.5; white-space: pre; animation: sl-drop .6s cubic-bezier(.3,1.6,.5,1); }
.sl-hot { background: rgba(255,121,168,.25); border-radius: 4px; box-shadow: 0 0 10px rgba(255,121,168,.6); }
@keyframes sl-drop { from { transform: translateY(-120%); opacity: 0; } }
.sl-brain { flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 14px 8px 8px; width: 100%; height: 100%; overflow: hidden; }
.sl-robot { font-size: 2.6em; position: relative; animation: sl-bob 1s ease-in-out infinite; }
.sl-think { position: absolute; right: -.7em; top: -.5em; font-size: .5em; animation: sparkle 1.2s ease-in-out infinite; }
@keyframes sl-bob { 50% { transform: translateY(-6px) rotate(-4deg); } }
.sl-typing { font-family: var(--font-code); font-size: .85em; color: var(--ink); width: 100%; }
.sl-typing div:first-child { color: var(--pink); font-weight: 700; text-align: center; margin-bottom: 4px; }
.sl-phone { flex-direction: column; height: 96%; aspect-ratio: 9 / 16; max-width: 92%; background: #111; border-radius: 18px; border: 4px solid #222; position: relative; overflow: hidden; animation: pop-in .5s cubic-bezier(.3,1.5,.5,1); }
.sl-art { flex: 1; background: linear-gradient(160deg, #B5FFFC, #FFDEE9 45%, #D3A4FF); position: relative; display: flex; align-items: center; justify-content: center; }
.sl-art b { font-family: var(--font-head); font-size: 2.2em; color: #fff; text-shadow: 2px 2px 0 #FF4FA3, 4px 4px 0 #7A5CFF; transform: rotate(-8deg); }
.sl-art span { position: absolute; font-size: 1.3em; animation: sl-bob 1.6s ease-in-out infinite; }
.sl-art .a1 { left: 10%; top: 12%; } .sl-art .a2 { right: 12%; top: 22%; animation-delay: .3s; } .sl-art .a3 { left: 16%; bottom: 30%; animation-delay: .6s; } .sl-art .a4 { right: 18%; bottom: 36%; animation-delay: .9s; }
.sl-side { position: absolute; right: 5px; bottom: 26%; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: .9em; }
.sl-side small { color: #fff; font-size: .7em; font-weight: 700; margin-bottom: 4px; }
.sl-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 8px; color: #fff; font-size: .72em; line-height: 1.3; background: linear-gradient(transparent, rgba(0,0,0,.75)); }
.sl-arrow { align-self: center; color: var(--pink); font-weight: 800; font-size: 1.4em; animation: pulse-arrow 1.6s ease-in-out infinite; }
.sl-foot { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; font-weight: 700; }

/* C · live fetch */
.lf { flex: 1; min-height: 0; display: grid; grid-template-columns: 1.05fr 1fr; gap: 12px; }
.lf-left { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.lf-form { display: flex; gap: 8px; }
.lf-input { flex: 1; min-width: 0; padding: 7px 12px; border: 2.5px solid var(--pink-soft); border-radius: 12px; font: 700 1em var(--font-code); color: var(--ink); outline: none; }
.lf-input:focus { border-color: var(--pink); }
.lf-chips { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; font-weight: 700; color: var(--ink-soft); font-size: .9em; }
.lf-chip { border: 1.5px solid var(--pink-soft); background: #fff; color: var(--pink); border-radius: 999px; padding: 1px 9px; font: 700 .95em var(--font-code); cursor: pointer; }
.lf-chip:hover { background: var(--pink); color: #fff; }
.lf-code { margin: 0; background: #241436; color: #EDE4FA; border-radius: 14px; padding: 10px 12px; font-family: var(--font-code); font-size: .82em; line-height: 1.6; white-space: pre-wrap; word-break: break-all; }
.lf-name { color: #fff; background: rgba(255,121,168,.35); border-radius: 4px; padding: 0 2px; }
.lf-log { border-radius: 4px; transition: box-shadow .3s, background .3s; }
.lf-log.lit { background: rgba(255,209,102,.18); box-shadow: 0 0 0 2px rgba(255,209,102,.7), 0 0 12px rgba(255,209,102,.6); }
.lf-log b, .j-hot { color: #FFD166; }
.j-hot { text-shadow: 0 0 8px rgba(255,209,102,.8); }
.lf-postman { background: #FFF3EA; border-left: 4px solid #FF6C37; border-radius: 10px; padding: 6px 10px; font-weight: 700; color: var(--ink); }
.lf-postman b { color: #FF6C37; }
.lf-out { flex: 1; min-height: 0; overflow: auto; padding: 10px 12px; color: #EDE4FA; }
.lf-hint { text-align: center; margin-top: 18%; line-height: 1.6; color: #C9B6E4; font-family: var(--font-body); font-weight: 700; }
.lf-card { display: flex; gap: 10px; align-items: center; font-family: var(--font-body); margin-bottom: 6px; animation: pop-in .4s ease; }
.lf-card img { width: 4.6em; height: 4.6em; object-fit: contain; background: rgba(255,255,255,.08); border-radius: 12px; }
.lf-pname { font-family: var(--font-head); font-size: 1.3em; text-transform: capitalize; color: #fff; }
.lf-id { color: #8E7BB0; font-weight: 700; }
.lf-type { display: inline-block; background: var(--pink); color: #fff; border-radius: 999px; padding: 0 8px; margin: 2px 4px 2px 0; font-size: .8em; font-weight: 800; }
.lf-ab { color: #FFD166; font-size: .85em; font-weight: 700; }
.lf-json { margin: 0; font-family: var(--font-code); font-size: .82em; line-height: 1.45; white-space: pre; }
.lf-more { color: #8E7BB0; font-size: .78em; margin-top: 6px; font-family: var(--font-body); font-weight: 700; }

/* D · Variables vs. Database (React page in a frame) */
.demo-frame { flex: 1; min-height: 0; width: 100%; border: 0; background: transparent; }

/* C+ · tools of the trade: Postman mock + JSON auto-format */
.tt { flex: 1; min-height: 0; display: grid; grid-template-columns: 1.1fr 1fr; gap: 12px; }
.tt-pm { display: flex; flex-direction: column; min-height: 0; background: #fff; border: 2px solid #F0E3DA; border-radius: 16px; overflow: hidden; }
.pm-top { display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: #FFF3EA; color: #FF6C37; }
.pm-tab { background: #fff; color: #555; border-radius: 6px 6px 0 0; padding: 2px 10px; font-size: .85em; font-weight: 700; border-bottom: 2px solid #FF6C37; }
.pm-req { display: flex; gap: 6px; padding: 8px 10px; align-items: center; }
.pm-method { color: #0CBB52; font: 800 .9em var(--font-code); padding: 6px 8px; background: #F2F2F2; border-radius: 6px; }
.pm-url { flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid #DDD; border-radius: 6px; font: .82em var(--font-code); color: #222; outline: none; }
.pm-url:focus { border-color: #FF6C37; }
.pm-send { border: none; background: #097BED; color: #fff; font-weight: 800; border-radius: 6px; padding: 6px 14px; cursor: pointer; }
.pm-res { flex: 1; min-height: 0; display: flex; flex-direction: column; border-top: 1px solid #EEE; }
.pm-status { padding: 5px 10px; font-size: .8em; color: #6B6B6B; }
.pm-status .ok { color: #0CBB52; } .pm-status .bad, .vf-msg .bad { color: var(--red); }
.pm-body { flex: 1; min-height: 0; margin: 0; overflow: auto; padding: 6px 10px; font: .76em/1.45 var(--font-code); color: #222; background: #FAFAFA; white-space: pre; }
.pm-body .j-key, .tj-pretty .j-key { color: #A626A4; } .pm-body .j-str, .tj-pretty .j-str { color: #50A14F; } .pm-body .j-num, .tj-pretty .j-num { color: #986801; }
.pm-same { text-align: center; font-weight: 800; color: var(--pink); font-size: .85em; padding: 3px 0; }
.pm-code { margin: 0 8px 8px; background: #241436; color: #EDE4FA; border-radius: 10px; padding: 7px 10px; font: .76em/1.5 var(--font-code); white-space: pre-wrap; word-break: break-all; }
.pm-u { color: #fff; background: rgba(255,121,168,.3); border-radius: 3px; }
.tt-json { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.tj-head { background: #F6EDF9; border-radius: 12px; padding: 7px 12px; font-weight: 700; line-height: 1.4; }
.tj-head b { color: var(--pink); }
.tj-stage { flex: 1; min-height: 0; position: relative; display: grid; grid-template-columns: 1fr; gap: 8px; }
.tj-raw { margin: 0; background: #EFEDF2; color: #6F6A78; border: 2px dashed #CFC9D6; border-radius: 12px; padding: 10px; font: .78em/1.5 var(--font-code); white-space: pre-wrap; word-break: break-all; overflow: auto; }
.tj-pretty, .tj-card { display: none; }
.tj-stage.formatted { grid-template-columns: 1fr 1fr; }
.tj-stage.formatted .tj-raw { display: none; }
.tj-stage.formatted .tj-pretty { display: block; margin: 0; background: #fff; border: 2px solid var(--pink-soft); border-radius: 12px; padding: 8px 10px; font: .72em/1.45 var(--font-code); white-space: pre; overflow: auto; animation: pop-in .35s ease; }
.tj-stage.formatted .tj-card { display: block; background: linear-gradient(160deg, #FFF0F6, #F3EAFD); border: 2px solid var(--pink); border-radius: 14px; padding: 8px 12px; overflow: auto; animation: pop-in .45s cubic-bezier(.3,1.5,.5,1); font-size: .85em; }
.tj-emoji { font-size: 2em; line-height: 1; }
.tj-card h4 { color: var(--ink); font-family: var(--font-head); font-size: 1.25em; margin: 2px 0; }
.tj-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 4px; }
.tj-chips span { background: #fff; border-radius: 999px; padding: 1px 8px; font-weight: 800; color: var(--pink); font-size: .9em; }
.tj-card b { color: var(--ink-soft); font-size: .9em; }
.tj-card ul, .tj-card ol { margin: 0 0 4px 18px; line-height: 1.4; }
.tj-btn { align-self: center; }

/* D+ · live database exercise */
.ex { flex: 1; min-height: 0; display: grid; grid-template-columns: 1.15fr 1fr; gap: 12px; }
.ex-left { display: flex; flex-direction: column; min-height: 0; gap: 6px; }
.ex-tabs { display: flex; gap: 6px; }
.ex-tab { flex: 1; border: 2px solid var(--pink-soft); background: #fff; color: var(--ink); border-radius: 12px; padding: 6px 4px; font: 800 .95em var(--font-head); cursor: pointer; }
.ex-tab.on { background: var(--pink); border-color: var(--pink); color: #fff; box-shadow: 0 4px 12px rgba(216,52,116,.35); }
.ex-panel { display: none; flex: 1; min-height: 0; overflow: auto; background: #FBF8FE; border-radius: 14px; padding: 8px 12px; line-height: 1.45; }
.ex-panel.on { display: block; animation: pop-in .25s ease; }
.ex-panel p { margin: 4px 0; font-weight: 600; }
.ex-panel code, .vf-steps code { background: #F3EAF7; border-radius: 5px; padding: 0 5px; font: .9em var(--font-code); color: var(--ink); }
.ex-code { position: relative; background: #241436; border-radius: 10px; margin: 4px 0 6px; }
.ex-code pre { margin: 0; padding: 8px 76px 8px 10px; color: #9FF0C8; font: .82em/1.5 var(--font-code); white-space: pre-wrap; word-break: break-all; }
.ex-file { display: block; padding: 4px 10px 0; color: #8E7BB0; font: 700 .72em var(--font-code); }
.ex-copy { position: absolute; top: 4px; right: 6px; border: none; background: rgba(255,255,255,.12); color: #EDE4FA; border-radius: 6px; padding: 1px 7px; font: 700 .72em var(--font-body); cursor: pointer; }
.ex-copy:hover { background: var(--pink); }
.ex-small { font-size: .85em; }
.ex-small a { color: var(--pink); font-weight: 800; }
.ex-list { margin: 4px 0 0 20px; font-weight: 600; line-height: 1.6; }
kbd { background: #fff; border: 1px solid #CFC9D6; border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; font: 700 .85em var(--font-code); }
.ex-right { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.ex-vid-head { display: flex; justify-content: space-between; align-items: center; font-weight: 800; color: var(--ink); }
.ex-replay { border: 1.5px solid var(--pink-soft); background: #fff; color: var(--pink); border-radius: 999px; padding: 1px 10px; font: 800 .85em var(--font-body); cursor: pointer; }
.ex-term { flex: 0 0 38%; min-height: 0; }
.ex-term-body { flex: 1; min-height: 0; margin: 0; padding: 6px 10px; overflow: hidden; color: #EDE4FA; font: .74em/1.5 var(--font-code); white-space: pre-wrap; }
.ex-browser { flex: 1; min-height: 0; display: flex; flex-direction: column; border: 2px solid #E1D7EE; border-radius: 12px; overflow: hidden; }
.ex-url { background: #F1EEF5; padding: 3px 10px; font: .75em var(--font-code); color: #6B6973; display: flex; justify-content: space-between; }
.ex-page { flex: 1; min-height: 0; background: linear-gradient(160deg, #674C9B, #B43F82); padding: 8px 10px; display: flex; flex-direction: column; gap: 5px; transition: opacity .2s; }
.ex-page.reloading { opacity: .25; }
.ex-title { color: #fff; font-size: .95em; }
.ex-form { display: flex; gap: 6px; background: #fff; border-radius: 10px; padding: 4px; align-items: center; }
.ex-typing { flex: 1; min-height: 1.4em; padding: 2px 6px; font-size: .8em; color: var(--ink); border: 1.5px solid #E8DCF0; border-radius: 7px; }
.ex-typing::after { content: "|"; color: var(--pink); animation: blink 1s steps(1) infinite; }
.ex-add { background: var(--pink); color: #fff; border-radius: 999px; padding: 2px 9px; font-size: .75em; font-weight: 800; }
.ex-ideas { list-style: none; margin: 0; padding: 0; }
.ex-ideas li { background: #fff; border-radius: 9px; padding: 4px 8px; font-size: .78em; animation: pop-in .3s ease; }
.ex-ideas b { color: var(--pink); margin-right: 6px; }
.ex-badge { margin-top: auto; color: #fff; font-weight: 800; text-shadow: 0 0 10px rgba(47,179,128,.9); }
.ex-badge:empty { display: none; }

/* D++ · find it in the vault */
.vf { flex: 1; min-height: 0; display: grid; grid-template-columns: .9fr 1.2fr; gap: 14px; align-items: stretch; }
.vf-steps { margin: 0; padding: 10px 12px 10px 30px; background: #E5DBFD; border-radius: 16px; color: #43317E; font-weight: 700; line-height: 1.5; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.vf-steps a { color: var(--pink); }
.vf-steps small { color: var(--ink-soft); font-weight: 600; }
.vf-atlas { display: flex; flex-direction: column; min-height: 0; background: #fff; border: 2px solid #C1E7D0; border-radius: 16px; overflow: hidden; }
.vf-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #001E2B; color: #fff; padding: 6px 12px; }
.vf-top b { color: #00ED64; } .vf-top span { color: #C1C7C6; font-size: .85em; } .vf-top span b { color: #fff; }
.vf-mode { margin-left: auto; font-style: normal; font-size: .75em; font-weight: 800; color: #C1C7C6; }
.vf-bar { display: flex; gap: 6px; align-items: center; padding: 8px 10px; border-bottom: 1px solid #E8EDEB; }
.vf-label { font-weight: 800; color: #5C6C75; font-size: .85em; }
.vf-input { flex: 1; min-width: 0; padding: 6px 9px; border: 1.5px solid #C1C7C6; border-radius: 8px; font: .85em var(--font-code); outline: none; }
.vf-input:focus { border-color: #00684A; box-shadow: 0 0 0 2px rgba(0,237,100,.3); }
.vf-apply, .vf-reset { border: 1px solid #00684A; border-radius: 8px; padding: 5px 10px; font: 800 .82em var(--font-body); cursor: pointer; }
.vf-apply { background: #00684A; color: #fff; } .vf-reset { background: #fff; color: #00684A; }
.vf-msg { padding: 5px 12px; font-size: .75em; font-weight: 800; letter-spacing: .4px; color: #5C6C75; }
.vf-docs { flex: 1; min-height: 0; overflow: auto; padding: 0 10px 10px; display: flex; flex-direction: column; gap: 6px; }
.vf-doc { border: 1px solid #E8EDEB; border-radius: 10px; padding: 5px 10px; background: #F9FBFA; font: .76em/1.5 var(--font-code); color: #001E2B; }
.vf-doc.hit { animation: vf-hit 1s ease; border-color: #00ED64; box-shadow: 0 0 0 2px rgba(0,237,100,.5); }
@keyframes vf-hit { 0% { transform: scale(.9); opacity: 0; background: #C0FAE6; } 50% { transform: scale(1.03); opacity: 1; } }
.at-k { color: #016BF8; } .at-oid { color: #00684A; } .at-s { color: #12924F; } .at-d { color: #B45AF2; }
.vf-none { text-align: center; padding: 18px 0; color: #889397; font-weight: 700; }

/* Part 1 · ready-made database: class login + exercises + practice copy */
.rd { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1.15fr; gap: 12px; }
.rd-left { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: auto; }
.cdb { background: #001E2B; color: #E8EDEB; border-radius: 14px; padding: 8px 12px; display: flex; flex-direction: column; gap: 5px; }
.cdb-head { font-family: var(--font-head); font-weight: 800; color: #00ED64; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cdb-head span { font-family: var(--font-body); font-size: .8em; color: #C1C7C6; } .cdb-head b { color: #fff; }
.cdb-row { font-size: .85em; } .cdb-row a { color: #00ED64; font-weight: 800; } .cdb-row small { color: #889397; }
.cdb-uri { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.cdb-val { flex: 1; min-width: 0; background: rgba(255,255,255,.08); border-radius: 7px; padding: 4px 8px; font: .78em var(--font-code); color: #fff; word-break: break-all; }
.cdb-in { flex: 1; min-width: 0; padding: 5px 8px; border-radius: 7px; border: 1.5px dashed #00ED64; background: transparent; color: #fff; font: .8em var(--font-code); outline: none; }
.cdb-in::placeholder { color: #889397; }
.cdb-btn { border: none; border-radius: 7px; padding: 4px 9px; background: #00ED64; color: #001E2B; font: 800 .78em var(--font-body); cursor: pointer; }
.cdb-note { width: 100%; color: #889397; font-size: .72em; }
.rd-ex { margin: 0; padding: 8px 12px 8px 30px; background: #E5DBFD; border-radius: 14px; color: #43317E; display: flex; flex-direction: column; gap: 6px; font-weight: 600; line-height: 1.35; }
.rd-ex b { color: var(--ink); }
.rd-try { display: block; margin-top: 2px; border: 1.5px solid var(--pink-soft); background: #fff; color: var(--ink); border-radius: 8px; padding: 1px 8px; font: 700 .8em var(--font-body); cursor: pointer; text-align: left; }
.rd-try:hover { border-color: var(--pink); }
.rd-try code { font: .95em var(--font-code); color: var(--pink); }
.rd-ans details { background: #FFF8E5; border-radius: 10px; padding: 5px 10px; font-size: .82em; font-weight: 700; color: var(--ink); }
.rd-ans summary { cursor: pointer; color: #B7791F; }
.rd-atlas .vf-bar + .vf-bar { border-top: none; padding-top: 0; }

/* Part 3 · clickable resource cards */
.s-links { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(8px, 1.4vw, 14px); }
.s-link { text-decoration: none; display: flex; flex-direction: column; text-align: left; transition: transform .2s, box-shadow .2s; }
.s-link:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(103,76,155,.25); }
.s-link p { color: var(--ink); flex: 1; }
.s-link-url { margin-top: 6px; font-size: .78em; font-weight: 800; color: var(--pink); }

@media (max-width: 700px) {
  .slide.k-demo { overflow-y: auto; }
  .race, .lf, .td, .tt, .ex, .vf, .rd { grid-template-columns: 1fr; }
  .tj-stage.formatted { grid-template-columns: 1fr; }
  .ex-right { min-height: 340px; } .tt-pm { min-height: 360px; }
  .race { grid-template-rows: 260px 220px; }
  .sl-grid { grid-template-columns: 1fr; min-height: 640px; }
  .sl-arrow { transform: rotate(90deg); }
  .demo-frame { min-height: 620px; }
  .lf-right { min-height: 260px; }
  .s-links { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .sl-robot, .sl-art span, .sl-arrow, .sl-think { animation: none; }
}

/* ============================================================
   Labs carousel below the deck — every lab/demo of the lesson
   ============================================================ */
.labs-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.labs-count { display: inline-block; background: var(--pink); color: #fff; border-radius: 999px; font-size: .55em; padding: 2px 10px; vertical-align: middle; }
.labs-fs { box-shadow: none; border-color: var(--pink); color: var(--pink); }
.labs-tools { display: flex; gap: 6px; }
.labs-card.closed .labs-tools, .labs-card.closed .labs-nav, .labs-card.closed .labs-panels { display: none; }
.labs-card.closed .labs-chips { margin: 12px 0 0; justify-content: flex-start; }
.labs-card:not(.closed) .labs-hint { display: none; }
.labs-nav { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin: 14px 0 10px; }
.labs-arrow { width: 46px; height: 46px; border-radius: 50%; border: none; background: var(--pink); color: #fff; font-size: 1.6rem; font-weight: 800; line-height: 1; cursor: pointer; box-shadow: 0 6px 16px rgba(216,52,116,.4); transition: transform .15s; }
.labs-arrow:hover { transform: scale(1.1); }
.labs-now { text-align: center; min-width: 0; }
.labs-name { font-family: var(--font-head); font-weight: 800; font-size: clamp(1.15rem, 2.6vw, 1.6rem); color: var(--ink); animation: pop-in .3s ease; }
.labs-meta { font-weight: 800; font-size: .85rem; color: var(--pink); }
.labs-jump { border: none; background: none; color: var(--pink); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }
.labs-sub { color: var(--ink-soft); font-weight: 600; font-size: .92rem; margin-top: 2px; }
.labs-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 14px; }
.labs-chip { border: 2px solid var(--pink-soft); background: #fff; color: var(--ink); border-radius: 999px; padding: 4px 12px; font: 700 .8rem var(--font-body); cursor: pointer; transition: all .15s; }
.labs-chip:hover { border-color: var(--pink); }
.labs-chip.on { background: var(--pink); border-color: var(--pink); color: #fff; }
.lab-panel { display: none; }
.lab-panel.on { display: flex; flex-direction: column; height: clamp(460px, 52vw, 580px); }
.lab-panel .demo-embed { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; position: relative; font-size: clamp(.7rem, 1.1vw, .9rem); }
.lab-panel .lab-embed { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.lab-panel .lab-buttons { justify-content: center; }
.lab-panel .lab-split { flex: 1; min-height: 0; }
.lab-panel .lab-code, .lab-panel .lab-preview { min-height: 0; }
.labs-card:fullscreen { background: #fff; overflow-y: auto; padding: 24px; }
.labs-card:fullscreen .lab-panel.on { height: calc(100vh - 250px); }
@media (max-width: 700px) {
  .lab-panel.on { height: auto; min-height: 640px; }
  .lab-panel .lab-split { min-height: 420px; }
  .labs-arrow { width: 38px; height: 38px; font-size: 1.3rem; }
}
