/* Ontario Kettle Corn — app styles every Worker's admin and form pages share (admin shell, cards, tables, forms,
   notices, sign-in). Brand palette, spacing, radii and the type scale live in tokens.css; each Worker adds its own sheet
   after this. The admin register (design review Oct 2026, D09): white page, Montserrat on the seven --text-* steps,
   16px inputs, 44px touch targets, 8px corners, one gold primary per screen, outlined secondaries, text-link
   tertiaries. packages/core/test/admin-css.test.ts holds every admin sheet to the scales.

   Status meaning map (badges and notices; always with a word, never colour alone):
     ok   green  live or done        badge .ok, .active             notice .ok
     warn amber  needs you           badge .warn, .grace, .tentative notice .warn
     err  red    a problem           badge .err, .alert             notice .err
     off  grey   inactive or not yet badge .off, .closed, .locked, .draft, and a plain .badge
   Plain news is .notice.info (neutral). A stage (the site's planning stages) is not a status: an outlined chip. */
/* Focus ring: charcoal on light surfaces (--focus in tokens.css), gold only on the charcoal topbar. */
/* Elements hidden from script stay hidden even when a class sets display (e.g. grid). */
[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
}
img {
  max-width: 100%;
}
/* Links: charcoal text with a quiet underline that darkens on hover. */
a {
  color: var(--text);
  text-decoration-color: var(--control-border);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover {
  text-decoration-color: currentColor;
}
h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: var(--charcoal);
  font-weight: 700;
}
h1 {
  font-size: var(--text-xl);
  text-wrap: balance;
}
h2 {
  font-size: var(--text-lg);
}
h3 {
  font-size: var(--text-md);
}
p {
  margin: 0 0 1em;
}
small,
.muted {
  color: var(--muted);
}
small {
  font-size: var(--text-sm);
}

/* ---------- Admin shell (D17) ---------- */
/* One charcoal bar: the logo and "Staff" (or a product name), the nav, an optional search box, and the account menu or
   Sign out at the right. One row on wide screens; on phones the nav folds under Menu and the bar stays 56px. */
.topbar {
  position: relative;
  background: var(--charcoal);
  color: var(--on-band);
  border-bottom: 4px solid var(--gold);
}
.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--space-3) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--on-band);
  text-decoration: none;
  font-weight: 700;
}
.brand img {
  height: 44px;
  width: auto;
}
.product-name {
  padding: var(--space-2) 0;
  font-weight: 700;
}
.nav {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
  flex: 1;
}
.nav a {
  color: var(--cream);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--text-sm);
}
.nav-toggle {
  display: none;
  align-items: center;
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--cream);
  border-radius: var(--radius-md);
  background: none;
  color: var(--cream);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}
.nav-toggle[aria-expanded="true"] {
  background: color-mix(in srgb, var(--gold) 18%, transparent);
  color: var(--gold);
  border-color: var(--gold);
}
.nav a {
  transition:
    background-color 120ms ease-out,
    color 120ms ease-out;
}
.nav a:hover,
.nav a[aria-current="page"],
.nav a[aria-current="true"] {
  background: color-mix(in srgb, var(--gold) 18%, transparent);
  color: var(--gold);
}
/* Grouped nav: wide screens show each section's link (its pages are the tab row below the bar); the phone menu shows
   each section as a heading with its pages instead. The first end link (Settings) sits on the right. */
.nav-group {
  display: contents;
}
.nav-heading,
.nav-pages {
  display: none;
}
.nav .nav-end {
  margin-left: auto;
}
.subnav {
  background: var(--card-bg);
  border-bottom: 1px solid var(--line);
}
.subnav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--space-5);
  display: flex;
  gap: var(--space-1);
  overflow-x: auto;
}
/* More tabs past an edge (admin-nav.js sets the classes): the row fades out over the last 40px on that side, so a cut
   tab reads as "keep scrolling". Focus and the current tab stop clear of the fade (scroll-padding). */
.subnav-inner {
  scroll-padding-inline: 40px;
}
.subnav.is-more-end .subnav-inner {
  -webkit-mask-image: linear-gradient(to right, rgb(0 0 0) calc(100% - 40px), transparent);
  mask-image: linear-gradient(to right, rgb(0 0 0) calc(100% - 40px), transparent);
}
.subnav.is-more-start .subnav-inner {
  -webkit-mask-image: linear-gradient(to left, rgb(0 0 0) calc(100% - 40px), transparent);
  mask-image: linear-gradient(to left, rgb(0 0 0) calc(100% - 40px), transparent);
}
.subnav.is-more-start.is-more-end .subnav-inner {
  -webkit-mask-image: linear-gradient(to right, transparent, rgb(0 0 0) 40px, rgb(0 0 0) calc(100% - 40px), transparent);
  mask-image: linear-gradient(to right, transparent, rgb(0 0 0) 40px, rgb(0 0 0) calc(100% - 40px), transparent);
}
.subnav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-3);
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.subnav a:hover {
  color: var(--ink);
  border-bottom-color: var(--line);
}
/* A tab whose page sits under it (a fundraiser's page under All fundraisers, the read-only Tax rates copy under Tax
   rates) is marked like the current tab, as the top bar marks "true" and "page" alike. */
.subnav a[aria-current="page"],
.subnav a[aria-current="true"] {
  color: var(--ink);
  border-bottom-color: var(--gold);
}
.subnav a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}
.topbar form {
  margin: 0;
}
.link-button {
  background: none;
  border: 0;
  padding: var(--space-2) 2px;
  color: var(--cream);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
  text-decoration: underline;
}
/* Search slot (D22 fills it): a box on wide screens, an icon link to the search page on phones. */
.topbar-search input {
  width: 200px;
  min-height: 36px;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--cream);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-sm);
}
.search-link {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-md);
  color: var(--cream);
}
/* The account menu (and the places menu): <details> menus dropping a white panel under the bar. */
.menu {
  position: relative;
}
.menu-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 44px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-md);
  color: var(--on-band);
  font-weight: 700;
  list-style: none;
  cursor: pointer;
  white-space: nowrap;
}
/* No disclosure triangle: the caret or the initials say it opens (the site's details rule draws one in ::before). */
.menu-button::-webkit-details-marker {
  display: none;
}
.menu > .menu-button::marker,
.menu > .menu-button::before {
  content: none;
}
.menu-button:hover,
.menu[open] > .menu-button {
  background: color-mix(in srgb, var(--gold) 18%, transparent);
  color: var(--gold);
}
.caret {
  font-size: var(--text-xs);
}
.dropdown {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0;
  z-index: 20;
  min-width: 220px;
  margin: 0;
  padding: var(--space-2);
  list-style: none;
  background: var(--card-bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  font-size: var(--text-sm);
}
.dropdown a,
.dropdown button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 36px;
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.dropdown a:hover,
.dropdown button:hover {
  background: var(--n-100);
}
.dropdown a[aria-current] {
  box-shadow: inset 3px 0 0 var(--gold);
}
.account-menu {
  margin-left: auto;
}
.account-menu .dropdown {
  left: auto;
  right: 0;
}
.account-button {
  padding: 0;
  min-width: 44px;
  justify-content: center;
}
.account-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: var(--cream);
  color: var(--charcoal);
  font-size: var(--text-xs);
}
.account-who {
  display: flex;
  flex-direction: column;
  margin: 0 0 var(--space-2);
  padding: var(--space-2) var(--space-3) var(--space-3);
  border-bottom: 1px solid var(--line);
  /* A long address wraps at the break points PlacesMenu puts before its "@" and dots; mid-word only if a piece is
     still wider than the panel. */
  overflow-wrap: break-word;
}
.account-who span {
  color: var(--muted);
}
/* The account menu (PlacesMenu in topbar-menus.tsx; account pages design): who is signed in, the places they can go,
   each a 44px row with a one-line hint under it (the current page carries app.css's gold edge), one line per group
   under "Teams", staff's admins under their own heading, then Sign out under a rule. Taller than the screen on a phone
   with many teams, so it scrolls inside itself. */
