/* The public site (body.public: /, /about, /donate, /zmanim, /seats, the email lists' message
   pages and the 404; /zmanim/season borrows the header and footer): the printed sheets' type
   (Frank Ruhl Libre) on warm paper. Every page has the same header (.site-header: the logo, then
   Zmanim, Seating chart, About, the Donate button and Member login) and footer (.site-footer: the
   shul's name, legal line, address and email, then the links); the static pages repeat the markup
   and src/render/public-page.js writes it for the Worker's pages (test/public-pages.test.js keeps
   them the same). Colors, fonts and sizes are the tokens in /css/tokens.css
   (src/design/tokens.js), which every page loads first; the components are /ui.css's. */

* { box-sizing: border-box; }

html:has(> body.public) { height: 100%; }

body.public {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 0 var(--space-4) var(--powered-by-height); /* room for "Powered by SCHWAI" (/ui.css) */
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  text-align: center;
}

:where(body.public) > main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-9) 0 var(--space-10);
}
:where(body.public) h1 { margin: 0; font-size: var(--text-display); font-weight: 700; line-height: 1.3; }

/* site header: the logo at the left, the menu at the right; on a phone the menu is a row under
   the logo, with Donate beside the logo. */
.site-header { position: relative; margin: 0 calc(-1 * var(--space-4)); border-bottom: 1px solid var(--border); background: var(--paper); }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); max-width: 1080px; min-height: 76px; margin: 0 auto; padding: 0 var(--space-4); }
.site-brand { display: block; flex: none; border-radius: var(--radius-control); }
.site-brand img { display: block; width: auto; height: 42px; mix-blend-mode: multiply; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-1); font-family: var(--font-serif); }
.site-nav a { display: inline-flex; align-items: center; height: 36px; padding: 0 var(--space-3); border-radius: var(--radius-control); color: var(--nav-ink); font-size: var(--text-ui); text-decoration: none; transition: background-color var(--motion-fast) var(--motion-ease), color var(--motion-fast) var(--motion-ease); }
.site-nav a:hover { background: var(--tint); color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 7px; }
.site-nav .site-donate { margin: 0 var(--space-2) 0 var(--space-3); padding: 0 var(--space-5); background: var(--ink); color: var(--on-ink); box-shadow: var(--shadow-button-filled); letter-spacing: 0.02em; }
.site-nav .site-donate:hover { background: var(--ink-hover); color: var(--on-ink); }
.site-nav .site-donate[aria-current="page"] { color: var(--on-ink); text-decoration: none; }
:is(.site-brand, .site-nav a, .site-footer a):focus-visible { outline: none; box-shadow: var(--shadow-ring), 0 0 0 1px var(--ink); }

@media (max-width: 760px) {
  .site-header-inner { flex-wrap: wrap; gap: 0; min-height: 0; padding: var(--space-3) var(--space-4) var(--space-1); }
  .site-brand img { height: 34px; }
  .site-nav { flex-basis: 100%; flex-wrap: nowrap; justify-content: space-between; margin: var(--space-2) calc(-1 * var(--space-2)) 0; gap: 0; }
  .site-nav a { padding: 0 var(--space-2); font-size: var(--text-sm); white-space: nowrap; }
  .site-nav .site-donate { position: absolute; top: var(--space-3); right: var(--space-4); height: 34px; margin: 0; padding: 0 var(--space-4); font-size: var(--text-sm); }
}

@media (max-width: 360px) {
  .site-nav { flex-wrap: wrap; justify-content: center; }
}

