/* Visitor journey. One responsive source: phone = full page, >= 600px = card on violet backdrop. */
body { min-height: 100dvh; }
.card { min-height: 100dvh; background: var(--page); display: flex; flex-direction: column; overflow: hidden; position: relative; }
@media (min-width: 600px) {
  body { background: var(--violet-950); padding: 24px 0; }
  .card { width: min(430px, 100vw - 48px); min-height: min(860px, 100dvh - 48px); margin: 0 auto; border-radius: 28px; box-shadow: 0 24px 64px rgb(20 8 48 / .35); }
}
.pad { padding-left: 20px; padding-right: 20px; }
@media (min-width: 400px) { .pad { padding-left: 24px; padding-right: 24px; } }

.top { display: flex; align-items: center; gap: 10px; height: 56px; flex: none; border-bottom: 1px solid var(--line); padding: 0 20px; }
@media (min-width: 400px) { .top { padding: 0 24px; } }
.top img { height: 28px; width: auto; display: block; }
.word { font-weight: 800; font-size: 18px; line-height: 24px; letter-spacing: .02em; white-space: nowrap; }
@media (max-width: 359px) { .word { font-size: 16px; letter-spacing: .01em; } .top { gap: 8px; padding: 0 16px; } }

.prog { display: flex; align-items: center; gap: 8px; height: 48px; flex: none; padding: 0 12px 0 8px; }
@media (min-width: 400px) { .prog { padding: 0 16px 0 12px; } }
.back { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; border-radius: 12px; color: var(--ink); transition: transform 90ms ease-out; }
.back:active { transform: scale(.94); }
.back[hidden] { display: grid !important; visibility: hidden; }
.segs { flex: 1; display: flex; gap: 6px; }
.segs i { flex: 1; height: 6px; border-radius: 999px; background: var(--violet-100); transition: background-color 200ms; }
.segs i.on { background: var(--violet-600); }
.count { font-size: 14px; font-weight: 500; color: var(--subtle); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }

main { flex: 1; display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; flex-direction: column; }
.screen.enter-fwd { animation: in-fwd 200ms var(--ease) both; }
.screen.enter-back { animation: in-back 200ms var(--ease) both; }
@keyframes in-fwd { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes in-back { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }

.photo { position: relative; aspect-ratio: 3 / 2; background: var(--violet-50); flex: none; }
.photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; display: block; }
.photo::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 56px; background: linear-gradient(to bottom, rgb(250 248 253 / 0), var(--page)); }

.photo.band { aspect-ratio: 900 / 340; }
.photo.band img { object-position: center 30%; }
@media (max-height: 700px) { .photo.band { aspect-ratio: auto; height: 84px; } .photo.band::after { height: 32px; } }

/* Network status pill: floats under the header so nothing shifts. */
.net { position: absolute; z-index: 5; top: 62px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); padding: 8px 14px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; line-height: 20px; text-align: center; box-shadow: 0 6px 18px rgb(20 8 48 / .25); }

/* First-load skeleton (shown before any config is available) */
.load { flex: 1; display: flex; flex-direction: column; }
.l-photo { aspect-ratio: 3 / 2; background: var(--violet-50); }
.l-body { padding: 8px 24px; display: flex; flex-direction: column; gap: 14px; }
.l-body i { display: block; height: 18px; border-radius: 8px; background: var(--violet-50); animation: pulse 1.2s ease-in-out infinite; }
.l-body .w1 { width: 30%; height: 14px; } .l-body .w2 { width: 92%; height: 28px; } .l-body .w3 { width: 70%; height: 28px; } .l-body .w4 { width: 85%; }
@keyframes pulse { 50% { opacity: .5; } }

.body { padding-top: 4px; padding-bottom: 24px; }
.label { font-size: 13px; line-height: 16px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--violet-600); margin-bottom: 8px; }
.title { font-size: 26px; line-height: 32px; font-weight: 800; letter-spacing: -.01em; text-wrap: balance; }
@media (min-width: 400px) { .title { font-size: 30px; line-height: 36px; } }
.title:focus { outline: none; }
.hint { font-size: 17px; line-height: 24px; color: var(--muted); margin-top: 12px; }

/* Rating circles */
.circles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 28px; padding: 8px 0 6px; }
.circle { position: relative; width: 100%; max-width: 64px; aspect-ratio: 1; min-width: 44px; justify-self: center; border-radius: 50%; border: 1px solid transparent;
  font-size: 22px; line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; display: grid; place-items: center; padding: 0;
  transition: transform 90ms ease-out; }