.account-places {
  min-width: 264px;
  width: max-content;
  max-width: min(320px, calc(100vw - 2 * var(--space-3)));
  max-height: calc(100dvh - 80px);
  overflow-y: auto;
}
.account-places ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.dropdown.account-places a {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  min-height: 44px;
  overflow-wrap: anywhere;
}
.account-places a small {
  font-weight: 500;
  color: var(--text-muted);
  font-size: var(--text-xs);
}
/* A person on two or more teams: one flat line per group under a small "Teams" label (no fly-out). */
.account-places .menu-label {
  margin: var(--space-2) var(--space-3) 0;
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 700;
}
/* Staff only: the admins, set apart under their own heading. */
.account-places .menu-section {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--line);
}
.account-places .menu-heading {
  margin: 0 var(--space-3) var(--space-1);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 700;
}
.account-places .menu-foot button {
  min-height: 44px;
}
.menu-foot {
  margin: var(--space-2) 0 0;
  padding-top: var(--space-2);
  border-top: 1px solid var(--line);
}
/* Breadcrumbs (Breadcrumbs in admin-layout.tsx): an ordered list; on phones only the nearest link, as "‹ label". */
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}
.crumb-sep {
  margin: 0 var(--space-2);
  color: var(--muted);
}

main.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-5) var(--space-16);
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}
.page-head h1 {
  margin: 0;
}
.crumbs {
  font-size: var(--text-sm);
  margin-bottom: var(--space-1);
}
.crumbs a {
  color: var(--muted);
  /* A long name or email wraps instead of pushing the page sideways (the links are inline-flex on phones). */
  overflow-wrap: anywhere;
  max-width: 100%;
  min-width: 0;
}

/* Cards: white with a rule border. */
.card {
  /* Grid and flex children default to min-width: auto, which lets a wide table stretch the card off a phone screen. */
  min-width: 0;
  background: var(--card-bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}
.card > h2:first-child {
  margin-top: 0;
}
.grid {
  display: grid;
  gap: var(--space-4);
}
.grid.items-start {
  align-items: start;
}
.grid-2 {
  /* Side by side only when each column gets at least 360px (stacked on phones and most tablets). */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
}
.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}
.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
}

/* Stat tiles: a caps label over a tabular number that shrinks on a phone rather than overflowing its tile. */
.stat {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}
.stat .label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}
.stat .value {
  font-size: clamp(1.2rem, 5.5vw, var(--text-stat));
  font-weight: 700;
  color: var(--charcoal);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* ---------- Tables ---------- */
/* Positioned, so a table's screen-reader-only caption (absolutely placed) stays inside the scroller and never widens
   the page. */
.table-wrap {
  overflow-x: auto;
  position: relative;
}
table {
  width: 100%;
  border-collapse: collapse;
  /* The one size between steps (tables read a touch smaller than body text): 15px. */
  font-size: 0.9375rem;
}
th,
td {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}
/* A row's own heading (a label beside its value) reads as words, not a column header. */
tbody th,
th[scope="row"] {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
}
td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
tr:last-child td,
tbody tr:last-child th,
tfoot tr:last-child th {
  border-bottom: 0;
}
tbody tr:hover {
  background: var(--surface-alt);
}
code,
.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}
/* Key-value rows (a record's details, a breakdown): sentence-case labels in a fixed column, values beside them. */
table.kv th {
  width: 12rem;
  font-size: inherit;
  text-transform: none;
  letter-spacing: normal;
  color: var(--muted);
  font-weight: 600;
}
/* A row whose name is its link: the name reads as the link, and the whole row shows it's one target. */
tr.row-link td:first-child a {
  font-weight: 600;
}
tr.row-link:hover td:first-child a {
  text-decoration-color: currentColor;
}

/* ---------- Forms ---------- */
.stack {
  display: grid;
  gap: var(--space-4);
}
/* Quantity and price boxes in tables keep a usable width when the table is squeezed on a phone. */
td input[type="number"],
td input[inputmode="decimal"] {
  min-width: 4.5rem;
}
.field {
  display: grid;
  gap: var(--space-1);
  align-content: start;
  min-width: 0;
}
.field label,
.label-text {
  font-weight: 600;
  font-size: var(--text-sm);
}
.hint {
  font-size: var(--text-sm);
  color: var(--muted);
  overflow-wrap: anywhere;
}
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="search"],
input[type="url"],
select,
textarea {
  font: inherit;
  /* 16px or more, so iPhones never zoom into a field. */
  font-size: var(--text-base);
  width: 100%;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  min-width: 0;
  max-width: 100%;
}
/* A long option shortens with an ellipsis instead of widening its select. */
select {
  text-overflow: ellipsis;
}
::placeholder {
  color: var(--n-500);
  opacity: 1;
}
input[type="color"] {
  width: 56px;
  height: 44px;
  padding: 2px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
textarea {
  min-height: 96px;
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--focus);
}
a:focus-visible,
.btn:focus-visible,
summary:focus-visible,
.nav a:focus-visible,
.nav-toggle:focus-visible,
.link-button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.topbar {
  --focus: var(--gold);
}
/* "Skip to content": off screen until a keyboard user tabs to it, then over the top bar's corner. */
.skip-link {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 100;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--charcoal);
  font-weight: 700;
}
.skip-link:focus-visible {
  top: 8px;
}
main:focus {
  outline: none;
}
.check {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  font-weight: 500;
}
.check input {
  margin-top: 0;
}
.check small {
  display: block;
  color: var(--muted);
  font-weight: 400;
}
fieldset {
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4) var(--space-4);
  margin: 0;
  min-width: 0;
}
/* The role picker (Organizer or Owner): a gap between the options, and the step-down hint set apart under them. */
.role-picker {
  max-width: 40rem;
}
.role-picker > .check + .check {
  margin-top: var(--space-3);
}
.role-picker > .hint {
  margin: var(--space-3) 0 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--rule);
}
legend {
  font-weight: 700;
  padding: 0 var(--space-2);
  color: var(--charcoal);
}
.row {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  align-items: start;
}
/* One width for single-column forms. Its row of buttons (Save, then Back) is .form-actions, a button row (below). */
.form-narrow {
  max-width: 720px;
}