/* site footer */
.site-footer { margin: 0 calc(-1 * var(--space-4)); max-width: none; border-top: 1px solid var(--border); color: var(--muted); font-family: var(--font-serif); font-size: var(--text-sm); line-height: 1.6; text-align: left; }
.site-footer-inner { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-5) var(--space-8); max-width: 1080px; margin: 0 auto; padding: var(--space-7) var(--space-4) var(--space-8); }
.site-footer p { margin: 0; }
.site-footer-name { color: var(--ink); font-size: var(--text-base); font-weight: var(--weight-medium); }
.site-footer .legal { font-size: var(--text-xs); }
.site-footer-contact { margin-top: var(--space-2) !important; }
.site-footer a { color: inherit; text-decoration: none; border-radius: var(--radius-xs); }
.site-footer a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.site-footer-contact a { color: var(--ink); }
.site-footer-links { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-5); max-width: 460px; padding-top: 2px; }
body.public .nowrap, .site-footer .nowrap { white-space: nowrap; }
@media (max-width: 760px) {
  .site-footer { text-align: center; }
  .site-footer-inner { flex-direction: column; align-items: center; padding: var(--space-6) var(--space-4) var(--space-7); }
  .site-footer-links { justify-content: center; }
}

/* Printed: the logo alone at the top, no menu or footer (a page may print its own credit). */
@media print {
  /* Printed, the page is as tall as its content: stretched to the window, it can spill a blank sheet. */
  html:has(> body.public) { height: auto; }
  body.public { min-height: 0; padding-bottom: 0; }
  .site-header { border: 0; background: none; }
  .site-header-inner { justify-content: center; min-height: 0; padding: 0; }
  .site-header .site-nav, .site-footer { display: none; }
}

/* home (/): the logo, the Hebrew name, the Rav, Donate and Zmanim, and the email lists' box,
   centered. The header's own logo and (on a phone) Donate step aside for the page's. The Ner
   L'Maor banner (written in by the Worker) runs along the very top. */
.home-page .site-brand { visibility: hidden; }
@media (max-width: 760px) {
  .home-page .site-brand, .home-page .site-nav .site-donate { display: none; }
  .home-page .site-nav { margin-top: 0; }
}
.home-page > main { justify-content: center; padding-top: var(--space-9); }
.ner-lmaor { margin: 0 calc(-1 * var(--space-4)); padding: 10px var(--space-4); border-bottom: 1px solid var(--border); background: var(--banner); font-size: var(--text-ui); line-height: 1.5; }
.ner-lmaor p { max-width: 760px; margin: 0 auto; }
.ner-label { margin-right: 6px; font-weight: 700; letter-spacing: 0.06em; }

.home-page .logo { width: 100%; max-width: 420px; height: auto; mix-blend-mode: multiply; }
.home-page h1 { margin: var(--space-7) 0 0; font-size: var(--text-display); font-weight: 700; line-height: 1.3; }
.home-page .name { margin: 10px 0 0; font-size: var(--text-ui); font-weight: 500; letter-spacing: 0.28em; text-transform: uppercase; color: var(--muted); }
.home-page .rule { width: 72px; height: 1px; margin: var(--space-7) auto; background: var(--ink); }
.home-page .dedication { margin: 0; font-size: var(--text-base); color: var(--muted); line-height: 1.5; }
.home-page .rav { margin: 6px 0 0; font-size: var(--text-xl); font-weight: 500; }

/* The big buttons: Donate (filled) and the quieter ones beside it (outlined). */
.home-page .links { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: var(--space-8); }
.donate, .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 148px;
  height: 50px;
  padding: 0 var(--space-8);
  border: 1px solid var(--ink);
  border-radius: var(--radius-control);
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--motion-fast) var(--motion-ease), color var(--motion-fast) var(--motion-ease);
}
.donate { background: var(--ink); color: var(--on-ink); box-shadow: var(--shadow-button-filled); }
.donate:hover { background: var(--ink-hover); border-color: var(--ink-hover); }
.secondary { background: transparent; color: var(--ink); }
.secondary:hover { background: var(--ink); color: var(--on-ink); }
:is(.donate, .secondary):focus-visible { outline: none; box-shadow: var(--shadow-ring), 0 0 0 1px var(--ink); }

/* The email lists' sign-up box (public/subscribe-box.js), on the home page and /zmanim: a card,
   name and email side by side, its height kept before the script fills it so the page doesn't
   move. */
