/* ==========================================================================
   Doodle Desk — design system
   A bright, playful marketing + subscription site for the classroom suite.
   Organised as: tokens -> base -> layout -> components -> sections -> utils
   ========================================================================== */

/* ---------- 1. Tokens ---------------------------------------------------- */
:root {
  /* Crayon box: the six brand colours, used for accents everywhere */
  --grape: #7c3aed;
  --grape-deep: #5b21b6;
  --bubble: #ff4d9d;
  --bubble-deep: #db2777; /* deeper pink for white text (4.6:1 contrast) */
  --sunny: #ffc93c;
  --mint: #16c79a;
  --sky: #38bdf8;
  --coral: #ff7a5c;

  /* Surfaces */
  --ink: #1b1235;
  --bg: #fffdf8;
  --bg-tint: #f7f1ff;
  --surface: #ffffff;
  --surface-2: #faf6ff;
  --text: #241a3d;
  --muted: #6b5f86;
  --border: #ebe3f7;
  /* Outlines are a light lavender tint, not black ("clean & glossy") */
  --border-strong: #d4c6f1;
  --edge-deep: #b9a7e8;

  /* Soft, layered shadows give depth without heavy outlines */
  --pop: 0 1px 1px rgba(36, 26, 61, 0.06), 0 3px 8px rgba(36, 26, 61, 0.08);
  --pop-lg: 0 2px 3px rgba(36, 26, 61, 0.08), 0 10px 22px rgba(36, 26, 61, 0.12);
  --float: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 20px 40px -24px rgba(36, 26, 61, 0.35);
  --shine: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 60%);
  --soft: 0 18px 40px -24px rgba(27, 18, 53, 0.45);

  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  --font-display: "Fredoka", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --font-body: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --wrap: 1140px;
  --nav-h: 76px;
}

[data-theme="dark"] .blob { opacity: 0.32; }

[data-theme="dark"] {
  --bg: #14101f;
  --bg-tint: #1a1430;
  --surface: #221a38;
  --surface-2: #2b2246;
  --text: #f6f1ff;
  --muted: #b3a6d4;
  --border: #3a3059;
  --border-strong: #4a3d73;
  --edge-deep: #5d4d8f;
  --soft: 0 18px 40px -24px rgba(0, 0, 0, 0.8);
  --pop: 0 1px 1px rgba(0, 0, 0, 0.35), 0 3px 8px rgba(0, 0, 0, 0.3);
  --pop-lg: 0 2px 3px rgba(0, 0, 0, 0.4), 0 10px 22px rgba(0, 0, 0, 0.4);
  --float: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 20px 40px -20px rgba(0, 0, 0, 0.7);
  --shine: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 60%);
}

/* ---------- 2. Base ------------------------------------------------------ */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

[id] { scroll-margin-top: calc(var(--nav-h) + 1.2rem); }

body {
  margin: 0;
  /* Column flex keeps the footer at the bottom on short pages (the dashboard
     with one room, say) instead of floating halfway up. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  /* Faint dot grid — like the back of a maths exercise book */
  background-image: radial-gradient(var(--border) 1.4px, transparent 1.4px);
  background-size: 26px 26px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); }
h3 { font-size: clamp(1.25rem, 2.4vw, 1.6rem); }

p { margin: 0 0 1rem; }
a { color: var(--grape); text-decoration-thickness: 2px; text-underline-offset: 3px; }
img, svg, canvas { max-width: 100%; }
ul { margin: 0; padding: 0; list-style: none; }

/* Author rules that set `display` beat the UA stylesheet's [hidden] rule, so
   an element like .badge (inline-flex) would stay visible when hidden. */
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px dashed var(--bubble);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: -60px;
  transform: translateX(-50%);
  z-index: 200;
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 0 0 var(--radius) var(--radius);
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }

/* ---------- 3. Layout ---------------------------------------------------- */
.wrap {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}
main { flex: 1 0 auto; }
.footer { flex: none; }

.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; position: relative; }
.section--tint { background: var(--bg-tint); }
.section--ink { background: var(--ink); color: #fff; }
.section--ink h2,
.section--ink h3 { color: #fff; }
.section--ink p { color: #d8cdf2; }

.section-head { max-width: 720px; margin: 0 auto clamp(2rem, 5vw, 3.2rem); text-align: center; }
.section-head p { color: var(--muted); font-size: 1.12rem; }
.section--ink .section-head p { color: #cfc2ee; }

.grid { display: grid; gap: 1.5rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

/* ---------- 4. Buttons --------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  padding: 0.78rem 1.5rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text); /* was var(--ink): dark-on-dark in dark mode */
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--pop);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.2s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--pop-lg); }
.btn:active { transform: translateY(1px); box-shadow: var(--pop); }
.btn--primary { background: var(--grape); color: #fff; }
.btn--pink { background: var(--bubble-deep); color: #fff; }
.btn--sun { background: var(--sunny); color: var(--ink); }
.btn--mint { background: var(--mint); color: var(--ink); }
.btn--ghost { background: transparent; box-shadow: none; border-color: transparent; }
.btn--ghost:hover { background: var(--surface-2); box-shadow: none; transform: none; }
.btn--lg { font-size: 1.15rem; padding: 1rem 2rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: var(--pop); }

/* ---------- 5. Navigation ------------------------------------------------ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1.5px solid var(--border-strong);
}
.nav__inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.logo {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
}
.logo__mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1.5px solid var(--border-strong);
  background: var(--sunny);
  box-shadow: var(--pop);
  font-size: 1.25rem;
  transform: rotate(-6deg);
  transition: transform 0.25s ease;
}
.logo:hover .logo__mark { transform: rotate(8deg) scale(1.06); }

.nav__links { display: flex; align-items: center; gap: 0.35rem; }
.nav__links a {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-pill);
  transition: background-color 0.18s ease, color 0.18s ease;
}
.nav__links a:hover { background: var(--surface-2); }
.nav__links a[aria-current="page"] { background: var(--grape); color: #fff; }

.nav__actions { display: flex; align-items: center; gap: 0.6rem; }
.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--pop);
  transition: transform 0.12s ease;
}
.icon-btn:hover { transform: translateY(-2px) rotate(-8deg); }

.nav__burger { display: none; }

@media (max-width: 900px) {
  .nav__burger { display: grid; }
  .nav__links {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 1rem 1.25rem 1.5rem;
    background: var(--bg);
    border-bottom: 1.5px solid var(--border-strong);
    box-shadow: var(--soft);
    transform: translateY(-140%);
    transition: transform 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
  }
  .nav__links[data-open="true"] { transform: translateY(0); }
  .nav__links a { padding: 0.8rem 1rem; font-size: 1.1rem; }
  .nav__actions .btn { display: none; }
}

/* ---------- 6. Stickers, badges & decoration ----------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-strong);
  background: var(--sunny);
  color: var(--ink);
  box-shadow: var(--pop);
}
.badge--mint { background: var(--mint); }
.badge--sky { background: var(--sky); }
.badge--pink { background: var(--bubble-deep); color: #fff; }
.badge--grape { background: var(--grape); color: #fff; }

.blob {
  position: absolute;
  border-radius: 45% 55% 62% 38% / 52% 42% 58% 48%;
  filter: blur(34px);
  opacity: 0.55;
  z-index: 0;
  pointer-events: none;
  animation: drift 14s ease-in-out infinite;
}

.sticker {
  position: absolute;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  font-size: 1.8rem;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: var(--pop);
  z-index: 2;
  animation: bob 5s ease-in-out infinite;
}

/* ---------- 7. Cards ----------------------------------------------------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  box-shadow: var(--pop-lg);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.card--lift:hover { transform: translateY(-4px); box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 28px 48px -24px rgba(36, 26, 61, 0.42); }
.card__icon {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  border-radius: 18px;
  border: 1.5px solid var(--border-strong);
  margin-bottom: 1rem;
  transform: rotate(-5deg);
}
.card h3 { margin-bottom: 0.4rem; }
.card p { color: var(--muted); margin-bottom: 0; font-size: 1rem; }

.tape {
  position: absolute;
  top: -14px;
  left: 50%;
  translate: -50% 0;
  width: 92px;
  height: 26px;
  background: color-mix(in srgb, var(--sunny) 72%, transparent);
  border: 2px dashed rgba(27, 18, 53, 0.35);
  rotate: -3deg;
}

/* ---------- 8. Hero ------------------------------------------------------ */
.hero { position: relative; padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(3.5rem, 8vw, 6rem); overflow: hidden; }
.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  position: relative;
  z-index: 3;
}
.hero h1 { margin-bottom: 1rem; font-size: clamp(2.2rem, 4.6vw, 3.4rem); }
.hero__lead { font-size: 1.22rem; color: var(--muted); max-width: 52ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.9rem; margin: 1.8rem 0 1.2rem; }
.hero__note { font-size: 0.95rem; color: var(--muted); display: flex; align-items: center; gap: 0.5rem; }

.squiggle { display: block; width: 190px; height: 14px; margin-top: -0.4rem; }
.squiggle path { stroke: var(--sunny); stroke-width: 7; fill: none; stroke-linecap: round; }

/* Faux app window used in the hero and demo teasers */
.window {
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--pop-lg);
  overflow: hidden;
  rotate: 1.2deg;
}
.window__bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1rem;
  background: var(--grape);
  border-bottom: 1.5px solid var(--border-strong);
}
.window__dot { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--border-strong); }
.window__title {
  margin-left: auto;
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: #fff;
  letter-spacing: 0.02em;
}
.window__body { padding: 1rem; background: var(--surface-2); }