/* ---------- Buttons ---------- */
/* One rule: the default .btn is the outlined secondary; .gold is the single primary on a screen; .danger is outlined
   red (.danger.solid for the confirm step); .link is a text button for tertiary actions. The charcoal fill belongs to
   the top bar only. .ghost, the old name of the default, needs no rule of its own. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--space-2);
  font: inherit;
  font-weight: 700;
  font-size: var(--text-sm);
  line-height: 1.25;
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--btn-radius);
  border: 1px solid var(--charcoal);
  background: var(--surface);
  color: var(--charcoal);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 120ms ease-out,
    transform 80ms ease-out;
}
.btn:active {
  transform: scale(0.98);
}
.btn:hover {
  background: var(--n-100);
}
.btn.gold {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--charcoal);
}
.btn.gold:hover {
  background: var(--gold-hover);
}
.btn.danger {
  background: var(--surface);
  color: var(--err);
  border-color: var(--err);
}
.btn.danger:hover {
  background: var(--err-bg);
}
.btn.danger.solid {
  background: var(--err);
  border-color: var(--err);
  color: var(--n-0);
}
.btn.danger.solid:hover {
  background: var(--red-ink);
}
.btn.link {
  min-height: 0;
  padding-inline: var(--space-1);
  border-color: transparent;
  background: none;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--control-border);
  text-underline-offset: 2px;
}
.btn.link:hover {
  text-decoration-color: currentColor;
}
.btn.small {
  min-height: 32px;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
}
/* A list filter drawn as buttons (aria-current marks the chosen one): selected reads as a tab, charcoal text with a
   3px charcoal underline, whatever its old fill. Page tasks move these to .tabs. */
.btn[aria-current="page"],
.btn.gold[aria-current="page"] {
  background: var(--surface);
  border-color: var(--charcoal);
  color: var(--charcoal);
  box-shadow: inset 0 -3px 0 var(--charcoal);
}
.badge.leading {
  margin-left: var(--space-2);
}
/* Button rows: the one pattern for buttons side by side, wherever they are (a page head, a card, a form's foot).
   .btn-row is the name to use; .form-actions and .actions are older names for the same row. --btn-gap (12px) between
   buttons, --btn-gap-wrap (8px) between lines once a phone wraps it. A component that needs its own gap sets the two
   tokens, not margins on the buttons. A joined control (.segmented, a stepper) isn't a row and keeps its own rules. */
.btn-row,
.form-actions,
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--btn-gap-wrap) var(--btn-gap);
}
/* Outside a .stack (whose gap already does it), a row keeps 12px from text right after it (a paragraph's own top
   margin is 0), from a field right before it, and from another row of buttons under it. One class's weight, so a
   margin a page sets on purpose (.mt-4, a component's own rule) still wins. */
:where(.btn-row, .form-actions, .actions) + :is(p, ul, ol, .hint):where(:not(.stack > *)),
:where(textarea, select, input:not([type="hidden"]), .btn-row, .form-actions, .actions)
  + :is(.btn-row, .form-actions, .actions):where(:not(.stack > *)) {
  margin-top: var(--space-3);
}
/* Text links beside a row's buttons ("Go back" on an error page) get a full-height target. */
.btn-row > a:not(.btn) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--space-1);
}

/* ---------- Tabs and segmented control ---------- */
/* List filters (Upcoming / Past / Drafts): underlined tabs like the section tabs, the current one marked with
   aria-current. */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--rule);
}
.tabs a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-3);
  margin-bottom: -1px;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
}
.tabs a:hover {
  color: var(--ink);
  border-bottom-color: var(--rule);
}
.tabs a[aria-current] {
  color: var(--charcoal);
  border-bottom-color: var(--charcoal);
}
/* One choice of a few (a stage): joined segments; the chosen one charcoal with white text and a check, never grey.
   Radio markup: <div class="segmented"><label><input type="radio">Stage</label>…</div>. Links that switch views work
   the same way, the current one marked aria-current: <nav class="segmented"><a aria-current="page">List</a>…</nav>. */
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-md);
  background: var(--rule);
  overflow: hidden;
}
.segmented > :is(label, a) {
  position: relative;
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-4);
  background: var(--surface);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}
.segmented > label > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.segmented > :is(label:has(input:checked), a[aria-current]) {
  background: var(--charcoal);
  color: var(--n-0);
}
.segmented > label:has(input:checked)::before {
  content: "✓";
}
.segmented > a {
  color: var(--ink);
  text-decoration: none;
}
.segmented > a:hover:not([aria-current]) {
  background: var(--surface-alt);
}
.segmented > a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}
.segmented > a[aria-current]:focus-visible {
  outline-color: var(--gold);
}
.segmented > label:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}
/* The chosen segment is charcoal, so its focus ring is gold (8.3:1 on charcoal), as on the dark bands. */
.segmented > label:has(input:checked:focus-visible) {
  outline-color: var(--gold);
}

/* ---------- Notices & badges ---------- */
/* Severity: red reads strongest (a heavier border), amber means "needs you", plain news is info. A notice may start
   with an icon (.notice-icon); the slot keeps the text aligned. */
.notice {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  border: 1px solid;
}
.notice.ok {
  background: var(--ok-bg);
  border-color: var(--ok-line);
  color: var(--ok);
}
.notice.warn {
  background: var(--warn-bg);
  border-color: var(--warn-line);
  color: var(--warn);
}
.notice.err {
  background: var(--err-bg);
  border: 2px solid var(--err);
  color: var(--err);
}
.notice.info {
  background: var(--n-50);
  border-color: var(--n-200);
  color: var(--charcoal);
}
.notice:has(> .notice-icon) {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}
.notice-icon {
  flex: none;
  width: 1.25em;
  text-align: center;
}
.notice ul {
  margin: var(--space-2) 0 0;
  padding-left: var(--space-5);
}
/* "Needs your attention" on an admin home: a white card with a heading and one row per item. */
.attention {
  margin-bottom: var(--space-5);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.attention h2 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-md);
}
.attention ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
/* The fundraiser History page's changes: one "Field: old → new" per line. */
.change-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.change-list li + li {
  margin-top: var(--space-1);
}
.attention li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--rule);
}

/* Badges: a word on its status colour, in sentence case, on one line. Pills are for badges only. */
.badge {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.5;
  padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--off-bg);
  color: var(--off);
  white-space: nowrap;
}
.badge.ok,
.badge.active {
  background: var(--ok-bg);
  color: var(--ok);
}
.badge.warn,
.badge.grace {
  background: var(--warn-bg);
  color: var(--warn);
}
.badge.err,
.badge.alert {
  background: var(--err-bg);
  color: var(--err);
}
.badge.off,
.badge.closed,
.badge.locked,
.badge.draft {
  background: var(--off-bg);
  color: var(--off);
}

