/* =====================================================================
   CoPilot Data quote builder — application styles
   Load order: tokens.css, app.css, preview.css
   ===================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

/*
 * The UA's `[hidden] { display: none }` has the same specificity as any author rule, so a
 * `.btn { display: inline-flex }` quietly wins and the element stays on screen. Several
 * components hide themselves with `el.hidden = true`; this makes that mean what it says.
 */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-base);
  line-height: var(--lh-body);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/*
 * Element-level resets, scoped away from the document preview.
 *
 * `.cp-doc` is rendered by packages/document with the exact CSS headless Chromium prints
 * the PDF from. A bare `h2 { font-family: … }` rule here would silently restyle the
 * "Included with Aviator" heading on screen and nowhere else — the preview would then be
 * lying about the PDF, which is the one thing it exists not to do. `:not(.cp-doc *)` keeps
 * every one of these inside the app chrome.
 */
h1:not(.cp-doc *),
h2:not(.cp-doc *),
h3:not(.cp-doc *),
h4:not(.cp-doc *) {
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: var(--lh-tight);
  margin: 0;
  color: var(--ink);
}

p:not(.cp-doc *) {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a:not(.cp-doc *) {
  color: var(--cta);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

/* Focus: always visible, always the same shape, never removed. */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/*
 * Moving into a step focuses its heading so a screen reader announces where it landed.
 * That target is not interactive, so it gets a softer halo than a button would — still
 * clearly visible, but it does not read as "this heading is a text field".
 */
.step__title:focus-visible,
.step:focus-visible {
  outline: 2px solid var(--brand-line);
  outline-offset: 4px;
  border-radius: var(--r-sm);
}
:focus:not(:focus-visible) {
  outline: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--s-3);
  top: var(--s-3);
  z-index: 100;
  transform: translateY(-200%);
  background: var(--surface);
  color: var(--cta);
  border: var(--border);
  border-radius: var(--r-sm);
  padding: var(--s-2) var(--s-4);
  box-shadow: var(--shadow-md);
  font-weight: 600;
}
.skip-link:focus {
  transform: translateY(0);
}

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

/* =====================================================================
   Shell
   ===================================================================== */

.app {
  display: grid;
  /* header, banner, stepper, main, footer — five rows. The 1fr has to land on
     `main`, or the free space collects above the step content and every short
     step (Plan, Contact) renders pinned to the bottom of the screen. */
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  min-height: 100dvh;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--s-5);
}

/* Inside an iframe the host owns the height: grow naturally and let the
   postMessage auto-height report a real number.

   `min-height: 100dvh` on the body has to go too. Inside a frame, 100dvh is the
   frame's *current* height, so the measured height can only ever grow — the
   placeholder height would be reported straight back and the frame would never
   shrink to fit a short step. */
body.is-embed {
  min-height: 0;
}
body.is-embed .app {
  min-height: 0;
  height: auto;
  padding: 0 var(--s-4);
}
body.is-embed .app__header {
  padding-block: var(--s-4) var(--s-2);
}

.app__header {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding-block: var(--s-6) var(--s-4);
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-width: 0;
}
.brand__mark {
  height: 26px;
  width: auto;
  display: block;
}
/* The wordmark is a black-on-transparent PNG (packages/document/assets.js), which
   disappears on a dark ground. It is monochrome, so a straight inversion gives the white
   version of the same mark rather than a colour-shifted one. */
@media (prefers-color-scheme: dark) {
  .brand__mark {
    filter: invert(1);
  }
}
.brand__divider {
  width: 1px;
  align-self: stretch;
  background: var(--line-2);
  margin-inline: var(--s-1);
}
.brand__title {
  font-family: var(--font-display);
  font-size: var(--t-sm);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}

.app__header-spacer {
  flex: 1 1 auto;
}

.header-badges {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}

/* =====================================================================
   Stepper — the runway
   ===================================================================== */