.boards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; }
.board {
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  border: 1.5px solid var(--border-strong);
  background: #fff;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
}
.board span { position: relative; z-index: 2; animation: pop-in 0.5s backwards; }
.board::after {
  content: attr(data-name);
  position: absolute;
  left: 5px;
  bottom: 4px;
  font-family: var(--font-display);
  font-size: 0.62rem;
  color: var(--muted);
  z-index: 2;
}
.board--live { box-shadow: 0 0 0 3px var(--mint); }

/* ---------- 9. Marquee --------------------------------------------------- */
.marquee {
  border-block: 1.5px solid var(--border-strong);
  background: var(--bubble-deep);
  overflow: hidden;
  padding: 0.7rem 0;
  rotate: -1.2deg;
  margin-block: -0.5rem;
}
.marquee__track {
  display: flex;
  gap: 2.5rem;
  width: max-content;
  animation: slide 26s linear infinite;
}
.marquee span {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: #fff;
  white-space: nowrap;
  display: inline-flex;
  gap: 2.5rem;
  align-items: center;
}

/* ---------- 10. Steps ---------------------------------------------------- */
.steps { counter-reset: step; position: relative; }
.step { position: relative; padding-top: 2.2rem; }
.step__num {
  position: absolute;
  top: -22px;
  left: 1.4rem;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: #fff;
  background: var(--grape);
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  box-shadow: var(--pop);
}

/* ---------- 11. Pricing -------------------------------------------------- */
.toggle-wrap { display: flex; justify-content: center; align-items: center; gap: 0.9rem; margin-bottom: 2.4rem; flex-wrap: wrap; }
.toggle {
  display: inline-flex;
  padding: 5px;
  gap: 4px;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-pill);
  box-shadow: var(--pop);
}
.toggle button {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.5rem 1.4rem;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.toggle button[aria-pressed="true"] { background: var(--grape); color: #fff; }

.plan { display: flex; flex-direction: column; }
.plan--featured {
  border-width: 4px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--sunny) 26%, var(--surface)), var(--surface));
  transform: translateY(-10px);
}
/* Yellow over a dark surface goes muddy — tint with grape instead */
[data-theme="dark"] .plan--featured {
  background: linear-gradient(180deg, color-mix(in srgb, var(--grape) 36%, var(--surface)), var(--surface));
}
.plan__flag {
  position: absolute;
  top: -18px;
  right: 18px;
  rotate: 6deg;
}
.plan__name { font-family: var(--font-display); font-size: 1.35rem; margin-bottom: 0.15rem; }
.plan__blurb { color: var(--muted); font-size: 0.97rem; min-height: 3rem; }
.plan__price { display: flex; align-items: baseline; gap: 0.35rem; margin: 0.6rem 0 0.1rem; }
.plan__amount { font-family: var(--font-display); font-size: 3rem; line-height: 1; }
.plan__per { color: var(--muted); font-size: 0.95rem; }
.plan__sub { font-size: 0.88rem; color: var(--muted); min-height: 1.4rem; }
.plan__list { margin: 1.2rem 0 1.6rem; display: grid; gap: 0.6rem; }
.plan__list li { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.98rem; }
.plan__list li::before {
  content: "✔";
  flex: none;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  border-radius: 50%;
  background: var(--mint);
  border: 1.5px solid var(--border-strong);
  color: var(--ink);
}
.plan__list li[data-no]::before { content: "–"; background: var(--border); }
.plan .btn { margin-top: auto; }

/* Comparison table */
.table-scroll { overflow-x: auto; border-radius: var(--radius-lg); border: 1.5px solid var(--border-strong); box-shadow: var(--pop-lg); }
table.compare { width: 100%; border-collapse: collapse; background: var(--surface); min-width: 620px; }
table.compare th,
table.compare td { padding: 0.9rem 1.1rem; text-align: left; border-bottom: 2px solid var(--border); font-size: 0.98rem; }
table.compare thead th { background: var(--grape); color: #fff; font-family: var(--font-display); }
table.compare tbody tr:nth-child(even) { background: var(--surface-2); }
table.compare td:not(:first-child) { text-align: center; }
table.compare tr:last-child td { border-bottom: none; }

/* ---------- 12. Testimonials & stats ------------------------------------- */
.quote { font-size: 1.05rem; }
.quote__who { display: flex; align-items: center; gap: 0.75rem; margin-top: 1.1rem; }
.avatar {
  width: 48px;
  height: 48px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
}
.quote__who strong { display: block; font-family: var(--font-display); font-weight: 600; }
.quote__who small { color: var(--muted); }

.stat { text-align: center; }
.stat__num { font-family: var(--font-display); font-size: clamp(2.2rem, 5vw, 3.2rem); color: var(--sunny); line-height: 1; }
.stat p { color: #d8cdf2; font-size: 0.98rem; margin: 0.4rem 0 0; }

/* ---------- 13. FAQ ------------------------------------------------------ */
.faq { display: grid; gap: 1rem; max-width: 780px; margin-inline: auto; }
details.qa {
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--pop);
  overflow: hidden;
}
details.qa summary {
  cursor: pointer;
  list-style: none;
  padding: 1.1rem 1.3rem;
  font-family: var(--font-display);
  font-size: 1.08rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
details.qa summary::-webkit-details-marker { display: none; }
details.qa summary::after {
  content: "+";
  margin-left: auto;
  font-size: 1.5rem;
  line-height: 1;
  transition: rotate 0.2s ease;
}
details.qa[open] summary::after { rotate: 45deg; }
details.qa[open] summary { background: var(--surface-2); }
details.qa .qa__body { padding: 0 1.3rem 1.2rem; color: var(--muted); font-size: 1rem; }
details.qa .qa__body p:last-child { margin-bottom: 0; }

/* ---------- 14. Forms & checkout ----------------------------------------- */
.field { display: grid; gap: 0.4rem; margin-bottom: 1.1rem; }
.field label { font-family: var(--font-display); font-size: 0.95rem; font-weight: 600; }
.field input,
.field select,
.field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.75rem 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  width: 100%;
}
.field input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.field input:focus,
.field select:focus { outline: none; border-color: var(--grape); box-shadow: 0 0 0 4px color-mix(in srgb, var(--grape) 25%, transparent); }
.field small { color: var(--muted); font-size: 0.85rem; }
.field--error input,
.field--error select { border-color: var(--coral); }
.field .err { color: var(--coral); font-size: 0.85rem; font-weight: 700; min-height: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.checkout { display: grid; grid-template-columns: 1.3fr 0.9fr; gap: 2rem; align-items: start; }
.summary { position: sticky; top: calc(var(--nav-h) + 1.5rem); }
.summary__row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; font-size: 0.98rem; }
.summary__row--total {
  border-top: 3px dashed var(--border);
  margin-top: 0.5rem;
  padding-top: 0.9rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
}
.summary__row span:last-child { font-weight: 700; }

.plan-pick { display: grid; gap: 0.75rem; margin-bottom: 1.6rem; }
.plan-pick label {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1.1rem;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.plan-pick label:hover { transform: translateX(3px); }
.plan-pick input { accent-color: var(--grape); width: 22px; height: 22px; flex: none; }
.plan-pick label:has(input:checked) { background: color-mix(in srgb, var(--sunny) 30%, var(--surface)); }
.plan-pick .pp__name { font-family: var(--font-display); font-weight: 600; }
.plan-pick .pp__price { margin-left: auto; font-family: var(--font-display); white-space: nowrap; }

.notice {
  display: flex;
  gap: 0.8rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  border: 3px dashed var(--border-strong);
  background: color-mix(in srgb, var(--sky) 18%, var(--surface));
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}
.notice strong { font-family: var(--font-display); }

.success {
  text-align: center;
  padding: clamp(2rem, 6vw, 3.5rem);
  display: none;
}
.success[data-show="true"] { display: block; }
.success__mark {
  width: 96px;
  height: 96px;
  margin: 0 auto 1.2rem;
  display: grid;
  place-items: center;
  font-size: 2.8rem;
  background: var(--mint);
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  box-shadow: var(--pop-lg);
  animation: pop-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- 15. Whiteboard demo ------------------------------------------ */
.wb { display: grid; grid-template-columns: 250px 1fr; gap: 1.5rem; align-items: start; }
.wb__tools { display: grid; gap: 1.2rem; }
.tool-group h4 { font-size: 0.95rem; margin-bottom: 0.6rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.swatches { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.swatch {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  cursor: pointer;
  box-shadow: var(--pop);
  transition: transform 0.12s ease;
}
.swatch:hover { transform: scale(1.12) rotate(-6deg); }
.swatch[aria-pressed="true"] { outline: 3px solid var(--grape); outline-offset: 3px; }
.sizes { display: flex; gap: 0.5rem; align-items: center; }
.size-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  cursor: pointer;
  box-shadow: var(--pop);
}
.size-btn[aria-pressed="true"] { background: var(--sunny); }
.size-btn i { display: block; border-radius: 50%; background: var(--text); }
.stamp-row { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.stamp {
  width: 44px;
  height: 44px;
  font-size: 1.3rem;
  border-radius: 12px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  cursor: pointer;
  box-shadow: var(--pop);
}
.stamp[aria-pressed="true"] { background: var(--sky); }

.wb__canvas-wrap {
  position: relative;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--pop-lg);
  overflow: hidden;
  background: #fff;
}
#board { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; background: #fff; }
.wb__hint {
  position: absolute;
  inset: auto 0 0 0;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  background: color-mix(in srgb, #fff 82%, transparent);
  border-top: 2px dashed var(--border);
  text-align: center;
}
.wb__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }

/* ---------- 16. Footer --------------------------------------------------- */
.footer {
  background: var(--ink);
  color: #cfc2ee;
  border-top: 1.5px solid var(--border-strong);
  padding: clamp(3rem, 6vw, 4.5rem) 0 2rem;
}
.footer h4 { color: #fff; font-size: 1.05rem; margin-bottom: 0.8rem; }
.footer a { color: #cfc2ee; text-decoration: none; }
.footer a:hover { color: var(--sunny); text-decoration: underline; }
.footer__grid { display: grid; grid-template-columns: 1.4fr repeat(3, 0.8fr); gap: 2rem; }
.footer__links { display: grid; gap: 0.5rem; font-size: 0.97rem; }
.footer__bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  font-size: 0.88rem;
}
.newsletter { display: flex; gap: 0.5rem; margin-top: 1rem; }
.newsletter input {
  flex: 1;
  min-width: 0;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-strong);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

/* ---------- 17. Animations ----------------------------------------------- */
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-12px) rotate(6deg); }
}
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(24px, -18px) scale(1.06); }
  66% { transform: translate(-18px, 14px) scale(0.96); }
}
@keyframes slide {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes confetti-fall {
  to { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}

.confetti-bit {
  position: fixed;
  top: -20px;
  width: 11px;
  height: 16px;
  z-index: 300;
  pointer-events: none;
  animation: confetti-fall linear forwards;
}

/* Only hide things when JS is running to un-hide them again — a page with
   scripts blocked still shows every section. */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34, 1.2, 0.64, 1); }
