/*
  Columbia West College: online payments.
  One stylesheet for every page. System fonts only, no outside files.

  Spacing scale  4, 8, 12, 16, 24, 32, 48
  Type scale     13, 15, 16 (body), 20 (section), 24 to 30 (page), 28 (total)
  Colour         school navy for structure, school gold as a thin accent only
*/

:root {
  --navy: #252466;
  --navy-deep: #18174a;
  --navy-wash: #f1f1f8;
  --navy-pale: #d6d6ea;
  --gold: #fdbe13;
  --ink: #1b1b2a;
  --muted: #56586d;
  --rule: #dbd9d2;
  --control: #7f8196;
  --paper: #f6f5f1;
  --paper-light: #fbfaf8;
  --white: #ffffff;
  --danger: #a3201b;
  --danger-wash: #fcf0ef;

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", Times, serif;

  --pad: 16px;    /* space at the sides of the page */
  --inset: 16px;  /* space inside cards */
  --rail: 280px;  /* width of the summary rail */
  --gap: 24px;    /* space between the main column and the rail */
  --radius: 6px;
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  color-scheme: light;
  scroll-padding-top: 16px;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.5 var(--sans);
  /* A word too long for its line (an email address in large text) breaks
     instead of widening the page. */
  overflow-wrap: break-word;
}

[hidden] { display: none !important; }

h1, h2, h3, p, ul, ol, dl, dt, dd, address { margin: 0; padding: 0; }
ul, ol { list-style: none; }
address { font-style: normal; }
img, svg { display: block; }
button, input { font: inherit; color: inherit; }

a {
  color: var(--navy);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 2px; }

/* Two-colour focus ring: navy shows on light surfaces, gold on navy ones. */
:focus {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--navy);
}
:focus:not(:focus-visible) { outline: none; box-shadow: none; }
[tabindex="-1"]:focus, iframe:focus { outline: none; box-shadow: none; }

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

/* Honeypot field: off screen, never focusable, hidden from assistive technology. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.print-only { display: none !important; }

.wrap {
  width: 100%;
  max-width: calc(1200px + 2 * var(--pad));
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ---------- Masthead: the school's letterhead ---------- */

.masthead-band {
  background: var(--navy);
  color: var(--white);
  border-bottom: 3px solid var(--gold);
}

.masthead-row {
  display: flex;
  align-items: center;
  min-height: 64px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.lockup {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.seal {
  flex: none;
  width: 44px;
  height: 44px;
  margin-right: 12px;
  padding: 2px;
  border-radius: 50%;
  background: var(--white);
}

.brand { min-width: 0; font: inherit; }

.brand-name {
  display: block;
  font: 400 1.0625rem/1.2 var(--serif);
  letter-spacing: 0.01em;
}

.brand-tag {
  display: block;
  margin-top: 4px;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.masthead-help {
  flex: none;
  margin-left: 12px;
  margin-right: -8px; /* the word stays on the page margin, the tap area is 44px */
  padding: 12px 8px;
  color: var(--white);
  font-size: 0.9375rem;
}

/* On phones the address is in the footer instead. */
.masthead-address { display: none; }
.masthead-address span { display: block; }

/* ---------- Steps ---------- */

.progress {
  background: var(--white);
  border-bottom: 1px solid var(--rule);
}

.steps {
  display: flex;
  flex-wrap: wrap; /* with very large text a whole step moves to a second line */
  align-items: center;
  max-width: 560px;
  min-height: 48px;
}

.step {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.2;
  white-space: nowrap;
}

.step + .step { flex: 1 1 auto; }

.step + .step::before {
  content: "";
  flex: 1 1 auto;
  min-width: 12px;
  margin: 0 8px;
  border-top: 1px solid var(--control);
}

.step-dot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 24px;
  height: 24px;
  margin-right: 8px;
  border: 1px solid var(--control);
  border-radius: 50%;
  background: var(--white);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.step[aria-current="step"] { color: var(--navy); font-weight: 700; }

.step[aria-current="step"] .step-dot {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--white);
}

.step.is-done { color: var(--ink); }

.step.is-done .step-dot {
  border-color: var(--gold);
  background: var(--gold);
}

.step.is-done .step-dot::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 4px;
  width: 6px;
  height: 11px;
  border: solid var(--navy);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.step.is-done + .step::before { border-top: 2px solid var(--navy); }

/* ---------- Page and type ---------- */

.page {
  flex: 1 0 auto;
  padding-top: 16px;
  padding-bottom: 32px;
}

.title {
  color: var(--navy);
  font: 400 1.5rem/1.2 var(--serif);
}

h3 {
  color: var(--navy);
  font: 400 1.25rem/1.25 var(--serif);
}

.lead { margin-top: 4px; color: var(--muted); }
.hint { color: var(--muted); font-size: 0.9375rem; }

/* Where the browser can, avoid a last line of one short word. */
.title { text-wrap: balance; }
p { text-wrap: pretty; }

.layout-head { margin-bottom: 16px; }

/* ---------- Cards and fields ---------- */

.card {
  margin-bottom: 16px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--white);
}

.card-head { padding: var(--inset) var(--inset) 0; }
.card-head .hint { margin-top: 2px; }
.card-foot { padding: 12px var(--inset) var(--inset); }

.fields {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, max(220px, calc(50% - 8px))), 1fr));
  gap: 16px;
  padding: var(--inset);
}