.circle[data-v="1"], .circle[data-v="2"] { border-color: var(--violet-300); }
.circle:active { transform: scale(.94); }
.circle[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--page), 0 0 0 6px var(--ink); }
.tick { position: absolute; top: -5px; right: -5px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); display: none; place-items: center; }
[aria-pressed="true"] > .tick { display: grid; }
.ends { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 15px; line-height: 20px; color: var(--muted); }
.ends span:last-child { text-align: right; }
.tapnote { text-align: center; font-size: 15px; line-height: 20px; color: var(--muted); margin-top: 20px; }
.tn-d { display: none; }

/* Role cards */
.cards { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.choice { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 64px; padding: 16px 18px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--field-border); text-align: left; font-size: 17px; line-height: 22px; font-weight: 600; transition: transform 90ms ease-out; }
.choice:active { transform: scale(.98); }
.choice[aria-pressed="true"] { background: var(--violet-50); border: 2px solid var(--violet-600); padding: 15px 17px; }
.choice .tick { position: static; flex: none; }

/* Form */
.form { margin-top: 24px; }
.form .btn { width: 100%; }
.form input { scroll-margin-bottom: 120px; }
.consent { text-align: center; font-size: 14px; line-height: 20px; color: var(--muted); margin-top: 12px; }
.form .banner { margin-bottom: 16px; }
/* Short phone screens: keep all three fields on screen by dropping the hint line and tightening gaps. */
@media (max-height: 700px) { .hint.fh { display: none; } .form { margin-top: 16px; } .form .field { margin-bottom: 12px; } }

/* Thank-you */
.thanks { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 48px; padding-bottom: 32px; gap: 0; }
.thanks .badge { width: 72px; height: 72px; border-radius: 50%; background: var(--violet-50); display: grid; place-items: center; margin-bottom: 24px; }
.thanks h1 { font-size: 32px; line-height: 38px; font-weight: 800; }
.thanks h1:focus { outline: none; }
.thanks .tbody { margin-top: 12px; font-size: 17px; line-height: 24px; max-width: 32ch; overflow-wrap: anywhere; }
.thanks .loc { display: flex; align-items: center; gap: 8px; margin-top: 20px; font-size: 16px; font-weight: 600; color: var(--violet-600); overflow-wrap: anywhere; text-align: left; }
.thanks .personal { margin-top: 16px; padding: 12px 16px; border-radius: 16px; background: var(--violet-50); border: 1px solid var(--violet-100); color: var(--ink); font-size: 17px; line-height: 24px; font-weight: 600; max-width: 32ch; overflow-wrap: anywhere; }
.thanks .personal[hidden] { display: none; }
.thanks .note { margin-top: 20px; font-size: 14px; color: var(--subtle); }
.draw { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw 300ms ease-out 100ms forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.foot { flex: none; margin-top: auto; border-top: 1px solid var(--line); text-align: center; font-size: 14px; line-height: 20px; color: var(--subtle); padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); }