.js .reveal[data-seen="true"] { opacity: 1; transform: none; }

/* ---------- 18. Utilities & responsive ----------------------------------- */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.stack > * + * { margin-top: 1rem; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .checkout { grid-template-columns: 1fr; }
  .summary { position: static; }
  .wb { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .plan--featured { transform: none; }
}

@media (max-width: 700px) {
  /* Once the hero stacks, floating stickers land on top of the copy */
  .hero .sticker { display: none; }
}

@media (max-width: 560px) {
  body { font-size: 17px; }
  .field-row { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .sticker { width: 50px; height: 50px; font-size: 1.4rem; }
  .hero__cta .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}

@media print {
  .nav, .footer, .marquee, .blob, .sticker { display: none; }
  body { background: #fff; }
}

/* ==========================================================================
   19. The app — dashboard, teacher room view, student board
   ========================================================================== */

/* ---- Room code display -------------------------------------------------- */
.code-display {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.6rem;
}
.code-big {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1;
  letter-spacing: 0.08em;
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius);
  border: 1.5px solid var(--border-strong);
  background: var(--sunny);
  color: var(--ink);
  box-shadow: var(--pop-lg);
  rotate: -1.5deg;
}
.code-hint { font-size: 0.95rem; color: var(--muted); margin: 0; }
.code-big + .code-hint { margin-top: 1.1rem; }

/* ---- Live student grid -------------------------------------------------- */
.class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 1.1rem;
}
.pupil {
  position: relative;
  padding: 0;
  overflow: hidden;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--pop);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.pupil:hover { transform: translateY(-2px); box-shadow: var(--pop-lg); }
.pupil__shot {
  display: block;
  width: 100%;
  aspect-ratio: 1200 / 740;
  object-fit: cover;
  background: #fff;
  border-bottom: 1.5px solid var(--border-strong);
}
.pupil__empty {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1200 / 740;
  background: repeating-linear-gradient(45deg, #fff, #fff 12px, #f4eeff 12px, #f4eeff 24px);
  border-bottom: 1.5px solid var(--border-strong);
  color: var(--muted);
  font-size: 0.88rem;
}
.pupil__foot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
}
.pupil__name { font-family: var(--font-display); font-weight: 600; font-size: 1rem; }
.pupil__marks { margin-left: auto; font-size: 0.82rem; color: var(--muted); }
.pupil__note { font-size: 1rem; animation: note-bob 2.4s ease-in-out infinite; }
@keyframes note-bob { 0%, 100% { transform: rotate(-6deg) translateY(0); } 50% { transform: rotate(-6deg) translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .pupil__note { animation: none; } }
.pupil[data-offline="true"] { opacity: 0.5; }
.pupil[data-offline="true"]:has(.pupil__note) { opacity: 0.8; } /* a note is waiting — keep it easy to spot */
.pupil[data-status="stuck"] { box-shadow: 0 0 0 4px var(--coral), var(--pop); }
.pupil[data-status="done"] { box-shadow: 0 0 0 4px var(--mint), var(--pop); }

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  flex: none;
  background: var(--sky);
}
.dot[data-status="stuck"] { background: var(--coral); }
.dot[data-status="done"] { background: var(--mint); }
.dot[data-status="offline"] { background: var(--border); }

/* ---- Filter chips ------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  font-family: var(--font-display);
  font-size: 0.92rem;
  padding: 0.42rem 1rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--pop);
}
.chip[aria-pressed="true"] { background: var(--grape); color: #fff; }
.chip b { font-weight: 700; }

/* ---- Toolbars ----------------------------------------------------------- */
.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.4rem;
}
.bar .grow { flex: 1 1 260px; }
.bar input[type="text"] {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.65rem 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-pill);
}

/* ---- Focus view (one student, full size) -------------------------------- */
.focus {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
  place-items: center;
  padding: 1.2rem;
  background: rgba(27, 18, 53, 0.72);
  backdrop-filter: blur(4px);
}
.focus[data-open="true"] { display: grid; }
.focus__panel {
  width: min(100%, 1040px);
  max-height: 92vh;
  overflow: auto;
  background: var(--bg);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--pop-lg);
  padding: 1.2rem;
}
.focus__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1rem;
}
.focus__head h3 { margin: 0; }
.focus__head .btn { padding: 0.5rem 1rem; font-size: 0.92rem; }
.focus__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.9rem; }

/* ---- Prompt banner & frozen overlay (student side) ---------------------- */
.prompt-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.9rem 1.2rem;
  margin-bottom: 1rem;
  border: 3px dashed var(--border-strong);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--sunny) 30%, var(--surface));
  font-size: 1.05rem;
}
.prompt-banner strong { font-family: var(--font-display); }

.frozen-veil {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  place-items: center;
  text-align: center;
  padding: 1.5rem;
  background: color-mix(in srgb, var(--grape) 82%, transparent);
  color: #fff;
}
.frozen-veil[data-on="true"] { display: grid; }
.frozen-veil span { font-size: 3rem; display: block; margin-bottom: 0.5rem; }
.frozen-veil strong { font-family: var(--font-display); font-size: 1.5rem; }

/* ---- Extra drawing tools, paper picker, text box ------------------------- */
/* Pressed tools sit on a bright accent, so their glyph must stay dark in
   both themes (see the UI rules: --ink on --sunny / --sky). */
.size-btn[aria-pressed="true"],
.stamp[aria-pressed="true"] { color: var(--ink); }
.tool-glyph { font-size: 1.25rem; font-weight: 700; line-height: 1; color: var(--text); }
.size-btn.tool-glyph[aria-pressed="true"] { color: var(--ink); }
.size-btn[aria-pressed="true"] i { background: var(--ink); }
.size-btn:disabled,
.stamp:disabled,
.swatch:disabled,
.paper-select:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.paper-select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 600;
  padding: 0.55rem 0.8rem;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.paper-select:focus { outline: none; border-color: var(--grape); box-shadow: 0 0 0 4px color-mix(in srgb, var(--grape) 25%, transparent); }
.tool-group h4 label { cursor: pointer; }

/* Typed onto the board: always on white, like the board itself */
.board-text-input {
  position: absolute;
  z-index: 6;
  min-width: 180px;
  max-width: 70%;
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  padding: 0 0.25em;
  font-family: var(--font-body);
  font-weight: 700;
  line-height: 1.15;
  background: rgba(255, 255, 255, 0.94);
  border: 2px dashed var(--grape);
  border-radius: 6px;
  outline: none;
}