.stepper {
  padding-bottom: var(--s-5);
}
.stepper__list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--s-2);
  list-style: none;
  margin: 0;
  padding: 0;
}
.stepper__item {
  min-width: 0;
}
.stepper__btn {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  width: 100%;
  padding: var(--s-2) var(--s-1) var(--s-3);
  background: none;
  border: 0;
  border-top: 2px solid var(--line-2);
  border-radius: 0;
  text-align: left;
  cursor: pointer;
  color: var(--ink-3);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.stepper__btn:hover:not(:disabled) {
  color: var(--ink);
}
.stepper__btn:disabled {
  cursor: default;
  color: var(--ink-4);
  opacity: 0.75;
}
.stepper__num {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-size: var(--t-2xs);
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--ink-3);
}
.stepper__label {
  font-size: var(--t-sm);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stepper__item--current .stepper__btn {
  border-top-color: var(--brand-line);
  color: var(--ink);
}
.stepper__item--current .stepper__num {
  background: var(--brand);
  border-color: var(--brand-line);
  color: var(--on-brand);
}
.stepper__item--current .stepper__label {
  font-weight: 600;
}
.stepper__item--done .stepper__btn {
  border-top-color: var(--accent);
}
.stepper__item--done .stepper__num {
  background: var(--accent-soft);
  border-color: var(--accent-edge);
  color: var(--accent);
}

@media (max-width: 640px) {
  .stepper {
    padding-bottom: var(--s-4);
  }
  .stepper__list {
    gap: var(--s-1);
  }
  .stepper__label {
    display: none;
  }
  .stepper__btn {
    justify-content: center;
    padding-inline: 0;
    padding-bottom: var(--s-2);
  }
}

/* =====================================================================
   Main / rail
   ===================================================================== */

.app__main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 316px;
  gap: var(--s-6);
  align-items: start;
  min-height: 0;
}

.step {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}

/*
 * Steps that carry their own primary action (the parent's "Write my draft", the waitlist,
 * the contact form) need room under it: the footer is sticky, and without this the button
 * the whole step exists for sits behind the frosted bar.
 */
.app--self-submitting #step-host {
  padding-bottom: 5.5rem;
}
/* Nothing inside a step may widen its column: the rail's width is fixed, and an overflowing
   card would slide under it rather than wrapping. */
.step > * {
  min-width: 0;
  max-width: 100%;
}

.step__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
}
.step__title {
  font-size: var(--t-lg);
}
.step__lede {
  color: var(--ink-3);
  font-size: var(--t-sm);
  max-width: 62ch;
  /* Enough room that the heading's focus halo never crosses this line. */
  margin-top: var(--s-3);
}