.field { min-width: 0; }

.field label,
.fee-note label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
}

.optional { color: var(--muted); font-weight: 400; }
.field .hint { margin-top: 8px; }

input[type="text"],
input[type="email"] {
  display: block;
  width: 100%;
  height: 48px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--control);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
  font-size: 1rem;
  -webkit-appearance: none;
  appearance: none;
}

input::placeholder { color: var(--muted); opacity: 1; }

input[aria-invalid="true"] {
  border: 2px solid var(--danger);
  padding: 0 11px;
}

.error {
  margin-top: 8px;
  padding-left: 8px;
  border-left: 3px solid var(--danger);
  color: var(--danger);
  font-size: 0.9375rem;
  font-weight: 600;
}

.alert {
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid var(--danger);
  border-left-width: 4px;
  border-radius: 4px;
  background: var(--danger-wash);
  color: var(--danger);
  font-weight: 600;
}

/* ---------- Payment list ---------- */

.fees {
  min-height: 514px; /* nine rows: no jump when the script fills the list */
  margin-top: 12px;
  border-top: 1px solid var(--rule);
}

/* Shown in the list until the script has filled it. */
.fees-wait { padding: 16px var(--inset); color: var(--muted); font-size: 0.9375rem; }

/* A row keeps whole words: when the name, the price and the amount field do
   not fit side by side (small screen, large text), the price or the field
   moves under the name. */
.fee {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 12px;
  min-height: 57px;
  padding: 0 var(--inset);
  border-bottom: 1px solid var(--rule);
}

.fee.is-on { background: var(--navy-wash); }

.fee-pick {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 0;
  flex-wrap: wrap;
  min-width: 7rem;
  min-height: 56px;
  padding: 8px 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.fee-check {
  position: absolute;
  left: 0;
  top: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0;
  opacity: 0;
  cursor: pointer;
}

.fee-box {
  position: relative;
  flex: none;
  width: 24px;
  height: 24px;
  margin-right: 12px;
  border: 2px solid var(--control);
  border-radius: 4px;
  background: var(--white);
}

.fee-check:checked + .fee-box { border-color: var(--navy); background: var(--navy); }

.fee-check:checked + .fee-box::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 1px;
  width: 8px;
  height: 14px;
  border: solid var(--white);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.fee-check:focus + .fee-box {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--navy);
}
.fee-check:focus:not(:focus-visible) + .fee-box { outline: none; box-shadow: none; }