.subscribe { width: 100%; max-width: 540px; min-height: 331px; margin: var(--space-9) auto 0; padding: var(--space-6) var(--space-7) var(--space-7); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--card); box-shadow: var(--shadow-card); text-align: left; }
.subscribe form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--space-4); }
.subscribe form > :not(.subscribe-field) { grid-column: 1 / -1; }
.subscribe h2 { margin: 0 0 var(--space-1); font-size: var(--text-2xl); font-weight: 700; text-align: center; }
.subscribe-field { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.subscribe-field label, .subscribe legend { color: var(--nav-ink); font-size: var(--text-ui); font-weight: 500; }
.subscribe-field input { width: 100%; }
.subscribe fieldset { margin: 0; padding: 0; border: 0; }
.subscribe legend { margin-bottom: var(--space-2); padding: 0; }
.subscribe .check { display: flex; gap: 10px; align-items: baseline; margin: 6px 0; font-size: var(--text-base); line-height: 1.4; cursor: pointer; }
.subscribe .check input { flex: none; transform: translateY(2px); }
.subscribe button { justify-self: start; min-width: 140px; height: 42px; font-size: var(--text-base); letter-spacing: 0.02em; }
.subscribe-status { margin: 0; color: var(--muted); font-size: var(--text-ui); line-height: 1.45; }
.subscribe-status:empty { display: none; }
body.public .subscribe-status.form-error, body.public .subscribe-status.form-done { font-size: var(--text-ui); }
body.public .subscribe-status.form-done { display: flex; align-items: baseline; }
@media (max-width: 560px) {
  .subscribe { min-height: 420px; padding: var(--space-5) var(--space-5) var(--space-6); }
  .subscribe form { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 360px) {
  .subscribe { min-height: 443px; }
}

/* about (/about): the mission at the left; the facts in a card at the right, with Donate. */
.about-page > main { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; gap: var(--space-9) var(--space-10); max-width: 1080px; padding-top: var(--space-10); text-align: left; }
.about-page h1 { margin: 0; font-size: var(--text-4xl); font-weight: 700; line-height: 1.2; }
.mission { margin: var(--space-5) 0 0; font-size: var(--text-lg); line-height: 1.7; }
.facts { padding: var(--space-6) var(--space-7) var(--space-7); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--card); box-shadow: var(--shadow-card); }
.details { margin: 0; font-size: var(--text-base); line-height: 1.5; }
.details > div { padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.details dt { color: var(--muted); font-size: var(--text-sm); }
.details dd { margin: 2px 0 0; }
.details a { color: var(--ink); }
.facts .donate { width: 100%; margin-top: var(--space-6); }
@media (max-width: 860px) {
  .about-page > main { grid-template-columns: minmax(0, 1fr); gap: var(--space-8); padding-top: var(--space-8); }
}

/* zmanim (/zmanim, src/render/zmanim-page.js): the coming Shabbos's sheet for the screen: the
   title and dates, the buttons in a row, then the schedule beside this week's minyanim and the
   announcements. */
.zmanim-page > main { max-width: 960px; }
.zmanim-head { display: flex; flex-direction: column; align-items: center; width: 100%; padding-bottom: var(--space-6); margin-bottom: var(--space-7); border-bottom: 1px solid var(--border); }
.zmanim-page h1 { margin: 0; font-size: var(--text-display); font-weight: 700; line-height: 1.25; }
.zmanim-page .date { margin: var(--space-2) 0 0; color: var(--muted); font-size: var(--text-base); }
.print-row { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center; margin: var(--space-5) 0 0; }
.print-row .secondary { min-width: 0; height: 38px; padding: 0 var(--space-5); font-size: var(--text-ui); letter-spacing: 0.02em; }
@media (max-width: 600px) {
  .print-row [data-print] { display: none; }
}
.zmanim { display: flex; flex-wrap: wrap; gap: var(--space-7) var(--space-9); width: 100%; text-align: left; }
.zmanim .sched { flex: 1 1 320px; direction: rtl; }
.zmanim .side { flex: 1 1 320px; }
.zmanim .he { direction: rtl; }
.zmanim .sched h2 { font-size: var(--text-2xl); font-weight: 700; border-bottom: 1px solid var(--ink); padding-bottom: 3px; margin: 18px 0 2px; }
.zmanim .sched h2:first-child { margin-top: 0; }
.zmanim .item { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.zmanim .item .what { font-size: var(--text-xl); }
.zmanim .item .what small { color: var(--muted); font-size: var(--text-xs); }
.zmanim .item .when { direction: ltr; font-size: var(--text-3xl); font-weight: 500; white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }
.zmanim .item.key { background: var(--highlight); border-radius: var(--radius-md); padding: 7px 8px; margin: 0 -8px; border-bottom: 0; }
.zmanim .item.key .when { font-weight: 700; }
.zmanim .loc { display: inline-block; width: 0.9em; text-align: left; font-size: 0.75em; color: var(--muted); margin-left: 4px; }
.zmanim .changed { color: inherit; }
.zmanim .legend { direction: ltr; text-align: left; color: var(--muted); font-size: var(--text-xs); margin-top: 8px; }
.zmanim .week { padding: var(--space-4) var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--card); box-shadow: var(--shadow-card); }
.zmanim .week h2 { margin: 0 0 var(--space-2); font-size: var(--text-xl); font-weight: 500; }
.zmanim .week table { border-collapse: collapse; width: 100%; }
.zmanim .week td { padding: 4px 0; vertical-align: baseline; font-size: var(--text-base); line-height: 1.4; }
.zmanim .week td.lbl { width: 4.5em; font-size: var(--text-md); text-align: left; }
/* The week's announcements, as on the sheet (src/render/weekly.js). */
.zmanim .announcements section { margin-top: var(--space-5); }
.zmanim .announcements section + section { border-top: 1px solid var(--border); padding-top: var(--space-4); }
.zmanim .announcements h2 { margin: 0 0 6px; font-size: var(--text-xl); font-weight: 500; }
.zmanim .announcements h2.he { font-weight: 700; }
.zmanim .announcements p { margin: 0 0 6px; font-size: var(--text-base); line-height: 1.5; white-space: pre-line; }
.zmanim .announcements .lead { font-weight: 700; }
.zmanim .announcements ol { margin: 4px 0 0 1.4em; padding: 0; }
.zmanim-page .credit { margin: var(--space-6) 0 0; color: var(--muted); font-size: var(--text-xs); }

/* Printing the zmanim page: one Letter page of times, without the buttons and links (its @page
   rule is in the page itself, src/render/zmanim-page.js). */
@media print {
  body.zmanim-page { background: var(--card); padding: 0; font-size: var(--print-text-base); }
  .zmanim-page .print-row, .zmanim-page .subscribe { display: none; }
  .zmanim-page > main { padding: 0; max-width: none; }
  .zmanim-page .site-brand img { height: auto; width: 2.6in; }
  .zmanim-head { margin: 8pt 0 14pt; padding: 0; border: 0; }
  .zmanim-page h1 { font-size: var(--print-text-3xl); }
  .zmanim-page .date { margin-top: 2pt; font-size: var(--print-text-xs); }
  .zmanim { flex-wrap: nowrap; gap: 20pt; }
  .zmanim .sched h2 { font-size: var(--print-text-lg); margin-top: 10pt; }
  .zmanim .item { padding: 3pt 0; }
  .zmanim .item .what { font-size: var(--print-text-md); }
  .zmanim .item .when { font-size: var(--print-text-xl); }
  .zmanim .week { padding: 8pt 10pt; border: 0; box-shadow: none; background: var(--highlight); }
  .zmanim .week td, .zmanim .announcements p { font-size: var(--print-text-sm); }
  .zmanim-page .credit { margin-top: 14pt; font-size: var(--print-text-2xs); }
  .zmanim .item.key, .zmanim .week { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* season (/zmanim/season, src/render/zmanim-page.js): the master's own page (src/render/master.js,
   on its grey desk) with the site's header and footer around it; its bar (back to this week's
   zmanim, Print) is in the page's own CSS. */
.season-page .site-header, .season-page .site-footer { margin: 0; background: var(--paper); }
.season-page .site-header { margin-bottom: var(--space-6); }
.season-page .site-footer { margin-top: var(--space-6); }
@media print {
  .season-page .site-header { display: none; }
}

/* seats (/seats, public/seats.html): the title and the legend, the chart on its card using the
   width (scrolling sideways inside it on a narrow screen), and the note on asking for a seat. The
   chart's own rules are in /style.css. */
.chart-page > main { max-width: 1280px; padding-top: var(--space-8); }
.chart-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-3) var(--space-6); width: 100%; margin-bottom: var(--space-4); text-align: left; }
.chart-page h1 { margin: 0; font-size: var(--text-4xl); font-weight: 700; line-height: 1.2; }
.chart-head .lead { margin: var(--space-1) 0 0; color: var(--muted); font-size: var(--text-base); }
.chart-page .seat-legend { font-family: var(--font-serif); font-size: var(--text-sm); }
.chart-page #status { flex-basis: 100%; min-height: 0; margin: 0; font-size: var(--text-sm); }
.chart-page #status:empty { display: none; }
.chart-page #chart-scroll { width: 100%; max-width: none; margin: 0; padding: var(--space-5) var(--space-3); border-color: var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.seat-note { max-width: 760px; margin: var(--space-6) auto 0; color: var(--muted); font-size: var(--text-ui); line-height: 1.6; }
@media (max-width: 640px) {
  .chart-page #chart-scroll { padding: var(--space-3); }
}
@media print {
  .chart-page > main { padding: 0; max-width: none; }
  .chart-page .site-brand img { height: 0.45in; }
  .chart-head { margin: 4pt 0 6pt; }
  .chart-page h1 { font-size: var(--print-text-2xl); }
  .chart-head .lead { display: none; }
  .chart-page #chart-scroll { padding: 0; border: 0; box-shadow: none; }
  .seat-note { margin-top: 6pt; font-size: var(--print-text-2xs); }
}