.card {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card--pad {
  padding: var(--s-5);
}

/* =====================================================================
   Buttons
   ===================================================================== */

.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  --btn-edge: var(--line-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 0.55rem var(--s-4);
  min-height: 40px;
  border: 1px solid var(--btn-edge);
  border-radius: var(--r-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--t-base);
  font-weight: 550;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}
.btn:hover:not(:disabled) {
  background: var(--surface-2);
}
.btn:active:not(:disabled) {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/*
 * The primary action is the brand teal, #35b8be verbatim — the same fill as the
 * "Request Invoice" buttons on the pricing page, so the visual thread runs unbroken from
 * the click that opens this form to the button that finishes it.
 *
 * The label is navy (#28224b on #35b8be = 6.2:1). White on teal-500 is 2.4:1 and would
 * fail AA outright, and darkening the fill until white worked would land on a teal the
 * pricing page never uses — which is the whole point of matching it. The border takes
 * teal-900 so the control's own edge clears 3:1 against the page ground, which teal-500
 * (2.4:1 on white) does not.
 *
 * The site's blue stays where the site puts it: links and inline text actions.
 */
.btn--primary {
  --btn-bg: var(--brand);
  --btn-fg: var(--on-brand);
  --btn-edge: var(--brand-line);
  font-weight: 650;
}
.btn--primary:hover:not(:disabled) {
  background: var(--brand-strong);
  border-color: var(--brand-line);
}

/* A button that happens to be a link still takes the button's own label colour: the global
   `a:not(.cp-doc *)` link blue is more specific than `.btn`, and blue-on-teal is unreadable. */
a.btn:not(.cp-doc *) {
  color: var(--btn-fg);
}
.btn--ghost {
  --btn-bg: transparent;
  --btn-edge: transparent;
  color: var(--ink-3);
}
.btn--ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--ink);
}
.btn--sm {
  min-height: 32px;
  padding: 0.25rem var(--s-3);
  font-size: var(--t-sm);
}
.btn--link {
  background: none;
  border: 0;
  padding: 0;
  min-height: 0;
  color: var(--cta);
  font-size: inherit;
  font-weight: 550;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.btn--link:hover {
  color: var(--cta-strong);
}
.btn--block {
  width: 100%;
}

/* =====================================================================
   Chips, badges, notes
   ===================================================================== */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.12em 0.5em;
  border-radius: var(--r-xs);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--ink-3);
  font-size: var(--t-2xs);
  font-weight: 550;
  letter-spacing: 0.02em;
  line-height: 1.5;
  white-space: nowrap;
}
.chip--brand {
  background: var(--brand-soft);
  border-color: var(--brand-edge);
  color: var(--brand-ink);
}
.chip--accent {
  background: var(--accent-soft);
  border-color: var(--accent-edge);
  color: var(--accent);
}
.chip--warn {
  background: var(--warn-soft);
  border-color: var(--warn-edge);
  color: var(--warn);
}
.chip--danger {
  background: var(--danger-soft);
  border-color: var(--danger-edge);
  color: var(--danger);
}

.note {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: var(--t-sm);
  line-height: var(--lh-snug);
}
.note .icon {
  flex: 0 0 auto;
  margin-top: 1px;
}
.note--info {
  background: var(--brand-soft);
  border-color: var(--brand-edge);
  color: var(--ink-2);
}
.note--warn {
  background: var(--warn-soft);
  border-color: var(--warn-edge);
  color: var(--ink-2);
}
.note--danger {
  background: var(--danger-soft);
  border-color: var(--danger-edge);
  color: var(--ink-2);
}
.note--ok {
  background: var(--ok-soft);
  border-color: var(--accent-edge);
  color: var(--ink-2);
}
.note strong {
  font-weight: 650;
}

/* =====================================================================
   Step 1 — Role
   ===================================================================== */

.roles {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-3);
  max-width: 42rem;
}

.role-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.role-card:hover {
  border-color: var(--brand-line);
}
.role-card:has(input:checked) {
  border-color: var(--brand-line);
  box-shadow: 0 0 0 1px var(--brand-line);
}
.role-card:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.role-card__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.role-card__body {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.role-card__name {
  font-family: var(--font-display);
  font-size: var(--t-md);
  font-weight: 650;
  letter-spacing: -0.01em;
}
.role-card__hint {
  font-size: var(--t-sm);
  color: var(--ink-3);
  line-height: var(--lh-snug);
}
/* A shape, not just a colour. */
.role-card__tick {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: transparent;
  flex: 0 0 auto;
}
.role-card:has(input:checked) .role-card__tick {
  background: var(--brand);
  border-color: var(--brand-line);
  color: var(--on-brand);
}

/* =====================================================================
   Single-campus picker (parent, teacher)
   ===================================================================== */

.campus-choice {
  display: grid;
  gap: var(--s-4);
}
.campus-choice__filter {
  max-width: 22rem;
  margin-bottom: var(--s-2);
}
.campus-choice__group-title {
  font-family: var(--font-display);
  font-size: var(--t-xs);
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 var(--s-2);
}
.campus-choice__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-2);
}
.campus-choice__item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: var(--s-3);
  align-items: start;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
}
.campus-choice__item:hover {
  border-color: var(--brand-line);
}
.campus-choice__item:has(input:checked) {
  border-color: var(--brand-line);
  box-shadow: 0 0 0 1px var(--brand-line);
}
.campus-choice__item:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.campus-choice__radio {
  margin: 3px 0 0;
  accent-color: var(--brand-line);
}
.campus-choice__body {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.campus-choice__name {
  font-weight: 600;
}
.campus-choice__meta {
  font-size: var(--t-xs);
  color: var(--ink-3);
}

.chosen-campus {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--accent-edge);
  background: var(--accent-soft);
  border-radius: var(--r-sm);
  font-size: var(--t-sm);
  color: var(--ink-2);
  width: fit-content;
}
.chosen-campus .icon {
  color: var(--accent);
}