/* Status tags (core tag.tsx): a step's status as a word and an icon on core's badge colours, in sentence case so they
   read as words. The site's Planning and Home and the organizer's All steps draw them. Red is only ever Overdue. A tag
   moves to the next line whole before it wraps. */
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 100%;
  padding: 0 var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.5;
}
.tag-icon {
  flex: none;
}
.tag-overdue {
  background: var(--err-bg);
  color: var(--err);
  font-weight: 700;
}
.tag-soon {
  background: var(--warn-bg);
  color: var(--warn);
}
.tag-todo {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}
.tag-waiting {
  background: var(--off-bg);
  color: var(--off);
  font-weight: 500;
}
.tag-done {
  background: var(--ok-bg);
  color: var(--ok);
}
/* Not yet: the organizer's own step for a later part of the sale. Lighter than Waiting, a dotted circle. */
.tag-notyet {
  border-color: var(--rule);
  background: var(--surface-alt);
  color: var(--muted);
  font-weight: 500;
}
/* Past: a step whose time ended without a mark, never an alarm. White, charcoal-grey words, a circle with a dash. */
.tag-past {
  border-color: var(--control-border);
  background: var(--surface);
  color: var(--off);
}
/* Problem: something to check (a seller's email invitation that didn't go through). Warn colours and the "!" disc;
   red stays for Overdue. */
.tag-problem {
  background: var(--warn-bg);
  color: var(--warn);
}
.swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: var(--radius-sm);
  vertical-align: -2px;
  border: 1px solid rgb(0 0 0 / 15%);
}

.empty {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--muted);
}

/* ---------- Sign-in and account cards ---------- */
/* One white card (admin-pages.tsx AuthCard): on the charcoal sign-in background with the light logo above it, or on a
   plain white page (.plain) for the account page, refusals and messages. One full-width gold primary per card. */
.auth-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-4);
  background: var(--charcoal);
}
.auth-page.plain {
  background: var(--page);
}
/* Under the account host's menu bar: the card starts below the bar instead of filling the screen. */
.auth-page.with-bar {
  min-height: auto;
  justify-content: flex-start;
}
.auth-logo {
  display: block;
  width: 150px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--n-0);
  border-radius: var(--radius-md);
  padding: var(--space-8) var(--space-6);
  box-shadow: var(--shadow);
  /* A long email address breaks rather than pushing the card wider than a phone. */
  overflow-wrap: anywhere;
}
.auth-page.plain .auth-card {
  border: 1px solid var(--n-200);
}
/* Pages that still put the logo inside the card (the organizer and team pages). */
.auth-card > img {
  display: block;
  width: 150px;
  margin: 0 auto var(--space-3);
}
.auth-card h1 {
  font-size: var(--text-lg);
}
.auth-card > .btn.gold {
  width: 100%;
}
.auth-card p {
  margin: 0;
}
.auth-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  font-size: var(--text-sm);
}
/* Taller tap targets on phones; the padding is the space between links. */
.auth-links a {
  display: inline-block;
  padding-block: var(--space-2);
}
/* First-time sign-in (issue #900). The numbered steps on a first-time door: step 1 is "now" (bold), the rest plain. */
.auth-steps {
  margin: 0;
  padding-left: 1.4em;
  display: grid;
  gap: var(--space-1);
}
.auth-steps li::marker {
  font-weight: 700;
}
.auth-steps .now {
  font-weight: 700;
}
/* "Step 2 of 3" sits right on the heading. */
.auth-card > .eyebrow + h1 {
  margin-top: 0;
}
/* A one-time code field (the code page, the Passkeys row's remove code): sized to its digits, numeric keyboard. */
input.code-input {
  width: 11ch;
  min-width: 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2em;
  font-size: var(--text-lg);
  text-align: center;
}
/* A card's quiet second row: a secondary button and a text link side by side, wrapping on phones. */
.auth-again {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
}
.auth-again a {
  display: inline-block;
  padding-block: var(--space-2);
}
/* The account page's products: full-width rows with what each is, the person's role and a chevron. */
.launcher {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}
.launcher a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  min-height: 44px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text);
}
.launcher a:hover {
  border-color: var(--charcoal);
}
.launcher a.primary {
  background: var(--gold);
  border-color: var(--gold);
}
.launcher a.primary:hover {
  background: var(--gold-hover);
}
.launcher .what {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.launcher b {
  font-size: var(--text-md);
}
.launcher .what span {
  font-size: var(--text-sm);
}
.launcher .waiting {
  font-weight: 600;
}
.launcher a::after {
  content: "\203A";
  margin-left: auto;
  font-size: var(--text-lg);
  font-weight: 700;
}
.auth-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--n-200);
}
.auth-card summary {
  cursor: pointer;
}
.summary-link {
  text-decoration: underline;
  text-decoration-color: var(--control-border);
  text-underline-offset: 2px;
  font-weight: 600;
}
/* The development-only local sign-in, set apart under its own rule. */
.auth-local {
  padding-top: var(--space-4);
  border-top: 1px dashed var(--control-border);
}

/* ---------- The staff bar (#955) ---------- */
/* The one staff nav on both admins (header.staff-bar; the organizer header keeps plain .topbar): the logo and "Staff",
   six sections, the search box and the account menu. Wide (1024px up): one row; up to 1120px the gaps and link padding
   tighten first, then the box may narrow from 240px to 200px (its placeholder still reads whole). Tablet (641-1023px):
   two deliberate rows, logo, "Staff", box and account on the first and the sections on their own row. Phone (640px
   down): the 56px row with the search icon and Menu, unchanged. */
@media (min-width: 1024px) {
  /* .topbar-inner keeps flex-wrap: wrap as a safety net: an overfull bar (password mode with a text-spacing override,
     or a seventh section one day) drops the account control to a new line instead of overflowing the page. Only the
     sections never wrap among themselves. */
  .staff-bar .nav {
    flex: 1 0 auto;
    flex-wrap: nowrap;
  }
  .staff-bar .nav a,
  .staff-bar .link-button {
    white-space: nowrap;
  }
  .staff-bar :is(.topbar-brand, .account-menu, .topbar-signout) {
    flex-shrink: 0;
  }
  .staff-bar .topbar-search {
    flex: 0 1 240px;
    min-width: 200px;
  }
  .staff-bar .topbar-search input {
    width: 100%;
  }
}
/* Laptops and landscape tablets: tighter gaps and links buy the box its width back. */
@media (min-width: 1024px) and (max-width: 1120px) {
  .staff-bar .topbar-inner {
    gap: var(--space-4);
  }
  .staff-bar .nav a {
    padding-inline: var(--space-2);
  }
}
@media (min-width: 641px) and (max-width: 1023.98px) {
  .staff-bar .topbar-inner {
    gap: 0 var(--space-4);
    padding-bottom: var(--space-1);
  }
  .staff-bar .topbar-brand {
    margin-right: auto;
  }
  .staff-bar .account-menu {
    margin-left: 0;
  }
  /* The sections take their own row, pulled out by a link's padding so "Home" lines up with the logo. */
  .staff-bar .nav {
    order: 3;
    flex: 1 0 100%;
    flex-wrap: nowrap;
    overflow-x: auto; /* safety net only: six sections need 519px of the 625px row at 641px */
    margin-inline: calc(-1 * var(--space-3));
  }
  .staff-bar .nav a {
    white-space: nowrap;
  }
  .staff-bar .topbar-search {
    flex: 0 1 240px;
  }
  .staff-bar .topbar-search input {
    width: 100%;
  }
}
/* The search hand-over page (events host /admin/search): the staff shell with a short main, so the bar stays put for
   the moment before the results load. Text at a reading width; the fallback link on its own line. */