.fatal { padding: 64px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.fatal h1 { font-size: 24px; line-height: 30px; }

/* Short phones (<= 700px tall): a slimmer photo on the question and role screens, so the longer question titles still leave the rating circles on screen. */
@media (max-width: 1023px) and (max-height: 700px) { .photo:not(.band) { aspect-ratio: auto; height: 140px; } .photo:not(.band)::after { height: 32px; } .circles { margin-top: 20px; } }
@media (max-width: 359px) and (max-height: 700px) { .title { font-size: 24px; line-height: 30px; } }

@media (prefers-reduced-motion: reduce) {
  .screen.enter-fwd, .screen.enter-back { animation: none; }
  .circle:active, .choice:active, .back:active { transform: none; }
  .draw { animation: none; stroke-dashoffset: 0; }
  .l-body i { animation: none; }
}

/* ---- Desktop (>= 1024px): two columns. Photo left, question right, full-bleed light page.
   Everything below lives inside this media query, so phone and tablet (< 1024px) are untouched. ---- */
.side-art { display: none; }
@media (min-width: 1024px) {
  body { background: var(--page); padding: 0; }
  .card { width: 100%; height: 100dvh; min-height: 640px; margin: 0; border-radius: 0; box-shadow: none; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }

  .top { height: 72px; gap: 12px; padding: 0 40px; background: var(--surface); }
  .top img { height: 36px; }
  .word { font-size: 20px; line-height: 26px; }

  main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; column-gap: 56px; padding: 20px 40px; min-height: 0; }
  .screen { display: contents; }
  .screen.enter-fwd, .screen.enter-back { animation: none; }
  .screen.enter-fwd .body { animation: in-fwd 200ms var(--ease) both; }
  .screen.enter-back .body { animation: in-back 200ms var(--ease) both; }

  /* Left column: photo (or art block on thank-you / error) fills the full height. */
  .photo, .side-art { grid-column: 1; grid-row: 1 / -1; min-height: 0; border-radius: 28px; overflow: hidden; }
  .photo, .photo.band { aspect-ratio: auto; height: auto; }
  .photo img { position: absolute; inset: 0; }
  .photo::after { display: none; }
  .side-art { display: block; background: var(--violet-50) center 35% / cover no-repeat; }
  .side-art.t { background-image: url(/img/photo-06-role-lg.jpg); background-image: image-set(url(/img/photo-06-role-lg.webp) type("image/webp"), url(/img/photo-06-role-lg.jpg) type("image/jpeg")); }
  .side-art.f { background-image: url(/img/logo.png); background-image: image-set(url(/img/logo.webp) type("image/webp"), url(/img/logo.png) type("image/png")); background-size: min(28%, 200px) auto; background-position: center; }

  /* Right column: back (top), content (middle, scrolls if short), progress (bottom). */
  .prog { display: contents; }
  .back { grid-column: 2; grid-row: 1; justify-self: start; align-self: start; width: auto; display: inline-flex; align-items: center; gap: 4px; padding: 0 14px 0 0; margin-left: max(0px, calc((100% - 600px) / 2)); font-weight: 600; font-size: 16px; }
  .back::after { content: "Back"; }
  .back:hover { background: var(--violet-50); }
  .segs, .count { grid-column: 2; grid-row: 3; align-self: center; justify-self: center; width: 100%; max-width: 600px; margin: 8px 0 20px; }
  .segs { padding: 0 72px 0 8px; }
  .segs i { height: 8px; }
  .count { padding: 0 8px; font-size: 15px; font-weight: 600; text-align: right; pointer-events: none; }

  .body.pad { grid-column: 2; grid-row: 2; justify-self: center; width: 100%; max-width: 600px; min-height: 0; padding: 8px; overflow-y: auto; display: flex; flex-direction: column; justify-content: safe center; }
  .label { font-size: 14px; margin-bottom: 12px; }
  .title { font-size: clamp(34px, 3vw, 42px); line-height: 1.14; letter-spacing: -.02em; }
  .hint { font-size: clamp(18px, 1.4vw, 20px); line-height: 28px; margin-top: 16px; }

  .circles { gap: clamp(10px, 1.1vw, 16px); margin-top: 36px; padding: 10px 0 6px; }
  .circle { max-width: 92px; font-size: clamp(24px, 2.1vw, 30px); }
  .tick { width: 24px; height: 24px; top: -6px; right: -6px; }
  .ends { font-size: 16px; line-height: 22px; margin-top: 14px; }
  .tapnote { text-align: left; font-size: 16px; line-height: 22px; margin-top: 24px; }
  .tn-m { display: none; }
  .tn-d { display: inline; }

  .cards { gap: 12px; margin-top: 28px; }
  .choice { min-height: 72px; padding: 16px 24px; font-size: 20px; line-height: 26px; }
  .choice[aria-pressed="true"] { padding: 15px 23px; }
  .choice::after { content: ""; flex: none; width: 22px; height: 22px; background: var(--violet-500); -webkit-mask: var(--chev) center / contain no-repeat; mask: var(--chev) center / contain no-repeat; }
  .choice[aria-pressed="true"]::after { display: none; }

  .form { margin-top: 24px; }
  .field { margin-bottom: 16px; }
  .frame { min-height: 54px; }
  .frame input { font-size: 17px; padding: 0 16px; }
  .frame .prefix { padding-left: 16px; }
  .form .btn { min-height: 58px; font-size: 18px; margin-top: 4px; }
  .consent { margin-top: 12px; }

  .body.thanks { align-items: flex-start; text-align: left; padding: 8px; }
  .thanks .badge { width: 80px; height: 80px; margin-bottom: 28px; }
  .thanks h1 { font-size: clamp(36px, 3.4vw, 48px); line-height: 1.12; letter-spacing: -.02em; }
  .thanks .tbody { margin-top: 16px; font-size: 20px; line-height: 28px; max-width: 36ch; }
  .thanks .personal { margin-top: 20px; padding: 14px 20px; font-size: 20px; line-height: 28px; max-width: 36ch; }
  .thanks .loc { margin-top: 24px; font-size: 18px; }
  .thanks .note { font-size: 15px; }

  .foot { background: var(--surface); font-size: 15px; padding: 14px 20px; }

  /* Busy / offline pill sits in the empty right side of the header, so it never covers the question. */
  .net { top: 36px; left: auto; right: 40px; transform: translateY(-50%); max-width: calc(100% - 440px); font-size: 15px; line-height: 21px; text-align: left; }

  /* Error screen and first-load skeleton */
  .fatal { grid-column: 2; grid-row: 1 / -1; justify-self: center; align-self: center; width: 100%; max-width: 600px; padding: 8px; align-items: flex-start; text-align: left; gap: 20px; }
  .fatal h1 { font-size: clamp(30px, 2.6vw, 38px); line-height: 1.15; letter-spacing: -.02em; }
  .fatal .hint { margin-top: 0; }
  .load { grid-column: 1 / -1; grid-row: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 56px; }
  .l-photo { aspect-ratio: auto; border-radius: 28px; }
  .l-body { align-self: center; padding: 8px; gap: 16px; width: 100%; max-width: 600px; justify-self: center; }
  .l-body i { height: 22px; }
  .l-body .w2, .l-body .w3 { height: 40px; }

  @media (hover: hover) {
    .circle:hover { transform: scale(1.06); }
    .choice:hover { background: var(--violet-50); border-color: var(--violet-500); }
  }
}
:root { --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E"); }

/* Short desktop windows: tighten type and gaps so the circles and the form button stay in view.
   The form hint is dropped here (as on phones <= 700px tall) so the form with 3 errors fits without an inner scrollbar. */
@media (min-width: 1024px) and (max-height: 820px) {
  main { padding-top: 12px; padding-bottom: 12px; }
  .title { font-size: clamp(30px, 2.6vw, 38px); }
  .hint { font-size: 18px; line-height: 26px; margin-top: 10px; }
  .hint.fh { display: none; }
  .circles { margin-top: 20px; }
  .circle { max-width: 80px; }
  .tapnote { margin-top: 14px; }
  .cards { gap: 10px; margin-top: 20px; }
  .choice { min-height: 64px; }
  .form { margin-top: 14px; }
  .field { margin-bottom: 8px; }
  .field label { margin-bottom: 4px; }
  .err { margin-top: 3px; }
  .frame { min-height: 48px; }
  .form .btn { min-height: 52px; margin-top: 2px; }
  .consent { margin-top: 8px; }
  .label { margin-bottom: 8px; }
  .body.pad { padding-top: 4px; padding-bottom: 4px; }
  .segs, .count { margin-bottom: 8px; }
}
/* Very short windows: the page itself scrolls (never an inner panel), so nothing is cut. */
@media (min-width: 1024px) and (max-height: 700px) {
  .card { height: auto; min-height: 100dvh; grid-template-rows: auto auto auto; }
  main { grid-template-rows: auto auto auto; }
  .photo, .side-art { min-height: 460px; }
  .body.pad { overflow: visible; }
}

/* Per-photo focal point on desktop, so faces stay in the tall crop (the column is portrait, the photo is 3:2). */
@media (min-width: 1024px) {
  .photo[data-p="photo-01-teacher-wellbeing"] img { object-position: 30% 35%; }
  .photo[data-p="photo-02-ai-ready-students"] img { object-position: 68% 35%; }
  .photo[data-p="photo-03-learning-gaps"] img { object-position: 56% 35%; }
  .photo[data-p="photo-07-student-creators"] img { object-position: 35% 35%; }
  .photo[data-p="photo-06-form"] img, .photo[data-p="photo-06-role"] img { object-position: 60% 35%; }
}
@media (min-width: 1280px) {
  .photo[data-p="photo-06-form"] img, .photo[data-p="photo-06-role"] img { object-position: 45% 35%; }
}

@media (prefers-reduced-motion: reduce) {
  .screen.enter-fwd .body, .screen.enter-back .body { animation: none; }
}