/* =====================================================================
   Attribution, disclosure, the parent's draft
   ===================================================================== */

.attribution {
  display: grid;
  gap: var(--s-3);
  padding-top: var(--s-4);
  border-top: var(--border);
  max-width: 28rem;
}

/* The disclosure sits at the submit point and has to read as part of the decision, not as
   a footnote under it. */
.disclosure {
  align-items: flex-start;
}

.draft {
  display: grid;
  gap: var(--s-4);
}
/*
 * A document, not a preview. Monospace would make it look like output; this is the parent's
 * letter, so it is set in the reading face at a comfortable measure.
 */
.draft__body {
  width: 100%;
  min-height: 22rem;
  padding: var(--s-4);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: var(--t-base);
  line-height: 1.6;
  resize: vertical;
}
.draft__body:focus {
  outline: none;
  border-color: var(--brand-line);
  box-shadow: 0 0 0 1px var(--brand-line);
}
.draft__body:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.draft__actions {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.draft__notice {
  display: flex;
  align-items: flex-start;
  gap: var(--s-2);
  font-size: var(--t-sm);
  color: var(--ink-2);
  padding: var(--s-3);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface-inset);
}
.draft__notice .icon {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--ink-3);
}

/* =====================================================================
   Plan
   ===================================================================== */

.plans {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--s-4);
}
.plans > legend {
  padding: 0;
}

.plan {
  position: relative;
  display: block;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    background var(--dur) var(--ease);
}
.plan:hover {
  border-color: var(--brand-edge);
}
.plan__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.plan:has(.plan__input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.plan:has(.plan__input:checked) {
  border-color: var(--brand-line);
  box-shadow: 0 0 0 1px var(--brand-line), var(--shadow-md);
  background: var(--surface);
}

.plan__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
}
.plan__name {
  font-family: var(--font-display);
  font-size: var(--t-md);
  font-weight: 600;
  letter-spacing: -0.01em;
}
/* The check is a shape, not a colour — colour alone never carries state. */
.plan__tick {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: transparent;
}
.plan:has(.plan__input:checked) .plan__tick {
  background: var(--brand);
  border-color: var(--brand-line);
  color: var(--on-brand);
}

.plan__prices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-1) var(--s-4);
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: var(--border);
}
.plan__price-label {
  font-size: var(--t-xs);
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.plan__price {
  font-family: var(--font-display);
  font-size: var(--t-md);
  font-weight: 600;
}
.plan__price-unit {
  font-family: var(--font-body);
  font-size: var(--t-xs);
  font-weight: 400;
  color: var(--ink-3);
}

.plan__features {
  margin: var(--s-4) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--s-1);
  font-size: var(--t-sm);
  color: var(--ink-2);
}
.plan__features li {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: var(--s-2);
  align-items: start;
}
.plan__features .icon {
  color: var(--accent);
  margin-top: 3px;
}
.plan__more {
  color: var(--ink-3);
  font-size: var(--t-xs);
  margin-top: var(--s-2);
}

/* =====================================================================
   Step 2 — District
   ===================================================================== */

.combo {
  position: relative;
  max-width: 34rem;
}
.combo__field {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding-inline: var(--s-3);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
.combo__field:focus-within {
  border-color: var(--brand-line);
  box-shadow: 0 0 0 1px var(--brand-line);
}
.combo__field .icon {
  color: var(--ink-4);
  flex: 0 0 auto;
}
.combo__input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: none;
  padding: 0.7rem 0;
  font-size: var(--t-md);
  outline: none;
}
.combo__input::placeholder {
  color: var(--ink-4);
}