.fee-name { flex: 1 1 0; min-width: min-content; }
.fee.is-on .fee-name { font-weight: 600; }

.fee-price,
.fee-ask {
  flex: none;
  margin-left: auto;
  padding-left: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fee-price { font-weight: 600; }
.fee-ask { color: var(--muted); font-size: 0.9375rem; }

/* On the narrowest phones, room for two-word names beside "Enter amount". */
@media (max-width: 359.98px) {
  .fee-ask { padding-left: 8px; font-size: 0.8125rem; }
}

/* Sized in text units, so an amount is never cut off when text is enlarged. */
.fee-amount {
  position: relative;
  flex: none;
  width: 7.75rem;
  min-width: 124px;
  margin: 4px 0 4px auto;
}

.fee-amount input {
  padding-left: 26px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.fee-amount input[aria-invalid="true"] { padding-left: 25px; }

.fee-currency {
  position: absolute;
  left: 12px;
  top: 50%;
  margin-top: -12px;
  color: var(--muted);
  line-height: 24px;
  pointer-events: none;
}

.fee > .error {
  flex: 0 0 100%;
  margin: 0 0 12px 36px;
}

.fee-note {
  flex: 0 0 100%;
  padding: 4px 0 16px 36px;
}

.has-error .fees { border-top-color: var(--danger); }

@media (hover: hover) {
  .fee:hover { background: var(--paper-light); }
  .fee.is-on:hover { background: var(--navy-wash); }
}

@media (forced-colors: active) {
  .fee-check { position: static; flex: none; margin: 0 12px 0 0; opacity: 1; }
  .fee-box { display: none; }
}

/* ---------- Summary, total and buttons ---------- */

.rail, .rail-card { display: contents; }

.summary {
  margin-bottom: 16px;
  padding: var(--inset);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--navy);
  border-radius: var(--radius);
  background: var(--white);
}

.summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin: -8px 0 -4px;
}

.summary-empty { margin-top: 8px; color: var(--muted); font-size: 0.9375rem; }

.summary-student {
  margin-top: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}

.summary-student span { display: block; color: var(--muted); font-size: 0.8125rem; }

.lines { margin-top: 8px; }

.line {
  display: flex;
  align-items: baseline;
  padding: 4px 0;
  font-size: 0.9375rem;
}

.line-name { flex: 1 1 auto; min-width: 0; margin-right: 16px; overflow-wrap: anywhere; }
.line-note { display: block; color: var(--muted); font-size: 0.8125rem; }
.line-amount { flex: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
.line-amount.is-missing { color: var(--muted); }

.total-row {
  display: flex;
  flex-wrap: wrap; /* a very long total moves under its label instead of spilling out */
  align-items: flex-end;
  justify-content: space-between;
  column-gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px solid var(--navy);
}

.total-label { font-weight: 700; line-height: 1.3; }

.total-label small {
  display: block;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 400;
}

.total-amount {
  margin-left: auto;
  color: var(--navy);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 8px 16px;
  border: 1px solid var(--navy);
  border-radius: var(--radius);
  font: 700 1rem/1.2 var(--sans);
  text-align: center;
  text-decoration: none;
  text-wrap: balance;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-deep); }
.btn-primary:disabled { border-color: var(--muted); background: var(--muted); cursor: progress; }

.btn-secondary { background: var(--white); color: var(--navy); }
.btn-secondary:hover { background: var(--navy-wash); }

.btn-inline { width: auto; }

.btn-link {
  min-height: 44px;
  margin: 0 -4px 0 12px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--navy);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

/* Phones: the total and the button stay at the bottom of the screen while the
   form scrolls, and settle into the page at the end of the form. */
.paybar {
  position: -webkit-sticky;
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  margin: 0 calc(-1 * var(--pad));
  padding: 12px var(--pad);
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--white);
  box-shadow: 0 -4px 14px rgba(27, 27, 42, 0.08);
}