/* ---- Room: tool panel (tabs) -------------------------------------------- */
.cp { margin-bottom: 1.4rem; padding: 0; overflow: hidden; }
.cp__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1rem;
  background: var(--surface-2);
  border-bottom: 3px solid var(--border);
}
.cp__tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-pill);
}
.cp__tab {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.cp__tab:hover { background: var(--surface-2); }
.cp__tab[aria-selected="true"] { background: var(--grape); color: #fff; }
.cp__tab:focus-visible { outline: 3px solid var(--grape); outline-offset: 2px; }
.cp__freeze { margin-left: auto; padding: 0.55rem 1.2rem; font-size: 0.98rem; }
.cp__freeze[aria-pressed="true"] { background: var(--sky); color: var(--ink); }
.cp__panel { padding: 1.2rem 1.2rem 1.3rem; }
.cp__label { display: block; margin: 0 0 0.5rem; font-family: var(--font-display); font-weight: 600; font-size: 0.98rem; color: var(--text); }
.cp__label .muted { font-family: var(--font-body); font-weight: 600; font-size: 0.88rem; }
.cp__label--gap { margin-top: 1.3rem; }
.cp__row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem; }
.cp__row--end { justify-content: flex-end; margin-top: 0.9rem; }
.cp__row--split { justify-content: space-between; margin-top: 1rem; }
.cp__keep { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; color: var(--text); }
.cp__keep label { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; }
.cp__keep .paper-select { width: auto; padding: 0.35rem 0.6rem; font-size: 0.92rem; }
.cp__input {
  flex: 1 1 280px;
  min-width: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.7rem 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-pill);
}
.cp__input:focus { outline: none; border-color: var(--grape); box-shadow: 0 0 0 4px color-mix(in srgb, var(--grape) 25%, transparent); }
.cp__select { flex: 1 1 260px; width: auto; max-width: 420px; }
.cp__danger { font-size: 0.95rem; color: var(--text); }
.cp__danger:hover { background: color-mix(in srgb, var(--coral) 22%, transparent); }
.cp__tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.8rem; }
.cp__tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--pop);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.cp__tile:hover { transform: translateY(-1px); box-shadow: var(--pop-lg); }
.cp__tile:disabled { opacity: 0.55; cursor: wait; transform: none; }
.cp__tile:focus-visible { outline: 3px solid var(--grape); outline-offset: 3px; }
.cp__tile-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  font-size: 1.4rem;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 12px;
}
.cp__tile-text { display: grid; gap: 0.1rem; }
.cp__tile-text strong { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; }
.cp__tile-text small { color: var(--muted); font-size: 0.85rem; line-height: 1.3; }
.cp__tile .pro-tag { position: absolute; top: 8px; right: 8px; font-size: 0.68rem; padding: 0.1rem 0.45rem; background: var(--grape); color: #fff; border-width: 2px; }
.cp__tile .plus-tag { position: absolute; top: 8px; right: 8px; font-size: 0.68rem; padding: 0.1rem 0.45rem; background: var(--sky); color: var(--ink, #1b1235); border-width: 2px; }
@media (max-width: 560px) {
  .cp__freeze { margin-left: 0; width: 100%; }
  .cp__tab { padding: 0.45rem 0.8rem; font-size: 0.9rem; }
  .cp__tabs { border-radius: var(--radius); }
}

/* ---- Doodle Drawer -------------------------------------------------------- */
.drawer-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; margin-bottom: 1.6rem; }
.drawer-head > div { flex: 1 1 320px; }
.drawer-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; margin-bottom: 1.4rem; padding: 0.9rem 1rem; }
.drawer-search { flex: 1 1 240px; max-width: 360px; margin-left: auto; }
.drawer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.2rem; }
.drawer-empty { grid-column: 1 / -1; }
.pad {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--pop);
}
.pad__cover {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1200 / 740;
  background: #fff;
  border-bottom: 1.5px solid var(--border-strong);
  overflow: hidden;
}
.pad__cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.pad__emoji { font-size: 3rem; }
.pad__kind { position: absolute; top: 8px; left: 8px; font-size: 0.75rem; padding: 0.2rem 0.6rem; color: var(--ink); }
.pad__kind[data-kind="worksheet"] { background: var(--sunny); }
.pad__kind[data-kind="snapshot"] { background: var(--sky); }
.pad__kind[data-kind="grades"] { background: var(--mint); }
.pad__body { display: flex; flex-direction: column; gap: 0.45rem; padding: 0.9rem 1rem 1rem; flex: 1; }
.pad__title { margin: 0; font-size: 1.12rem; line-height: 1.25; }
.pad__keep { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.2rem; }
.pad__keep .paper-select { width: 100%; min-width: 0; flex: 1 1 0; padding: 0.3rem 0.5rem; font-size: 0.88rem; text-overflow: ellipsis; }
@media (max-width: 560px) { .nav__actions [data-teacher-badge] { display: none; } }
.pad__until { margin: 0; }
.pad__actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: auto; padding-top: 0.4rem; }
.pad__actions .btn { padding: 0.45rem 0.9rem; font-size: 0.92rem; }
.pad__actions .btn--ghost { padding: 0.45rem 0.6rem; }
.use-rooms { display: grid; gap: 0.7rem; }
a.cp__tile { text-decoration: none; }
.drawer-save { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.drawer-save .paper-select { width: auto; padding: 0.4rem 0.6rem; font-size: 0.9rem; }

/* ---- Room: lesson pages, snapshots, class list -------------------------- */
.template-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; flex: 1 1 420px; }
.template-pick .paper-select { width: auto; min-width: 220px; }
.snap-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.upload-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.upload-actions .pro-tag { font-size: 0.7rem; padding: 0.15rem 0.5rem; margin-left: 0.2rem; }
.upload-note {
  margin: -0.6rem 0 1.4rem;
  padding: 0.8rem 1.1rem;
  color: var(--text);
  background: var(--surface-2);
  border: 3px solid var(--border);
  border-radius: var(--radius);
}
.upload-note[data-kind="good"] { border-color: var(--mint); }
.upload-note[data-kind="warn"] { border-color: var(--coral); }
.upload-note[data-kind="pro"] { border-color: var(--grape); }
.upload-note a { color: var(--grape); font-weight: 700; }
/* ---- AI worksheet maker -------------------------------------------------- */
.ai-panel { width: min(100%, 1100px); }
.ai-form { display: grid; gap: 0.2rem; }
.ai-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 1rem; }
.ai-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin: 0.6rem 0 1rem; }
.ai-pages { display: grid; gap: 1rem; margin-bottom: 1rem; }
.ai-pages img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--pop);
}
.ai-edit { margin-bottom: 1rem; padding: 0.9rem 1.1rem; color: var(--text); }
.ai-edit summary { cursor: pointer; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.ai-edit .field { margin-top: 0.8rem; }
.ai-q input { margin-top: 0.4rem; }
.ai-key { margin: 0.8rem 0; padding-left: 1.6rem; color: var(--text); }
.ai-key li { margin-bottom: 0.3rem; }
@media (max-width: 640px) { .ai-row { grid-template-columns: 1fr; } }

/* ---- AI grading (teacher only) ------------------------------------------- */
.grade-runs { width: auto; max-width: 320px; }
.grade-bar { height: 16px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-pill); background: var(--surface-2); overflow: hidden; }
.grade-bar span { display: block; height: 100%; width: 3%; background: var(--grape); transition: width 0.3s ease; }
.grade-summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.6rem; color: var(--text); }
.grade-stats { display: flex; flex-wrap: wrap; gap: 1rem; }
.grade-stats b { font-family: var(--font-display); }
.grade-flag { white-space: nowrap; }
.grade-table-wrap { overflow-x: auto; }
.grade-table { width: 100%; min-width: 560px; border-collapse: collapse; color: var(--text); }
.grade-table th, .grade-table td { padding: 0.55rem 0.5rem; text-align: left; border-bottom: 2px solid var(--border); vertical-align: middle; }
.grade-table th { font-size: 0.85rem; color: var(--muted); }
.grade-row { cursor: pointer; }
.grade-row:hover, .grade-row:focus-visible { background: var(--surface-2); outline: none; }
.grade-table .marks { display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }
.mark {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 0.2rem;
  font-weight: 800;
  font-size: 0.9rem;
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  color: var(--ink);
}
.mark sup { font-size: 0.6rem; margin-left: 1px; }
.mark[data-mark="correct"] { background: var(--mint); }
.mark[data-mark="partial"] { background: var(--sunny); }
.mark[data-mark="incorrect"] { background: var(--coral); }
.mark[data-mark="blank"] { background: var(--surface-2); color: var(--text); }
.grade-detail td { background: var(--surface-2); }
.grade-detail__wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.grade-detail__img { width: 100%; height: auto; background: #fff; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); }
.grade-q { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.grade-q__n { font-weight: 800; min-width: 1.6rem; }
.grade-q .paper-select { width: auto; padding: 0.3rem 0.5rem; font-size: 0.9rem; }
@media (max-width: 760px) { .grade-detail__wrap { grid-template-columns: 1fr; } }

[data-theme="dark"] .upload-note a { color: #c4b5fd; }

.roster { margin-bottom: 1.4rem; padding: 1rem 1.2rem; }
.roster summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
}
.roster__body { margin-top: 0.8rem; overflow-x: auto; }
.roster__table { width: 100%; min-width: 600px; border-collapse: collapse; color: var(--text); }
.roster__table th,
.roster__table td { padding: 0.55rem 0.5rem; text-align: left; border-bottom: 2px solid var(--border); vertical-align: middle; }
.roster__table th { font-size: 0.85rem; color: var(--muted); font-weight: 700; }
.roster__table .dot { display: inline-block; vertical-align: middle; }
.roster__actions { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: flex-end; }
.roster__actions .chip { font-size: 0.85rem; padding: 0.32rem 0.8rem; }
.chip--danger:hover { background: var(--coral); color: var(--ink); }

.snap-list { display: grid; gap: 0.7rem; }
.snap-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.8rem 1rem;
  color: var(--text);
  background: var(--surface-2);
  border: 3px solid var(--border);
  border-radius: var(--radius);
}
.snap-row__actions { display: flex; gap: 0.5rem; }
.snap-row__actions .btn { padding: 0.45rem 1rem; font-size: 0.92rem; }
.snap-card { margin: 0; cursor: default; }
.snap-card:hover { transform: none; box-shadow: var(--pop); }

/* ---- Status buttons (student) ------------------------------------------- */
.status-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.status-btn[aria-pressed="true"] { outline: 3px solid var(--grape); outline-offset: 3px; }

/* ---- Toast -------------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  translate: -50% 0;
  z-index: 250;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-strong);
  background: var(--mint);
  color: var(--ink);
  font-family: var(--font-display);
  box-shadow: var(--pop);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, translate 0.2s ease;
}
.toast[data-show="true"] { opacity: 1; translate: -50% -8px; }

/* ---- Empty states ------------------------------------------------------- */
.empty {
  text-align: center;
  padding: clamp(2rem, 6vw, 3.5rem);
  border: 3px dashed var(--border);
  border-radius: var(--radius-lg);
  color: var(--muted);
}
.empty span { font-size: 2.6rem; display: block; margin-bottom: 0.6rem; }

@media (max-width: 700px) {
  .class-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}


/* ==========================================================================
   Clean & glossy — the finishing layer
   A gentle shine on buttons and tiles, deeper-shade outlines on the colored
   buttons, and cards that float on a soft shadow instead of an outline.
   ========================================================================== */
.btn,
.chip,
.cp__tile,
.size-btn,
.stamp,
.toggle,
.cp__tabs { background-image: var(--shine); }
.btn--primary { background-image: linear-gradient(180deg, #8b50f3, var(--grape)); border-color: var(--grape-deep); }
.btn--pink { background-image: linear-gradient(180deg, #e2408a, var(--bubble-deep)); border-color: #b81d62; }
.btn--sun { background-image: linear-gradient(180deg, #ffd96b, var(--sunny)); border-color: #e0a800; }
.btn--mint { background-image: linear-gradient(180deg, #3bd8ae, var(--mint)); border-color: #0e9f7a; }
.btn--ghost { background-image: none; }
.chip[aria-pressed="true"],
.cp__tab[aria-selected="true"],
.toggle button[aria-pressed="true"],
.nav__links a[aria-current="page"] { background-image: linear-gradient(180deg, #8b50f3, var(--grape)); }
.chip[aria-pressed="true"] { border-color: var(--grape-deep); }
.size-btn[aria-pressed="true"] { border-color: #e0a800; }
.stamp[aria-pressed="true"] { border-color: #0ea5e9; }
.swatch { box-shadow: var(--pop); }

/* Cards float — no outline */
.card,
.pad,
.pupil,
.focus__panel,
.window { border-color: transparent; box-shadow: var(--float); }
[data-theme="dark"] .card,
[data-theme="dark"] .pad,
[data-theme="dark"] .pupil,
[data-theme="dark"] .window { border-color: var(--border); }
.pupil[data-status="stuck"] { box-shadow: 0 0 0 3px var(--coral), var(--float); }
.pupil[data-status="done"] { box-shadow: 0 0 0 3px var(--mint), var(--float); }
.pupil__shot,
.pupil__empty,
.pad__cover { border-bottom-color: var(--border); }
.cp { box-shadow: var(--float); }
.cp__head { border-bottom-width: 1.5px; }

/* The drawing surface keeps a clear (but light) frame */
.wb__canvas-wrap { border-color: var(--edge-deep); box-shadow: var(--pop-lg); }
.nav { border-bottom: 1px solid var(--border); box-shadow: 0 4px 18px -12px rgba(36, 26, 61, 0.25); }


/* ==========================================================================
   Teacher side menu (assets/js/sidebar.js)
   ========================================================================== */
:root { --side-w: 236px; --side-tucked: 74px; }
.side {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  bottom: 0;
  z-index: 90;
  width: var(--side-w);
  padding: 0.9rem 0.7rem 1.2rem;
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 24px -18px rgba(36, 26, 61, 0.35);
  transition: width 0.2s ease, transform 0.25s ease;
}
.side__nav { display: grid; gap: 2px; }
.side__group {
  margin: 0.9rem 0.6rem 0.3rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side__group:first-child { margin-top: 0.2rem; }
.side__item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  font: 600 0.98rem var(--font-display);
  color: var(--text);
  text-align: left;
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}
.side__item:hover { background: var(--surface-2); }
.side__item[aria-current="page"] { background: linear-gradient(180deg, #8b50f3, var(--grape)); color: #fff; }
.side__item:focus-visible { outline: 3px solid var(--grape); outline-offset: 1px; }
.side__icon { flex: none; width: 1.6rem; text-align: center; font-size: 1.15rem; }
.side__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side__tuck {
  position: absolute;
  top: 0.7rem;
  right: 0.6rem;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font: 700 0.9rem var(--font-body);
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.side__tuck:hover { color: var(--text); }
.side__nav { margin-top: 1.6rem; }
.side__open { display: none; }
.side__scrim { display: none; }

html.has-side main,
html.has-side .footer { margin-left: var(--side-w); transition: margin-left 0.2s ease; }
html.has-side .nav__links,
html.has-side .nav__burger { display: none; }

/* Tucked: icons only */
html.side-tucked .side { width: var(--side-tucked); }
html.side-tucked .side__label,
html.side-tucked .side__group { display: none; }
html.side-tucked .side__item { justify-content: center; padding: 0.6rem 0; }
html.side-tucked .side__tuck { right: 50%; transform: translateX(50%) rotate(180deg); }
html.side-tucked.has-side main,
html.side-tucked.has-side .footer { margin-left: var(--side-tucked); }

/* Phones & small tablets: slides in from ☰ */
@media (max-width: 900px) {
  .side { top: 0; z-index: 210; width: min(82vw, 280px); transform: translateX(-105%); }
  html.side-tucked .side { width: min(82vw, 280px); }
  html.side-tucked .side__label,
  html.side-tucked .side__group { display: initial; }
  html.side-tucked .side__item { justify-content: flex-start; padding: 0.55rem 0.65rem; }
  .side__tuck { display: none; }
  .side__nav { margin-top: 0.4rem; }
  html.side-open .side { transform: none; }
  html.side-open .side__scrim { display: block; position: fixed; inset: 0; z-index: 205; background: rgba(27, 18, 53, 0.5); }
  html.has-side main,
  html.has-side .footer,
  html.side-tucked.has-side main,
  html.side-tucked.has-side .footer { margin-left: 0; }
  .side__open { display: inline-grid; }
}

/* Present mode: nothing but the work */
html.presenting .side,
html.presenting .side__scrim,
html.presenting .nav,
html.presenting .footer,
html.presenting .toast { display: none !important; }
html.presenting main,
html.presenting.has-side main { margin-left: 0 !important; }

/* ==========================================================================
   Teaching desk & Present mode (teach.html)
   ========================================================================== */
.teach__head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; margin-bottom: 1.4rem; }
.teach__head > div { flex: 1 1 320px; }
.teach__col { min-width: 0; }
.teach__stage { position: relative; }
.present-bar { display: none; }
.present-start { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; }

html.presenting .teach__stage,
.teach__stage:fullscreen {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 1vh 1vw;
  background: var(--bg);
}
.teach__stage:-webkit-full-screen { width: 100%; height: 100%; display: grid; place-items: center; background: var(--bg); }
html.presenting .teach__canvas,
.teach__stage:fullscreen .teach__canvas {
  width: min(98vw, calc(97vh * 1200 / 740));
  border-radius: 14px;
  box-shadow: 0 10px 40px -20px rgba(36, 26, 61, 0.35);
}
html.presenting .teach__canvas .wb__hint { display: none; }

html.presenting .present-bar,
.teach__stage:fullscreen .present-bar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 310;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 8px 10px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 12px 40px -12px rgba(36, 26, 61, 0.45);
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
html.present-awake .present-bar,
html.present-awake .teach__stage:fullscreen .present-bar {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
.present-bar .size-btn,
.present-bar .swatch { width: 40px; height: 40px; }
.present-bar__sep { width: 1px; height: 26px; margin: 0 4px; background: var(--border); }
.present-bar__exit { padding: 0.5rem 1rem; font-size: 0.92rem; }
@media (max-width: 700px) {
  .present-bar .size-btn,
  .present-bar .swatch { width: 34px; height: 34px; }
}


/* ==========================================================================
   A student presents their desk
   ========================================================================== */
.switch-row { display: flex; align-items: flex-start; gap: 0.8rem; margin-top: 1rem; cursor: pointer; color: var(--text); }
.switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch {
  flex: none;
  position: relative;
  width: 46px;
  height: 26px;
  margin-top: 2px;
  background: var(--surface-2);
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  transition: background 0.2s ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 19px;
  height: 19px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(36, 26, 61, 0.3);
  transition: transform 0.2s ease;
}
.switch-input:checked + .switch { background: var(--grape); border-color: var(--grape-deep); }
.switch-input:checked + .switch::after { transform: translateX(20px); }
.switch-input:focus-visible + .switch { outline: 3px solid var(--grape); outline-offset: 2px; }
.switch-text { display: grid; gap: 0.1rem; }
.switch-text strong { font-family: var(--font-display); font-weight: 600; }
.switch-text small { color: var(--muted); font-size: 0.86rem; }

.present-requests { display: grid; gap: 0.6rem; margin: -0.4rem 0 1.4rem; }
.present-request {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.8rem 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--sunny);
  border-radius: var(--radius);
  box-shadow: var(--pop);
  animation: request-in 0.3s ease;
}
.present-request__actions { display: flex; gap: 0.5rem; }
.present-request__actions .btn { padding: 0.45rem 1rem; font-size: 0.94rem; }
@keyframes request-in { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }

.present-room { position: fixed; inset: 0; z-index: 300; }
.present-room__stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1vh 1vw;
  background: var(--bg);
}
.present-room__stage:fullscreen { background: var(--bg); }
.present-room__canvas { width: min(98vw, calc(97vh * 1200 / 740)); border-radius: 14px; }
.present-room__name {
  position: absolute;
  top: 14px;
  left: 16px;
  z-index: 2;
  padding: 0.35rem 0.9rem;
  font: 600 1rem var(--font-display);
  color: var(--ink);
  background: var(--sunny);
  border-radius: 999px;
  box-shadow: var(--pop);
}
.present-bar__who { padding: 0 0.6rem; font-family: var(--font-display); font-weight: 600; color: var(--text); white-space: nowrap; }
.present-room .present-bar .btn { padding: 0.5rem 1rem; font-size: 0.92rem; }

.presenting-banner {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1rem;
  padding: 0.8rem 1.1rem;
  color: var(--ink);
  background: linear-gradient(180deg, #ffd96b, var(--sunny));
  border: 1.5px solid #e0a800;
  border-radius: var(--radius);
  box-shadow: var(--pop);
}
.presenting-banner > span:first-child { font-size: 1.5rem; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.18); } }
html.student-presenting .wb__canvas-wrap { box-shadow: 0 0 0 4px var(--sunny), var(--pop-lg); }
.present-ask[aria-pressed="true"] { outline: 3px solid var(--sunny); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .presenting-banner > span:first-child, .present-request { animation: none; }
}

/* A little sticky note — a teacher's note waiting on a desk */
.sticky { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M3 3h18v13l-5 5H3z' fill='%23ffd84d' stroke='%23d9a400' stroke-width='1.2' stroke-linejoin='round'/><path d='M21 16h-5v5z' fill='%23f0b90b' stroke='%23d9a400' stroke-width='1.2' stroke-linejoin='round'/><path d='M7 9h10M7 13h7' stroke='%23a87a00' stroke-width='1.6' stroke-linecap='round'/></svg>") center / contain no-repeat;
  transform: rotate(-6deg); filter: drop-shadow(0 1px 1px rgba(60, 40, 0, 0.25)); }

/* ==========================================================================
   Attendance (attendance.html)
   ========================================================================== */
.att-sync { font-size: 0.9rem; color: var(--muted); padding: 0.35rem 0.8rem; border-radius: var(--radius-pill); background: var(--surface-2); border: 1px solid var(--border); }
.att-sync[data-state="offline"], .att-sync[data-state="local"] { color: var(--text); background: color-mix(in srgb, var(--sunny) 22%, var(--surface)); }
.att-sync:empty { display: none; }
.att-classes .chips { flex: 1 1 320px; }

.att-empty { text-align: center; padding: clamp(2rem, 5vw, 3rem); }
.att-empty__art { font-size: 3rem; margin-bottom: 0.4rem; }
.att-empty p { max-width: 54ch; margin: 0 auto 1.2rem; }

.att-panel { padding: clamp(1rem, 3vw, 1.6rem); }
.att-panel__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.9rem; margin-bottom: 1.2rem; }
.att-panel__title { margin: 0 0 0.2rem; font-size: clamp(1.4rem, 3vw, 1.8rem); }

.att-day { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem; margin-bottom: 0.8rem; }
.att-date { display: flex; align-items: center; gap: 0.4rem; }
.att-date__input { width: auto; min-width: 0; padding: 0.5rem 0.7rem; }
.att-date .icon-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.att-totals { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.att-pill { font-size: 0.88rem; padding: 0.3rem 0.75rem; border-radius: var(--radius-pill); background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.att-pill b { font-family: var(--font-display); }
.att-pill[data-s="p"] { background: color-mix(in srgb, var(--mint) 20%, var(--surface)); }
.att-pill[data-s="l"] { background: color-mix(in srgb, var(--sunny) 26%, var(--surface)); }
.att-pill[data-s="a"] { background: color-mix(in srgb, var(--coral) 22%, var(--surface)); }
.att-bulk { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1.1rem; }

.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 0.8rem; }
.att-card {
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--surface);
  background-image: var(--shine);
  box-shadow: var(--pop);
  padding: 0.75rem 0.8rem 0.55rem;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.att-card[data-s="p"] { background-color: color-mix(in srgb, var(--mint) 16%, var(--surface)); border-color: color-mix(in srgb, var(--mint) 55%, var(--border)); }
.att-card[data-s="l"] { background-color: color-mix(in srgb, var(--sunny) 20%, var(--surface)); border-color: color-mix(in srgb, var(--sunny) 65%, var(--border)); }
.att-card[data-s="a"] { background-color: color-mix(in srgb, var(--coral) 16%, var(--surface)); border-color: color-mix(in srgb, var(--coral) 55%, var(--border)); }
.att-card__top { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.55rem; min-width: 0; }
.att-card__num { flex: none; width: 1.7rem; height: 1.7rem; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); font-size: 0.8rem; color: var(--muted); font-weight: 700; }
.att-card__name { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; min-width: 0; }
.att-card__note { margin: 0.45rem 0 0; font-size: 0.78rem; color: var(--muted); min-height: 1.1em; }
.att-new { flex: none; font: inherit; font-size: 0.75rem; font-weight: 700; padding: 0.15rem 0.55rem; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: color-mix(in srgb, var(--sky) 20%, var(--surface)); color: var(--text); cursor: pointer; }

.att-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.3rem; }
.att-seg__btn {
  font-family: var(--font-display);
  font-size: 0.86rem;
  padding: 0.45rem 0.2rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.att-seg__btn:hover { border-color: var(--grape); }
.att-seg__btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--grape) 45%, transparent); outline-offset: 2px; }
.att-seg__btn[data-mark="p"][aria-pressed="true"] { background: var(--mint); border-color: var(--mint); color: var(--ink); }
.att-seg__btn[data-mark="l"][aria-pressed="true"] { background: var(--sunny); border-color: var(--sunny); color: var(--ink); }
.att-seg__btn[data-mark="a"][aria-pressed="true"] { background: var(--coral); border-color: var(--coral); color: var(--ink); }
.att-hint { margin: 1rem 0 0; }

.att-range { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; margin-bottom: 1rem; }
.att-range__dates { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.att-range__dates .cp__input { flex: 0 0 auto; width: 10.5rem; min-width: 0; padding: 0.45rem 0.6rem; }
.att-range__out { display: flex; gap: 0.5rem; margin-left: auto; }
.att-table { min-width: 0; }
.att-table th[scope="row"] { font-family: var(--font-display); font-weight: 600; color: var(--text); white-space: nowrap; font-size: 0.95rem; }
.att-table__day { text-align: center !important; font-size: 0.78rem !important; line-height: 1.2; white-space: nowrap; }
.att-table__day span { display: block; font-weight: 700; }
.att-table__sum { text-align: center !important; white-space: nowrap; }
.att-cell { text-align: center !important; font-weight: 700; font-size: 0.85rem; min-width: 2.2rem; }
.att-cell[data-s="p"] { background: color-mix(in srgb, var(--mint) 24%, var(--surface)); }
.att-cell[data-s="l"] { background: color-mix(in srgb, var(--sunny) 30%, var(--surface)); }
.att-cell[data-s="a"] { background: color-mix(in srgb, var(--coral) 26%, var(--surface)); }
.att-table tfoot th, .att-table tfoot td { color: var(--muted); font-size: 0.85rem; border-bottom: 0; }
.att-key { margin-top: 0.8rem; }
.att-none { padding: 1.2rem 0; }

.att-edit .cp__input { max-width: 520px; }
.att-link { margin-top: 1rem; }
.att-list { list-style: none; margin: 0 0 1.2rem; padding: 0; display: grid; gap: 0.4rem; }
.att-row { display: flex; align-items: center; gap: 0.45rem; padding: 0.35rem 0.5rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); }
.att-row.is-dragging { opacity: 0.5; }
.att-row__grip { cursor: grab; color: var(--muted); font-size: 1.1rem; padding: 0 0.15rem; }
.att-row__num { width: 1.6rem; text-align: right; color: var(--muted); font-size: 0.85rem; font-weight: 700; }
.att-row__name { flex: 1 1 auto; min-width: 0; padding: 0.4rem 0.6rem !important; }
.att-row .icon-btn { width: 36px; height: 36px; }
.att-row .icon-btn[disabled] { opacity: 0.35; cursor: not-allowed; }
.att-row .chip { font-size: 0.82rem; padding: 0.3rem 0.7rem; }
.att-row__tag { font-size: 0.72rem; }
.att-row--empty { padding: 0.5rem 0; }
.att-add { display: block; width: 100%; max-width: 520px; min-height: 5.5rem; resize: vertical; font-family: var(--font-body); border-radius: var(--radius) !important; margin-bottom: 0.6rem; }

/* Today's attendance on the room page */
.att-room { color: var(--text); }
.att-room a { font-weight: 700; }

@media (max-width: 560px) {
  .att-range__out { margin-left: 0; }
  .att-row { flex-wrap: wrap; }
  .att-row__name { flex-basis: calc(100% - 4rem); }
  .att-day { flex-direction: column; align-items: flex-start; }
}

/* ==========================================================================
   Activities: timer, quick polls, name picker
   ========================================================================== */
.act-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 1rem; align-items: start; }
.act {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  background-image: var(--shine);
  box-shadow: var(--pop);
  padding: 1rem 1.05rem 1.1rem;
  display: grid;
  gap: 0.7rem;
  min-width: 0;
}
.act--wide { grid-column: span 2; }
@media (max-width: 860px) { .act--wide { grid-column: auto; } }
.act__title { margin: 0; font-size: 1.12rem; color: var(--text); }
.act__sub { font-family: var(--font-body); font-weight: 600; font-size: 0.85rem; color: var(--muted); }
.act__chips .chip { padding: 0.35rem 0.8rem; font-size: 0.88rem; }
.act__row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.act__row .cp__input { flex: 1 1 140px; min-width: 0; }
.act__num { flex: 0 0 5rem !important; width: 5rem; }
.act__switch { margin-top: 0; }
.act__meta { margin: 0; min-height: 1.2em; }
.act__more summary { cursor: pointer; font-weight: 700; font-size: 0.9rem; color: var(--muted); }
.act__more[open] summary { margin-bottom: 0.4rem; }
.act__check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.92rem; color: var(--text); margin: 0.3rem 0; cursor: pointer; }
.act__check input { width: 18px; height: 18px; accent-color: var(--grape); }

/* Countdown pill */
.timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.95rem;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  box-shadow: var(--pop-lg);
  color: var(--text);
  font-size: 1rem;
  white-space: nowrap;
  justify-self: start;
}
.timer-pill[hidden] { display: none; }
.timer-pill__time { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-size: 1.15em; }
.timer-pill__label { color: var(--muted); font-size: 0.9em; overflow: hidden; text-overflow: ellipsis; max-width: 14ch; }
.timer-pill[data-state="soon"] { background: color-mix(in srgb, var(--sunny) 35%, var(--surface)); border-color: var(--sunny); }
.timer-pill[data-state="end"] { background: var(--coral); border-color: var(--coral); color: var(--ink); animation: timer-throb 1s ease-in-out infinite; }
.timer-pill[data-state="end"] .timer-pill__label { color: var(--ink); }
.timer-pill[data-state="done"] { background: var(--grape); border-color: var(--grape); color: #fff; }
.timer-pill[data-state="paused"] { opacity: 0.85; }
@keyframes timer-throb { 50% { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .timer-pill[data-state="end"] { animation: none; } }
.timer-pill--big { font-size: 1.35rem; padding: 0.55rem 1.2rem; }
.timer-pill--desk, .timer-pill--stage { position: absolute; top: 12px; right: 12px; z-index: 4; font-size: 1.1rem; }
.timer-pill--stage { font-size: clamp(1.1rem, 2vw, 1.6rem); }

/* Poll setup */
.poll-opts { display: grid; gap: 0.45rem; }
.poll-opt { display: flex; align-items: center; gap: 0.45rem; }
.poll-opt .cp__input { flex: 1 1 auto; min-width: 0; padding: 0.45rem 0.8rem; }
.poll-opt .icon-btn { width: 34px; height: 34px; flex: none; }
.poll-opt__key { flex: none; width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 50%; background: var(--grape); color: #fff; font-family: var(--font-display); font-weight: 600; }
.poll-preview { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.poll-preview__opt, .poll-preview__text { padding: 0.35rem 0.75rem; border-radius: var(--radius-sm); border: 1.5px dashed var(--border-strong); color: var(--text); font-size: 0.92rem; }
.poll-live__q { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: var(--text); }

/* Poll results — shared by the room, past polls and the student's desk */
.poll-results { display: grid; gap: 0.55rem; }
.poll-results[hidden] { display: none; }
.poll-bar__label { display: flex; align-items: baseline; gap: 0.4rem; color: var(--text); font-size: 0.95rem; }
.poll-bar__key { font-family: var(--font-display); font-weight: 600; }
.poll-bar__n { margin-left: auto; font-family: var(--font-display); font-weight: 600; }
.poll-bar__track { height: 12px; border-radius: var(--radius-pill); background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; margin-top: 0.2rem; }
.poll-bar__track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--grape), var(--bubble)); transition: width 0.4s ease; }
.poll-bar__who { margin: 0.25rem 0 0; font-size: 0.8rem; color: var(--muted); }
.poll-answers { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; max-height: 280px; overflow: auto; }
.poll-answers li { padding: 0.45rem 0.7rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: 0.95rem; }
.poll-answers strong { font-family: var(--font-display); font-weight: 600; margin-right: 0.3rem; }
.past-polls { display: grid; gap: 1rem; }
.past-poll { border: 1.5px solid var(--border); border-radius: var(--radius); padding: 0.9rem 1rem; display: grid; gap: 0.5rem; justify-items: start; }
.past-poll h4 { margin: 0; color: var(--text); }
.past-poll .poll-results { justify-self: stretch; }
.past-poll p { margin: 0; }

/* Name picker */
.picker {
  min-height: 4.2rem;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 0.6rem;
  border-radius: var(--radius);
  border: 2px dashed var(--border-strong);
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  overflow-wrap: anywhere;
}
.picker[data-state="spinning"] { color: var(--text); border-style: solid; }
.picker[data-state="picked"] {
  color: var(--ink);
  border: 2px solid var(--sunny);
  background: var(--sunny);
  font-size: 1.7rem;
  animation: pick-pop 0.45s ease-out;
}
@keyframes pick-pop { 0% { transform: scale(0.85); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .picker[data-state="picked"] { animation: none; } }

/* On the student's desk */
.poll-card {
  margin: 0 0 1rem;
  padding: 1rem 1.2rem 1.1rem;
  border-radius: var(--radius-lg);
  border: 2px solid color-mix(in srgb, var(--grape) 45%, var(--border));
  background: color-mix(in srgb, var(--grape) 7%, var(--surface));
  background-image: var(--shine);
  box-shadow: var(--float);
  display: grid;
  gap: 0.7rem;
}
.poll-card[hidden] { display: none; }
.poll-card[data-closed="true"] { opacity: 0.85; }
.poll-card__kicker { margin: 0; font-size: 0.85rem; font-weight: 800; color: var(--muted); letter-spacing: 0.02em; }
.poll-card__q { margin: 0; font-size: clamp(1.2rem, 2.6vw, 1.55rem); color: var(--text); }
.poll-card__opts { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.poll-card__opts[hidden] { display: none; }
.poll-card__text { display: flex; gap: 0.5rem; }
.poll-card__text[hidden] { display: none; }
.poll-card__text .cp__input { flex: 1 1 auto; min-width: 0; }
.poll-card__note { margin: 0; min-height: 1.2em; }
.poll-choice {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 52px;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  border: 2px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  box-shadow: var(--pop);
  text-align: left;
}
.poll-choice:hover:not(:disabled) { border-color: var(--grape); transform: translateY(-1px); }
.poll-choice:focus-visible { outline: 3px solid color-mix(in srgb, var(--grape) 45%, transparent); outline-offset: 2px; }
.poll-choice[aria-pressed="true"] { background: var(--grape); border-color: var(--grape); color: #fff; }
.poll-choice:disabled { cursor: default; }
.poll-choice__key { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; }
.poll-choice__emoji { font-size: 1.5rem; line-height: 1; }
.poll-choice__text { font-size: 0.98rem; }
.poll-card__opts[data-type="thumbs"] .poll-choice { flex-direction: column; gap: 0.1rem; min-width: 64px; justify-content: center; text-align: center; }

.picked-banner {
  margin: 0 0 1rem;
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--sky) 22%, var(--surface));
  border: 1.5px solid var(--sky);
  color: var(--text);
  font-size: 1.05rem;
}
.picked-banner[hidden] { display: none; }
.picked-banner strong { font-family: var(--font-display); font-weight: 600; }
.picked-banner[data-mine="true"] { background: var(--sunny); border-color: var(--sunny); color: var(--ink); font-size: 1.3rem; animation: pick-pop 0.45s ease-out; }

/* Teaching desk */
.teach__head > .teach__actions { flex: 0 1 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.teach__acts { display: inline-flex; flex-wrap: wrap; gap: 0.5rem; }
.teach__acts[hidden] { display: none; }
.teach__canvas { position: relative; }
.timer-pop {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 330;
  width: min(320px, calc(100% - 24px));
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  box-shadow: var(--float);
  display: grid;
  gap: 0.6rem;
}
.timer-pop[hidden] { display: none; }
.timer-pop__title { margin: 0; font-family: var(--font-display); font-weight: 600; color: var(--text); }
.timer-pop .chip { padding: 0.35rem 0.8rem; font-size: 0.9rem; }
html.presenting .timer-pop { position: fixed; top: auto; right: auto; left: 50%; bottom: 90px; transform: translateX(-50%); }
.stage-pick {
  position: absolute;
  inset: 0;
  z-index: 320;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1rem;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(3px);
  cursor: pointer;
}
.stage-pick[hidden] { display: none; }
html.presenting .stage-pick { position: fixed; }
.stage-pick__kicker { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.2rem, 2.6vw, 2rem); color: var(--text); }
.picker--stage { min-width: min(80vw, 520px); min-height: 7rem; font-size: clamp(2rem, 5vw, 3.6rem); box-shadow: var(--float); background: var(--surface); }
.picker--stage[data-state="picked"] { font-size: clamp(2.4rem, 6vw, 4.4rem); }

/* Doodle Drawer: saved polls */
.pad__kind[data-kind="poll"] { background: var(--coral); }
.act > div:not([hidden]):not(.act__row):not(.picker):not(.timer-pill) { display: grid; gap: 0.7rem; min-width: 0; }
.act .cp__input { width: 100%; }
.act .act__row .cp__input { width: auto; }
.act .poll-opts > .btn { justify-self: start; }
.act > div > .act__row > .btn, .act > div > .btn { justify-self: start; }

/* ---- Class stars ------------------------------------------------------------ */
.pupil__stars { font-size: 0.8rem; font-weight: 800; color: var(--text); padding: 0.1rem 0.45rem; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--sunny) 40%, var(--surface)); white-space: nowrap; }
.stars-goal { display: grid; gap: 0.35rem; color: var(--text); }
.stars-goal__track, .stars-strip__track { height: 14px; }
.stars-goal__track span, .stars-strip__track span { background: linear-gradient(90deg, var(--sunny), var(--coral)); }
.stars-goal-form { padding: 0.6rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.stars-goal-form[hidden] { display: none; }
.stars-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 0.45rem; max-height: 340px; overflow: auto; }
.stars-row { display: flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.4rem 0.35rem 0.75rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); }
.stars-row[data-away="true"] .stars-row__name { color: var(--muted); }
.stars-row__name { flex: 1 1 auto; min-width: 0; font-family: var(--font-display); font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stars-row__n { font-weight: 800; color: var(--text); font-size: 0.9rem; min-width: 2.6rem; text-align: right; }
.stars-row .icon-btn { width: 34px; height: 34px; }
.stars-row .icon-btn[disabled] { opacity: 0.35; cursor: not-allowed; }
.stars-row__give { padding: 0.35rem 0.7rem; font-size: 0.88rem; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--grape); text-decoration: underline; cursor: pointer; }
[data-theme="dark"] .linkish { color: #c4b5fd; }

.star-badge { display: inline-flex; align-items: center; padding: 0.3rem 0.75rem; border-radius: var(--radius-pill); background: var(--sunny); color: var(--ink); font-family: var(--font-display); font-weight: 600; box-shadow: var(--pop); }
.star-badge[hidden] { display: none; }
.star-badge.is-new { animation: pick-pop 0.6s ease-out; }
.stars-strip { display: grid; gap: 0.35rem; margin: 0 0 1rem; padding: 0.65rem 1rem; border-radius: var(--radius); background: color-mix(in srgb, var(--sunny) 14%, var(--surface)); border: 1.5px solid color-mix(in srgb, var(--sunny) 60%, var(--border)); color: var(--text); }
.stars-strip[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .star-badge.is-new { animation: none; } }

/* ---- Partner desks ---------------------------------------------------------- */
.group-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 0.7rem; }
.group-card { border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface-2); padding: 0.7rem 0.8rem; display: grid; gap: 0.45rem; align-content: start; justify-items: start; min-width: 0; }
.group-card--loose { border-style: dashed; }
.group-card__name { margin: 0; font-size: 1rem; color: var(--text); }
.group-card__who { margin: 0; font-size: 0.88rem; color: var(--text); }
.group-card__who .dot { display: inline-block; vertical-align: middle; }
.group-card__members { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; width: 100%; }
.group-card__members li { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; color: var(--text); font-weight: 700; font-size: 0.92rem; }
.group-card__members .paper-select { width: auto; padding: 0.2rem 0.4rem; font-size: 0.82rem; }
.group-card__shot { display: block; width: 100%; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; overflow: hidden; aspect-ratio: 1200 / 740; cursor: pointer; }
div.group-card__shot { cursor: default; }
.group-card__shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.group-card__shot img[src=""] { visibility: hidden; }
.group-card--live .btn { padding: 0.35rem 0.8rem; font-size: 0.88rem; }
.group-banner {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin: 0 0 1rem;
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--mint) 18%, var(--surface));
  border: 1.5px solid color-mix(in srgb, var(--mint) 60%, var(--border));
  color: var(--text);
}
.group-banner[hidden] { display: none; }
.group-banner > span:first-child { font-size: 1.4rem; }
.group-banner strong { font-family: var(--font-display); font-weight: 600; }
.group-paper { width: auto; max-width: 100%; }

/* ---- Student portfolios ----------------------------------------------------- */
.pf-all { margin: 0 0 0 auto; }
.pf-layout { display: grid; grid-template-columns: minmax(200px, 260px) 1fr; gap: 1rem; align-items: start; }
@media (max-width: 860px) { .pf-layout { grid-template-columns: 1fr; } }
.pf-list { padding: 0.9rem; display: grid; gap: 0.6rem; position: sticky; top: calc(var(--nav-h) + 1rem); max-height: calc(100vh - var(--nav-h) - 2rem); overflow: auto; }
@media (max-width: 860px) { .pf-list { position: static; max-height: 280px; } }
.pf-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
.pf-student { width: 100%; text-align: left; font: inherit; font-family: var(--font-display); font-weight: 600; color: var(--text); background: transparent; border: 1.5px solid transparent; border-radius: var(--radius-sm); padding: 0.45rem 0.7rem; cursor: pointer; }
.pf-student:hover { background: var(--surface-2); }
.pf-student[aria-current="true"] { background: var(--grape); color: #fff; }
.pf-sheet { padding: clamp(1rem, 3vw, 1.6rem); min-width: 0; }
.pf-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.8rem; }
.pf-name { margin: 0; font-size: clamp(1.5rem, 3.5vw, 2rem); }
.pf-sec { margin-top: 1.4rem; display: grid; gap: 0.6rem; }
.pf-sec h3 { margin: 0; font-size: 1.15rem; color: var(--text); padding-bottom: 0.35rem; border-bottom: 2px solid var(--border); }
.pf-stars { background: color-mix(in srgb, var(--sunny) 30%, var(--surface)); }
.pf-days { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.pf-day { display: inline-grid; justify-items: center; min-width: 2.8rem; padding: 0.3rem 0.35rem; border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: 0.72rem; font-weight: 700; color: var(--muted); }
.pf-day b { font-size: 0.9rem; color: var(--text); }
.pf-table { min-width: 0; }
.pf-polls { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.pf-polls li { display: grid; grid-template-columns: 7rem 1fr 1fr; gap: 0.6rem; align-items: baseline; padding: 0.5rem 0.7rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
@media (max-width: 560px) { .pf-polls li { grid-template-columns: 1fr; gap: 0.15rem; } }
.pf-desks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 0.8rem; }
.pf-desk { margin: 0; display: grid; gap: 0.3rem; }
.pf-desk img { width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #fff; }
.pf-desk figcaption { font-size: 0.82rem; color: var(--muted); }
.pf-note { min-height: 6rem; resize: vertical; border-radius: var(--radius) !important; font-family: var(--font-body); }
.poll-card__note.muted, .poll-card .small.muted { color: var(--text); opacity: 0.85; }

/* ---- Long-form pages (privacy, terms, about) ---------------------------- */
.prose { max-width: 760px; }
.prose h2 { font-size: 1.45rem; margin-top: 2.2rem; margin-bottom: 0.6rem; }
.prose p, .prose li { font-size: 1.05rem; line-height: 1.7; }
.prose ul { padding-left: 1.3rem; margin: 0.4rem 0 1rem; }
.prose li { margin-bottom: 0.45rem; }
.prose a:not(.btn) { color: var(--grape); text-decoration: underline; text-underline-offset: 3px; }
[data-theme="dark"] .prose a:not(.btn) { color: var(--sky); }

/* ---- Hero: animated teacher screen -------------------------------------- */
.board-task {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--text);
  background: var(--surface);
  border: 1.5px dashed var(--border-strong);
  border-radius: 10px;
  padding: 0.35rem 0.6rem;
}
.board__ink { position: absolute; inset: 10% 8% 18%; width: 84%; height: 72%; z-index: 1; }
.board__ink path {
  fill: none;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 260;
  stroke-dashoffset: 260;
  animation: ink-draw 0.6s ease-out forwards;
}
.board__ink--done path { animation: none; stroke-dashoffset: 0; }
.board__badge {
  position: absolute;
  top: 4px;
  right: 5px;
  z-index: 3;
  font-size: 1rem;
  line-height: 1;
  animation: pop-in 0.45s backwards;
}
.board__badge--hand { animation: pop-in 0.45s backwards, hand-wave 0.9s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes hand-wave { 0%, 100% { transform: rotate(-12deg); } 50% { transform: rotate(12deg); } }
.board { transition: box-shadow 0.3s ease; }
@keyframes ink-draw { to { stroke-dashoffset: 0; } }

/* ---- Stroke replay ------------------------------------------------------ */
.replay { z-index: 160; }
.replay__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 0.9rem; }
.replay__bar .btn { padding: 0.5rem 1rem; font-size: 0.92rem; }
.replay__scrub { flex: 1 1 220px; accent-color: var(--grape); min-width: 160px; }
.replay__count { min-width: 7.5em; text-align: right; }
.snap-card { position: relative; }
.snap-card__replay {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  padding: 0.3rem 0.7rem; font-size: 0.8rem;
}

/* ---- Checkbox groups (school interest form) ----------------------------- */
.checks { display: flex; flex-wrap: wrap; gap: 0.5rem 1.1rem; }
.check { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.97rem; cursor: pointer; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--grape); }
