/* The Third Grandparent — picture-book style */
:root {
  --paper: #FFF8EC;
  --paper-2: #FDEFD6;
  --card: #FFFDF8;
  --ink: #3B2F2A;
  --ink-2: #6B5A50;
  --sun: #FFC845;
  --sun-2: #FFE39A;
  --coral: #FF8A65;
  --coral-2: #FFD1C1;
  --sky: #8FD3F4;
  --sky-2: #D6F0FB;
  --leaf: #8BC97A;
  --leaf-2: #DDF0D5;
  --lav: #B9A6E8;
  --lav-2: #E9E2FA;
  --rose: #F4A6B8;
  --ocean: #CFEAF4;
  --danger: #C93B3B;
  --danger-2: #FDE1DE;
  --ok: #2E8150;
  --ok-2: #DCF2E2;
  --wobble: 255px 18px 225px 18px / 18px 225px 18px 255px;
  --wobble-2: 18px 225px 18px 255px / 255px 18px 225px 18px;
  --shadow: 4px 5px 0 var(--ink);
  --shadow-sm: 2px 3px 0 var(--ink);
  --font-head: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;
  --font-hand: 'Caveat', 'Comic Sans MS', cursive;
  --scale: 1;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.45, .64, 1);
  font-size: calc(17px * var(--scale));
  interpolate-size: allow-keywords;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
/* Always reserve the scrollbar's space, so pages never shift sideways
   when one page is long enough to scroll and the next is not. */
html { scrollbar-gutter: stable; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
main [id] { scroll-margin-top: 84px; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .23 0 0 0 0 .18 0 0 0 0 .16 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.15; margin: 0 0 .4em; letter-spacing: .2px; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 .8em; }
a { color: #A8461F; }
a:hover { color: #7C3215; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px dashed var(--ink); outline-offset: 3px; }
.hand { font-family: var(--font-hand); font-size: 1.45em; line-height: 1.1; }
.muted { color: var(--ink-2); }
.small { font-size: .88rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--sun); padding: 8px 14px; border: 2px solid var(--ink); border-radius: 10px; z-index: 100; }
.skip:focus { left: 8px; }

/* an element with the hidden attribute is really hidden, whatever its display style */
[hidden] { display: none !important; }

/* ---------- Top bar (logo + menu only) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60; height: 64px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 0 clamp(16px, 3vw, 28px);
  /* the frosted glass lives on ::before: a backdrop-filter on the bar itself would
     trap position:fixed children (the phone bottom tab bar) inside the top bar */
  isolation: isolate;
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease-out), background-color .3s var(--ease-out);
  view-transition-name: topbar;
}
.topbar::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: color-mix(in srgb, var(--paper) 72%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
  transition: opacity .3s var(--ease-out);
}
.topbar.scrolled { border-bottom-color: color-mix(in srgb, var(--ink) 14%, transparent); }
body[data-route=""][data-role=""] .topbar:not(.scrolled)::before { opacity: 0; }
body[data-route=""][data-role=""] .brand { visibility: hidden; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark svg { width: 46px; height: 46px; display: block; }
.brand-text { font-family: var(--font-head); font-size: .95rem; line-height: 1.05; }
.brand-text b { font-size: 1.15rem; font-weight: 700; }
.who-chip {
  margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 1px;
  text-decoration: none; color: var(--ink); line-height: 1.1; min-width: 0; max-width: 46vw;
  padding: 4px 14px; border-radius: 14px; border: 2px solid color-mix(in srgb, var(--ink) 14%, transparent); background: var(--card);
}
.who-chip b { font-family: var(--font-head); font-weight: 600; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.who-chip span { font-size: .78rem; font-weight: 800; padding: 1px 8px; border-radius: 999px; background: var(--sun-2); white-space: nowrap; }
body[data-role="kid"] .who-chip span { background: color-mix(in srgb, var(--ok) 22%, var(--card)); }
.menu-btn {
  width: 48px; height: 48px; border-radius: 14px; border: 2.5px solid var(--ink); background: var(--card);
  display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-sm);
}
.menu-btn[aria-expanded="true"] { background: var(--sun); }
.menu {
  position: absolute; right: clamp(16px, 3vw, 28px); top: 60px; width: min(280px, calc(100vw - 32px));
  background: var(--card); border: 2.5px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow);
  padding: 10px; display: flex; flex-direction: column; gap: 2px; animation: menu-in .3s var(--ease-out); transform-origin: top right;
}
.menu[hidden] { display: none; }
.menu a {
  text-decoration: none; color: var(--ink); font-family: var(--font-head); font-weight: 500; font-size: 1.05rem;
  padding: 10px 14px; border-radius: 12px; min-height: 44px; display: flex; align-items: center;
}
.menu a:hover { background: var(--sun-2); }
.menu a[aria-current="page"] { background: var(--sun); }
.menu-sep { height: 2px; background: color-mix(in srgb, var(--ink) 12%, transparent); margin: 6px 4px; }
.menu-label { font-size: .85rem; font-weight: 800; color: var(--ink-2); padding: 2px 14px; }
.textsize { display: flex; gap: 6px; padding: 4px 10px 6px; }
.textsize button {
  min-width: 48px; min-height: 44px; border: 2px solid var(--ink); background: var(--card); border-radius: 12px;
  font-family: var(--font-head); font-weight: 600; cursor: pointer;
}
.textsize button[aria-pressed="true"] { background: var(--sky); }

/* ---------- Home: logo + two choices ---------- */
.home { min-height: calc(100vh - 64px); display: grid; place-items: center; text-align: center; padding: 24px 16px 48px; }
.home-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.home-logo { width: clamp(120px, 18vw, 170px); height: auto; }
.home-logo .sunrays { transform-origin: 32px 32px; } /* the rays are drawn around (32, 32) in the logo's own coordinates */
.home h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); margin: 6px 0 0; }
.home .tagline { font-family: var(--font-hand); font-size: clamp(1.4rem, 3vw, 1.9rem); color: var(--ink-2); margin: 0 0 22px; }
.choices { display: flex; gap: clamp(16px, 3vw, 28px); flex-wrap: wrap; justify-content: center; }
.choice {
  width: 250px; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 18px 20px;
  text-decoration: none; color: var(--ink); background: var(--sun); border: 3px solid var(--ink); border-radius: var(--wobble);
  box-shadow: var(--shadow); transition: transform .4s var(--ease-spring), box-shadow .4s var(--ease-out);
}
.choice.kid { background: var(--sky); border-radius: var(--wobble-2); }
.choice:hover { transform: translate(-2px, -3px) rotate(-1deg); box-shadow: 6px 8px 0 var(--ink); color: var(--ink); }
.choice:active { transform: translate(2px, 3px); box-shadow: 0 0 0 var(--ink); transition-duration: .08s; }
.choice .label { font-family: var(--font-head); font-weight: 600; font-size: 1.45rem; }
.choice .avatar-wrap { height: 120px; display: flex; align-items: flex-end; }

main { display: block; }
main:focus { outline: none; }
.wrap { max-width: 1180px; margin: 0 auto; padding: clamp(20px, 4vw, 44px) clamp(16px, 3vw, 32px); }