.assure { margin-top: 16px; color: var(--muted); font-size: 0.9375rem; }
.assure p + p { margin-top: 4px; }
.assure-now { color: var(--ink); font-weight: 600; }

@media (max-width: 767.98px) {
  /* Room for the bar below, in text units: the bar grows with the text. */
  html { scroll-padding-bottom: 6rem; }

  .paybar .total-row {
    display: block;
    flex: none;
    margin: 0 12px 0 0;
    padding: 0;
    border: 0;
  }

  .paybar .total-label {
    display: block;
    color: var(--muted);
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.3;
  }

  .paybar .total-label small { display: inline; font-size: inherit; }
  .paybar .total-amount { display: block; font-size: 1.25rem; line-height: 1.3; }
  .paybar .btn { flex: 1 1 0; min-width: 0; min-height: 48px; padding: 4px 12px; }

  .actions .btn { margin-top: 12px; }
}

/* A very short screen (phone held sideways, or a keyboard that shrinks the
   page): the bar gives its space back and waits at the end of the form. */
@media (max-width: 767.98px) and (max-height: 480px) {
  .paybar { position: static; box-shadow: none; }
}

/* ---------- Help ---------- */

.help { margin-top: 24px; font-size: 0.9375rem; scroll-margin-top: 16px; }
.help h3 { font-size: 1.125rem; }
.help-list { margin-top: 4px; }

.help-list li { border-bottom: 1px solid var(--rule); }

.help-list a {
  display: inline-block;
  max-width: 100%;
  padding: 12px 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.help-hours { display: block; margin: -8px 0 12px; color: var(--muted); font-size: 0.8125rem; }
.help-wire { margin-top: 12px; color: var(--muted); }
#done-panel .help-wire { display: none; }
#done-panel .help-list li:last-child { border-bottom: 0; }

/* ---------- Card step ---------- */

/* The card form is served by Authorize.net inside this frame. The frame is
   320 to 450px wide (one column) or 780px and wider (two columns): the form
   breaks at any width in between. On phones the shell spans the screen. */
.shell {
  margin: 0 calc(-1 * var(--pad));
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--white);
}

.shell-note {
  display: flex;
  align-items: flex-start;
  padding: 12px var(--pad);
  border-bottom: 1px solid var(--rule);
  background: var(--paper-light);
  font-size: 0.9375rem;
}

.note-icon { flex: none; margin: 2px 12px 0 0; }
.note-text { flex: 1 1 auto; min-width: 0; }
.clock { margin-top: 4px; color: var(--muted); }

/* The two-minute warning sticks to the top of the screen while the card form
   scrolls under it, so it is seen wherever the payer is in the form. */
.closing {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px var(--pad);
  border-bottom: 1px solid var(--danger);
  background: var(--danger-wash);
  color: var(--danger);
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: center;
}

/* On a screen narrower than the 320px the card form needs, this area scrolls
   sideways as a whole instead of squeezing the form. */
.frame-area { position: relative; overflow-x: auto; }

/* Covers the frame until Authorize.net's form has drawn itself, so the payer
   sees that something is on its way instead of an empty box. */
.frame-loading {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  padding: 64px var(--pad) 0;
  background: var(--white);
  color: var(--muted);
  text-align: center;
}

.frame-loading::before {
  content: "";
  display: block;
  width: 28px;
  height: 28px;
  margin: 0 auto 16px;
  border: 3px solid var(--navy-pale);
  border-top-color: var(--navy);
  border-radius: 50%;
}

@keyframes turn {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: no-preference) {
  .frame-loading::before { animation: turn 0.9s linear infinite; }
}

.frame {
  position: relative;
  display: block;
  width: 100%;
  min-width: 320px;
  max-width: 450px;
  height: 900px;
  margin: 0 auto;
  border: 0;
}

.expired { max-width: 450px; margin: 0 auto; padding: 32px var(--pad) 48px; }
.expired p { margin: 8px 0 16px; }