.combo__listbox {
  position: absolute;
  z-index: 20;
  inset-inline: 0;
  top: calc(100% + 6px);
  margin: 0;
  padding: var(--s-1);
  list-style: none;
  max-height: 19rem;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
}
.combo__listbox[hidden] {
  display: none;
}
.combo__option {
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  cursor: pointer;
  display: grid;
  gap: 1px;
}
.combo__option[aria-selected='true'] {
  background: var(--brand-soft);
  outline: 1px solid var(--brand-edge);
}
.combo__option-name {
  font-weight: 600;
}
.combo__option-meta {
  font-size: var(--t-xs);
  color: var(--ink-3);
}
.combo__empty {
  padding: var(--s-3);
  color: var(--ink-3);
  font-size: var(--t-sm);
}

/* ---- step 1: work email, with search as an equal way in ---- */

.email-entry {
  max-width: 34rem;
}
.email-entry__row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.email-entry__row .field__input {
  font-size: var(--t-md);
  padding-block: 0.65rem;
}
.email-entry .field__hint {
  margin-top: var(--s-2);
}

/*
 * "or" and the search button carry the same weight as the field above them. A visitor who
 * will not type an email into a form before knowing what it does must not have to hunt for
 * the other way in, so this is a full-height rule and a real button, not a footnote.
 */
.email-entry__or {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-5);
  padding-top: var(--s-5);
  border-top: var(--border);
}


/* ---- the ambiguous picker ---- */

.choice-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-2);
  max-width: 34rem;
}
.choice {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.choice:hover {
  border-color: var(--brand-line);
  background: var(--surface-2);
}
.choice__name {
  font-weight: 600;
}
.choice__meta {
  font-size: var(--t-xs);
  color: var(--ink-3);
}

.district-card {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  flex-wrap: wrap;
}
.district-card__body {
  flex: 1 1 14rem;
  min-width: 0;
}
.district-card__name {
  font-family: var(--font-display);
  font-size: var(--t-md);
  font-weight: 600;
}
.district-card__meta {
  font-size: var(--t-sm);
  color: var(--ink-3);
}

/* =====================================================================
   Step 3 — Campuses
   ===================================================================== */

.campus-toolbar {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.campus-toolbar__count {
  font-size: var(--t-sm);
  color: var(--ink-2);
  margin-right: auto;
}
.campus-toolbar__count strong {
  font-weight: 650;
  color: var(--ink);
}

.campus-filter {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding-inline: var(--s-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  min-width: 12rem;
}
.campus-filter .icon {
  color: var(--ink-4);
}
.campus-filter input {
  border: 0;
  background: none;
  outline: none;
  padding: 0.35rem 0;
  min-width: 0;
  width: 100%;
  font-size: var(--t-sm);
}

.campus-scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  max-height: min(52vh, 640px);
  border: var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
body.is-embed .campus-scroll {
  max-height: none;
  overflow: visible;
}

.campus-group + .campus-group {
  border-top: var(--border);
}
.campus-group__head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--surface-2);
  border-bottom: var(--border);
  backdrop-filter: saturate(1.4) blur(6px);
}
.campus-group__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--t-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.5;
}
.campus-group__meta {
  margin-left: auto;
  font-size: var(--t-xs);
  color: var(--ink-3);
  white-space: nowrap;
}
.campus-group__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.campus-group__list > li + li .campus {
  border-top: var(--border);
}

/* One row. The grid is named so 375px can reflow it without any of the
   parts overlapping or the price falling off the edge. */
.campus {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  grid-template-areas:
    'box name price'
    'box meta price';
  column-gap: var(--s-3);
  align-items: start;
  padding: 0.6rem var(--s-4);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}
.campus:hover {
  background: var(--surface-2);
}
.campus:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
  border-radius: var(--r-xs);
}