/* message pages (src/render/public-page.js: confirming a subscription, unsubscribing; and the
   404, public/404.html): one centered card, its button, and the way home under it. */
.message-page > main { justify-content: center; max-width: 560px; padding: var(--space-10) 0; }
.message-card { width: 100%; padding: var(--space-8) var(--space-8) var(--space-7); border: 1px solid var(--border); border-radius: var(--radius-dialog); background: var(--card); box-shadow: var(--shadow-card); }
.message-card h1 { margin: 0; font-size: var(--text-4xl); font-weight: 500; line-height: 1.2; }
.message-card p { margin: var(--space-4) 0 0; font-size: var(--text-lg); line-height: 1.6; overflow-wrap: anywhere; }
.message-card p a:not(.donate, .secondary) { color: var(--ink); }
body.public .message-card .hint { margin-top: var(--space-3); color: var(--muted); font-size: var(--text-base); }
.message-card .message-code { margin: 0 0 var(--space-2); color: var(--muted); font-size: var(--text-xs); letter-spacing: 0.16em; }
.message-card form { margin-top: var(--space-6); }
.message-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); }
.message-card .message-actions { margin-top: var(--space-6); }
.message-actions :is(.donate, .secondary) { min-width: 0; height: 42px; padding: 0 var(--space-5); font-size: var(--text-base); letter-spacing: 0.02em; }
.message-card form button { min-width: 180px; height: 46px; font-size: var(--text-base); letter-spacing: 0.02em; }
.message-links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2) var(--space-5); margin: var(--space-6) 0 0; font-size: var(--text-base); }
.message-links a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 4px; }
.message-links a:hover { color: var(--ink); text-decoration-color: var(--ink); }
@media (max-width: 520px) {
  .message-page > main { padding: var(--space-8) 0; }
  .message-card { padding: var(--space-7) var(--space-5) var(--space-6); }
  .message-card h1 { font-size: var(--text-3xl); }
}