/* No overflow clipping on the shell: it would stop the warning from sticking. */
@media (min-width: 482px) {
  .shell {
    margin: 0;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
  }

  .shell-note { border-radius: 5px 5px 0 0; }
  .frame { border-radius: 0 0 5px 5px; }
}

/* ---------- Receipt ---------- */

.receipt {
  border: 1px solid var(--rule);
  border-top: 3px solid var(--navy);
  border-radius: var(--radius);
  background: var(--white);
}

/* The mark and the outcome share a row; on phones the sentence below them
   uses the full width, on wider screens it lines up under the outcome. */
.receipt-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 12px;
  align-items: center;
  padding: 16px var(--inset);
  border-bottom: 1px solid var(--rule);
}

.status-icon { grid-column: 1; grid-row: 1; width: 44px; height: 44px; }
.receipt-status .title { grid-column: 2; grid-row: 1; }
.receipt-status p { grid-column: 1 / -1; grid-row: 2; margin-top: 12px; }
.receipt-items { padding: 8px var(--inset) 16px; }
.receipt-items .line { padding: 8px 0; font-size: 1rem; }

.meta {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px 24px;
  padding: 16px var(--inset);
  border-top: 1px solid var(--rule);
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--paper-light);
}

.meta dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.meta dd { margin-top: 2px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--white);
  color: var(--muted);
  font-size: 0.9375rem;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  padding-bottom: 8px;
}

.footer-address { margin: 8px 24px 8px 0; }
.footer-links { display: flex; flex-wrap: wrap; }
.footer-links li { margin-right: 24px; }
.footer-links li:last-child { margin-right: 0; }
.footer-links a { display: inline-block; padding: 12px 0; }
.ext { display: inline-block; margin-left: 4px; vertical-align: baseline; }

/* ---------- Text pages: policies, thank you, not found ---------- */

.doc { max-width: 720px; }
.doc .title { margin-bottom: 16px; }
.doc > p { margin-bottom: 16px; }
.doc .card { padding: var(--inset); }
.doc .card h2 { margin-bottom: 8px; color: var(--navy); font: 400 1.25rem/1.25 var(--serif); }
.doc .card p + p { margin-top: 12px; }
.doc .help-list { max-width: 420px; margin-bottom: 24px; }

/* ---------- Tablets and wider: two columns ---------- */

@media (min-width: 360px) {
  .brand-name { font-size: 1.1875rem; }
}

@media (min-width: 768px) {
  :root { --pad: 24px; }

  .masthead-row { min-height: 80px; padding-top: 12px; padding-bottom: 12px; }
  .seal { width: 56px; height: 56px; margin-right: 16px; padding: 3px; }
  .brand-name { font-size: 1.5rem; }
  .brand-tag { margin-top: 4px; }
  .masthead-help { display: none; }

  .masthead-address {
    display: block;
    flex: none;
    margin-left: 24px;
    color: var(--navy-pale);
    font-size: 0.875rem;
    line-height: 1.45;
    text-align: right;
  }

  .footer-address { display: none; }

  .steps { min-height: 52px; }
  .step { font-size: 0.9375rem; }
  .step-dot { width: 28px; height: 28px; font-size: 0.8125rem; }
  .step.is-done .step-dot::after { left: 10px; top: 5px; width: 7px; height: 13px; }
  .step + .step::before { margin: 0 12px; }

  .page { padding-top: 24px; padding-bottom: 48px; }
  .title { font-size: 1.875rem; }

  .layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--rail);
    column-gap: var(--gap);
    align-items: start;
  }

  .layout-head { grid-column: 1 / -1; grid-row: 1; }
  .layout-main { grid-column: 1; grid-row: 2; min-width: 0; }

  .rail {
    display: block;
    grid-column: 2;
    grid-row: 2;
    position: -webkit-sticky;
    position: sticky;
    top: 16px;
  }

  #done-panel .layout-main, #done-panel .rail { grid-row: 1; }

  .rail-card {
    display: block;
    padding: var(--inset);
    border: 1px solid var(--rule);
    border-top: 3px solid var(--navy);
    border-radius: var(--radius);
    background: var(--white);
  }

  .summary {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
  }

  .paybar {
    position: static;
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
  }

  .paybar .btn { margin-top: 16px; }
  .actions .btn + .btn { margin-top: 12px; }
  .help { padding: 0 var(--inset); }
  .fee-amount { width: 8.75rem; min-width: 140px; }
  .receipt-status { padding-top: 24px; padding-bottom: 24px; }
  .receipt-status p { grid-column: 2; margin-top: 4px; }
}