.campus__box {
  grid-area: box;
  margin: 3px 0 0;
  width: 18px;
  height: 18px;
  /* teal-900, not teal-500: a #35b8be box on white is 2.4:1, under the 3:1 a
     control needs against the background it sits on. */
  accent-color: var(--brand-line);
  cursor: pointer;
}
.campus__name {
  grid-area: name;
  font-weight: 550;
  line-height: var(--lh-snug);
  overflow-wrap: anywhere;
}
.campus__meta {
  grid-area: meta;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-1) var(--s-3);
  margin-top: 2px;
  font-size: var(--t-xs);
  color: var(--ink-3);
}
.campus__no {
  font-family: var(--font-mono);
  font-size: var(--t-2xs);
  letter-spacing: 0.02em;
  color: var(--ink-4);
}
.campus__price {
  grid-area: price;
  align-self: center;
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  padding-left: var(--s-2);
}
/* Dimmed, but still AA: an excluded campus's name is the thing a rep reads to decide
   whether to add it. --ink-4 tested at 3.4:1, which is not enough for body text. */
.campus--off .campus__name {
  color: var(--ink-3);
  font-weight: 500;
}
.campus--off .campus__price {
  color: var(--ink-3);
  font-weight: 500;
}
.campus__reasons {
  grid-area: meta;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  align-items: center;
}
.campus__why {
  font-size: var(--t-xs);
  color: var(--ink-3);
}

/* level_unknown, internal: a rep has to choose before this quote can go out. */
.campus--needs-tier {
  background: var(--warn-soft);
}
.campus--needs-tier:hover {
  background: var(--warn-soft);
}

/* level_unknown, public: nothing to do, so this is a note rather than an alarm — amber
   would ask a visitor to fix something they have no control over (Addendum 5). */
.campus--unknown-level {
  background: var(--surface-2);
}
.campus--unknown-level:hover {
  background: var(--surface-3);
}
.campus--unknown-level .campus__tier {
  color: var(--ink-3);
}
.campus__tier {
  grid-column: 2 / -1;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
  margin-top: var(--s-2);
  font-size: var(--t-xs);
}
.campus__tier select {
  padding: 0.2rem var(--s-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xs);
  background: var(--surface);
  font-size: var(--t-xs);
}

.campus-other {
  margin-top: var(--s-4);
  border: var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
}
.campus-other > summary {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  cursor: pointer;
  font-size: var(--t-sm);
  font-weight: 550;
  color: var(--ink-2);
  list-style: none;
}
.campus-other > summary::-webkit-details-marker {
  display: none;
}
.campus-other > summary .icon {
  transition: transform var(--dur) var(--ease);
  color: var(--ink-3);
}
.campus-other[open] > summary .icon {
  transform: rotate(90deg);
}
.campus-other__hint {
  margin-left: auto;
  font-weight: 400;
  color: var(--ink-3);
  font-size: var(--t-xs);
}
.campus-other__body {
  border-top: var(--border);
}

.campus-lookup {
  margin-top: var(--s-4);
}
.campus-lookup__form {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-4);
  border-top: var(--border);
}

@media (max-width: 460px) {
  .campus {
    grid-template-columns: 20px minmax(0, 1fr);
    grid-template-areas:
      'box name'
      'box meta'
      'box price';
  }
  .campus__price {
    justify-self: start;
    padding-left: 0;
    margin-top: var(--s-1);
    align-self: start;
  }
}

/* =====================================================================
   Forms
   ===================================================================== */

.field {
  display: grid;
  gap: var(--s-1);
}
.field__label {
  font-size: var(--t-sm);
  font-weight: 550;
  color: var(--ink-2);
}
.field__optional {
  font-weight: 400;
  color: var(--ink-4);
}
.field__input,
.field textarea,
.field select {
  width: 100%;
  padding: 0.55rem var(--s-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: var(--t-base);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.field__input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--brand-line);
  box-shadow: 0 0 0 1px var(--brand-line);
}
.field__input:focus-visible,
.field textarea:focus-visible,
.field select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.field__input[aria-invalid='true'] {
  border-color: var(--danger);
}
.field__error {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  font-size: var(--t-xs);
  color: var(--danger);
  font-weight: 550;
}
.field__hint {
  font-size: var(--t-xs);
  color: var(--ink-3);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--s-4);
}
.form-grid--full > * {
  grid-column: 1 / -1;
}