/* donate */
/* The donate page (/donate, public/donate.js): a compact head, then one white card. From 1024px
   wide it has two columns: "Your gift" on the left (tinted, staying in view while the page
   scrolls: the amount tiles, Once / Monthly, the note, and a summary line with the tax line), and
   on the right the donor's details, the billing address, the card, the security check and the
   Donate button. Narrower, one column in that order. The thank-you replaces the card. Banquest's
   card fields are in their own iframe, drawn as one framed field (/lib/card-widget.js) at
   --card-field-height, the height of every field here. */
.donate-page { --card-field-height: 44px; }
.donate-page > main { justify-content: flex-start; max-width: 640px; padding: var(--space-8) 0 var(--space-9); }
.donate-head h1 { margin-top: var(--space-2); }
.donate-head .lead { margin: var(--space-1) 0 0; color: var(--muted); font-size: var(--text-md); line-height: 1.5; }
.donate-unavailable { margin: var(--space-7) 0 0; font-size: var(--text-lg); line-height: 1.5; }
.donate-section { width: 100%; }

/* The card: the gift panel, then the details. */
.donate-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  margin-top: var(--space-5);
  overflow: clip; /* rounds the panels' corners; clip, not hidden, so the gift panel can stay in view */
  border: 1px solid var(--border);
  border-radius: var(--radius-dialog);
  background: var(--card);
  box-shadow: var(--shadow-card);
  text-align: left;
}
.donate-gift { border-bottom: 1px solid var(--border); background: var(--tint); }
.gift-inner { padding: var(--space-6) var(--space-7) var(--space-7); }
.donate-details { padding: var(--space-6) var(--space-7) var(--space-7); }