/* A short window: the rail scrolls with the page instead of sticking. */
@media (min-width: 768px) and (max-height: 620px) {
  .rail { position: static; }
}

@media (min-width: 1024px) {
  :root { --inset: 24px; --rail: 340px; --gap: 40px; }
}

/* Room for Authorize.net's two-column card form (780px and wider). */
@media (min-width: 1240px) {
  .frame { max-width: none; height: 720px; }
  .note-text { display: flex; align-items: flex-start; justify-content: space-between; }
  .clock { flex: none; margin: 0 0 0 32px; white-space: nowrap; }
}

/* A short screen, such as a phone held sideways: a slimmer masthead. */
@media (max-height: 520px) {
  .masthead-row { min-height: 52px; padding-top: 4px; padding-bottom: 4px; }
  .seal { width: 40px; height: 40px; margin-right: 12px; padding: 2px; }
  .brand-name { font-size: 1.125rem; }
  .masthead-address { font-size: 0.8125rem; line-height: 1.35; }
  .steps { min-height: 40px; }
  .page { padding-top: 16px; }
}

@media (prefers-reduced-motion: no-preference) {
  .btn, .fee, .fee-box { transition: background-color 0.12s ease, border-color 0.12s ease; }
}

/* ---------- Print: the receipt on the school's letterhead ---------- */

@media print {
  @page { margin: 12mm; }

  html, body { background: var(--white); }
  body { display: block; min-height: 0; }

  .wrap { max-width: 7.5in; padding: 0 16px; }

  .masthead-band {
    border-bottom: 2px solid var(--navy);
    background: none;
    color: var(--navy);
  }

  .masthead-row { min-height: 0; padding-top: 8px; padding-bottom: 12px; }
  .seal { width: 64px; height: 64px; margin-right: 16px; padding: 0; }
  .brand-name { font-size: 1.5rem; }
  .brand-tag { color: var(--muted); }

  .masthead-address {
    display: block;
    flex: none;
    margin-left: 24px;
    color: var(--ink);
    font-size: 0.8125rem;
    line-height: 1.4;
    text-align: right;
  }

  .masthead-address .print-only { display: block !important; }

  .progress, .masthead-help, .site-footer, .screen-only, .btn, .btn-link,
  #done-panel .rail { display: none !important; }

  /* The card form is never printed: it may hold a card number. */
  .shell { display: none !important; }

  /* Ticks are printed in ink: browsers leave out background colours. */
  .fee-check:checked + .fee-box { background: var(--white); }
  .fee-check:checked + .fee-box::after { border-color: var(--navy); }

  .page { padding-top: 24px; padding-bottom: 0; }
  .layout { display: block; }
  .paybar { position: static; box-shadow: none; }

  .receipt { border: 0; border-radius: 0; }
  .receipt-status { padding: 0 0 16px; }
  .receipt-status p { grid-column: 2; margin-top: 4px; }
  .receipt-items { padding: 8px 0 16px; }
  .meta { padding: 16px 0 0; background: none; }
}

/* Printing from a narrow window: the address goes under the name. */
@media print and (max-width: 560px) {
  .masthead-row { flex-wrap: wrap; }
  .seal { width: 48px; height: 48px; margin-right: 12px; }
  .brand-name { font-size: 1.25rem; }
  .masthead-address { flex: 0 0 100%; margin: 8px 0 0; text-align: left; }
}