.handover {
  max-width: 40rem;
}
.handover p + p {
  margin-top: var(--space-4);
}

@media (max-width: 640px) {
  .auth-page {
    justify-content: flex-start;
  }
  .auth-logo {
    width: 96px;
  }
  main.container {
    padding: var(--space-4) var(--space-4) var(--space-12);
  }
  .card {
    padding: var(--space-4);
  }
  /* Wide tables scroll inside their card instead of pushing the whole page sideways. */
  .card:has(table) {
    overflow-x: auto;
  }
  /* A long button label wraps rather than widening the page. */
  .btn {
    white-space: normal;
    max-width: 100%;
  }
  .brand span {
    display: none;
  }
  /* Top bar: one 56px row of logo, "Staff" (or a product name), search icon, Menu and the account menu or sign-out. With
     scripting on, the links collapse into a dropdown under the Menu button; without it they stay visible as a wrapped
     list. Section tab rows stay visible under the bar, scrolling sideways. */
  .topbar-inner {
    gap: 0 var(--space-2);
    padding: var(--space-1) var(--space-3);
  }
  .topbar-brand,
  .topbar-inner > .brand {
    margin-right: auto;
  }
  .topbar-brand {
    order: -2;
    gap: var(--space-1);
  }
  .brand img {
    height: 36px;
  }
  .topbar-search {
    display: none;
  }
  .search-link {
    display: inline-flex;
    order: -1;
  }
  .account-menu {
    margin-left: 0;
  }
  .menu {
    position: static;
  }
  .dropdown {
    top: calc(100% + var(--space-1));
    left: var(--space-3);
  }
  .account-menu .dropdown {
    right: var(--space-3);
  }
  /* Phones pin dropdowns to both edges; this panel keeps its own width, from the right. */
  .account-menu .account-places {
    left: auto;
  }
  .topbar .nav {
    order: 3;
    flex: 1 0 100%;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding-bottom: var(--space-1);
  }
  .topbar.nav-js .nav-toggle {
    display: inline-flex;
  }
  .topbar.nav-js .nav-toggle[aria-expanded="false"] ~ .nav {
    display: none;
  }
  .topbar .nav a {
    border-radius: var(--radius-md);
    padding: var(--space-3);
  }
  .topbar .nav-section {
    display: none;
  }
  .subnav-inner {
    padding: 0 var(--space-3);
  }
  .topbar .nav-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .topbar .nav-heading {
    display: block;
    margin: var(--space-3) var(--space-3) 2px;
    color: var(--gold);
    font-size: var(--text-xs);
    font-weight: 700;
  }
  .topbar .nav-pages {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .topbar .nav .nav-end {
    margin-left: 0;
    margin-top: var(--space-3);
  }
  .breadcrumb li:not(.crumb-up) {
    display: none;
  }
  .crumb-up .crumb-sep {
    display: none;
  }
  .crumb-up a::before {
    content: "‹" / "";
    margin-right: var(--space-1);
  }
}
/* The narrowest phones (320px): tighter bar items keep "Staff", Menu and the account button on one row. */
@media (max-width: 360px) {
  .topbar-inner {
    gap: 0 var(--space-1);
  }
  .nav-toggle {
    padding: var(--space-2) var(--space-3);
  }
  .menu-button {
    padding: 0 var(--space-1);
  }
  .topbar .link-button {
    padding-inline: var(--space-1);
  }
}

/* File inputs: before the touch-target block below, which lifts them to 44px on touch screens. */
input[type="file"] {
  /* The native control has a wide intrinsic size; let it shrink to its field instead of poking out of the card. */
  width: 100%;
  min-width: 0;
  max-width: 100%;
  font: inherit;
  padding: var(--space-1) 0;
  min-height: 44px;
}
input[type="file"]::file-selector-button {
  font: inherit;
  font-weight: 700;
  font-size: var(--text-sm);
  min-height: 32px;
  padding: var(--space-1) var(--space-3);
  margin-right: var(--space-3);
  border: 1px solid var(--charcoal);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--charcoal);
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover {
  background: var(--n-100);
}
/* A file field's label, control and hint get 8px between them, not a text field's 4px: the control reads as a button,
   and a button keeps clear of the words around it. */
.field:has(> input[type="file"]) {
  gap: var(--space-2);
}
/* Touch targets: 44px minimum on phones and tablets (WCAG 2.5.5 target size), and 16px fields however the page is
   zoomed. One block for every control. */
@media (pointer: coarse), (max-width: 900px) {
  .btn.small,
  .nav a,
  .dropdown a,
  .dropdown button,
  .link-button,
  .crumbs a,
  .brand,
  td > a:not(.btn),
  td > span > a:not(.btn) {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .btn.link {
    min-height: 44px;
  }
  input[type="file"]::file-selector-button {
    min-height: 44px;
  }
  .brand {
    min-width: 44px;
  }
  .link-button {
    padding: var(--space-2);
  }
  .crumbs a {
    padding-inline: var(--space-1);
  }
}
@media (pointer: coarse) {
  input,
  select,
  textarea {
    font-size: max(16px, 1em);
  }
  /* A plain "Show more" style toggle is a full-size tap target, not a 24px line of text. */
  main summary:not([class]) {
    padding-block: var(--space-2);
  }
}

@media print {
  .topbar,
  .subnav,
  .no-print {
    display: none !important;
  }
  body {
    background: var(--n-0);
  }
  .card {
    border: 0;
    padding: 0;
  }
}

.btn:disabled,
.btn[disabled] {
  /* Keep the label readable and grey the outline, so a disabled or busy button still reads as a button. */
  background: var(--surface);
  color: var(--n-600);
  border-color: var(--n-500);
  cursor: not-allowed;
  transform: none;
}
.btn.gold:disabled,
.btn.gold[disabled] {
  background: var(--cream-2);
  border-color: var(--cream-2);
  color: var(--charcoal);
}
.btn.danger:disabled,
.btn.danger[disabled] {
  background: var(--surface);
  color: var(--n-600);
  border-color: var(--n-500);
}

/* ---------- Utilities (4px scale) ---------- */
.mt-2 {
  margin-top: var(--space-2);
}
.mt-4 {
  margin-top: var(--space-4);
}
.mt-3 {
  margin-top: var(--space-3);
}
.mb-4 {
  margin-bottom: var(--space-4);
}
.mb-5 {
  margin-bottom: var(--space-5);
}
.text-center {
  text-align: center;
}
.pre-wrap {
  white-space: pre-wrap;
}
.self-end {
  align-self: end;
}
.stat-of {
  font-size: var(--text-base);
  font-weight: 600;
}
.col-check {
  width: 2em;
}
.maxw-88 {
  max-width: 88px;
}
.maxw-140 {
  max-width: 140px;
}
.maxw-152 {
  max-width: 152px;
}
.maxw-172 {
  max-width: 172px;
}
.maxw-220 {
  max-width: 220px;
}
.nowrap {
  white-space: nowrap;
}
.maxw-280 {
  max-width: 280px;
}
.maxh-80 {
  max-height: 80px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Form controls: comfortable tap targets (WCAG 2.5.8) and brand-colored checks. */
input[type="checkbox"],
input[type="radio"] {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  accent-color: var(--charcoal);
  vertical-align: middle;
}
.topbar :is(input[type="checkbox"], input[type="radio"]) {
  accent-color: var(--gold);
}
/* Long unbroken values (ids, references) wrap instead of widening their table. */
.wrap-anywhere {
  overflow-wrap: anywhere;
}
[data-error-summary]:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
/* An invalid field: a 2px red edge, not just a colour change (a ring outside the 1px border, so nothing moves). */
[aria-invalid="true"] {
  border-color: var(--err);
  box-shadow: 0 0 0 1px var(--err);
}
/* The message under an invalid field (form-errors.js, or printed by the page): words and a mark as well as the red
   edge, never color alone. */
.field-error {
  margin: var(--space-1) 0 0;
  color: var(--red-ink);
  font-weight: 600;
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}
.field-error.has-mark {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}
.field-error-mark {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.1em;
  height: 1.1em;
  margin-top: 0.15em;
  border-radius: var(--radius-pill);
  background: var(--red-ink);
  color: var(--n-0);
  font-size: var(--text-xs);
  line-height: 1;
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .nav a {
    transition: none;
  }
  .btn:active {
    transform: none;
  }
}
/* A team's people on the account host (A02a): one row per person, with its change form folded away. */
.people {
  list-style: none;
  padding: 0;
  margin: 0;
}
.people > li + li {
  border-top: 1px solid var(--rule);
  padding-top: var(--space-3);
}
/* A 44px touch target that keeps the disclosure triangle (it only shows while the summary is a list-item). */
.people summary {
  display: list-item;
  padding-block: var(--space-3);
  cursor: pointer;
}

/* A one-time code shown to staff to read out or copy (fundraise organizer passcodes, Owner setup codes). */
.passcode {
  font-family: ui-monospace, Menlo, monospace;
  font-size: var(--text-xl);
  letter-spacing: 0.08em;
}

/* Link cards (the fundraise admin's Reports, and both admins' Email previews): a grid of links, each with a line under it. */
.report-links {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
}
.report-links a {
  display: block;
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  text-decoration: none;
  color: var(--charcoal);
  font-weight: 700;
  transition:
    background-color 120ms ease-out,
    border-color 120ms ease-out;
}
.report-links a small {
  display: block;
  font-weight: 500;
  color: var(--muted);
  margin-top: 2px;
}
.report-links a small.late {
  color: var(--err);
  font-weight: 600;
}
.report-links a:hover {
  border-color: var(--charcoal);
  background: var(--surface-alt);
}
/* Email previews: the groups of link cards, spaced apart. */
.email-groups {
  display: grid;
  gap: var(--space-6);
}
/* Email previews (core email-previews.tsx): the email at its real width, scrolling inside its frame. */
.email-preview {
  display: block;
  width: 100%;
  height: 70vh;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

/* ---------- Account pages (account pages design, Oct 2026) ---------- */
/* ---------- The bar's place name, beside the logo ---------- */
/* Says which of the four places this is ("Your account", "Team", "Your fundraisers"); app.css's .product-name. On the
   narrowest phones it shortens rather than pushing the account button off the row. */
.account-bar .product-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-bar .topbar-brand {
  min-width: 0;
}
.account-bar .topbar-inner {
  flex-wrap: nowrap;
}

/* ---------- Page column ---------- */
/* Your account, Your fundraisers, Your sellers and the Add a seller form are short, single-purpose pages: one 720px
   column, left-aligned like the admin's forms, so the bar's left edge, the heading and the cards line up. */
.account-page {
  max-width: 720px;
}
.account-page > h1 {
  margin-bottom: var(--space-5);
}
/* A small label above a page heading (the Team page: "Team" over the group's name). */
.eyebrow {
  margin: 0 0 var(--space-1);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.card > h2:first-child,
.card > .card-head:first-child {
  margin-top: 0;
}
.card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-3);
}
.card-head h2 {
  margin: 0;
}

/* ---------- Your account: who you are ---------- */
.you {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  min-width: 0;
}
.you .account-initials {
  flex: none;
  width: 48px;
  height: 48px;
  background: var(--charcoal);
  color: var(--cream);
  font-size: var(--text-base);
  font-weight: 700;
}
.you-text {
  display: grid;
  min-width: 0;
  overflow-wrap: anywhere;
}
.you-name {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--charcoal);
}
.you-name.unnamed {
  color: var(--text-muted);
  font-weight: 600;
}
/* "Change your name": a folded form under who you are (app.css's details summary look, 44px target). */
.change-name {
  margin-bottom: var(--space-4);
}
.change-name > summary {
  display: list-item;
  padding-block: var(--space-2);
  font-weight: 600;
  cursor: pointer;
}
.change-name form {
  margin-top: var(--space-2);
  max-width: 420px;
}
/* The one way on: "Go to your fundraisers" (or your sellers), set apart by a rule. */
.go-on {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}
.go-on p {
  margin: 0;
}

/* ---------- Your account: how you sign in, where you're signed in ---------- */
/* Each way to sign in is a row: what it is and its state on the left, its action on the right (under it on phones). */
.ways {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ways > li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  padding-block: var(--space-4);
}
.ways > li:first-child {
  padding-top: 0;
}
.ways > li + li {
  border-top: 1px solid var(--rule);
}
.way-text {
  flex: 1 1 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}
/* A password link's answer names the address, which can be one long word on a phone. */
#sign-in .notice {
  overflow-wrap: anywhere;
}
/* A way's label (its first strong) is a line of its own; a strong inside a way's words (the address in a passkey's
   remove step) stays inline (passkey design review M1). */
.way-text > strong {
  display: block;
  color: var(--charcoal);
}
.way-text p {
  margin: 2px 0 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.way-list {
  list-style: none;
  margin: var(--space-2) 0 0;
  padding: 0;
  font-size: var(--text-sm);
}
.way-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding-block: var(--space-1);
}
.sessions {
  list-style: none;
  margin: 0 0 var(--space-4);
  padding: 0;
}
.sessions li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-3);
  padding-block: var(--space-2);
}
.sessions li + li {
  border-top: 1px solid var(--rule);
}
/* Your teams: one row per group, its roles under the name, its Team link at the right. */
.team-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}
.team-rows li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-1) var(--space-4);
  padding-block: var(--space-3);
}
.team-rows li + li {
  border-top: 1px solid var(--rule);
}
.team-rows .team-name {
  display: grid;
  min-width: 0;
  overflow-wrap: anywhere;
}
.team-rows .team-name strong {
  color: var(--charcoal);
}
.team-rows .team-name span {
  font-size: var(--text-sm);
  color: var(--text-muted);
}
/* The page's quiet last line: not you, and sign out. */
.account-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--rule);
  font-size: var(--text-sm);
}
.account-foot form {
  margin: 0;
}
/* "Sign in with a different email" stands alone on its line: a 44px target like the Sign out beside it (WCAG 2.5.8). */
.account-foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* ---------- Your account: the Passkeys row (passkey management) ---------- */
/* The row is the last li of .ways (#passkeys, the anchor every return lands on). Its one notice slot sits right under
   the "Passkeys" label, so the answer to a passkey action is next to the list it changed. */