/* Titles: the parts ("Your gift", "Your details", …) small and quiet; the questions as labels. */
.donate-form .part-title {
  float: left; /* a floated legend sits inside its fieldset like a heading */
  width: 100%;
  margin: 0 0 var(--space-3);
  padding: 0;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
}
.donate-form :is(.part-title, .group > legend) + * { clear: both; }
.donate-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.donate-form .group + .group { margin-top: var(--space-5); }
.donate-form .group > legend { float: left; width: 100%; margin: 0 0 var(--space-2); padding: 0; }
.donate-form .step + .step { margin-top: var(--space-5); }
.donate-form .optional { margin-left: var(--space-1); color: var(--muted); font-size: var(--text-xs); font-weight: var(--weight-regular); }

/* Fields: the label over the control, its message under it. */
.donate-form .field { align-items: stretch; gap: 6px; margin: 0 0 14px; }
.donate-form .field:last-child, .donate-form .field-grid:last-child { margin-bottom: 0; }
.donate-form :is(.field > label, .group > legend, .card-label) { color: var(--nav-ink); font-size: var(--text-ui); font-weight: var(--weight-medium); }
.donate-form :where(input:not([type="radio"]), select) { height: var(--card-field-height); padding: 0 14px; font-size: var(--text-base); }
.donate-form select { padding-right: var(--space-7); }
.donate-form textarea { width: 100%; min-height: 0; padding: 10px 14px; font-size: var(--text-base); } /* a dedication runs to a sentence or two */
.donate-form .field-error { font-size: var(--text-sm); line-height: 1.4; }
.donate-form .field-grid { display: grid; gap: 14px var(--space-4); margin: 0 0 14px; }
.donate-form .field-grid.two { grid-template-columns: 1fr 1fr; }
.donate-form .field-grid.contact { grid-template-columns: 3fr 2fr; }
.donate-form .field-grid.address { grid-template-columns: 5fr 4fr 3fr; }
.donate-form .field-grid .field { min-width: 0; margin: 0; }
body.donate-page .hint { margin: var(--space-2) 0 0; color: var(--muted); font-size: var(--text-sm); line-height: 1.5; }