/* ---------- Buttons, chips, cards ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: .7em 1.35em;
  font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; text-decoration: none; color: var(--ink);
  background: var(--sun); border: 2.5px solid var(--ink); border-radius: var(--wobble);
  box-shadow: var(--shadow-sm); cursor: pointer; transition: transform .3s var(--ease-spring), box-shadow .3s var(--ease-out), background-color .25s var(--ease-out);
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 4px 0 var(--ink); color: var(--ink); }
.btn:active { transform: translate(2px, 3px); box-shadow: 0 0 0 var(--ink); transition-duration: .08s; }
.btn.big { font-size: 1.3rem; min-height: 64px; padding: .8em 1.8em; }
.btn.coral { background: var(--coral); }
.btn.sky { background: var(--sky); }
.btn.leaf { background: var(--leaf); }
.btn.lav { background: var(--lav); }
.btn.white { background: var(--card); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { color: #fff; }
.btn.sm { min-height: 44px; font-size: .95rem; padding: .45em 1em; }
.btn svg { flex: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 14px;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--card); cursor: pointer;
  font-family: var(--font-head); font-weight: 500;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.chip .dot { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--ink); }

.card {
  background: var(--card); border: 2.5px solid var(--ink); border-radius: var(--wobble);
  box-shadow: var(--shadow); padding: 22px;
}
.card.alt { border-radius: var(--wobble-2); }
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  border: 1.5px solid var(--ink); font-size: .82rem; font-weight: 700; background: var(--paper-2); white-space: nowrap;
}
.tag.live { background: var(--coral); }
.tag.live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); animation: blink 1.2s infinite; }
.tag.ok { background: var(--ok-2); color: var(--ok); border-color: var(--ok); }
.tag.danger { background: var(--danger-2); color: var(--danger); border-color: var(--danger); }
@keyframes blink { 50% { opacity: .2; } }

.grid { display: grid; gap: 22px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ---------- Landing ---------- */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 30px; align-items: center; }
.hero .lead { font-size: 1.2rem; color: var(--ink-2); max-width: 34ch; }
.hero-art { width: 100%; height: auto; display: block; }
.hero .eyebrow { font-family: var(--font-hand); font-size: 1.7rem; color: #A8461F; margin-bottom: 4px; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }
.subject-card { text-align: left; }
.subject-card .icon { width: 64px; height: 64px; border-radius: 50%; border: 2.5px solid var(--ink); display: grid; place-items: center; margin-bottom: 12px; }
.promise { background: var(--leaf-2); }
.promise ul { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.promise li { display: flex; gap: 10px; align-items: flex-start; }
.promise li svg { flex: none; margin-top: 3px; }
.section-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 46px 0 18px; }

/* ---------- Map (full screen) ---------- */
.map-full { position: relative; height: calc(100vh - 64px); min-height: 520px; overflow: hidden; background: #FDEFD6; }
.map-full svg.world { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.map-full svg.world:active { cursor: grabbing; }
.map-full .countries path { vector-effect: non-scaling-stroke; }
.map-full.zooming .countries { filter: none !important; }
.markers { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.marker {
  position: absolute; left: 0; top: 0; pointer-events: auto;
  background: none; border: 0; padding: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center;
}
.marker .bob { animation: bob 3s ease-in-out infinite; display: block; position: relative; }
.marker:nth-child(3n) .bob { animation-delay: -1s; }
.marker:nth-child(3n+1) .bob { animation-delay: -2s; }
@keyframes bob { 50% { transform: translateY(-4px); } }
.marker .name {
  margin-top: -4px; background: var(--card); border: 2px solid var(--ink); border-radius: 999px;
  font-family: var(--font-head); font-weight: 600; font-size: .8rem; padding: 1px 10px; white-space: nowrap; box-shadow: 1.5px 2px 0 var(--ink);
}
.marker .bubble {
  position: absolute; top: -10px; right: -12px; width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--ink); display: grid; place-items: center; box-shadow: 1.5px 2px 0 var(--ink);
}
.marker .ring { position: absolute; left: 50%; bottom: 2px; width: 54px; height: 16px; margin-left: -27px; border-radius: 50%; border: 3px solid var(--coral); animation: ring 1.8s ease-out infinite; }
@keyframes ring { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.marker:hover .name, .marker:focus-visible .name, .marker.selected .name { background: var(--ink); color: var(--paper); }
.marker.self { cursor: default; z-index: 2; }
.marker.self .name { background: var(--coral); }
.marker.cluster .count {
  position: absolute; top: -6px; right: -14px; min-width: 32px; height: 32px; padding: 0 6px; border-radius: 999px;
  background: var(--coral); border: 2px solid var(--ink); font-family: var(--font-head); font-weight: 700; display: grid; place-items: center;
}
@keyframes dash { to { stroke-dashoffset: -22; } }
.map-overlay { position: absolute; z-index: 3; }
.map-toggle { left: 50%; top: 16px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; width: max-content; max-width: calc(100% - 32px); }
.seg.big { box-shadow: var(--shadow-sm); border-width: 2.5px; }
.seg.big button { min-height: 52px; padding: 4px 18px 4px 10px; font-size: 1.05rem; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.seg.big button svg { flex: none; }
.map-hint { margin: 0; background: var(--card); border: 2px solid var(--ink); border-radius: 999px; padding: 4px 14px; font-size: .92rem; font-weight: 700; text-align: center; }
.map-note { left: 16px; bottom: 16px; font-size: .8rem; color: var(--ink-2); background: color-mix(in srgb, var(--card) 85%, transparent); border-radius: 999px; padding: 4px 12px; display: flex; gap: 6px; align-items: center; }
.map-zoom { right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.map-zoom button { width: 48px; height: 48px; border: 2.5px solid var(--ink); background: var(--card); border-radius: 14px; font-size: 1.5rem; font-weight: 700; cursor: pointer; box-shadow: var(--shadow-sm); display: grid; place-items: center; }
.map-sun { right: 20px; top: 14px; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.sunrays { animation: spin 30s linear infinite; }
.arc-anim { animation: dash 1.2s linear infinite; }
.map-loading { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-head); font-size: 1.3rem; z-index: 4; }
.info-card { right: 16px; top: 96px; width: min(360px, calc(100% - 32px)); max-height: calc(100% - 180px); overflow-y: auto; padding: 20px; animation: pop .25s ease; }
.info-card .close { position: absolute; right: 10px; top: 10px; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--ink); background: var(--card); cursor: pointer; font-size: 1.4rem; line-height: 1; }
.info-card .head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.info-card .btn { width: 100%; margin-top: 6px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .95rem; margin: 12px 0; }
.kv dt { font-weight: 800; }
.kv dd { margin: 0; }
@media (max-width: 700px) {
  .info-card { top: auto; bottom: 0; right: 0; left: 0; width: auto; max-height: 62%; border-radius: 22px 22px 0 0; }
  .seg.big button { font-size: .95rem; padding: 4px 12px 4px 6px; }
  .map-sun { display: none; }
}
/* ---------- Corner (grandparent home) ---------- */
.corner-hero { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.corner-hero .greet { flex: 1 1 320px; }
.join-card { background: var(--sun-2); display: flex; flex-direction: column; gap: 14px; }
.tz { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-family: var(--font-head); font-size: 1.15rem; }
.tz .clock { padding: 6px 14px; background: var(--card); border: 2px solid var(--ink); border-radius: 14px; }
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 22px; }
.artwork { background: #fff; padding: 10px 10px 14px; border: 2px solid var(--ink); box-shadow: var(--shadow-sm); transform: rotate(var(--r, -1.5deg)); transition: transform .2s; }
.artwork:hover { transform: rotate(0) scale(1.03); }
.artwork svg { width: 100%; height: auto; display: block; border: 1.5px solid #e7dccb; }
.artwork .cap { font-family: var(--font-hand); font-size: 1.3rem; line-height: 1.1; margin-top: 8px; }
.artwork .reply { font-size: .85rem; color: var(--ink-2); margin-top: 4px; }
.letter { background: #fff; border: 2px solid var(--ink); border-radius: 6px; padding: 16px 18px; box-shadow: var(--shadow-sm); background-image: repeating-linear-gradient(transparent 0 30px, #E4EEF6 30px 31px); }
.letter .orig { font-family: var(--font-hand); font-size: 1.45rem; line-height: 1.25; }
.letter .trans { font-size: .95rem; color: var(--ink-2); margin-top: 6px; }

/* ---------- Classroom ---------- */
.class-top { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.class-top h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 0; }
.class-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 22px; }
@media (max-width: 980px) { .class-layout { grid-template-columns: 1fr; } }
.stage { position: relative; }
.tile { position: relative; border: 2.5px solid var(--ink); border-radius: 18px; overflow: hidden; background: var(--sky-2); box-shadow: var(--shadow); }
.tile svg.scene, .tile video { display: block; width: 100%; height: auto; }
.tile video { aspect-ratio: 4/3; object-fit: cover; background: #000; }
.tile video[data-own] { transform: scaleX(-1); } /* my own camera as a mirror; the other person's is not mirrored */
.tile .label { position: absolute; left: 10px; bottom: 10px; background: var(--card); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 12px; font-family: var(--font-head); font-weight: 600; font-size: .9rem; }
.tile.speaking { outline: 5px solid var(--sun); outline-offset: -2px; }
.tile .rec { position: absolute; right: 10px; top: 10px; }
.pip { position: absolute; right: 14px; bottom: 14px; width: 30%; min-width: 150px; }
.pip .tile { box-shadow: var(--shadow-sm); }
.teacher-strip { display: flex; gap: 12px; align-items: center; margin-top: 16px; padding: 10px 14px; border: 2px solid var(--ok); background: var(--ok-2); border-radius: 14px; color: var(--ok); font-weight: 700; flex-wrap: wrap; }
.captions { display: flex; flex-direction: column; height: 100%; min-height: 520px; padding: 0; overflow: hidden; }
.captions header { padding: 14px 18px; border-bottom: 2px dashed var(--ink); display: flex; flex-direction: column; gap: 10px; }
.caption-list { flex: 1; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; max-height: 520px; scroll-behavior: smooth; }
.cap-line { display: grid; grid-template-columns: 40px 1fr; gap: 10px; animation: pop .35s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }
.cap-line .who { font-weight: 800; font-size: .85rem; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cap-line .tr { font-size: 1.15rem; font-family: var(--font-head); font-weight: 500; line-height: 1.3; }
.cap-line .orig { font-size: .88rem; color: var(--ink-2); }
.cap-line .face { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--ink); overflow: hidden; background: var(--sky-2); display: grid; place-items: center; }
.cap-line .face svg { margin-top: 10px; }
.cap-line.blocked .tr { color: var(--danger); text-decoration: line-through; text-decoration-thickness: 2px; }
.cap-line.withheld .tr { color: var(--danger); font-style: italic; }
.cap-line.flag-medium .tr { background: #FFF1C9; border-radius: 6px; padding: 0 4px; }
.redact { background: var(--ink); color: var(--paper); border-radius: 4px; padding: 0 5px; font-size: .85em; text-decoration: none; display: inline-block; }
.composer { border-top: 2px dashed var(--ink); padding: 12px 18px; display: flex; flex-direction: column; gap: 8px; }
.composer form { display: flex; gap: 8px; }
.composer input[type="text"] { flex: 1; min-width: 0; min-height: 48px; padding: 8px 14px; border: 2px solid var(--ink); border-radius: 14px; font: inherit; background: #fff; }
.seg { display: inline-flex; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--card); flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 12px; min-height: 40px; cursor: pointer; font-family: var(--font-head); font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.shield-status { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.icon-btn { width: 48px; height: 48px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--card); display: grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn[aria-pressed="true"] { background: var(--coral); }
.help-hand {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 2.5px solid var(--ink); border-radius: var(--wobble);
  background: var(--sun); cursor: pointer; font-family: var(--font-head); font-weight: 600; font-size: 1.1rem; box-shadow: var(--shadow-sm); text-align: left;
}
.alert-overlay { position: fixed; inset: 0; background: rgba(59, 47, 42, .55); display: grid; place-items: center; z-index: 150; padding: 16px; overflow-y: auto; }
.pip .label { font-size: .72rem; padding: 0 8px; left: 6px; bottom: 6px; }
.alert-card { background: var(--card); border: 3px solid var(--danger); border-radius: 18px; padding: 22px; max-width: 460px; width: 100%; box-shadow: 5px 6px 0 var(--ink); animation: pop .3s ease; }
.alert-card h3 { color: var(--danger); display: flex; gap: 8px; align-items: center; }
.steps { list-style: none; padding: 0; margin: 12px 0 16px; display: grid; gap: 8px; }
.steps li { display: flex; gap: 10px; align-items: center; opacity: .25; transition: opacity .3s; }
.steps li.done { opacity: 1; }
.steps li .tick { width: 24px; height: 24px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; flex: none; font-weight: 800; font-size: .8rem; }

/* ---------- Safety center ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.kpi { padding: 16px 18px; }
.kpi .n { font-family: var(--font-head); font-size: 2.2rem; font-weight: 700; line-height: 1; }
.safety-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); gap: 22px; align-items: start; }
@media (max-width: 980px) { .safety-layout { grid-template-columns: 1fr; } }
.alert-row { display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border: 2px solid var(--ink); border-radius: 14px; background: var(--card); cursor: pointer; text-align: left; width: 100%; }
.alert-row:hover, .alert-row[aria-current="true"] { background: var(--sun-2); }
.sev { width: 14px; height: 100%; min-height: 38px; border-radius: 6px; border: 1.5px solid var(--ink); }
.sev.high { background: var(--danger); }
.sev.medium { background: #F2A33A; }
.sev.low { background: var(--sun); }
.alert-row .t { font-weight: 800; }
.timeline { list-style: none; margin: 10px 0; padding: 0 0 0 16px; border-left: 2.5px dotted var(--ink); display: grid; gap: 10px; }
.timeline li { position: relative; font-size: .93rem; }
.timeline li::before { content: ''; position: absolute; left: -23px; top: 6px; width: 11px; height: 11px; border-radius: 50%; background: var(--card); border: 2.5px solid var(--ink); }
.excerpt { background: var(--paper-2); border: 1.5px dashed var(--ink); border-radius: 10px; padding: 10px 12px; font-size: .95rem; margin: 8px 0; }
.channels { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.channel { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 2px solid var(--ink); border-radius: 14px; background: var(--card); }
.channel .ic { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; flex: none; }

/* ---------- Storybook ---------- */
.book { display: grid; grid-template-columns: 1fr 1fr; background: var(--card); border: 3px solid var(--ink); border-radius: 22px; box-shadow: 6px 8px 0 var(--ink); overflow: hidden; min-height: 460px; position: relative; }
.book::after { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; background: repeating-linear-gradient(var(--ink) 0 8px, transparent 8px 14px); opacity: .35; }
.book .art { background: var(--sky-2); display: grid; place-items: center; padding: 20px; }
.book .art svg { width: 100%; max-width: 420px; height: auto; }
.book .text { padding: clamp(22px, 4vw, 48px); display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.book .text .big { font-family: var(--font-head); font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.25; font-weight: 600; }
.book .pg { font-family: var(--font-hand); font-size: 1.5rem; color: var(--ink-2); }
.book-nav { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin-top: 22px; flex-wrap: wrap; }
.dots { display: flex; gap: 8px; }
.dots button { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ink); background: var(--card); padding: 0; cursor: pointer; }
.dots button[aria-current="true"] { background: var(--coral); }
@media (max-width: 760px) { .book { grid-template-columns: 1fr; } .book::after { display: none; } }

/* ---------- Grandparent funnel: info page ---------- */
/* ---------- Home: safety strip + safety rules ---------- */
body[data-route=""] .home { min-height: auto; padding: 4px 16px 28px; }
body[data-route=""] .home-logo { width: clamp(110px, 16vw, 170px); }
body[data-route=""] .home .tagline { margin-bottom: 16px; }
body[data-route=""] .home-explore { margin-top: 14px; }
.safety-strip {
  margin-top: 18px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: center; text-align: left;
  max-width: 760px; padding: 14px 18px; background: var(--ok-2); border: 2.5px solid var(--ok); border-radius: 18px; box-shadow: 3px 4px 0 var(--ok);
}
.safety-strip-text { flex: 1 1 320px; font-size: 1.05rem; }
.safety-strip-text b { font-family: var(--font-head); font-size: 1.15rem; }
.safety-strip ul { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-weight: 700; font-size: .95rem; color: var(--ok); }
.safety-strip li { display: inline-flex; gap: 6px; align-items: center; }
.safety-badge { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--ok); color: #fff; border: 2.5px solid var(--ink); }
.safety-badge.big { width: 84px; height: 84px; box-shadow: var(--shadow-sm); }
.safety-home { background: var(--leaf-2); border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink); margin-top: 18px; }
.safety-head { display: flex; gap: 20px; align-items: center; margin-bottom: 26px; }
.safety-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 6px; }
.lead-safety { font-size: 1.15rem; color: var(--ink-2); margin: 0; max-width: 60ch; }
.safety-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.safety-rule { display: flex; gap: 14px; align-items: flex-start; }
.safety-rule h3 { margin-bottom: 4px; }
.safety-rule p, .zero-tolerance p { margin: 0; }
.safety-ic { width: 54px; height: 54px; border-radius: 50%; border: 2.5px solid var(--ink); display: grid; place-items: center; flex: none; }
.zero-tolerance {
  margin-top: 22px; display: flex; gap: 16px; align-items: flex-start; padding: 20px 22px;
  background: var(--danger-2); border: 3px solid var(--danger); border-radius: var(--wobble-2); box-shadow: 4px 5px 0 var(--danger);
}
.zero-tolerance h3 { color: var(--danger); margin-bottom: 4px; }
@media (max-width: 600px) { .safety-head { flex-direction: column; align-items: flex-start; } }
@media (max-width: 560px) {
  body[data-route=""] .choices { flex-wrap: nowrap; gap: 12px; }
  body[data-route=""] .choice { width: auto; flex: 1 1 0; padding: 14px 8px 12px; gap: 6px; }
  body[data-route=""] .choice .avatar-wrap { height: 90px; }
  body[data-route=""] .choice .avatar-wrap svg { width: 70px; height: auto; }
  body[data-route=""] .choice .label { font-size: 1.1rem; }
  .safety-strip { padding: 12px 14px; gap: 10px; }
  .safety-strip .safety-badge { display: none; }
}
.funnel { font-size: 1.06rem; }
.funnel .hero .lead { max-width: 38ch; }
.funnel .small svg { vertical-align: -3px; color: var(--ok); }
.how { list-style: none; padding: 0; margin: 0; display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.how li { position: relative; padding-top: 30px; }
.how .num {
  width: 48px; height: 48px; border-radius: 50%; border: 2.5px solid var(--ink); box-shadow: var(--shadow-sm);
  display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; flex: none;
}
.how .num { position: absolute; top: -18px; left: 20px; }
.how-ic { margin-bottom: 6px; }
.how p, .decide p { margin: 0; font-size: 1.08rem; }
.decide { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.decide-card { display: flex; gap: 16px; align-items: flex-start; background: var(--tint, var(--card)); }
.decide-ic { width: 62px; height: 62px; border-radius: 50%; border: 2.5px solid var(--ink); display: grid; place-items: center; flex: none; }
.care { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 22px; align-items: start; }
@media (max-width: 860px) { .care { grid-template-columns: 1fr; } }
.care ul, .need ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.care li, .need li { display: flex; gap: 12px; align-items: flex-start; }
.care li svg, .need li svg { flex: none; margin-top: 2px; }
.need { background: var(--sun-2); }
.need li { align-items: center; font-weight: 700; }
.gp-quote { margin: 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.gp-quote blockquote { margin: 0; font-size: 1.6rem; }
.faq { display: grid; gap: 14px; max-width: 860px; }
.faq-item { padding: 0; box-shadow: var(--shadow-sm); }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 16px 56px 16px 20px; min-height: 56px; position: relative;
  font-family: var(--font-head); font-weight: 600; font-size: 1.2rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--ink); background: var(--sun); display: grid; place-items: center; font-size: 1.3rem; line-height: 1;
}
.faq-item[open] summary::after { content: '–'; background: var(--sky); }
.faq-item p { padding: 0 20px 18px; margin: 0; font-size: 1.08rem; }
.cta-band {
  margin-top: 50px; display: flex; gap: 26px; align-items: center; flex-wrap: wrap; padding: 28px clamp(20px, 4vw, 40px);
  background: var(--sun); border: 3px solid var(--ink); border-radius: var(--wobble); box-shadow: var(--shadow);
}
.cta-band .cta-text { flex: 1 1 360px; }
.cta-band p { font-size: 1.1rem; }
.cta-band .btn { background: var(--card); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 10px; z-index: 200; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--card); border: 2.5px solid var(--ink); border-radius: 16px; padding: 12px 16px; box-shadow: var(--shadow-sm); animation: pop .3s ease; display: flex; gap: 10px; align-items: flex-start; }
.toast.ok { background: var(--ok-2); }
.toast.warn { background: var(--danger-2); }

/* ---------- Safety Center: report a concern, my reports ---------- */
select.text, textarea.text {
  width: 100%; min-height: 54px; padding: 10px 16px; border: 2.5px solid var(--ink); border-radius: 14px;
  font: inherit; font-size: 1.05rem; background: #fff; color: var(--ink);
}
.safety-user-head { display: flex; gap: 20px; align-items: center; margin-bottom: 24px; }
.report-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .report-layout { grid-template-columns: 1fr; } }
.report-card { border-color: var(--ink); }
.report-card h2 { display: flex; gap: 10px; align-items: center; font-size: 1.6rem; }
.what-list .check { margin-bottom: 8px; padding: 10px 14px; }
.report-how { margin: 0 0 18px; padding-left: 22px; display: grid; gap: 8px; font-size: 1.05rem; }
.report-thanks { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; }
.done-tick { width: 76px; height: 76px; border-radius: 50%; background: var(--leaf); border: 3px solid var(--ink); box-shadow: var(--shadow-sm); display: grid; place-items: center; margin-bottom: 6px; animation: modal-in .45s var(--ease-spring); }
.case-card { padding: 18px; }
.case-steps { list-style: none; margin: 14px 0 10px; padding: 0; display: flex; }
.case-steps li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; font-size: .78rem; font-weight: 700; color: var(--ink-2); text-align: center; }
.case-steps li:not(:first-child)::before { content: ''; position: absolute; top: 14px; right: calc(50% + 16px); left: calc(-50% + 16px); height: 3px; border-radius: 2px; background: color-mix(in srgb, var(--ink) 18%, transparent); }
.case-steps li.done:not(:first-child)::before, .case-steps li.now:not(:first-child)::before { background: var(--ok); }
.case-steps .dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 2.5px solid color-mix(in srgb, var(--ink) 30%, transparent); font-family: var(--font-head); }
.case-steps li.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.case-steps li.now .dot { background: var(--sun); border-color: var(--ink); box-shadow: 0 0 0 4px var(--sun-2); }
.case-steps li.now { color: var(--ink); }
.case-msg { margin: 0; padding: 10px 12px; background: var(--paper-2); border-radius: 12px; font-size: .95rem; }
.empty-reports { padding: 18px; }
.staff-banner { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 0; padding: 12px 16px; background: var(--danger-2); border: 2px solid var(--danger); border-radius: 14px; color: var(--ink); }
.staff-banner svg { flex: none; color: var(--danger); margin-top: 2px; }
.staff-link { margin-top: 34px; display: flex; gap: 6px; align-items: center; }

/* ---------- Settings ---------- */
.settings { max-width: 860px; }
.set-card { margin-bottom: 22px; }
.set-card h2 { display: flex; gap: 10px; align-items: center; font-size: 1.5rem; }
.lang-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.lang-opt { position: relative; cursor: pointer; }
.lang-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lang-opt > span {
  display: flex; flex-direction: column; gap: 2px; min-height: 64px; justify-content: center; padding: 10px 16px;
  border: 2.5px solid var(--ink); border-radius: 16px; background: var(--card); font-size: 1.15rem;
  transition: background-color .2s var(--ease-out), transform .25s var(--ease-spring), box-shadow .25s var(--ease-out);
}
.lang-opt > span b { font-family: var(--font-head); font-weight: 600; }
.lang-opt:hover > span { background: var(--sun-2); }
.lang-opt input:checked + span { background: var(--sun); box-shadow: var(--shadow-sm); transform: translate(-1px, -1px); }
.lang-opt input:focus-visible + span { outline: 3px dashed var(--ink); outline-offset: 3px; }
.prof-head { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.prof-name { font-family: var(--font-head); font-size: 1.3rem; }
.big-size { padding: 0; gap: 10px; flex-wrap: wrap; }
.big-size button { min-width: 120px; min-height: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 1.2rem; }
.btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: var(--shadow-sm); }

/* ---------- Sign-up: avatar from a photo ---------- */
.photo-avatar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 4px 0 18px; padding: 14px 16px; border: 2.5px dashed var(--ink); border-radius: 16px; background: var(--card); }
.photo-avatar .btn:disabled { opacity: .6; }
.photo-status { flex-basis: 100%; display: flex; gap: 8px; align-items: flex-start; font-size: .95rem; }
.photo-status:empty { display: none; }
.photo-status svg { flex: none; margin-top: 3px; }
.photo-status { flex-wrap: wrap; }
.photo-debug { flex-basis: 100%; margin: 6px 0 0; padding: 8px 10px; background: var(--paper-2); border-radius: 10px; font-size: .8rem; white-space: pre-wrap; user-select: all; }
.dots-loader.small-dots { display: inline-flex; gap: 4px; margin: 0; }
.dots-loader.small-dots span { width: 8px; height: 8px; border-width: 1.5px; }

/* ---------- Pitch: an animated story behind a small button ---------- */
.pitch-btn {
  position: fixed; left: 14px; bottom: 14px; z-index: 90; display: inline-flex; gap: 6px; align-items: center;
  padding: 6px 12px; min-height: 34px; border: 2px solid var(--ink); border-radius: 999px; background: var(--card);
  font-family: var(--font-head); font-weight: 600; font-size: .85rem; cursor: pointer; opacity: .7; box-shadow: var(--shadow-sm);
  transition: opacity .2s var(--ease-out), transform .25s var(--ease-spring);
}
.pitch-btn:hover, .pitch-btn:focus-visible { opacity: 1; transform: translateY(-2px); }
body.pitch-open { overflow: hidden; }
body.pitch-open .pitch-btn { display: none; }
@media print { .pitch-btn { display: none; } }
/* phones: sit above the bottom tab bar when someone is logged in */
@media (max-width: 640px) { body[data-role="elder"] .pitch-btn, body[data-role="kid"] .pitch-btn { bottom: calc(78px + env(safe-area-inset-bottom)); } }
.pitch-overlay {
  position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; outline: none;
  background: #2A211D; animation: fade-in .3s var(--ease-out);
}
.pitch-close { position: absolute; right: 14px; top: 14px; z-index: 2; width: 46px; height: 46px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--card); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-sm); }
.pz-stage { width: calc(1280px * var(--pz-scale, 1)); height: calc(720px * var(--pz-scale, 1)); }
.pz-deck {
  position: relative; width: 1280px; height: 720px; transform: scale(var(--pz-scale, 1)); transform-origin: top left;
  background: var(--paper); border-radius: 22px; overflow: hidden; font-size: 20px; line-height: 1.4; color: var(--ink);
}
/* scenes cross-fade; their parts rise in one after another */
.pz-scene { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .7s var(--ease-out), visibility 0s .7s; }
.pz-scene.on { opacity: 1; visibility: visible; transition: opacity .7s var(--ease-out), visibility 0s; }
.pz-scene .pz-in { opacity: 0; }
.pz-scene.on .pz-in { animation: pz-rise .8s var(--ease-out) var(--d, 0s) both; }
@keyframes pz-rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
.pz-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pz-paper { padding: 54px 70px 128px; display: flex; flex-direction: column; gap: 14px; }
.pz-eyebrow { margin: 0; font-family: var(--font-head); font-weight: 700; font-size: 17px; letter-spacing: .14em; text-transform: uppercase; color: #A8461F; }
.pz-scene h2 { margin: 0; font-size: 46px; line-height: 1.1; }
.pz-hand { font-family: var(--font-hand); font-size: 34px; line-height: 1.15; margin: 0; color: var(--ink-2); }
.pz-center { text-align: center; margin-top: auto; }
.pz-src { position: absolute; left: 70px; right: 70px; bottom: 58px; margin: 0; font-size: 12px; color: var(--ink-2); }
.pz-dark .pz-src { color: #E8DCCB; left: auto; right: 40px; width: 560px; text-align: right; bottom: 62px; }
/* title */
.pz-title { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; background: radial-gradient(circle at 50% 42%, #FFF3C4 0, var(--paper) 62%); }
.pz-logo svg { width: 210px; height: auto; }
.pz-logo .sunrays { transform-origin: 32px 32px; } /* same centre as the home page logo */
.pz-logo.small svg { width: 96px; }
.pz-title h1 { margin: 10px 0 0; font-size: 82px; }
.pz-tag { margin: 0; font-family: var(--font-hand); font-size: 44px; color: var(--ink-2); }
.pz-press { margin: 30px 0 0; font-size: 20px; color: var(--ink-2); }
.pz-press kbd { display: inline-block; padding: 2px 14px; border: 2px solid var(--ink); border-bottom-width: 4px; border-radius: 10px; background: var(--card); font-family: var(--font-head); font-weight: 600; animation: pz-pulse 1.6s ease-in-out infinite; }
@keyframes pz-pulse { 50% { transform: translateY(2px); border-bottom-width: 2px; } }
/* illustrated scenes */
.pz-caption { position: absolute; left: 40px; bottom: 96px; width: 470px; padding: 22px 26px; background: var(--card); border: 3px solid var(--ink); border-radius: var(--wobble); box-shadow: 5px 6px 0 var(--ink); }
.pz-caption h2 { font-size: 40px; margin: 4px 0 8px; }
.pz-caption p { margin: 0 0 6px; }
.pz-caption .pz-hand { font-size: 30px; margin-top: 6px; }
.pz-dark .pz-caption { background: #FFF3E6; }
.pz-caption.pz-top { top: 36px; bottom: auto; } /* keeps the children and the mine visible */
.pz-flicker { animation: pz-flicker 2.6s steps(1) infinite; }
@keyframes pz-flicker { 0% { opacity: .05; } 12% { opacity: .35; } 20% { opacity: .1; } 45% { opacity: .5; } 52% { opacity: .12; } 70% { opacity: .3; } 85% { opacity: .08; } }
.pz-glow { opacity: .22; animation: pz-glow 2.6s steps(1) infinite; }
@keyframes pz-glow { 0% { opacity: .14; } 45% { opacity: .3; } 70% { opacity: .2; } }
.pz-rain { animation: pz-rain .8s linear infinite; }
@keyframes pz-rain { from { transform: translateY(-40px); } to { transform: translateY(40px); } }
.pz-tick { animation: spin 12s steps(60) infinite; }
.pz-steam { animation: pz-steam 3s ease-in-out infinite; }
@keyframes pz-steam { 0% { opacity: 0; transform: translateY(8px); } 40% { opacity: .9; } 100% { opacity: 0; transform: translateY(-18px); } }
.pz-breathe { animation: pz-breathe 4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes pz-breathe { 50% { scale: 1 1.012; } }
.pz-spin { animation: spin 40s linear infinite; }
.pz-hop { animation: pz-hop 2.4s ease-in-out infinite; }
.pz-hop2 { animation-delay: -.8s; } .pz-hop3 { animation-delay: -1.6s; }
@keyframes pz-hop { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }
.pz-ball { transform: translate(430px, 622px); animation: pz-ball 4.8s ease-in-out infinite; }
@keyframes pz-ball {
  0% { transform: translate(430px, 622px); } 16% { transform: translate(560px, 470px); } 32% { transform: translate(690px, 622px); }
  48% { transform: translate(820px, 450px); } 62% { transform: translate(950px, 622px); } 80% { transform: translate(690px, 400px); } 100% { transform: translate(430px, 622px); }
}
.pz-roll { animation: spin 1.2s linear infinite; }
.pz-dust circle { animation: pz-dust 2.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.pz-dust circle:nth-child(2) { animation-delay: -.8s; } .pz-dust circle:nth-child(3) { animation-delay: -1.6s; }
@keyframes pz-dust { 0% { opacity: .9; scale: .4; } 100% { opacity: 0; scale: 2.4; } }
.pz-cart { animation: pz-cart 5s ease-in-out infinite; }
@keyframes pz-cart { 50% { translate: 36px 0; } }
.pz-pick { animation: pz-pick 1.6s ease-in-out infinite; }
@keyframes pz-pick { 50% { rotate: -22deg; } }
.pz-specks circle { animation: pz-speck 6s linear infinite; }
@keyframes pz-speck { 0% { opacity: 0; translate: 0 0; } 20% { opacity: .8; } 100% { opacity: 0; translate: 30px -160px; } }
/* stats */
.pz-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 18px; }
.pz-stat { position: relative; padding: 24px 22px; background: var(--card); border: 3px solid var(--ink); border-radius: var(--wobble); box-shadow: 5px 6px 0 var(--ink); }
.pz-stat:nth-child(2) { border-radius: var(--wobble-2); background: var(--lav-2); }
.pz-stat:first-child { background: var(--sky-2); }
.pz-stat.pz-good { background: var(--ok-2); border-color: var(--ok); box-shadow: 5px 6px 0 var(--ok); }
.pz-num { display: block; font-family: var(--font-head); font-weight: 700; font-size: 62px; line-height: 1; color: #A8461F; white-space: nowrap; }
.pz-good .pz-num { color: var(--ok); }
.pz-stat p { margin: 10px 0 0; font-size: 21px; }
.pz-signal { position: absolute; right: 18px; top: 18px; display: flex; gap: 4px; align-items: flex-end; }
.pz-signal i { width: 9px; border-radius: 3px; background: var(--ok); animation: pz-signal 1.5s ease-in-out infinite; }
.pz-signal i:nth-child(1) { height: 12px; } .pz-signal i:nth-child(2) { height: 22px; animation-delay: .2s; } .pz-signal i:nth-child(3) { height: 32px; animation-delay: .4s; }
@keyframes pz-signal { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
/* balance sheet */
.pz-ledger { position: relative; margin: 14px auto 0; width: 900px; background: #FFF; border: 3px solid var(--ink); border-radius: 12px; box-shadow: 6px 7px 0 var(--ink); background-image: repeating-linear-gradient(transparent 0 61px, #E4EEF6 61px 63px); }
.pz-row { display: grid; grid-template-columns: 260px 1fr; gap: 20px; padding: 16px 28px; border-bottom: 2px dashed #D9CFC2; font-size: 22px; }
.pz-row:last-of-type { border-bottom: 0; }
.pz-row span { color: var(--ink-2); font-weight: 700; }
.pz-row b { font-family: var(--font-head); font-weight: 600; }
.pz-stamp { position: absolute; right: 40px; bottom: 6px; padding: 2px 18px; border: 5px solid #C93B3B; border-radius: 12px; color: #C93B3B; font-family: var(--font-head); font-weight: 700; font-size: 40px; letter-spacing: .08em; transform: rotate(-12deg); opacity: 0; }
.pz-scene.on .pz-stamp { animation: pz-stamp .5s cubic-bezier(.3, 1.6, .5, 1) 1.4s both; }
@keyframes pz-stamp { from { opacity: 0; transform: rotate(-12deg) scale(2.4); } to { opacity: .9; transform: rotate(-12deg) scale(1); } }
/* solution scene */
.pz-bubble { position: absolute; max-width: 360px; padding: 12px 18px; background: #FFF; border: 3px solid var(--ink); border-radius: 22px; box-shadow: 4px 5px 0 var(--ink); font-family: var(--font-head); font-weight: 600; font-size: 24px; opacity: 0; }
.pz-bubble small { display: block; margin-top: 4px; font-family: var(--font-body); font-weight: 700; font-size: 17px; color: var(--ok); }
.pz-bubble.pz-left { left: 90px; top: 70px; }
.pz-bubble.pz-right { right: 60px; top: 262px; }
.pz-scene.on .pz-bubble.pz-left { animation: pz-pop .5s var(--ease-spring) 1s both; }
.pz-scene.on .pz-bubble.pz-right { animation: pz-pop .5s var(--ease-spring) 2.2s both; }
@keyframes pz-pop { from { opacity: 0; transform: scale(.6) translateY(16px); } to { opacity: 1; transform: none; } }
.pz-banner { position: absolute; left: 50%; bottom: 76px; width: 820px; margin-left: -410px; padding: 18px 28px; text-align: center; background: var(--sun); border: 3px solid var(--ink); border-radius: var(--wobble-2); box-shadow: 6px 7px 0 var(--ink); }
.pz-banner h2 { font-size: 38px; }
.pz-banner p { margin: 6px 0 0; font-size: 21px; }
/* features */
.pz-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 14px; }
.pz-card { padding: 18px 20px; background: var(--card); border: 3px solid var(--ink); border-radius: var(--wobble); box-shadow: 4px 5px 0 var(--ink); }
.pz-card:nth-child(even) { border-radius: var(--wobble-2); }
.pz-card h3 { margin: 10px 0 6px; font-size: 25px; }
.pz-card p { margin: 0; font-size: 18px; color: var(--ink-2); }
.pz-ic { width: 56px; height: 56px; border-radius: 50%; border: 2.5px solid var(--ink); display: grid; place-items: center; background: var(--sun-2); }
.pz-card:nth-child(3n+2) .pz-ic { background: var(--sky-2); } .pz-card:nth-child(3n) .pz-ic { background: var(--leaf-2); }
/* technology */
.pz-pipe { position: relative; display: flex; align-items: stretch; gap: 0; margin-top: 10px; padding: 16px 18px; background: var(--card); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 5px 6px 0 var(--ink); }
.pz-node { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.pz-node .pz-ic { width: 50px; height: 50px; }
.pz-node b { font-family: var(--font-head); font-weight: 600; font-size: 18px; line-height: 1.15; }
.pz-node small { font-size: 14px; color: var(--ink-2); line-height: 1.2; }
.pz-arrow { width: 26px; align-self: center; height: 3px; margin-top: -40px; background: var(--ink); position: relative; flex: none; }
.pz-arrow::after { content: ''; position: absolute; right: -2px; top: -5px; border: 6.5px solid transparent; border-left: 9px solid var(--ink); }
.pz-packet { position: absolute; top: 40px; left: 60px; width: 16px; height: 16px; border-radius: 50%; background: #FF8A65; border: 2.5px solid var(--ink); animation: pz-packet 3.4s ease-in-out infinite; }
@keyframes pz-packet { 0% { left: 60px; opacity: 0; } 8% { opacity: 1; } 92% { opacity: 1; } 100% { left: calc(100% - 76px); opacity: 0; } }
.pz-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 8px; }
.pz-col h3 { margin: 0 0 6px; font-size: 26px; }
.pz-col ul { margin: 0; padding-left: 22px; display: grid; gap: 5px; font-size: 18px; line-height: 1.3; }
/* impact */
.pz-impact { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 10px; }
.pz-win { display: flex; flex-direction: column; align-items: center; padding: 16px 20px; background: var(--card); border: 3px solid var(--ink); border-radius: var(--wobble); box-shadow: 5px 6px 0 var(--ink); }
.pz-win:nth-child(2) { border-radius: var(--wobble-2); background: var(--sky-2); }
.pz-win:nth-child(3) { background: var(--leaf-2); }
.pz-win h3 { margin: 6px 0 6px; font-size: 28px; }
.pz-win ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 18px; line-height: 1.3; }
.pz-globe { height: 110px; display: grid; place-items: center; color: var(--ok); }
.pz-reach { margin: 6px auto 0; padding: 10px 22px; border: 2.5px dashed var(--ink); border-radius: 999px; background: var(--sun-2); font-size: 21px; }
/* mission */
.pz-mission { align-items: center; justify-content: center; text-align: center; gap: 12px; background: radial-gradient(circle at 50% 30%, #FFF3C4 0, var(--paper) 60%); }
.pz-mission h2 { font-size: 48px; max-width: 1050px; }
.pz-courses { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; margin: 14px 0 10px; font-size: 20px; }
.pz-courses > span { font-weight: 800; }
.pz-courses em { font-family: var(--font-hand); font-size: 28px; font-style: normal; color: var(--ink-2); }
.pz-chip { display: inline-flex; gap: 8px; align-items: center; padding: 8px 16px; background: var(--card); border: 2.5px solid var(--ink); border-radius: 999px; font-family: var(--font-head); font-weight: 600; box-shadow: 2px 3px 0 var(--ink); }
.pz-mission .btn { font-size: 24px; }
/* controls */
.pz-ui { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; align-items: center; gap: 14px; z-index: 5; }
.pz-nav { width: 40px; height: 40px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--card); display: grid; place-items: center; cursor: pointer; box-shadow: 2px 3px 0 var(--ink); }
.pz-nav[data-prev] svg { transform: scaleX(-1); }
.pz-nav:disabled { opacity: .35; cursor: default; }
.pz-dots { display: flex; gap: 7px; padding: 6px 10px; background: color-mix(in srgb, var(--card) 85%, transparent); border-radius: 999px; }
.pz-dots button { width: 12px; height: 12px; padding: 0; border-radius: 50%; border: 2px solid var(--ink); background: var(--card); cursor: pointer; }
.pz-dots button[aria-current="true"] { background: var(--coral); width: 28px; border-radius: 999px; transition: width .3s var(--ease-out); }
.pz-count-label { font-family: var(--font-head); font-weight: 600; font-size: 15px; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--card) 85%, transparent); }
@media (prefers-reduced-motion: reduce) { .pz-scene .pz-in, .pz-bubble, .pz-stamp { opacity: 1 !important; } }
/* ---------- Sign-up: live camera photo ---------- */
.link-btn { background: none; border: 0; padding: 6px 2px; min-height: 44px; color: #A8461F; text-decoration: underline; font: inherit; font-weight: 700; cursor: pointer; }
.cam { flex-basis: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 6px; }
.cam[hidden] { display: none; }
.cam-view { position: relative; width: min(420px, 100%); aspect-ratio: 4 / 3; border: 3px solid var(--ink); border-radius: 22px; overflow: hidden; background: var(--ink); box-shadow: var(--shadow); }
.cam-view video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.cam-oval { position: absolute; left: 50%; top: 50%; width: 46%; height: 72%; transform: translate(-50%, -50%); border: 3px dashed rgba(255, 255, 255, .85); border-radius: 50%; box-shadow: 0 0 0 999px rgba(59, 47, 42, .28); pointer-events: none; }
.cam-count { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 96px; color: #fff; text-shadow: 0 3px 0 var(--ink); pointer-events: none; }
.cam-count:empty { display: none; }
.cam-view.flash::after { content: ''; position: absolute; inset: 0; background: #fff; animation: cam-flash .45s ease-out forwards; }
@keyframes cam-flash { from { opacity: .95; } to { opacity: 0; } }
.cam-guide { margin: 0; padding: 8px 14px; border-radius: 999px; background: var(--paper-2); border: 2px solid color-mix(in srgb, var(--ink) 25%, transparent); font-weight: 700; text-align: center; transition: background-color .25s var(--ease-out), border-color .25s var(--ease-out); }
.cam-guide.ok { background: var(--ok-2); border-color: var(--ok); color: var(--ok); }

/* ---------- Motion: page changes, reveal on scroll ---------- */
@keyframes fade-in { from { opacity: 0; } }
@keyframes menu-in { from { opacity: 0; transform: scale(.94) translateY(-6px); } }
@keyframes modal-in { from { opacity: 0; transform: scale(.96) translateY(10px); } }
@keyframes page-out { to { opacity: 0; } }
@keyframes page-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } }
main { view-transition-name: page; }
::view-transition-group(page) { animation-duration: .42s; animation-timing-function: var(--ease-out); }
::view-transition-old(page) { animation: page-out .16s ease-out both; }
::view-transition-new(page) { animation: page-in .42s var(--ease-out) both; }
::view-transition-group(subnav), ::view-transition-group(mainnav), ::view-transition-group(topbar) { animation-duration: .35s; animation-timing-function: var(--ease-out); }
main.page-enter { animation: page-in .42s var(--ease-out); }
.rv { opacity: 0; }
.rv-in { animation: rise .75s var(--ease-out) both; }
.chip, .cc > span, .tick, .menu a, .menu-link { transition: background-color .2s var(--ease-out), color .2s var(--ease-out), transform .25s var(--ease-spring); }
/* FAQ answers slide open (browsers without ::details-content just open) */
.faq-item::details-content { block-size: 0; overflow: clip; transition: block-size .4s var(--ease-out), content-visibility .4s allow-discrete; }
.faq-item[open]::details-content { block-size: auto; }
@media print { .rv { opacity: 1 !important; } }

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

/* ---------- Sign-up ---------- */
.join { max-width: 780px; margin: 0 auto; padding: clamp(18px, 4vw, 40px) clamp(16px, 3vw, 32px) 60px; }
.join h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.steps-bar { display: flex; gap: 8px; }
.steps-bar span { flex: 1; height: 10px; border-radius: 999px; border: 2px solid var(--ink); background: var(--card); }
.steps-bar span.done { background: var(--sun); }
.field { margin: 18px 0; border: 0; padding: 0; min-width: 0; }
.field legend, .flabel { font-family: var(--font-head); font-weight: 600; font-size: 1.15rem; margin-bottom: 10px; display: block; padding: 0; }
input.text, .join select {
  width: 100%; min-height: 54px; padding: 10px 16px; border: 2.5px solid var(--ink); border-radius: 14px;
  font: inherit; font-size: 1.05rem; background: #fff; color: var(--ink);
}
.choice-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.cc { position: relative; }
.cc input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cc > span {
  display: inline-flex; align-items: center; gap: 8px; min-height: 50px; padding: 8px 18px;
  border: 2.5px solid var(--ink); border-radius: 999px; background: var(--card); cursor: pointer;
  font-family: var(--font-head); font-weight: 500; font-size: 1.02rem; transition: transform .1s;
}
.cc input:checked + span { background: var(--sun); box-shadow: var(--shadow-sm); }
.cc input:focus-visible + span { outline: 3px dashed var(--ink); outline-offset: 3px; }
.cc > span:hover { transform: translateY(-1px); }
.swatches .cc > span { width: 46px; height: 46px; min-height: 0; padding: 0; border-radius: 50%; }
.swatches .cc input:checked + span { box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--ink); }
.pics .cc > span { border-radius: var(--wobble); padding: 8px 10px; background: var(--sky-2); }
.pics .cc input:checked + span { background: var(--sun); }
.builder { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 26px; align-items: start; }
.builder .preview { position: sticky; top: 84px; background: var(--sky-2); border: 2.5px solid var(--ink); border-radius: var(--wobble); display: grid; place-items: center; padding: 18px; box-shadow: var(--shadow); }
@media (max-width: 640px) { .builder { grid-template-columns: 1fr; } .builder .preview { position: static; } }
.join-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.err { color: var(--danger); font-weight: 700; font-size: .92rem; margin-top: 6px; }
.err:empty { display: none; }
.check { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 2.5px solid var(--ink); border-radius: 16px; background: var(--card); margin-bottom: 12px; cursor: pointer; }
.check input { width: 26px; height: 26px; accent-color: var(--coral); flex: none; margin-top: 2px; }
.matching { min-height: calc(100vh - 64px); display: grid; place-items: center; align-content: center; text-align: center; gap: 6px; padding: 20px; }
.dots-loader { display: flex; gap: 10px; justify-content: center; margin-top: 10px; }
.dots-loader span { width: 14px; height: 14px; border-radius: 50%; background: var(--coral); border: 2px solid var(--ink); animation: hop 1s ease-in-out infinite; }
.dots-loader span:nth-child(2) { animation-delay: .15s; background: var(--sun); }
.dots-loader span:nth-child(3) { animation-delay: .3s; background: var(--sky); }
@keyframes hop { 50% { transform: translateY(-10px); } }

/* ---------- Match results ---------- */
.match-list { display: grid; gap: 22px; margin-top: 22px; }
.match-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 22px; align-items: center; }
.match-card.best { background: var(--sun-2); }
.match-card .pic { display: grid; place-items: center; min-width: 120px; }
.match-card .side { display: flex; flex-direction: column; align-items: stretch; gap: 10px; min-width: 150px; }
.ring { --p: 50; width: 100px; height: 100px; margin: 0 auto 4px; border-radius: 50%; border: 2.5px solid var(--ink); display: grid; place-items: center; background: conic-gradient(var(--coral) calc(var(--p) * 1%), var(--paper-2) 0); }
.ring b { width: 74px; height: 74px; border-radius: 50%; background: var(--card); border: 2px solid var(--ink); display: grid; place-items: center; font-family: var(--font-head); font-size: 1.45rem; }
.ring.sm { width: 64px; height: 64px; }
.ring.sm b { width: 46px; height: 46px; font-size: 1rem; }
.reasons { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; }
.reasons li { display: flex; gap: 8px; align-items: flex-start; font-size: .96rem; }
.reasons li svg { flex: none; margin-top: 2px; color: var(--ok); }
.reasons li.no { color: var(--ink-2); }
.reasons li.no svg { color: var(--ink-2); }
@media (max-width: 720px) { .match-card { grid-template-columns: 1fr; text-align: center; } .match-card .row { justify-content: center; } .reasons li { text-align: left; } }
.marker .pct { margin-left: 4px; background: var(--coral); border-radius: 999px; padding: 0 6px; font-size: .74rem; }
.marker.top .name { background: var(--sun); }
.home-explore { margin-top: 22px; font-size: .95rem; }
.menu button.menu-link { text-align: left; border: 0; background: none; font-family: var(--font-head); font-weight: 500; font-size: 1.05rem; padding: 10px 14px; border-radius: 12px; min-height: 44px; cursor: pointer; color: var(--ink); }
.menu button.menu-link:hover { background: var(--sun-2); }

/* ---------- Role pages (grandparent & child) ---------- */
.subnav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.subnav a {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 16px; border: 2px solid var(--ink);
  border-radius: 999px; background: var(--card); text-decoration: none; color: var(--ink); font-family: var(--font-head); font-weight: 500;
}
.subnav a:hover { background: var(--sun-2); }
.subnav a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.subnav { view-transition-name: subnav; }
.mainnav { view-transition-name: mainnav; } /* the quick bar stays put while pages change */
.subnav a { transition: background-color .25s var(--ease-out), color .25s var(--ease-out), transform .3s var(--ease-spring); }
.subnav a:active { transform: scale(.96); transition-duration: .08s; }
.gp-hero { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-bottom: 22px; }
.gp-hero .greet { flex: 1 1 220px; }
.gp-actions { display: flex; gap: 16px; flex-wrap: wrap; flex: 2 1 460px; }
.action-card {
  flex: 1 1 220px; display: flex; gap: 14px; align-items: center; padding: 18px 20px; min-height: 96px;
  background: var(--sun); border: 3px solid var(--ink); border-radius: var(--wobble); box-shadow: var(--shadow);
  text-decoration: none; color: var(--ink); font-family: var(--font-head); font-size: 1.2rem; transition: transform .15s, box-shadow .15s;
}
.action-card.alt { background: var(--sky); border-radius: var(--wobble-2); }
.action-card .small { font-family: var(--font-body); font-weight: 600; font-size: .9rem; }
.action-card:hover { transform: translate(-2px, -3px); box-shadow: 6px 8px 0 var(--ink); color: var(--ink); }
.action-card svg { flex: none; }
.notices { display: grid; gap: 10px; margin-bottom: 22px; }
.notice {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border: 2px solid var(--ink); border-radius: 14px;
  background: var(--card); text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm);
}
a.notice:hover { background: var(--sun-2); color: var(--ink); }
.notice .tag { margin-left: auto; text-decoration: none; }
.cal-card { margin-bottom: 10px; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal-day { min-height: 130px; border: 2px solid color-mix(in srgb, var(--ink) 25%, transparent); border-radius: 12px; padding: 8px; background: var(--paper); display: flex; flex-direction: column; gap: 6px; }
.cal-day.today { border-color: var(--ink); background: var(--sun-2); box-shadow: var(--shadow-sm); }
.cal-date { font-family: var(--font-head); font-size: .95rem; }
.cal-chip {
  display: block; padding: 6px 8px; border-radius: 10px; border: 2px solid var(--ink); background: var(--c, var(--sky));
  text-decoration: none; color: var(--ink); font-size: .85rem; line-height: 1.25;
}
.cal-chip:hover { transform: translateY(-1px); color: var(--ink); }
.cal-chip .small { display: block; opacity: .8; font-size: .75rem; }
.cal-empty { color: var(--ink-2); opacity: .5; }
@media (max-width: 860px) {
  .calendar { grid-template-columns: 1fr; }
  .cal-day { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .cal-date { min-width: 64px; }
}
.class-card { position: relative; }
.class-card.pinned { border-width: 3px; }
.pin-badge { position: absolute; top: -14px; right: 18px; width: 34px; height: 34px; border-radius: 50%; background: var(--coral); border: 2px solid var(--ink); display: grid; place-items: center; }
.faces-row { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: flex-end; }
.face-name { display: inline-flex; align-items: center; gap: 6px; line-height: 1.2; }
.empty { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.quote { font-family: var(--font-hand); font-size: 1.35rem; line-height: 1.2; margin: 10px 0; }
.course-head { display: flex; gap: 20px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; margin-top: 8px; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 22px; margin-top: 22px; }
.person-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.person-row.offer { padding: 10px; border: 2px dashed var(--ink); border-radius: 14px; margin-top: 8px; background: var(--paper); }
.doc-row { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 2px solid color-mix(in srgb, var(--ink) 30%, transparent); border-radius: 12px; background: var(--paper); flex-wrap: wrap; }
.btn-row { width: 100%; text-align: left; cursor: pointer; font: inherit; color: var(--ink); margin-bottom: 8px; min-height: 48px; }
.btn-row:hover { background: var(--sun-2); }
.portal-section { margin-bottom: 22px; }
.portal-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.portal-cols h3 { display: flex; gap: 8px; align-items: center; }
.player { aspect-ratio: 16 / 9; background: var(--ink); color: var(--paper); border-radius: 14px; display: grid; place-items: center; align-content: center; text-align: center; gap: 8px; }
textarea.text { min-height: 80px; resize: vertical; font: inherit; }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; z-index: 180; background: rgba(59, 47, 42, .5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; overflow-y: auto; animation: fade-in .25s var(--ease-out); }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 0; animation: modal-in .4s var(--ease-out); }
.modal.wide { width: min(820px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 2px dashed var(--ink); position: sticky; top: 0; background: var(--card); z-index: 1; }
.modal-head h2 { margin: 0; font-size: 1.4rem; }
.modal-head .close { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--ink); background: var(--card); cursor: pointer; font-size: 1.4rem; }
.modal-body { padding: 18px 22px 22px; }
.doc h3 { margin-top: 0; }
.doc h4 { margin: 14px 0 6px; }
.quiz { padding-left: 20px; display: grid; gap: 14px; }
.quiz ul { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 4px; }
.quiz li.right { color: var(--ok); font-weight: 800; }
.quiz-take legend { font-size: 1.05rem; }
@media print {
  body.printing > *:not(.modal-back) { display: none !important; }
  body.printing .modal-back { position: static; background: none; padding: 0; }
  body.printing .modal { box-shadow: none; border: 0; max-height: none; width: 100%; }
  body.printing .modal-head .row { display: none; }
}

/* ---------- Next lesson banner ---------- */
.next-lesson {
  display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-bottom: 22px; padding: 18px 22px;
  background: var(--sun-2); border: 3px solid var(--ink); border-radius: var(--wobble); box-shadow: var(--shadow);
}
.nl-faces { display: flex; align-items: flex-end; gap: 4px; }
.nl-main { flex: 1 1 260px; min-width: 0; }
.next-lesson .btn.big { margin-left: auto; }
@media (max-width: 640px) { .next-lesson .btn.big { width: 100%; margin-left: 0; } }

/* ---------- Sign-up helpers ---------- */
.hint-note {
  display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 6px; padding: 10px 14px;
  background: var(--sky-2); border: 2px dashed var(--ink); border-radius: 14px; font-size: .95rem;
}
.hint-note svg { flex: none; margin-top: 2px; }
.promise-list { list-style: none; margin: 14px 0; padding: 0; display: grid; gap: 12px; }
.promise-list li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border: 2px solid var(--ink); border-radius: 14px; background: var(--card); }
.promise-list li svg { flex: none; margin-top: 2px; }
.big-check { background: var(--sun-2); font-size: 1.1rem; }
.big-check input { width: 32px; height: 32px; }

/* ---------- Slides, quiz pictures, live room ---------- */
.slide-box { margin-top: 16px; }
.slide { background: var(--slide-bg, var(--sky-2)); border: 3px solid var(--ink); border-radius: var(--wobble); padding: 14px 16px 18px; text-align: center; margin-top: 10px; }
.slide-pic { max-width: 340px; margin: 0 auto; }
.slide-art { width: 100%; height: auto; display: block; }
.slide-word { font-family: var(--font-head); font-weight: 700; font-size: clamp(2.4rem, 7vw, 3.6rem); line-height: 1.05; margin-top: 6px; }
.slide-say { font-size: 1rem; color: var(--ink-2); letter-spacing: .5px; }
.slide-tr { font-family: var(--font-head); font-size: 1.5rem; margin-top: 4px; }
.slide-empty { border: 2px dashed var(--ink); border-radius: 14px; padding: 26px 16px; text-align: center; color: var(--ink-2); margin-top: 10px; }
.slide-page { page-break-after: always; margin-bottom: 18px; }
.quiz-pic { max-width: 220px; margin: 0 0 10px; }
.quiz-pic.sm { display: flex; gap: 12px; align-items: center; max-width: none; margin: 8px 0; text-align: left; }
.quiz-pic.sm .slide-art { width: 90px; flex: none; }
.quiz-review { margin: 12px 0 18px; }
.room-bar {
  display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 0 0 14px; padding: 10px 14px;
  background: var(--lav-2); border: 2px solid var(--ink); border-radius: 14px;
}
.room-bar > span { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.room-code { font-family: var(--font-head); font-size: 1.5rem; letter-spacing: 4px; background: var(--card); border: 2px solid var(--ink); border-radius: 10px; padding: 0 10px; }
.room-input { max-width: 150px; min-height: 46px; text-transform: uppercase; letter-spacing: 4px; font-family: var(--font-head); font-size: 1.3rem; text-align: center; }
.room-err { color: var(--danger); font-weight: 700; }
@media print { .slide-page { page-break-after: always; } }


/* ---------- Classroom: videos | slides | captions ---------- */
.wrap.wide { max-width: 1520px; }
.class-layout.three { grid-template-columns: minmax(230px, 290px) minmax(0, 1fr) minmax(300px, 370px); align-items: start; gap: 22px; }
.videos { display: grid; gap: 14px; align-content: start; }
.videos .tile { box-shadow: var(--shadow-sm); }
.videos .tile .label { font-size: .78rem; padding: 0 9px; max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.videos .tile .rec { font-size: .7rem; }
.center { min-width: 0; }
.center .slide-box { margin-top: 0; }
.center .slide-pic { max-width: 430px; }
.center .slide-word { font-size: clamp(2.6rem, 6vw, 4.4rem); }
.board-card { background: #2F5D50; border: 4px solid #B07A4F; border-radius: 14px; min-height: 240px; display: grid; place-items: center; padding: 20px; margin-top: 10px; }
.board-text { font-family: var(--font-hand); color: #fff; font-size: clamp(2rem, 5vw, 3.4rem); text-align: center; line-height: 1.1; }
.class-layout.three .captions { min-height: 0; }
.class-layout.three .caption-list { max-height: 640px; }
@media (max-width: 1180px) {
  .class-layout.three { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .class-layout.three .center { grid-column: 1 / -1; order: -1; }
}
@media (max-width: 760px) {
  .class-layout.three { grid-template-columns: 1fr; }
  .videos { grid-template-columns: 1fr 1fr; }
}

/* ---------- Courseware window ---------- */
.nl-actions { margin-left: auto; display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.next-lesson .nl-actions .btn.big { margin-left: 0; }
@media (max-width: 640px) { .nl-actions { width: 100%; margin-left: 0; } }
.cw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.cw-card { background: var(--slide-bg, var(--sky-2)); border: 2.5px solid var(--ink); border-radius: 16px; padding: 10px; text-align: center; display: grid; gap: 2px; box-shadow: var(--shadow-sm); }
.cw-card b { font-family: var(--font-head); font-size: 1.35rem; }
.cw-pic .slide-art { width: 100%; max-width: 150px; margin: 0 auto; display: block; }

/* ---------- live voice captions ---------- */
.listen-status { display: flex; align-items: center; gap: 8px; padding: 6px 14px; font-size: .88rem; font-weight: 700; background: color-mix(in srgb, var(--ok) 16%, var(--card)); border-bottom: 2px solid color-mix(in srgb, var(--ink) 10%, transparent); }
.listen-status svg { color: var(--ok); animation: listen-pulse 1.4s ease-in-out infinite; }
@keyframes listen-pulse { 50% { opacity: .35; } }
#listenBtn.on { background: var(--ok); color: #fff; }
.cap-line.interim { opacity: .7; }
.cap-line.interim .tr { color: var(--ink-2); font-style: italic; }
@media (prefers-reduced-motion: reduce) { .listen-status svg { animation: none; } }

/* ---------- simpler navigation ---------- */
.back-home { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 18px; padding: 8px 16px; min-height: 44px; border-radius: 999px; border: 2px solid var(--ink); background: var(--card); color: var(--ink); text-decoration: none; font-family: var(--font-head); font-weight: 500; }
.back-home:hover { background: var(--sun-2); }
.menu-more { border-top: 2px solid color-mix(in srgb, var(--ink) 12%, transparent); margin-top: 6px; padding-top: 4px; }
.menu-more summary { cursor: pointer; list-style: none; padding: 10px 14px; min-height: 44px; display: flex; align-items: center; border-radius: 12px; font-family: var(--font-head); font-weight: 500; color: var(--ink-2); }
.menu-more summary::-webkit-details-marker { display: none; }
.menu-more summary::after { content: '▾'; margin-left: auto; }
.menu-more[open] summary::after { content: '▴'; }
.menu-more summary:hover { background: var(--sun-2); }
.menu a.must { background: var(--sun); font-weight: 700; }
.more-tools { margin-top: 12px; }
.more-tools summary { cursor: pointer; font-weight: 700; color: var(--ink-2); padding: 6px 0; }
.more-tools .row { margin-top: 8px; }

/* ---------- Safety school ---------- */
.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 18px; flex-wrap: wrap; }
.steps li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 999px; border: 2px solid color-mix(in srgb, var(--ink) 25%, transparent); font-family: var(--font-head); font-weight: 500; color: var(--ink-2); background: var(--card); }
.steps li .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--paper-2); font-size: .85rem; font-weight: 700; }
.steps li[aria-current="step"] { border-color: var(--ink); color: var(--ink); background: var(--sun); }
.steps li[aria-current="step"] .n { background: var(--ink); color: var(--paper); }
.steps li.done { color: var(--ink); border-color: var(--ok); }
.steps li.done .n { background: var(--ok); color: #fff; }
.check-card { max-width: 720px; margin: 0 auto; }
.answer { text-align: left; font: inherit; font-family: var(--font-head); font-weight: 500; font-size: 1.1rem; padding: 14px 18px; min-height: 56px; border-radius: 16px; border: 2.5px solid var(--ink); background: var(--card); cursor: pointer; box-shadow: var(--shadow-sm); color: var(--ink); }
.answer:hover:not(:disabled) { background: var(--sun-2); }
.answer.right { background: color-mix(in srgb, var(--ok) 28%, var(--card)); }
.answer.wrong { background: color-mix(in srgb, var(--danger) 18%, var(--card)); opacity: .7; text-decoration: line-through; }
.answer:disabled:not(.right):not(.wrong) { opacity: .6; cursor: default; }
.check-feedback { margin-top: 16px; padding: 12px 16px; border-radius: 14px; font-weight: 600; }
.check-feedback.ok { background: color-mix(in srgb, var(--ok) 18%, var(--card)); }
.check-feedback.bad { background: color-mix(in srgb, var(--sun) 40%, var(--card)); }
.badge-card { max-width: 560px; margin: 0 auto; text-align: center; padding: 32px 24px; }
.badge-art { width: 130px; height: 130px; margin: 0 auto; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--ok) 20%, var(--card)); border: 3px solid var(--ink); animation: pop .5s ease; }

/* the must-do safety card on the student home */
.safety-must { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; margin: 0 0 22px; padding: 22px 24px; border-radius: 22px; border: 3px solid var(--ink); background: var(--sun); box-shadow: 6px 8px 0 var(--ink); }
.safety-must .sm-ic { width: 76px; height: 76px; border-radius: 50%; background: var(--card); border: 3px solid var(--ink); display: grid; place-items: center; }
.safety-must h2 { margin: 0 0 4px; }
.safety-must .tag.must { background: var(--ink); color: var(--paper); }
.safety-done { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 20px; padding: 10px 16px; border-radius: 16px; background: color-mix(in srgb, var(--ok) 16%, var(--card)); border: 2px solid var(--ok); font-weight: 700; }
.safety-done a { margin-left: auto; font-weight: 700; }
.btn.locked { opacity: .6; cursor: not-allowed; }
@media (max-width: 640px) { .safety-must { grid-template-columns: 1fr; text-align: center; justify-items: center; } }

/* ---------- quick navigation: top bar on wide screens, bottom bar on phones ---------- */
.mainnav { display: flex; gap: 6px; margin-left: 12px; }
.mainnav a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; min-height: 44px; border-radius: 999px; border: 2px solid transparent; text-decoration: none; color: var(--ink); font-family: var(--font-head); font-weight: 500; white-space: nowrap; }
.mainnav a:hover { background: var(--sun-2); }
.mainnav a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.mainnav a.must:not([aria-current="page"]) { background: var(--sun); border-color: var(--ink); font-weight: 700; }
.who-chip[hidden] + .menu-btn { margin-left: auto; }
@media (max-width: 980px) { .mainnav a span { display: none; } .mainnav a { padding: 8px 12px; } .mainnav a[aria-current="page"] span { display: inline; } }
@media (max-width: 640px) {
  .mainnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; margin: 0; gap: 0; justify-content: space-around; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: var(--paper); border-top: 2px solid var(--ink); }
  .mainnav[hidden] { display: none; }
  .mainnav a, .mainnav a[aria-current="page"] { flex-direction: column; gap: 2px; padding: 4px 8px; border-radius: 12px; font-size: .72rem; flex: 1; justify-content: center; min-height: 52px; }
  .mainnav a span, .mainnav a[aria-current="page"] span { display: inline; }
  body:has(#mainNav:not([hidden])) main { padding-bottom: 84px; }
}

/* the quick navigation sits in the middle of the top bar: logo left, account and menu right */
.topbar .brand { grid-column: 1; justify-self: start; }
.topbar .mainnav { grid-column: 2; margin: 0; justify-self: center; }
.topbar-right { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 10px; }
.topbar-right .who-chip, .topbar-right .who-chip[hidden] + .menu-btn { margin-left: 0; }
@media (max-width: 640px) { .topbar { grid-template-columns: 1fr auto; } .topbar-right { grid-column: 2; } }

/* voice options: Local / API and the language I speak */
.voice-opts { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-top: 12px; }
.voice-opts .seg button { min-height: 36px; padding: 4px 12px; font-size: .92rem; }
.voice-opts .seg button:disabled { opacity: .45; cursor: not-allowed; }

/* the last slides: few words, big type */
.pz-features .pz-card h3 { font-size: 30px; }
.pz-features .pz-card p { font-size: 23px; }
.pz-stack { display: grid; gap: 22px; margin-top: 26px; }
.pz-stack h3 { margin: 0 0 10px; font-size: 28px; }
.pz-chips { display: flex; flex-wrap: wrap; gap: 12px; }
.pz-chips .pz-chip { font-size: 22px; padding: 10px 22px; }
.pz-win p { margin: 4px 0 0; font-size: 26px; line-height: 1.3; text-align: center; }
.pz-win h3 { font-size: 32px; }
.pz-win { gap: 4px; padding: 24px 22px; }
.pz-mission .pz-courses { margin: 18px 0 14px; }
.pz-mission .pz-courses .pz-chip { font-size: 22px; }

/* the classroom is for teaching: no floating Pitch button there */
body[data-route="classroom"] .pitch-btn { display: none; }

/* a pulsing LIVE badge in the classroom header */
.live-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 12px; border-radius: 999px; background: #E5484D; color: #fff; border: 2.5px solid var(--ink); box-shadow: var(--shadow-sm); font-family: var(--font-head); font-weight: 700; letter-spacing: .08em; font-size: .95rem; line-height: 1; }
.live-badge i { position: relative; width: 11px; height: 11px; border-radius: 50%; background: #fff; }
.live-badge i::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid #fff; opacity: 0; animation: live-ping 1.6s ease-out infinite; }
@keyframes live-ping { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.7); opacity: 0; } }
.live-badge { animation: live-blink 2.4s ease-in-out infinite; }
@keyframes live-blink { 50% { box-shadow: 2px 3px 0 var(--ink), 0 0 0 5px rgba(229, 72, 77, .22); } }
@media (prefers-reduced-motion: reduce) { .live-badge, .live-badge i::after { animation: none; } }

/* LIVE badge when the class is over */
.live-badge.ended { background: var(--ink-2); animation: none; }
.live-badge.ended i { background: #ddd; }
.live-badge.ended i::after { display: none; }

/* the quiz: one question at a time */
.quiz-step { max-width: 640px; margin: 0 auto; }
.quiz-progress { height: 12px; border-radius: 999px; background: var(--paper-2); border: 2px solid var(--ink); overflow: hidden; }
.quiz-progress span { display: block; height: 100%; background: var(--leaf); transition: width .4s var(--ease-out, ease); }
.quiz-q { margin: 8px 0 12px; font-size: 1.5rem; }
.quiz-pic.big { display: grid; place-items: center; padding: 10px; margin: 0 auto 16px; max-width: 360px; background: var(--sky-2); border: 3px solid var(--ink); border-radius: var(--wobble); }
.quiz-pic.big svg { width: 100%; height: auto; max-height: 220px; }
.quiz-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.quiz-opt { font: inherit; font-family: var(--font-head); font-weight: 600; font-size: 1.3rem; padding: 14px 16px; min-height: 60px; border-radius: 16px; border: 2.5px solid var(--ink); background: var(--card); color: var(--ink); cursor: pointer; box-shadow: var(--shadow-sm); }
.quiz-opt:hover:not(:disabled) { background: var(--sun-2); }
.quiz-opt:disabled { cursor: default; opacity: .75; }
.quiz-opt.right { background: color-mix(in srgb, var(--ok) 30%, var(--card)); opacity: 1; }
.quiz-opt.wrong { background: color-mix(in srgb, var(--danger) 22%, var(--card)); opacity: 1; text-decoration: line-through; }
.quiz-feedback { margin-top: 16px; padding: 12px 16px; border-radius: 14px; font-size: 1.1rem; }
.quiz-feedback.ok { background: color-mix(in srgb, var(--ok) 18%, var(--card)); }
.quiz-feedback.bad { background: color-mix(in srgb, var(--sun) 40%, var(--card)); }

/* the class summary */
.summary { max-width: 640px; margin: 0 auto; }
.summary h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 1.6rem; }
.summary h4 { margin: 16px 0 4px; font-size: 1.1rem; color: var(--ink-2); }
.summary ul { margin: 0; padding-left: 22px; display: grid; gap: 6px; font-size: 1.1rem; line-height: 1.4; }
.summary-next { margin: 16px 0 6px; padding: 10px 14px; border-radius: 14px; background: var(--sun-2); font-size: 1.05rem; }

/* Safety school reads itself aloud */
.tap-start { display: flex; justify-content: center; margin: 0 0 16px; padding: 14px; border: 3px dashed var(--ink); border-radius: 22px; background: var(--sun-2); }