.radio-cards {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--s-3);
}
.radio-card {
  position: relative;
  display: grid;
  gap: 2px;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
}
.radio-card:has(input:checked) {
  border-color: var(--brand-line);
  box-shadow: 0 0 0 1px var(--brand-line);
}
.radio-card:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.radio-card input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.radio-card__title {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.radio-card__title::before {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  flex: 0 0 auto;
}
.radio-card:has(input:checked) .radio-card__title::before {
  border: 4px solid var(--brand-line);
  background: var(--surface);
}
.radio-card__hint {
  font-size: var(--t-xs);
  color: var(--ink-3);
}

/* =====================================================================
   Summary rail
   ===================================================================== */

.rail {
  position: sticky;
  top: var(--s-4);
  display: grid;
  gap: var(--s-4);
}

.summary {
  padding: var(--s-5);
}
.summary__label {
  font-size: var(--t-2xs);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 600;
  color: var(--ink-3);
}
.summary__total {
  font-family: var(--font-display);
  font-size: var(--t-xl);
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-top: var(--s-1);
  line-height: 1.1;
}
.summary__per-student {
  margin-top: var(--s-1);
  font-size: var(--t-xs);
  color: var(--ink-3);
  line-height: var(--lh-snug);
}
.summary__lines {
  margin: var(--s-4) 0 0;
  padding: var(--s-4) 0 0;
  border-top: var(--border);
  display: grid;
  gap: var(--s-2);
  font-size: var(--t-sm);
}
.summary__line {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  color: var(--ink-2);
}
.summary__line dt {
  color: var(--ink-3);
  min-width: 0;
}
.summary__line dd {
  margin: 0;
  font-weight: 600;
  white-space: nowrap;
}
.summary__line--discount dd {
  color: var(--accent);
}
.summary__facts {
  margin: var(--s-4) 0 0;
  padding: var(--s-4) 0 0;
  border-top: var(--border);
  display: grid;
  gap: var(--s-1);
  font-size: var(--t-xs);
  color: var(--ink-3);
}
.summary__facts div {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
}
.summary__facts span:last-child {
  color: var(--ink-2);
  font-weight: 550;
  text-align: right;
}

.summary__source {
  margin-top: var(--s-4);
  font-size: var(--t-2xs);
  color: var(--ink-4);
  display: flex;
  align-items: center;
  gap: var(--s-1);
}

/* =====================================================================
   Footer nav
   ===================================================================== */

.app__footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) 0 var(--s-5);
  margin-top: var(--s-5);
  flex-wrap: wrap;
  /* A toolbar, not a smear: the previous gradient washed over the document preview it was
     sitting on top of. Solid enough to read against anything, with the page tint kept. */
  background: var(--bg);
  box-shadow: 0 -1px 0 var(--line), 0 -16px 24px -18px rgb(10 22 38 / 0.25);
}
@supports (backdrop-filter: blur(1px)) {
  .app__footer {
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: blur(14px) saturate(1.3);
  }
}
body.is-embed .app__footer {
  position: static;
  background: none;
}
.app__footer .btn--primary {
  margin-left: auto;
}
.footer__hint {
  font-size: var(--t-sm);
  color: var(--ink-3);
  flex: 1 1 12rem;
  min-width: 0;
}
.footer__hint--block {
  color: var(--warn);
  font-weight: 550;
}

/* Mobile: the rail collapses into a bar on the footer's own first row, so the screen
   carries one sticky block rather than two stacked ones. */
.rail-mobile {
  display: none;
  order: -1;
  flex: 1 0 100%;
}