/* The amount: tiles, four to a row; "Other amount" takes two. */
.amount-choices { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-2); }
.amount-choices .skeleton { height: 48px; margin: 0; border-radius: var(--radius-inset); }
.amount-choices .skeleton.wide, .amount-choices .amount.other { grid-column: span 2; }
.donate-form label.amount { position: relative; display: block; }
.donate-form label.amount input { position: absolute; opacity: 0; pointer-events: none; }
.donate-form label.amount span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius-inset);
  background: var(--card);
  box-shadow: var(--shadow-button);
  font-size: var(--text-xl);
  font-weight: var(--weight-medium);
  font-variant-numeric: lining-nums tabular-nums;
  cursor: pointer;
  transition: background-color var(--motion-fast) var(--motion-ease), border-color var(--motion-fast) var(--motion-ease), color var(--motion-fast) var(--motion-ease);
}
.donate-form label.amount.other span { font-size: var(--text-base); }
.donate-form label.amount:hover input:not(:checked) + span { border-color: var(--border-strong); background: var(--paper); }
.donate-form label.amount input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--on-ink); box-shadow: var(--shadow-button-filled); }
.donate-form label.amount input:focus-visible + span { box-shadow: var(--shadow-ring); border-color: var(--ink); }
.donate-form label.amount input[aria-invalid="true"]:not(:checked) + span { border-color: var(--error); }
.amount-choices + .field-error:not(:empty) { margin-top: var(--space-2); }
.money-input { position: relative; display: block; max-width: 12em; }
.money-input > span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.donate-form .money-input input { width: 100%; padding-left: 28px; font-variant-numeric: lining-nums tabular-nums; }

/* A part that slides open (the other amount, the monthly choices); closed, it is inert. */
.reveal { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows var(--motion-base) var(--motion-ease), opacity var(--motion-base) var(--motion-ease); }
.reveal.open { grid-template-rows: 1fr; opacity: 1; }
.reveal-inner { min-height: 0; overflow: hidden; margin: 0 -4px; padding: 0 4px; } /* room for the focus ring */
.reveal-inner > :first-child { margin-top: var(--space-3); }
.reveal-inner > :last-child { margin-bottom: 4px; }

/* Once / Monthly: two halves across the panel. */
.donate-form .segmented.frequency { display: flex; height: var(--card-field-height); }
.donate-form .segmented.frequency label { flex: 1; justify-content: center; min-width: 0; font-size: var(--text-base); }

/* What will be charged, and the tax line. */
.gift-summary { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--border-strong); }
.gift-summary p { margin: 0; }
.gift-line { line-height: 1.4; }
.gift-total { font-size: var(--text-3xl); font-weight: var(--weight-medium); font-variant-numeric: lining-nums tabular-nums; }
.gift-how { color: var(--muted); font-size: var(--text-base); }
.gift-tax { margin-top: var(--space-1); color: var(--muted); font-size: var(--text-sm); line-height: 1.5; }

/* The card: the accepted brands beside its label, then Banquest's fields in one frame. */
.donate-form .card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin: 0 0 6px; }
.donate-page .card-brands { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.donate-page img.card-brand { vertical-align: middle; }
.donate-page .card-fields {
  box-sizing: border-box;
  height: var(--card-field-height);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--card);
  box-shadow: var(--shadow-field);
  font-family: var(--font-serif);
  font-size: var(--text-base);
  transition: border-color var(--motion-fast) var(--motion-ease), box-shadow var(--motion-fast) var(--motion-ease);
}
.donate-page .card-fields.two-rows { height: calc(2 * var(--card-field-height) - 1px); }
.donate-page .card-fields[hidden] { display: none; }
.donate-page .card-fields:hover:not(:focus-within) { border-color: var(--border-strong); }
.donate-page .card-fields:focus-within { border-color: var(--ink); box-shadow: var(--shadow-ring); }
.donate-page .card-fields-loading { display: flex; flex-direction: column; gap: var(--space-2); }
.donate-page .card-fields-loading[hidden] { display: none; }
.donate-page .card-fields-loading .skeleton { height: var(--card-field-height); margin: 0; border-radius: var(--radius-control); }
.donate-page .card-fields-loading .hint { margin: 0; }