.way-passkeys .pk-notice {
  margin: var(--space-2) 0 var(--space-3);
  /* Answers land on #pk-notice: keep the "Passkeys" label just above it in view. */
  scroll-margin-top: var(--space-8);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}
/* .way-text p is small and muted (a way's one-line description); inside a notice, a step or the add line the words are
   the content, so they take the surrounding colour. */
.way-passkeys .pk-notice p,
.way-passkeys .confirm-body p,
.way-passkeys .pk-add p,
.way-passkeys .pk-none,
.way-passkeys .pk-asof {
  color: inherit;
}
.way-passkeys .pk-notice p {
  margin: 0 0 var(--space-2);
}
.way-passkeys .pk-notice > :last-child {
  margin-bottom: 0;
}
.pk-notice-head {
  font-weight: 700;
}
.pk-notice form {
  margin: 0 0 var(--space-2);
}

/* The list: one bordered block, one line per passkey, newest first. Dates on the left (two lines: when it was added,
   when it was last used), its one action on the right; at 320 the action keeps its column and the dates wrap. */
.pk-list {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  color: var(--text);
}
.pk {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3) var(--space-4);
}
.pk + .pk {
  border-top: 1px solid var(--rule);
}
.pk-when {
  display: grid;
  flex: 1 1 10rem;
  gap: 2px;
  min-width: 0;
  font-size: var(--text-sm);
}
.pk-first {
  font-weight: 600;
  color: var(--charcoal);
}
/* Its own line under "Passkey added …", so at phone widths it never runs under the Remove button. */
.pk-first .badge {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 2px 0 0;
  white-space: normal;
  /* A pill wrapped onto two lines reads as a blob: square it off a little. */
  border-radius: var(--radius-sm);
}
.pk-second {
  color: var(--text-muted);
}
.pk form {
  margin: 0;
}