@media (max-width: 960px) {
  .app__main {
    grid-template-columns: minmax(0, 1fr);
  }
  .rail {
    position: static;
  }
  .rail--desktop {
    display: none;
  }
  .rail-mobile {
    display: block;
  }
  .rail-mobile__bar {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    border: var(--border);
    border-radius: var(--r-md);
    background: var(--surface);
    box-shadow: var(--shadow-md);
  }
  .rail-mobile__total {
    margin-left: auto;
    font-family: var(--font-display);
    font-size: var(--t-md);
    font-weight: 600;
  }
  .campus-scroll {
    max-height: none;
  }
}

@media (max-width: 620px) {
  /* The 375px case. Reclaim vertical space above the campus list, and stop the toolbar
     wrapping into three ragged rows. */
  .app__header {
    padding-block: var(--s-4) var(--s-3);
  }
  .step {
    gap: var(--s-4);
  }
  .campus-other__hint {
    display: none;
  }
  .campus-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: var(--s-2);
    align-items: center;
  }
  .campus-toolbar__count {
    grid-column: 1 / -1;
    font-size: var(--t-xs);
  }
  .campus-filter {
    min-width: 0;
  }
  .campus-toolbar .btn {
    min-height: 34px;
    padding: 0.2rem var(--s-3);
    font-size: var(--t-sm);
  }
  .step__lede {
    font-size: var(--t-xs);
  }
  .note {
    padding: var(--s-2) var(--s-3);
    font-size: var(--t-xs);
  }
}

@media (max-width: 560px) {
  .app {
    padding-inline: var(--s-3);
  }
  .app__footer {
    padding-bottom: var(--s-4);
  }
  .app__footer .btn {
    flex: 1 1 auto;
  }
  .footer__hint {
    order: 3;
    flex-basis: 100%;
  }
}

/* =====================================================================
   Review
   ===================================================================== */

.review {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-5);
}

.totals {
  padding: var(--s-5);
  display: grid;
  gap: var(--s-4);
}
.totals__figure {
  font-family: var(--font-display);
  font-size: var(--t-2xl);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1;
}
.totals__rows {
  display: grid;
  gap: var(--s-2);
  margin: 0;
  font-size: var(--t-sm);
}
.totals__row {
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
}
.totals__row dt {
  color: var(--ink-3);
}
.totals__row dd {
  margin: 0;
  font-weight: 600;
}

.result {
  display: grid;
  gap: var(--s-4);
  padding: var(--s-6);
}
.result__number {
  font-family: var(--font-mono);
  font-size: var(--t-sm);
  color: var(--ink-3);
}
/* Turnstile draws its own iframe; this only reserves the row and centres it. The height is
   not fixed — the widget is `size: flexible` and grows when it needs an interaction. */
.turnstile-host {
  display: flex;
  justify-content: center;
  min-height: 0;
}
.turnstile-host:empty {
  display: none;
}
.turnstile-note {
  text-align: center;
}

.secure-link {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface-inset);
  font-family: var(--font-mono);
  font-size: var(--t-sm);
  word-break: break-all;
}
.secure-link a {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* =====================================================================
   Internal mode
   ===================================================================== */

.internal-bar {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-4);
  border: 1px solid var(--accent-edge);
  background: var(--accent-soft);
  border-radius: var(--r-md);
  font-size: var(--t-sm);
  flex-wrap: wrap;
}
.internal-bar__who {
  color: var(--ink-2);
  margin-right: auto;
}
.internal-panel {
  display: grid;
  gap: var(--s-4);
  padding: var(--s-5);
  border: 1px solid var(--accent-edge);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.internal-panel__title {
  font-family: var(--font-display);
  font-size: var(--t-sm);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}
.manual-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8rem auto;
  gap: var(--s-2);
  align-items: end;
}
@media (max-width: 520px) {
  .manual-line {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

/* =====================================================================
   Loading / empty
   ===================================================================== */

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  border-top-color: var(--brand-line);
  animation: spin 700ms linear infinite;
  flex: 0 0 auto;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.loading-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-5);
  color: var(--ink-3);
  font-size: var(--t-sm);
}