/* The security check, the Donate button and why it waits, and the outcome. */
/* Side by side when there is room (the check needs 300px), else the button under the check. */
.donate-foot { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); margin-top: var(--space-5); padding-top: var(--space-5); border-top: 1px solid var(--border); }
.turnstile { min-width: 0; min-height: 65px; }
.donate-form .pay-button { width: 100%; height: 50px; font-size: var(--text-lg); letter-spacing: 0.02em; }
.donate-form .pay-button[aria-disabled="true"]:not([aria-busy="true"]) { opacity: 0.45; cursor: not-allowed; }
.donate-form .pay-button[aria-disabled="true"]:not([aria-busy="true"]):hover { border-color: var(--ink); background: var(--ink); }
.pay-reason { margin: 0; color: var(--muted); font-size: var(--text-sm); text-align: center; }
.pay-reason:empty { display: none; }
body.donate-page .form-error, body.donate-page .form-done { justify-content: center; font-size: var(--text-base); line-height: 1.45; text-align: center; }
body.donate-page :is(.form-error, .form-done):empty { display: none; }

/* The thank-you, in place of the form: the facts in two columns. */
.donate-thanks {
  width: 100%;
  max-width: 760px;
  margin: var(--space-6) auto 0;
  padding: var(--space-8) var(--space-8) var(--space-7);
  border: 1px solid var(--border);
  border-radius: var(--radius-dialog);
  background: var(--card);
  box-shadow: var(--shadow-card);
  font-size: var(--text-base);
  line-height: 1.55;
}
.donate-thanks:focus { outline: none; }
.thanks-mark { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto var(--space-4); border: 1px solid var(--success-line); border-radius: 50%; background: var(--success-soft); color: var(--success); }
.thanks-mark svg.icon { width: 24px; height: 24px; stroke-width: 2; }
.donate-thanks h2 { margin: 0; font-size: var(--text-4xl); font-weight: var(--weight-medium); line-height: 1.2; }
.donate-thanks .thanks-lead { max-width: 32em; margin: var(--space-2) auto 0; color: var(--muted); font-size: var(--text-md); }
.thanks-facts { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: var(--space-8); margin: var(--space-6) 0; padding: 0; border-top: 1px solid var(--border); text-align: left; }
.thanks-facts > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-1) var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.thanks-facts dt { color: var(--muted); }
.thanks-facts dd { margin: 0 0 0 auto; text-align: right; font-variant-numeric: lining-nums tabular-nums; overflow-wrap: anywhere; }
.donate-thanks p { margin: 0 0 var(--space-2); }
.donate-thanks .thanks-legal { margin-top: var(--space-4); color: var(--muted); font-size: var(--text-sm); }
.thanks-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); margin-top: var(--space-6); }

@media (min-width: 640px) {
  .thanks-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 600px) {
  .donate-foot { grid-template-columns: 300px minmax(0, 1fr); align-items: center; column-gap: var(--space-4); }
  .donate-foot > :not(.turnstile, .pay-button) { grid-column: 1 / -1; }
  .donate-form .pay-button { height: 56px; }
}

@media (min-width: 1024px) {
  .donate-page > main { max-width: 1080px; }
  .donate-form { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .donate-gift { border-right: 1px solid var(--border); border-bottom: 0; }
  .gift-inner { position: sticky; top: 0; padding: var(--space-6) var(--space-7) var(--space-7); }
  .donate-details { padding: var(--space-6) var(--space-8); }
}

@media (max-width: 520px) {
  .gift-inner, .donate-details { padding: var(--space-5) var(--space-5) var(--space-6); }
  .donate-form .field-grid.two, .donate-form .field-grid.contact { grid-template-columns: 1fr; }
  .donate-form .field-grid.address { grid-template-columns: 3fr 2fr; }
  .donate-form .field-grid.address > :first-child { grid-column: 1 / -1; }
  .donate-form label.amount span { font-size: var(--text-lg); }
  .donate-thanks { padding: var(--space-7) var(--space-5) var(--space-6); }
}

/* Printing the thank-you: the logo and it, nothing else. */
@media print {
  body.donate-page { background: var(--card); }
  .donate-page .donate-head, .donate-page footer, .donate-page .thanks-actions { display: none; }
  .donate-page > main { padding: 0; }
  .donate-page .donate-thanks { max-width: none; margin: 12pt 0 0; padding: 0; border: 0; box-shadow: none; }
  .thanks-mark { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