/* Remove opens the line's confirm in place (details.confirm from forms.css, one per line). The summary is drawn as a
   small outlined red button; open, it stays where it was (top right of the line) and the steps take the full width
   under the dates. (details.pk-remove: forms.css's details.confirm > summary sets a 24px height.) */
details.pk-remove > summary {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--err);
  border-radius: var(--btn-radius);
  background: var(--surface);
  font-size: var(--text-sm);
  list-style: none;
  white-space: nowrap;
}
.pk-remove > summary::-webkit-details-marker {
  display: none;
}
.pk-remove > summary:hover,
.pk-remove[open] > summary {
  background: var(--err-bg);
}
.pk-remove > summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.pk:has(> .pk-remove[open]) {
  background: var(--surface-alt);
}
.pk:has(> .pk-remove[open]) .pk-when {
  padding-right: calc(var(--space-24) + var(--space-2));
}
.pk-remove[open] {
  flex-basis: 100%;
}
.pk-remove[open] > summary {
  position: absolute;
  top: var(--space-3);
  right: var(--space-4);
  margin: 0;
}
.pk-remove .confirm-body {
  margin-top: var(--space-1);
  font-size: var(--text-sm);
}
.pk-step {
  display: grid;
  gap: var(--space-2);
  justify-items: start;
}
.pk-step p {
  margin: 0;
}
.pk-step .btn-row {
  margin-top: var(--space-1);
}
.pk-step-title {
  font-weight: 700;
  color: var(--charcoal);
  overflow-wrap: anywhere;
}
/* "Keep it": a text link with the row's full-height target, as .btn-row's other text links. */
.pk-keep {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--space-2);
  font-weight: 600;
}
.pk-again {
  margin-top: var(--space-2);
}
.pk-again p {
  margin: 0;
}
.pk-again .btn.link {
  margin-left: calc(-1 * var(--space-1));
}

/* A list that may be stale says when it was read, above the lines. */
.pk-asof {
  margin: var(--space-3) 0 0;
  padding: var(--space-2) var(--space-3);
  border-left: 3px solid var(--control-border);
  background: var(--surface-alt);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
/* No passkeys: the list's box, empty, so the row keeps its shape. */
.pk-none {
  margin: var(--space-3) 0 0;
  padding: var(--space-3) var(--space-4);
  border: 1px dashed var(--control-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
}

/* The add line: a pointer to the sign-in page's offer. Secondary under a list; with no passkeys it is the row's one
   action. Its button stays outlined: the page's one gold button is "Go to your fundraisers". */
.pk-add {
  margin-top: var(--space-4);
  font-size: var(--text-sm);
}
.pk-add p {
  margin: 0 0 var(--space-2);
}
.pk-add form {
  margin: var(--space-1) 0 var(--space-1);
}
.pk-add.primary {
  margin-top: var(--space-2);
}
.pk-add .hint {
  margin: 0 0 var(--space-2);
}
.pk-add > :last-child {
  margin-bottom: 0;
}
.way-passkeys > .way-text > .hint {
  margin: var(--space-2) 0 0;
}

/* "About passkeys": folded, a 44px summary like Change your name. */
.pk-about {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
}
.pk-about > summary {
  display: list-item;
  padding-block: var(--space-2);
  min-height: 44px;
  box-sizing: border-box;
  font-weight: 600;
  color: var(--charcoal);
  cursor: pointer;
}
.pk-about ul {
  margin: var(--space-1) 0 0;
  padding-left: var(--space-5);
  color: var(--text);
}
.pk-about li + li {
  margin-top: var(--space-2);
}

/* Where you're signed in, password sign-in on: the three-step fix order as a short list. */
.pk-foot-q {
  margin-bottom: var(--space-1);
}
.pk-foot-steps {
  margin: 0 0 var(--space-4);
  padding-left: var(--space-6);
}

@media (pointer: coarse), (max-width: 900px) {
  details.pk-remove > summary {
    min-height: 44px;
  }
}

/* ---------- Your fundraisers and Your sellers: the places to open ---------- */
/* app.css's .launcher rows (full width, chevron), with a status badge and dates under the name. The soonest current
   fundraiser is the page's one gold row; everything else is outlined. */
.launcher .when {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
}
/* Group setup's "Finish setting up · Next: Your sellers" under a fundraiser mid-setup (fundraise /me). */
.launcher .me-setup {
  display: block;
  font-size: var(--text-sm);
}
.launcher a.primary .badge {
  background: var(--n-0);
}
.group-card + .group-card {
  margin-top: 0;
}
.group-card .me-past {
  margin-top: var(--space-4);
}
.group-card .me-past > summary {
  display: list-item;
  padding-block: var(--space-2);
  font-weight: 600;
  cursor: pointer;
}
.group-card .me-past .me-list {
  margin-top: var(--space-2);
}
.add-own {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--rule);
}
.add-own.first {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.add-own p {
  margin: 0;
  flex: 1 1 16rem;
}
/* Two or more "Add your seller" buttons: the question on its own line above them, so they don't wrap beside it. */
.add-own.many p {
  flex-basis: 100%;
}
/* Empty states that point somewhere: the sentence, then its one action. */
.empty-state {
  display: grid;
  gap: var(--space-3);
  justify-items: start;
}
.empty-state p {
  margin: 0;
}
.empty-state .aside {
  margin-top: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--rule);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* ---------- Team page ---------- */
.people .you-tag {
  font-weight: 600;
  color: var(--text-muted);
}
.leave-team {
  margin-top: var(--space-2);
}
/* The foot's Sign out is a text button: line its text up with the row's edge. */
.account-foot .btn.link {
  padding-inline: 0;
}

/* ---------- Team page: Group contact (account dashboard design, Oct 2026) ---------- */
/* Contact, Phone, Email as a definition list: stacked on phones, a label column from 640px. */
.contact-list {
  display: grid;
  gap: var(--space-3);
  margin: 0;
}
.contact-list > div {
  display: grid;
  gap: 2px;
}
.contact-list dt {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-muted);
}
.contact-list dd {
  margin: 0;
  display: grid;
  gap: 2px;
}
.contact-list .dd-hint {
  font-size: var(--text-sm);
  color: var(--text-muted);
}
@media (min-width: 640px) {
  .contact-list > div {
    grid-template-columns: 7rem 1fr;
    gap: var(--space-4);
  }
}
.contact-edit > summary {
  display: list-item;
  min-height: 44px;
  padding-block: var(--space-2);
  font-weight: 600;
  cursor: pointer;
}
.contact-edit form {
  margin-top: var(--space-2);
}

/* ---------- Team page: History (U29 change history design, Oct 2026) ----------
   Owners and staff. Uses the shared .card, .hint, .empty, .notice, .change-list and table styles. */

/* Two parts under one heading, each with a small heading and a rule above the second. */
.team-history-part + .team-history-part {
  border-top: 1px solid var(--rule);
  padding-top: var(--space-4);
}
.team-history-part h3 {
  margin: 0 0 var(--space-1);
  font-size: var(--text-base);
}

/* The group's fundraisers: name and phase on the left, History on the right; a row per fundraiser. */
.history-fundraisers {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.history-fundraisers li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--rule);
}
.history-fundraisers li > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.history-fundraisers .hint {
  margin: 0;
}
.history-go {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  white-space: nowrap;
}

/* Rows: the sentence, then any "Field: old → new" under it. */
table.team-history td {
  vertical-align: top;
}
table.team-history .change-list {
  margin-top: var(--space-1);
  font-size: var(--text-sm);
}
/* A phone number keeps together: it breaks only between old and new, never at a hyphen. */
table.team-history .change-whole {
  white-space: nowrap;
}
table.team-history .change-old,
table.team-history .change-arrow {
  color: var(--text-muted);
}
.team-history-more {
  margin: var(--space-2) 0 0;
}
.team-history-more a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
}

/* Group contact card: "Changed by Ontario Kettle Corn staff on Oct 26. See History". */
.group-changed {
  margin-top: var(--space-3);
}

/* Phones: the time on its own muted line above the sentence, so the sentence gets the full width. */
@media screen and (max-width: 640px) {
  table.team-history thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  table.team-history,
  table.team-history tbody,
  table.team-history tr,
  table.team-history td {
    display: block;
  }
  table.team-history tr {
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--rule);
  }
  table.team-history td {
    padding: 0;
    border: 0;
  }
  table.team-history td.nowrap {
    font-size: var(--text-sm);
    color: var(--text-muted);
  }
}

/* ---------- Team page: Ask us to close this group (account dashboard design, Oct 2026) ---------- */
.close-list {
  margin: 0;
  padding-left: 1.25em;
  display: grid;
  gap: var(--space-2);
}
.close-group .notice {
  margin: 0;
}
/* The confirm body starts its items at their own width; the note box takes the form's width, as the invite field. */
.close-group .field {
  justify-self: stretch;
  max-width: 720px;
}

/* ---------- Save as PDF (fundraise issue #937): busy look, status line, failure notice ---------- */
/* Busy (Making PDF…): a link can't be disabled, so print.js sets aria-disabled and .is-busy and ignores clicks. */
.btn.is-busy[aria-disabled="true"] {
  background: var(--surface);
  color: var(--n-600);
  border-color: var(--n-500);
  cursor: progress;
  transform: none;
}
.pdf-spin {
  flex: none;
  width: 0.9em;
  height: 0.9em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: var(--radius-pill);
  animation: pdf-spin 0.8s linear infinite;
}
@keyframes pdf-spin {
  to {
    transform: rotate(1turn);
  }
}
@media (prefers-reduced-motion: reduce) {
  /* Still: a ring with a gap reads as "working" without moving. */
  .pdf-spin {
    animation: none;
  }
}
.pdf-strip:empty {
  display: none;
}
.pdf-strip {
  margin: 0 0 var(--space-4);
}
.pdf-status {
  margin: var(--space-3) 0 0;
  color: var(--text);
  font-size: var(--text-sm);
}
.pdf-strip > .pdf-status {
  margin: 0;
}
.pdf-status:empty {
  display: none;
}
.pdf-notice {
  margin: var(--space-3) 0 0;
}
.pdf-strip > .pdf-notice {
  margin: 0;
}
.pdf-notice h2 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-base);
  font-family: inherit;
  color: inherit;
}
.pdf-notice h2:focus {
  outline: none; /* focused by script only, so a screen reader reads it; not a control */
}
.pdf-notice p {
  margin: var(--space-2) 0 0;
}
.pdf-notice ul {
  margin: var(--space-2) 0 0;
}
.pdf-notice li + li {
  margin-top: var(--space-1);
}
.pdf-notice .btn-row {
  margin-top: var(--space-3);
}
.pdf-notice .btn {
  color: var(--charcoal);
}
@media screen and (max-width: 640px) {
  .pdf-notice .btn-row > .btn {
    flex: 1 1 0;
  }
}
@media print {
  .pdf-status,
  .pdf-notice,
  .pdf-strip {
    display: none !important;
  }
}
